(() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  var __esm = (fn, res) => function __init() {
    return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
  };
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __export = (target, all) => {
    for (var name2 in all)
      __defProp(target, name2, { get: all[name2], enumerable: true });
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key) && key !== except)
          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    // If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  var __publicField = (obj, key, value) => {
    __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
    return value;
  };

  // node_modules/object-assign/index.js
  var require_object_assign = __commonJS({
    "node_modules/object-assign/index.js"(exports, module) {
      "use strict";
      var getOwnPropertySymbols = Object.getOwnPropertySymbols;
      var hasOwnProperty = Object.prototype.hasOwnProperty;
      var propIsEnumerable = Object.prototype.propertyIsEnumerable;
      function toObject(val) {
        if (val === null || val === void 0) {
          throw new TypeError("Object.assign cannot be called with null or undefined");
        }
        return Object(val);
      }
      function shouldUseNative() {
        try {
          if (!Object.assign) {
            return false;
          }
          var test1 = new String("abc");
          test1[5] = "de";
          if (Object.getOwnPropertyNames(test1)[0] === "5") {
            return false;
          }
          var test2 = {};
          for (var i = 0; i < 10; i++) {
            test2["_" + String.fromCharCode(i)] = i;
          }
          var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
            return test2[n];
          });
          if (order2.join("") !== "0123456789") {
            return false;
          }
          var test3 = {};
          "abcdefghijklmnopqrst".split("").forEach(function(letter) {
            test3[letter] = letter;
          });
          if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
            return false;
          }
          return true;
        } catch (err) {
          return false;
        }
      }
      module.exports = shouldUseNative() ? Object.assign : function(target, source) {
        var from;
        var to = toObject(target);
        var symbols;
        for (var s2 = 1; s2 < arguments.length; s2++) {
          from = Object(arguments[s2]);
          for (var key in from) {
            if (hasOwnProperty.call(from, key)) {
              to[key] = from[key];
            }
          }
          if (getOwnPropertySymbols) {
            symbols = getOwnPropertySymbols(from);
            for (var i = 0; i < symbols.length; i++) {
              if (propIsEnumerable.call(from, symbols[i])) {
                to[symbols[i]] = from[symbols[i]];
              }
            }
          }
        }
        return to;
      };
    }
  });

  // node_modules/react/cjs/react.development.js
  var require_react_development = __commonJS({
    "node_modules/react/cjs/react.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var _assign34 = require_object_assign();
          var ReactVersion = "17.0.2";
          var REACT_ELEMENT_TYPE = 60103;
          var REACT_PORTAL_TYPE = 60106;
          exports.Fragment = 60107;
          exports.StrictMode = 60108;
          exports.Profiler = 60114;
          var REACT_PROVIDER_TYPE = 60109;
          var REACT_CONTEXT_TYPE = 60110;
          var REACT_FORWARD_REF_TYPE = 60112;
          exports.Suspense = 60113;
          var REACT_SUSPENSE_LIST_TYPE = 60120;
          var REACT_MEMO_TYPE = 60115;
          var REACT_LAZY_TYPE = 60116;
          var REACT_BLOCK_TYPE = 60121;
          var REACT_SERVER_BLOCK_TYPE = 60122;
          var REACT_FUNDAMENTAL_TYPE = 60117;
          var REACT_SCOPE_TYPE = 60119;
          var REACT_OPAQUE_ID_TYPE = 60128;
          var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
          var REACT_OFFSCREEN_TYPE = 60130;
          var REACT_LEGACY_HIDDEN_TYPE = 60131;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor = Symbol.for;
            REACT_ELEMENT_TYPE = symbolFor("react.element");
            REACT_PORTAL_TYPE = symbolFor("react.portal");
            exports.Fragment = symbolFor("react.fragment");
            exports.StrictMode = symbolFor("react.strict_mode");
            exports.Profiler = symbolFor("react.profiler");
            REACT_PROVIDER_TYPE = symbolFor("react.provider");
            REACT_CONTEXT_TYPE = symbolFor("react.context");
            REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
            exports.Suspense = symbolFor("react.suspense");
            REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
            REACT_MEMO_TYPE = symbolFor("react.memo");
            REACT_LAZY_TYPE = symbolFor("react.lazy");
            REACT_BLOCK_TYPE = symbolFor("react.block");
            REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
            REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
            REACT_SCOPE_TYPE = symbolFor("react.scope");
            REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
            REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
            REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
            REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
          }
          var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var ReactCurrentDispatcher = {
            /**
             * @internal
             * @type {ReactComponent}
             */
            current: null
          };
          var ReactCurrentBatchConfig = {
            transition: 0
          };
          var ReactCurrentOwner = {
            /**
             * @internal
             * @type {ReactComponent}
             */
            current: null
          };
          var ReactDebugCurrentFrame = {};
          var currentExtraStackFrame = null;
          function setExtraStackFrame(stack) {
            {
              currentExtraStackFrame = stack;
            }
          }
          {
            ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
              {
                currentExtraStackFrame = stack;
              }
            };
            ReactDebugCurrentFrame.getCurrentStack = null;
            ReactDebugCurrentFrame.getStackAddendum = function() {
              var stack = "";
              if (currentExtraStackFrame) {
                stack += currentExtraStackFrame;
              }
              var impl = ReactDebugCurrentFrame.getCurrentStack;
              if (impl) {
                stack += impl() || "";
              }
              return stack;
            };
          }
          var IsSomeRendererActing = {
            current: false
          };
          var ReactSharedInternals = {
            ReactCurrentDispatcher,
            ReactCurrentBatchConfig,
            ReactCurrentOwner,
            IsSomeRendererActing,
            // Used by renderers to avoid bundling object-assign twice in UMD bundles:
            assign: _assign34
          };
          {
            ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
          }
          function warn2(format2) {
            {
              for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                args[_key - 1] = arguments[_key];
              }
              printWarning("warn", format2, args);
            }
          }
          function error(format2) {
            {
              for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                args[_key2 - 1] = arguments[_key2];
              }
              printWarning("error", format2, args);
            }
          }
          function printWarning(level, format2, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format2 += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return "" + item;
              });
              argsWithFormat.unshift("Warning: " + format2);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          var didWarnStateUpdateForUnmountedComponent = {};
          function warnNoop(publicInstance, callerName) {
            {
              var _constructor = publicInstance.constructor;
              var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
              var warningKey = componentName + "." + callerName;
              if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
                return;
              }
              error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
              didWarnStateUpdateForUnmountedComponent[warningKey] = true;
            }
          }
          var ReactNoopUpdateQueue = {
            /**
             * Checks whether or not this composite component is mounted.
             * @param {ReactClass} publicInstance The instance we want to test.
             * @return {boolean} True if mounted, false otherwise.
             * @protected
             * @final
             */
            isMounted: function(publicInstance) {
              return false;
            },
            /**
             * Forces an update. This should only be invoked when it is known with
             * certainty that we are **not** in a DOM transaction.
             *
             * You may want to call this when you know that some deeper aspect of the
             * component's state has changed but `setState` was not called.
             *
             * This will not invoke `shouldComponentUpdate`, but it will invoke
             * `componentWillUpdate` and `componentDidUpdate`.
             *
             * @param {ReactClass} publicInstance The instance that should rerender.
             * @param {?function} callback Called after component is updated.
             * @param {?string} callerName name of the calling function in the public API.
             * @internal
             */
            enqueueForceUpdate: function(publicInstance, callback, callerName) {
              warnNoop(publicInstance, "forceUpdate");
            },
            /**
             * Replaces all of the state. Always use this or `setState` to mutate state.
             * You should treat `this.state` as immutable.
             *
             * There is no guarantee that `this.state` will be immediately updated, so
             * accessing `this.state` after calling this method may return the old value.
             *
             * @param {ReactClass} publicInstance The instance that should rerender.
             * @param {object} completeState Next state.
             * @param {?function} callback Called after component is updated.
             * @param {?string} callerName name of the calling function in the public API.
             * @internal
             */
            enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
              warnNoop(publicInstance, "replaceState");
            },
            /**
             * Sets a subset of the state. This only exists because _pendingState is
             * internal. This provides a merging strategy that is not available to deep
             * properties which is confusing. TODO: Expose pendingState or don't use it
             * during the merge.
             *
             * @param {ReactClass} publicInstance The instance that should rerender.
             * @param {object} partialState Next partial state to be merged with state.
             * @param {?function} callback Called after component is updated.
             * @param {?string} Name of the calling function in the public API.
             * @internal
             */
            enqueueSetState: function(publicInstance, partialState, callback, callerName) {
              warnNoop(publicInstance, "setState");
            }
          };
          var emptyObject = {};
          {
            Object.freeze(emptyObject);
          }
          function Component50(props, context, updater) {
            this.props = props;
            this.context = context;
            this.refs = emptyObject;
            this.updater = updater || ReactNoopUpdateQueue;
          }
          Component50.prototype.isReactComponent = {};
          Component50.prototype.setState = function(partialState, callback) {
            if (!(typeof partialState === "object" || typeof partialState === "function" || partialState == null)) {
              {
                throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
              }
            }
            this.updater.enqueueSetState(this, partialState, callback, "setState");
          };
          Component50.prototype.forceUpdate = function(callback) {
            this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
          };
          {
            var deprecatedAPIs = {
              isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
              replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
            };
            var defineDeprecationWarning = function(methodName, info2) {
              Object.defineProperty(Component50.prototype, methodName, {
                get: function() {
                  warn2("%s(...) is deprecated in plain JavaScript React classes. %s", info2[0], info2[1]);
                  return void 0;
                }
              });
            };
            for (var fnName in deprecatedAPIs) {
              if (deprecatedAPIs.hasOwnProperty(fnName)) {
                defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
              }
            }
          }
          function ComponentDummy() {
          }
          ComponentDummy.prototype = Component50.prototype;
          function PureComponent(props, context, updater) {
            this.props = props;
            this.context = context;
            this.refs = emptyObject;
            this.updater = updater || ReactNoopUpdateQueue;
          }
          var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
          pureComponentPrototype.constructor = PureComponent;
          _assign34(pureComponentPrototype, Component50.prototype);
          pureComponentPrototype.isPureReactComponent = true;
          function createRef27() {
            var refObject = {
              current: null
            };
            {
              Object.seal(refObject);
            }
            return refObject;
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var functionName = innerType.displayName || innerType.name || "";
            return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentName(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case exports.Fragment:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              case exports.Profiler:
                return "Profiler";
              case exports.StrictMode:
                return "StrictMode";
              case exports.Suspense:
                return "Suspense";
              case REACT_SUSPENSE_LIST_TYPE:
                return "SuspenseList";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  return getComponentName(type.type);
                case REACT_BLOCK_TYPE:
                  return getComponentName(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentName(init(payload));
                  } catch (x2) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          var RESERVED_PROPS = {
            key: true,
            ref: true,
            __self: true,
            __source: true
          };
          var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
          {
            didWarnAboutStringRefs = {};
          }
          function hasValidRef(config2) {
            {
              if (hasOwnProperty.call(config2, "ref")) {
                var getter = Object.getOwnPropertyDescriptor(config2, "ref").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config2.ref !== void 0;
          }
          function hasValidKey(config2) {
            {
              if (hasOwnProperty.call(config2, "key")) {
                var getter = Object.getOwnPropertyDescriptor(config2, "key").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config2.key !== void 0;
          }
          function defineKeyPropWarningGetter(props, displayName) {
            var warnAboutAccessingKey = function() {
              {
                if (!specialPropKeyWarningShown) {
                  specialPropKeyWarningShown = true;
                  error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              }
            };
            warnAboutAccessingKey.isReactWarning = true;
            Object.defineProperty(props, "key", {
              get: warnAboutAccessingKey,
              configurable: true
            });
          }
          function defineRefPropWarningGetter(props, displayName) {
            var warnAboutAccessingRef = function() {
              {
                if (!specialPropRefWarningShown) {
                  specialPropRefWarningShown = true;
                  error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              }
            };
            warnAboutAccessingRef.isReactWarning = true;
            Object.defineProperty(props, "ref", {
              get: warnAboutAccessingRef,
              configurable: true
            });
          }
          function warnIfStringRefCannotBeAutoConverted(config2) {
            {
              if (typeof config2.ref === "string" && ReactCurrentOwner.current && config2.__self && ReactCurrentOwner.current.stateNode !== config2.__self) {
                var componentName = getComponentName(ReactCurrentOwner.current.type);
                if (!didWarnAboutStringRefs[componentName]) {
                  error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config2.ref);
                  didWarnAboutStringRefs[componentName] = true;
                }
              }
            }
          }
          var ReactElement = function(type, key, ref, self2, source, owner, props) {
            var element = {
              // This tag allows us to uniquely identify this as a React Element
              $$typeof: REACT_ELEMENT_TYPE,
              // Built-in properties that belong on the element
              type,
              key,
              ref,
              props,
              // Record the component responsible for creating this element.
              _owner: owner
            };
            {
              element._store = {};
              Object.defineProperty(element._store, "validated", {
                configurable: false,
                enumerable: false,
                writable: true,
                value: false
              });
              Object.defineProperty(element, "_self", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: self2
              });
              Object.defineProperty(element, "_source", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: source
              });
              if (Object.freeze) {
                Object.freeze(element.props);
                Object.freeze(element);
              }
            }
            return element;
          };
          function createElement220(type, config2, children) {
            var propName;
            var props = {};
            var key = null;
            var ref = null;
            var self2 = null;
            var source = null;
            if (config2 != null) {
              if (hasValidRef(config2)) {
                ref = config2.ref;
                {
                  warnIfStringRefCannotBeAutoConverted(config2);
                }
              }
              if (hasValidKey(config2)) {
                key = "" + config2.key;
              }
              self2 = config2.__self === void 0 ? null : config2.__self;
              source = config2.__source === void 0 ? null : config2.__source;
              for (propName in config2) {
                if (hasOwnProperty.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                  props[propName] = config2[propName];
                }
              }
            }
            var childrenLength = arguments.length - 2;
            if (childrenLength === 1) {
              props.children = children;
            } else if (childrenLength > 1) {
              var childArray = Array(childrenLength);
              for (var i = 0; i < childrenLength; i++) {
                childArray[i] = arguments[i + 2];
              }
              {
                if (Object.freeze) {
                  Object.freeze(childArray);
                }
              }
              props.children = childArray;
            }
            if (type && type.defaultProps) {
              var defaultProps = type.defaultProps;
              for (propName in defaultProps) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps[propName];
                }
              }
            }
            {
              if (key || ref) {
                var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
                if (key) {
                  defineKeyPropWarningGetter(props, displayName);
                }
                if (ref) {
                  defineRefPropWarningGetter(props, displayName);
                }
              }
            }
            return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
          }
          function cloneAndReplaceKey(oldElement, newKey) {
            var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
            return newElement;
          }
          function cloneElement26(element, config2, children) {
            if (!!(element === null || element === void 0)) {
              {
                throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
              }
            }
            var propName;
            var props = _assign34({}, element.props);
            var key = element.key;
            var ref = element.ref;
            var self2 = element._self;
            var source = element._source;
            var owner = element._owner;
            if (config2 != null) {
              if (hasValidRef(config2)) {
                ref = config2.ref;
                owner = ReactCurrentOwner.current;
              }
              if (hasValidKey(config2)) {
                key = "" + config2.key;
              }
              var defaultProps;
              if (element.type && element.type.defaultProps) {
                defaultProps = element.type.defaultProps;
              }
              for (propName in config2) {
                if (hasOwnProperty.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                  if (config2[propName] === void 0 && defaultProps !== void 0) {
                    props[propName] = defaultProps[propName];
                  } else {
                    props[propName] = config2[propName];
                  }
                }
              }
            }
            var childrenLength = arguments.length - 2;
            if (childrenLength === 1) {
              props.children = children;
            } else if (childrenLength > 1) {
              var childArray = Array(childrenLength);
              for (var i = 0; i < childrenLength; i++) {
                childArray[i] = arguments[i + 2];
              }
              props.children = childArray;
            }
            return ReactElement(element.type, key, ref, self2, source, owner, props);
          }
          function isValidElement9(object) {
            return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
          }
          var SEPARATOR = ".";
          var SUBSEPARATOR = ":";
          function escape(key) {
            var escapeRegex = /[=:]/g;
            var escaperLookup = {
              "=": "=0",
              ":": "=2"
            };
            var escapedString = key.replace(escapeRegex, function(match) {
              return escaperLookup[match];
            });
            return "$" + escapedString;
          }
          var didWarnAboutMaps = false;
          var userProvidedKeyEscapeRegex = /\/+/g;
          function escapeUserProvidedKey(text) {
            return text.replace(userProvidedKeyEscapeRegex, "$&/");
          }
          function getElementKey(element, index) {
            if (typeof element === "object" && element !== null && element.key != null) {
              return escape("" + element.key);
            }
            return index.toString(36);
          }
          function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
            var type = typeof children;
            if (type === "undefined" || type === "boolean") {
              children = null;
            }
            var invokeCallback2 = false;
            if (children === null) {
              invokeCallback2 = true;
            } else {
              switch (type) {
                case "string":
                case "number":
                  invokeCallback2 = true;
                  break;
                case "object":
                  switch (children.$$typeof) {
                    case REACT_ELEMENT_TYPE:
                    case REACT_PORTAL_TYPE:
                      invokeCallback2 = true;
                  }
              }
            }
            if (invokeCallback2) {
              var _child = children;
              var mappedChild = callback(_child);
              var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
              if (Array.isArray(mappedChild)) {
                var escapedChildKey = "";
                if (childKey != null) {
                  escapedChildKey = escapeUserProvidedKey(childKey) + "/";
                }
                mapIntoArray(mappedChild, array, escapedChildKey, "", function(c2) {
                  return c2;
                });
              } else if (mappedChild != null) {
                if (isValidElement9(mappedChild)) {
                  mappedChild = cloneAndReplaceKey(
                    mappedChild,
                    // Keep both the (mapped) and old keys if they differ, just as
                    // traverseAllChildren used to do for objects as children
                    escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
                    (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
                      // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
                      escapeUserProvidedKey("" + mappedChild.key) + "/"
                    ) : "") + childKey
                  );
                }
                array.push(mappedChild);
              }
              return 1;
            }
            var child;
            var nextName;
            var subtreeCount = 0;
            var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
            if (Array.isArray(children)) {
              for (var i = 0; i < children.length; i++) {
                child = children[i];
                nextName = nextNamePrefix + getElementKey(child, i);
                subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
              }
            } else {
              var iteratorFn = getIteratorFn(children);
              if (typeof iteratorFn === "function") {
                var iterableChildren = children;
                {
                  if (iteratorFn === iterableChildren.entries) {
                    if (!didWarnAboutMaps) {
                      warn2("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
                    }
                    didWarnAboutMaps = true;
                  }
                }
                var iterator = iteratorFn.call(iterableChildren);
                var step;
                var ii = 0;
                while (!(step = iterator.next()).done) {
                  child = step.value;
                  nextName = nextNamePrefix + getElementKey(child, ii++);
                  subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
                }
              } else if (type === "object") {
                var childrenString = "" + children;
                {
                  {
                    throw Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
                  }
                }
              }
            }
            return subtreeCount;
          }
          function mapChildren(children, func, context) {
            if (children == null) {
              return children;
            }
            var result = [];
            var count = 0;
            mapIntoArray(children, result, "", "", function(child) {
              return func.call(context, child, count++);
            });
            return result;
          }
          function countChildren(children) {
            var n = 0;
            mapChildren(children, function() {
              n++;
            });
            return n;
          }
          function forEachChildren(children, forEachFunc, forEachContext) {
            mapChildren(children, function() {
              forEachFunc.apply(this, arguments);
            }, forEachContext);
          }
          function toArray(children) {
            return mapChildren(children, function(child) {
              return child;
            }) || [];
          }
          function onlyChild(children) {
            if (!isValidElement9(children)) {
              {
                throw Error("React.Children.only expected to receive a single React element child.");
              }
            }
            return children;
          }
          function createContext20(defaultValue, calculateChangedBits) {
            if (calculateChangedBits === void 0) {
              calculateChangedBits = null;
            } else {
              {
                if (calculateChangedBits !== null && typeof calculateChangedBits !== "function") {
                  error("createContext: Expected the optional second argument to be a function. Instead received: %s", calculateChangedBits);
                }
              }
            }
            var context = {
              $$typeof: REACT_CONTEXT_TYPE,
              _calculateChangedBits: calculateChangedBits,
              // As a workaround to support multiple concurrent renderers, we categorize
              // some renderers as primary and others as secondary. We only expect
              // there to be two concurrent renderers at most: React Native (primary) and
              // Fabric (secondary); React DOM (primary) and React ART (secondary).
              // Secondary renderers store their context values on separate fields.
              _currentValue: defaultValue,
              _currentValue2: defaultValue,
              // Used to track how many concurrent renderers this context currently
              // supports within in a single renderer. Such as parallel server rendering.
              _threadCount: 0,
              // These are circular
              Provider: null,
              Consumer: null
            };
            context.Provider = {
              $$typeof: REACT_PROVIDER_TYPE,
              _context: context
            };
            var hasWarnedAboutUsingNestedContextConsumers = false;
            var hasWarnedAboutUsingConsumerProvider = false;
            var hasWarnedAboutDisplayNameOnConsumer = false;
            {
              var Consumer = {
                $$typeof: REACT_CONTEXT_TYPE,
                _context: context,
                _calculateChangedBits: context._calculateChangedBits
              };
              Object.defineProperties(Consumer, {
                Provider: {
                  get: function() {
                    if (!hasWarnedAboutUsingConsumerProvider) {
                      hasWarnedAboutUsingConsumerProvider = true;
                      error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
                    }
                    return context.Provider;
                  },
                  set: function(_Provider) {
                    context.Provider = _Provider;
                  }
                },
                _currentValue: {
                  get: function() {
                    return context._currentValue;
                  },
                  set: function(_currentValue) {
                    context._currentValue = _currentValue;
                  }
                },
                _currentValue2: {
                  get: function() {
                    return context._currentValue2;
                  },
                  set: function(_currentValue2) {
                    context._currentValue2 = _currentValue2;
                  }
                },
                _threadCount: {
                  get: function() {
                    return context._threadCount;
                  },
                  set: function(_threadCount) {
                    context._threadCount = _threadCount;
                  }
                },
                Consumer: {
                  get: function() {
                    if (!hasWarnedAboutUsingNestedContextConsumers) {
                      hasWarnedAboutUsingNestedContextConsumers = true;
                      error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
                    }
                    return context.Consumer;
                  }
                },
                displayName: {
                  get: function() {
                    return context.displayName;
                  },
                  set: function(displayName) {
                    if (!hasWarnedAboutDisplayNameOnConsumer) {
                      warn2("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
                      hasWarnedAboutDisplayNameOnConsumer = true;
                    }
                  }
                }
              });
              context.Consumer = Consumer;
            }
            {
              context._currentRenderer = null;
              context._currentRenderer2 = null;
            }
            return context;
          }
          var Uninitialized = -1;
          var Pending = 0;
          var Resolved = 1;
          var Rejected = 2;
          function lazyInitializer(payload) {
            if (payload._status === Uninitialized) {
              var ctor = payload._result;
              var thenable = ctor();
              var pending = payload;
              pending._status = Pending;
              pending._result = thenable;
              thenable.then(function(moduleObject) {
                if (payload._status === Pending) {
                  var defaultExport = moduleObject.default;
                  {
                    if (defaultExport === void 0) {
                      error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n  const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
                    }
                  }
                  var resolved = payload;
                  resolved._status = Resolved;
                  resolved._result = defaultExport;
                }
              }, function(error2) {
                if (payload._status === Pending) {
                  var rejected = payload;
                  rejected._status = Rejected;
                  rejected._result = error2;
                }
              });
            }
            if (payload._status === Resolved) {
              return payload._result;
            } else {
              throw payload._result;
            }
          }
          function lazy(ctor) {
            var payload = {
              // We use these fields to store the result.
              _status: -1,
              _result: ctor
            };
            var lazyType = {
              $$typeof: REACT_LAZY_TYPE,
              _payload: payload,
              _init: lazyInitializer
            };
            {
              var defaultProps;
              var propTypes;
              Object.defineProperties(lazyType, {
                defaultProps: {
                  configurable: true,
                  get: function() {
                    return defaultProps;
                  },
                  set: function(newDefaultProps) {
                    error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
                    defaultProps = newDefaultProps;
                    Object.defineProperty(lazyType, "defaultProps", {
                      enumerable: true
                    });
                  }
                },
                propTypes: {
                  configurable: true,
                  get: function() {
                    return propTypes;
                  },
                  set: function(newPropTypes) {
                    error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
                    propTypes = newPropTypes;
                    Object.defineProperty(lazyType, "propTypes", {
                      enumerable: true
                    });
                  }
                }
              });
            }
            return lazyType;
          }
          function forwardRef27(render) {
            {
              if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
                error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
              } else if (typeof render !== "function") {
                error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
              } else {
                if (render.length !== 0 && render.length !== 2) {
                  error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
                }
              }
              if (render != null) {
                if (render.defaultProps != null || render.propTypes != null) {
                  error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
                }
              }
            }
            var elementType = {
              $$typeof: REACT_FORWARD_REF_TYPE,
              render
            };
            {
              var ownName;
              Object.defineProperty(elementType, "displayName", {
                enumerable: false,
                configurable: true,
                get: function() {
                  return ownName;
                },
                set: function(name2) {
                  ownName = name2;
                  if (render.displayName == null) {
                    render.displayName = name2;
                  }
                }
              });
            }
            return elementType;
          }
          var enableScopeAPI = false;
          function isValidElementType(type) {
            if (typeof type === "string" || typeof type === "function") {
              return true;
            }
            if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) {
              return true;
            }
            if (typeof type === "object" && type !== null) {
              if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
                return true;
              }
            }
            return false;
          }
          function memo2(type, compare) {
            {
              if (!isValidElementType(type)) {
                error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
              }
            }
            var elementType = {
              $$typeof: REACT_MEMO_TYPE,
              type,
              compare: compare === void 0 ? null : compare
            };
            {
              var ownName;
              Object.defineProperty(elementType, "displayName", {
                enumerable: false,
                configurable: true,
                get: function() {
                  return ownName;
                },
                set: function(name2) {
                  ownName = name2;
                  if (type.displayName == null) {
                    type.displayName = name2;
                  }
                }
              });
            }
            return elementType;
          }
          function resolveDispatcher() {
            var dispatcher = ReactCurrentDispatcher.current;
            if (!(dispatcher !== null)) {
              {
                throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
              }
            }
            return dispatcher;
          }
          function useContext17(Context, unstable_observedBits) {
            var dispatcher = resolveDispatcher();
            {
              if (unstable_observedBits !== void 0) {
                error("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s", unstable_observedBits, typeof unstable_observedBits === "number" && Array.isArray(arguments[2]) ? "\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks" : "");
              }
              if (Context._context !== void 0) {
                var realContext = Context._context;
                if (realContext.Consumer === Context) {
                  error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
                } else if (realContext.Provider === Context) {
                  error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
                }
              }
            }
            return dispatcher.useContext(Context, unstable_observedBits);
          }
          function useState27(initialState) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useState(initialState);
          }
          function useReducer(reducer, initialArg, init) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useReducer(reducer, initialArg, init);
          }
          function useRef24(initialValue) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useRef(initialValue);
          }
          function useEffect22(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useEffect(create, deps);
          }
          function useLayoutEffect2(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useLayoutEffect(create, deps);
          }
          function useCallback3(callback, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useCallback(callback, deps);
          }
          function useMemo5(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useMemo(create, deps);
          }
          function useImperativeHandle(ref, create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useImperativeHandle(ref, create, deps);
          }
          function useDebugValue(value, formatterFn) {
            {
              var dispatcher = resolveDispatcher();
              return dispatcher.useDebugValue(value, formatterFn);
            }
          }
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: _assign34({}, props, {
                    value: prevLog
                  }),
                  info: _assign34({}, props, {
                    value: prevInfo
                  }),
                  warn: _assign34({}, props, {
                    value: prevWarn
                  }),
                  error: _assign34({}, props, {
                    value: prevError
                  }),
                  group: _assign34({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: _assign34({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: _assign34({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name2, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x2) {
                  var match = x2.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name2;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame2 = componentFrameCache.get(fn);
              if (frame2 !== void 0) {
                return frame2;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x2) {
                    control = x2;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x2) {
                    control = x2;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x2) {
                  control = x2;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s2 = sampleLines.length - 1;
                var c2 = controlLines.length - 1;
                while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
                  c2--;
                }
                for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
                  if (sampleLines[s2] !== controlLines[c2]) {
                    if (s2 !== 1 || c2 !== 1) {
                      do {
                        s2--;
                        c2--;
                        if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
                          var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s2 >= 1 && c2 >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher$1.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name2 = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component51) {
            var prototype = Component51.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case exports.Suspense:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_BLOCK_TYPE:
                  return describeFunctionComponentFrame(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x2) {
                  }
                }
              }
            }
            return "";
          }
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has = Function.call.bind(Object.prototype.hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          function setCurrentlyValidatingElement$1(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                setExtraStackFrame(stack);
              } else {
                setExtraStackFrame(null);
              }
            }
          }
          var propTypesMisspellWarningShown;
          {
            propTypesMisspellWarningShown = false;
          }
          function getDeclarationErrorAddendum() {
            if (ReactCurrentOwner.current) {
              var name2 = getComponentName(ReactCurrentOwner.current.type);
              if (name2) {
                return "\n\nCheck the render method of `" + name2 + "`.";
              }
            }
            return "";
          }
          function getSourceInfoErrorAddendum(source) {
            if (source !== void 0) {
              var fileName = source.fileName.replace(/^.*[\\\/]/, "");
              var lineNumber = source.lineNumber;
              return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
            }
            return "";
          }
          function getSourceInfoErrorAddendumForProps(elementProps) {
            if (elementProps !== null && elementProps !== void 0) {
              return getSourceInfoErrorAddendum(elementProps.__source);
            }
            return "";
          }
          var ownerHasKeyUseWarning = {};
          function getCurrentComponentErrorInfo(parentType) {
            var info2 = getDeclarationErrorAddendum();
            if (!info2) {
              var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
              if (parentName) {
                info2 = "\n\nCheck the top-level render call using <" + parentName + ">.";
              }
            }
            return info2;
          }
          function validateExplicitKey(element, parentType) {
            if (!element._store || element._store.validated || element.key != null) {
              return;
            }
            element._store.validated = true;
            var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
            if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
              return;
            }
            ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
            var childOwner = "";
            if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
              childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
            }
            {
              setCurrentlyValidatingElement$1(element);
              error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
              setCurrentlyValidatingElement$1(null);
            }
          }
          function validateChildKeys(node, parentType) {
            if (typeof node !== "object") {
              return;
            }
            if (Array.isArray(node)) {
              for (var i = 0; i < node.length; i++) {
                var child = node[i];
                if (isValidElement9(child)) {
                  validateExplicitKey(child, parentType);
                }
              }
            } else if (isValidElement9(node)) {
              if (node._store) {
                node._store.validated = true;
              }
            } else if (node) {
              var iteratorFn = getIteratorFn(node);
              if (typeof iteratorFn === "function") {
                if (iteratorFn !== node.entries) {
                  var iterator = iteratorFn.call(node);
                  var step;
                  while (!(step = iterator.next()).done) {
                    if (isValidElement9(step.value)) {
                      validateExplicitKey(step.value, parentType);
                    }
                  }
                }
              }
            }
          }
          function validatePropTypes(element) {
            {
              var type = element.type;
              if (type === null || type === void 0 || typeof type === "string") {
                return;
              }
              var propTypes;
              if (typeof type === "function") {
                propTypes = type.propTypes;
              } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
              // Inner props are checked in the reconciler.
              type.$$typeof === REACT_MEMO_TYPE)) {
                propTypes = type.propTypes;
              } else {
                return;
              }
              if (propTypes) {
                var name2 = getComponentName(type);
                checkPropTypes(propTypes, element.props, "prop", name2, element);
              } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
                propTypesMisspellWarningShown = true;
                var _name = getComponentName(type);
                error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
              }
              if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
              }
            }
          }
          function validateFragmentProps(fragment) {
            {
              var keys = Object.keys(fragment.props);
              for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                if (key !== "children" && key !== "key") {
                  setCurrentlyValidatingElement$1(fragment);
                  error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
                  setCurrentlyValidatingElement$1(null);
                  break;
                }
              }
              if (fragment.ref !== null) {
                setCurrentlyValidatingElement$1(fragment);
                error("Invalid attribute `ref` supplied to `React.Fragment`.");
                setCurrentlyValidatingElement$1(null);
              }
            }
          }
          function createElementWithValidation(type, props, children) {
            var validType = isValidElementType(type);
            if (!validType) {
              var info2 = "";
              if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                info2 += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
              }
              var sourceInfo = getSourceInfoErrorAddendumForProps(props);
              if (sourceInfo) {
                info2 += sourceInfo;
              } else {
                info2 += getDeclarationErrorAddendum();
              }
              var typeString;
              if (type === null) {
                typeString = "null";
              } else if (Array.isArray(type)) {
                typeString = "array";
              } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
                typeString = "<" + (getComponentName(type.type) || "Unknown") + " />";
                info2 = " Did you accidentally export a JSX literal instead of a component?";
              } else {
                typeString = typeof type;
              }
              {
                error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info2);
              }
            }
            var element = createElement220.apply(this, arguments);
            if (element == null) {
              return element;
            }
            if (validType) {
              for (var i = 2; i < arguments.length; i++) {
                validateChildKeys(arguments[i], type);
              }
            }
            if (type === exports.Fragment) {
              validateFragmentProps(element);
            } else {
              validatePropTypes(element);
            }
            return element;
          }
          var didWarnAboutDeprecatedCreateFactory = false;
          function createFactoryWithValidation(type) {
            var validatedFactory = createElementWithValidation.bind(null, type);
            validatedFactory.type = type;
            {
              if (!didWarnAboutDeprecatedCreateFactory) {
                didWarnAboutDeprecatedCreateFactory = true;
                warn2("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
              }
              Object.defineProperty(validatedFactory, "type", {
                enumerable: false,
                get: function() {
                  warn2("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
                  Object.defineProperty(this, "type", {
                    value: type
                  });
                  return type;
                }
              });
            }
            return validatedFactory;
          }
          function cloneElementWithValidation(element, props, children) {
            var newElement = cloneElement26.apply(this, arguments);
            for (var i = 2; i < arguments.length; i++) {
              validateChildKeys(arguments[i], newElement.type);
            }
            validatePropTypes(newElement);
            return newElement;
          }
          {
            try {
              var frozenObject = Object.freeze({});
              /* @__PURE__ */ new Map([[frozenObject, null]]);
              /* @__PURE__ */ new Set([frozenObject]);
            } catch (e) {
            }
          }
          var createElement$1 = createElementWithValidation;
          var cloneElement$1 = cloneElementWithValidation;
          var createFactory = createFactoryWithValidation;
          var Children17 = {
            map: mapChildren,
            forEach: forEachChildren,
            count: countChildren,
            toArray,
            only: onlyChild
          };
          exports.Children = Children17;
          exports.Component = Component50;
          exports.PureComponent = PureComponent;
          exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
          exports.cloneElement = cloneElement$1;
          exports.createContext = createContext20;
          exports.createElement = createElement$1;
          exports.createFactory = createFactory;
          exports.createRef = createRef27;
          exports.forwardRef = forwardRef27;
          exports.isValidElement = isValidElement9;
          exports.lazy = lazy;
          exports.memo = memo2;
          exports.useCallback = useCallback3;
          exports.useContext = useContext17;
          exports.useDebugValue = useDebugValue;
          exports.useEffect = useEffect22;
          exports.useImperativeHandle = useImperativeHandle;
          exports.useLayoutEffect = useLayoutEffect2;
          exports.useMemo = useMemo5;
          exports.useReducer = useReducer;
          exports.useRef = useRef24;
          exports.useState = useState27;
          exports.version = ReactVersion;
        })();
      }
    }
  });

  // node_modules/react/index.js
  var require_react = __commonJS({
    "node_modules/react/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_react_development();
      }
    }
  });

  // node_modules/scheduler/cjs/scheduler.development.js
  var require_scheduler_development = __commonJS({
    "node_modules/scheduler/cjs/scheduler.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var enableSchedulerDebugging = false;
          var enableProfiling = false;
          var requestHostCallback;
          var requestHostTimeout;
          var cancelHostTimeout;
          var requestPaint;
          var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
          if (hasPerformanceNow) {
            var localPerformance = performance;
            exports.unstable_now = function() {
              return localPerformance.now();
            };
          } else {
            var localDate2 = Date;
            var initialTime = localDate2.now();
            exports.unstable_now = function() {
              return localDate2.now() - initialTime;
            };
          }
          if (
            // If Scheduler runs in a non-DOM environment, it falls back to a naive
            // implementation using setTimeout.
            typeof window === "undefined" || // Check if MessageChannel is supported, too.
            typeof MessageChannel !== "function"
          ) {
            var _callback = null;
            var _timeoutID = null;
            var _flushCallback = function() {
              if (_callback !== null) {
                try {
                  var currentTime = exports.unstable_now();
                  var hasRemainingTime = true;
                  _callback(hasRemainingTime, currentTime);
                  _callback = null;
                } catch (e) {
                  setTimeout(_flushCallback, 0);
                  throw e;
                }
              }
            };
            requestHostCallback = function(cb) {
              if (_callback !== null) {
                setTimeout(requestHostCallback, 0, cb);
              } else {
                _callback = cb;
                setTimeout(_flushCallback, 0);
              }
            };
            requestHostTimeout = function(cb, ms) {
              _timeoutID = setTimeout(cb, ms);
            };
            cancelHostTimeout = function() {
              clearTimeout(_timeoutID);
            };
            exports.unstable_shouldYield = function() {
              return false;
            };
            requestPaint = exports.unstable_forceFrameRate = function() {
            };
          } else {
            var _setTimeout = window.setTimeout;
            var _clearTimeout = window.clearTimeout;
            if (typeof console !== "undefined") {
              var requestAnimationFrame = window.requestAnimationFrame;
              var cancelAnimationFrame = window.cancelAnimationFrame;
              if (typeof requestAnimationFrame !== "function") {
                console["error"]("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
              }
              if (typeof cancelAnimationFrame !== "function") {
                console["error"]("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
              }
            }
            var isMessageLoopRunning = false;
            var scheduledHostCallback = null;
            var taskTimeoutID = -1;
            var yieldInterval = 5;
            var deadline = 0;
            {
              exports.unstable_shouldYield = function() {
                return exports.unstable_now() >= deadline;
              };
              requestPaint = function() {
              };
            }
            exports.unstable_forceFrameRate = function(fps) {
              if (fps < 0 || fps > 125) {
                console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
                return;
              }
              if (fps > 0) {
                yieldInterval = Math.floor(1e3 / fps);
              } else {
                yieldInterval = 5;
              }
            };
            var performWorkUntilDeadline = function() {
              if (scheduledHostCallback !== null) {
                var currentTime = exports.unstable_now();
                deadline = currentTime + yieldInterval;
                var hasTimeRemaining = true;
                try {
                  var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
                  if (!hasMoreWork) {
                    isMessageLoopRunning = false;
                    scheduledHostCallback = null;
                  } else {
                    port.postMessage(null);
                  }
                } catch (error) {
                  port.postMessage(null);
                  throw error;
                }
              } else {
                isMessageLoopRunning = false;
              }
            };
            var channel = new MessageChannel();
            var port = channel.port2;
            channel.port1.onmessage = performWorkUntilDeadline;
            requestHostCallback = function(callback) {
              scheduledHostCallback = callback;
              if (!isMessageLoopRunning) {
                isMessageLoopRunning = true;
                port.postMessage(null);
              }
            };
            requestHostTimeout = function(callback, ms) {
              taskTimeoutID = _setTimeout(function() {
                callback(exports.unstable_now());
              }, ms);
            };
            cancelHostTimeout = function() {
              _clearTimeout(taskTimeoutID);
              taskTimeoutID = -1;
            };
          }
          function push(heap, node) {
            var index = heap.length;
            heap.push(node);
            siftUp(heap, node, index);
          }
          function peek(heap) {
            var first = heap[0];
            return first === void 0 ? null : first;
          }
          function pop(heap) {
            var first = heap[0];
            if (first !== void 0) {
              var last = heap.pop();
              if (last !== first) {
                heap[0] = last;
                siftDown(heap, last, 0);
              }
              return first;
            } else {
              return null;
            }
          }
          function siftUp(heap, node, i) {
            var index = i;
            while (true) {
              var parentIndex = index - 1 >>> 1;
              var parent = heap[parentIndex];
              if (parent !== void 0 && compare(parent, node) > 0) {
                heap[parentIndex] = node;
                heap[index] = parent;
                index = parentIndex;
              } else {
                return;
              }
            }
          }
          function siftDown(heap, node, i) {
            var index = i;
            var length = heap.length;
            while (index < length) {
              var leftIndex = (index + 1) * 2 - 1;
              var left2 = heap[leftIndex];
              var rightIndex = leftIndex + 1;
              var right2 = heap[rightIndex];
              if (left2 !== void 0 && compare(left2, node) < 0) {
                if (right2 !== void 0 && compare(right2, left2) < 0) {
                  heap[index] = right2;
                  heap[rightIndex] = node;
                  index = rightIndex;
                } else {
                  heap[index] = left2;
                  heap[leftIndex] = node;
                  index = leftIndex;
                }
              } else if (right2 !== void 0 && compare(right2, node) < 0) {
                heap[index] = right2;
                heap[rightIndex] = node;
                index = rightIndex;
              } else {
                return;
              }
            }
          }
          function compare(a2, b) {
            var diff = a2.sortIndex - b.sortIndex;
            return diff !== 0 ? diff : a2.id - b.id;
          }
          var ImmediatePriority = 1;
          var UserBlockingPriority = 2;
          var NormalPriority = 3;
          var LowPriority = 4;
          var IdlePriority = 5;
          function markTaskErrored(task, ms) {
          }
          var maxSigned31BitInt = 1073741823;
          var IMMEDIATE_PRIORITY_TIMEOUT = -1;
          var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
          var NORMAL_PRIORITY_TIMEOUT = 5e3;
          var LOW_PRIORITY_TIMEOUT = 1e4;
          var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
          var taskQueue = [];
          var timerQueue = [];
          var taskIdCounter = 1;
          var currentTask = null;
          var currentPriorityLevel = NormalPriority;
          var isPerformingWork = false;
          var isHostCallbackScheduled = false;
          var isHostTimeoutScheduled = false;
          function advanceTimers(currentTime) {
            var timer2 = peek(timerQueue);
            while (timer2 !== null) {
              if (timer2.callback === null) {
                pop(timerQueue);
              } else if (timer2.startTime <= currentTime) {
                pop(timerQueue);
                timer2.sortIndex = timer2.expirationTime;
                push(taskQueue, timer2);
              } else {
                return;
              }
              timer2 = peek(timerQueue);
            }
          }
          function handleTimeout(currentTime) {
            isHostTimeoutScheduled = false;
            advanceTimers(currentTime);
            if (!isHostCallbackScheduled) {
              if (peek(taskQueue) !== null) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              } else {
                var firstTimer = peek(timerQueue);
                if (firstTimer !== null) {
                  requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
                }
              }
            }
          }
          function flushWork(hasTimeRemaining, initialTime2) {
            isHostCallbackScheduled = false;
            if (isHostTimeoutScheduled) {
              isHostTimeoutScheduled = false;
              cancelHostTimeout();
            }
            isPerformingWork = true;
            var previousPriorityLevel = currentPriorityLevel;
            try {
              if (enableProfiling) {
                try {
                  return workLoop(hasTimeRemaining, initialTime2);
                } catch (error) {
                  if (currentTask !== null) {
                    var currentTime = exports.unstable_now();
                    markTaskErrored(currentTask, currentTime);
                    currentTask.isQueued = false;
                  }
                  throw error;
                }
              } else {
                return workLoop(hasTimeRemaining, initialTime2);
              }
            } finally {
              currentTask = null;
              currentPriorityLevel = previousPriorityLevel;
              isPerformingWork = false;
            }
          }
          function workLoop(hasTimeRemaining, initialTime2) {
            var currentTime = initialTime2;
            advanceTimers(currentTime);
            currentTask = peek(taskQueue);
            while (currentTask !== null && !enableSchedulerDebugging) {
              if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || exports.unstable_shouldYield())) {
                break;
              }
              var callback = currentTask.callback;
              if (typeof callback === "function") {
                currentTask.callback = null;
                currentPriorityLevel = currentTask.priorityLevel;
                var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
                var continuationCallback = callback(didUserCallbackTimeout);
                currentTime = exports.unstable_now();
                if (typeof continuationCallback === "function") {
                  currentTask.callback = continuationCallback;
                } else {
                  if (currentTask === peek(taskQueue)) {
                    pop(taskQueue);
                  }
                }
                advanceTimers(currentTime);
              } else {
                pop(taskQueue);
              }
              currentTask = peek(taskQueue);
            }
            if (currentTask !== null) {
              return true;
            } else {
              var firstTimer = peek(timerQueue);
              if (firstTimer !== null) {
                requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
              }
              return false;
            }
          }
          function unstable_runWithPriority(priorityLevel, eventHandler) {
            switch (priorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
              case LowPriority:
              case IdlePriority:
                break;
              default:
                priorityLevel = NormalPriority;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_next(eventHandler) {
            var priorityLevel;
            switch (currentPriorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
                priorityLevel = NormalPriority;
                break;
              default:
                priorityLevel = currentPriorityLevel;
                break;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_wrapCallback(callback) {
            var parentPriorityLevel = currentPriorityLevel;
            return function() {
              var previousPriorityLevel = currentPriorityLevel;
              currentPriorityLevel = parentPriorityLevel;
              try {
                return callback.apply(this, arguments);
              } finally {
                currentPriorityLevel = previousPriorityLevel;
              }
            };
          }
          function unstable_scheduleCallback(priorityLevel, callback, options4) {
            var currentTime = exports.unstable_now();
            var startTime;
            if (typeof options4 === "object" && options4 !== null) {
              var delay3 = options4.delay;
              if (typeof delay3 === "number" && delay3 > 0) {
                startTime = currentTime + delay3;
              } else {
                startTime = currentTime;
              }
            } else {
              startTime = currentTime;
            }
            var timeout2;
            switch (priorityLevel) {
              case ImmediatePriority:
                timeout2 = IMMEDIATE_PRIORITY_TIMEOUT;
                break;
              case UserBlockingPriority:
                timeout2 = USER_BLOCKING_PRIORITY_TIMEOUT;
                break;
              case IdlePriority:
                timeout2 = IDLE_PRIORITY_TIMEOUT;
                break;
              case LowPriority:
                timeout2 = LOW_PRIORITY_TIMEOUT;
                break;
              case NormalPriority:
              default:
                timeout2 = NORMAL_PRIORITY_TIMEOUT;
                break;
            }
            var expirationTime = startTime + timeout2;
            var newTask = {
              id: taskIdCounter++,
              callback,
              priorityLevel,
              startTime,
              expirationTime,
              sortIndex: -1
            };
            if (startTime > currentTime) {
              newTask.sortIndex = startTime;
              push(timerQueue, newTask);
              if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
                if (isHostTimeoutScheduled) {
                  cancelHostTimeout();
                } else {
                  isHostTimeoutScheduled = true;
                }
                requestHostTimeout(handleTimeout, startTime - currentTime);
              }
            } else {
              newTask.sortIndex = expirationTime;
              push(taskQueue, newTask);
              if (!isHostCallbackScheduled && !isPerformingWork) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              }
            }
            return newTask;
          }
          function unstable_pauseExecution() {
          }
          function unstable_continueExecution() {
            if (!isHostCallbackScheduled && !isPerformingWork) {
              isHostCallbackScheduled = true;
              requestHostCallback(flushWork);
            }
          }
          function unstable_getFirstCallbackNode() {
            return peek(taskQueue);
          }
          function unstable_cancelCallback(task) {
            task.callback = null;
          }
          function unstable_getCurrentPriorityLevel() {
            return currentPriorityLevel;
          }
          var unstable_requestPaint = requestPaint;
          var unstable_Profiling = null;
          exports.unstable_IdlePriority = IdlePriority;
          exports.unstable_ImmediatePriority = ImmediatePriority;
          exports.unstable_LowPriority = LowPriority;
          exports.unstable_NormalPriority = NormalPriority;
          exports.unstable_Profiling = unstable_Profiling;
          exports.unstable_UserBlockingPriority = UserBlockingPriority;
          exports.unstable_cancelCallback = unstable_cancelCallback;
          exports.unstable_continueExecution = unstable_continueExecution;
          exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
          exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
          exports.unstable_next = unstable_next;
          exports.unstable_pauseExecution = unstable_pauseExecution;
          exports.unstable_requestPaint = unstable_requestPaint;
          exports.unstable_runWithPriority = unstable_runWithPriority;
          exports.unstable_scheduleCallback = unstable_scheduleCallback;
          exports.unstable_wrapCallback = unstable_wrapCallback;
        })();
      }
    }
  });

  // node_modules/scheduler/index.js
  var require_scheduler = __commonJS({
    "node_modules/scheduler/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_scheduler_development();
      }
    }
  });

  // node_modules/scheduler/cjs/scheduler-tracing.development.js
  var require_scheduler_tracing_development = __commonJS({
    "node_modules/scheduler/cjs/scheduler-tracing.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var DEFAULT_THREAD_ID = 0;
          var interactionIDCounter = 0;
          var threadIDCounter = 0;
          exports.__interactionsRef = null;
          exports.__subscriberRef = null;
          {
            exports.__interactionsRef = {
              current: /* @__PURE__ */ new Set()
            };
            exports.__subscriberRef = {
              current: null
            };
          }
          function unstable_clear(callback) {
            var prevInteractions = exports.__interactionsRef.current;
            exports.__interactionsRef.current = /* @__PURE__ */ new Set();
            try {
              return callback();
            } finally {
              exports.__interactionsRef.current = prevInteractions;
            }
          }
          function unstable_getCurrent() {
            {
              return exports.__interactionsRef.current;
            }
          }
          function unstable_getThreadID() {
            return ++threadIDCounter;
          }
          function unstable_trace(name2, timestamp, callback) {
            var threadID = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : DEFAULT_THREAD_ID;
            var interaction = {
              __count: 1,
              id: interactionIDCounter++,
              name: name2,
              timestamp
            };
            var prevInteractions = exports.__interactionsRef.current;
            var interactions = new Set(prevInteractions);
            interactions.add(interaction);
            exports.__interactionsRef.current = interactions;
            var subscriber = exports.__subscriberRef.current;
            var returnValue;
            try {
              if (subscriber !== null) {
                subscriber.onInteractionTraced(interaction);
              }
            } finally {
              try {
                if (subscriber !== null) {
                  subscriber.onWorkStarted(interactions, threadID);
                }
              } finally {
                try {
                  returnValue = callback();
                } finally {
                  exports.__interactionsRef.current = prevInteractions;
                  try {
                    if (subscriber !== null) {
                      subscriber.onWorkStopped(interactions, threadID);
                    }
                  } finally {
                    interaction.__count--;
                    if (subscriber !== null && interaction.__count === 0) {
                      subscriber.onInteractionScheduledWorkCompleted(interaction);
                    }
                  }
                }
              }
            }
            return returnValue;
          }
          function unstable_wrap(callback) {
            var threadID = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : DEFAULT_THREAD_ID;
            var wrappedInteractions = exports.__interactionsRef.current;
            var subscriber = exports.__subscriberRef.current;
            if (subscriber !== null) {
              subscriber.onWorkScheduled(wrappedInteractions, threadID);
            }
            wrappedInteractions.forEach(function(interaction) {
              interaction.__count++;
            });
            var hasRun = false;
            function wrapped() {
              var prevInteractions = exports.__interactionsRef.current;
              exports.__interactionsRef.current = wrappedInteractions;
              subscriber = exports.__subscriberRef.current;
              try {
                var returnValue;
                try {
                  if (subscriber !== null) {
                    subscriber.onWorkStarted(wrappedInteractions, threadID);
                  }
                } finally {
                  try {
                    returnValue = callback.apply(void 0, arguments);
                  } finally {
                    exports.__interactionsRef.current = prevInteractions;
                    if (subscriber !== null) {
                      subscriber.onWorkStopped(wrappedInteractions, threadID);
                    }
                  }
                }
                return returnValue;
              } finally {
                if (!hasRun) {
                  hasRun = true;
                  wrappedInteractions.forEach(function(interaction) {
                    interaction.__count--;
                    if (subscriber !== null && interaction.__count === 0) {
                      subscriber.onInteractionScheduledWorkCompleted(interaction);
                    }
                  });
                }
              }
            }
            wrapped.cancel = function cancel() {
              subscriber = exports.__subscriberRef.current;
              try {
                if (subscriber !== null) {
                  subscriber.onWorkCanceled(wrappedInteractions, threadID);
                }
              } finally {
                wrappedInteractions.forEach(function(interaction) {
                  interaction.__count--;
                  if (subscriber && interaction.__count === 0) {
                    subscriber.onInteractionScheduledWorkCompleted(interaction);
                  }
                });
              }
            };
            return wrapped;
          }
          var subscribers = null;
          {
            subscribers = /* @__PURE__ */ new Set();
          }
          function unstable_subscribe(subscriber) {
            {
              subscribers.add(subscriber);
              if (subscribers.size === 1) {
                exports.__subscriberRef.current = {
                  onInteractionScheduledWorkCompleted,
                  onInteractionTraced,
                  onWorkCanceled,
                  onWorkScheduled,
                  onWorkStarted,
                  onWorkStopped
                };
              }
            }
          }
          function unstable_unsubscribe(subscriber) {
            {
              subscribers.delete(subscriber);
              if (subscribers.size === 0) {
                exports.__subscriberRef.current = null;
              }
            }
          }
          function onInteractionTraced(interaction) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onInteractionTraced(interaction);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onInteractionScheduledWorkCompleted(interaction) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onInteractionScheduledWorkCompleted(interaction);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkScheduled(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkScheduled(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkStarted(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkStarted(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkStopped(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkStopped(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          function onWorkCanceled(interactions, threadID) {
            var didCatchError = false;
            var caughtError = null;
            subscribers.forEach(function(subscriber) {
              try {
                subscriber.onWorkCanceled(interactions, threadID);
              } catch (error) {
                if (!didCatchError) {
                  didCatchError = true;
                  caughtError = error;
                }
              }
            });
            if (didCatchError) {
              throw caughtError;
            }
          }
          exports.unstable_clear = unstable_clear;
          exports.unstable_getCurrent = unstable_getCurrent;
          exports.unstable_getThreadID = unstable_getThreadID;
          exports.unstable_subscribe = unstable_subscribe;
          exports.unstable_trace = unstable_trace;
          exports.unstable_unsubscribe = unstable_unsubscribe;
          exports.unstable_wrap = unstable_wrap;
        })();
      }
    }
  });

  // node_modules/scheduler/tracing.js
  var require_tracing = __commonJS({
    "node_modules/scheduler/tracing.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_scheduler_tracing_development();
      }
    }
  });

  // node_modules/react-dom/cjs/react-dom.development.js
  var require_react_dom_development = __commonJS({
    "node_modules/react-dom/cjs/react-dom.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var React395 = require_react();
          var _assign34 = require_object_assign();
          var Scheduler = require_scheduler();
          var tracing = require_tracing();
          var ReactSharedInternals = React395.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
          function warn2(format2) {
            {
              for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                args[_key - 1] = arguments[_key];
              }
              printWarning("warn", format2, args);
            }
          }
          function error(format2) {
            {
              for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                args[_key2 - 1] = arguments[_key2];
              }
              printWarning("error", format2, args);
            }
          }
          function printWarning(level, format2, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format2 += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return "" + item;
              });
              argsWithFormat.unshift("Warning: " + format2);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          if (!React395) {
            {
              throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
            }
          }
          var FunctionComponent = 0;
          var ClassComponent = 1;
          var IndeterminateComponent = 2;
          var HostRoot = 3;
          var HostPortal = 4;
          var HostComponent = 5;
          var HostText = 6;
          var Fragment38 = 7;
          var Mode = 8;
          var ContextConsumer = 9;
          var ContextProvider = 10;
          var ForwardRef = 11;
          var Profiler = 12;
          var SuspenseComponent = 13;
          var MemoComponent = 14;
          var SimpleMemoComponent = 15;
          var LazyComponent = 16;
          var IncompleteClassComponent = 17;
          var DehydratedFragment = 18;
          var SuspenseListComponent = 19;
          var FundamentalComponent = 20;
          var ScopeComponent = 21;
          var Block = 22;
          var OffscreenComponent = 23;
          var LegacyHiddenComponent = 24;
          var enableProfilerTimer = true;
          var enableFundamentalAPI = false;
          var enableNewReconciler = false;
          var warnAboutStringRefs = false;
          var allNativeEvents = /* @__PURE__ */ new Set();
          var registrationNameDependencies = {};
          var possibleRegistrationNames = {};
          function registerTwoPhaseEvent(registrationName, dependencies) {
            registerDirectEvent(registrationName, dependencies);
            registerDirectEvent(registrationName + "Capture", dependencies);
          }
          function registerDirectEvent(registrationName, dependencies) {
            {
              if (registrationNameDependencies[registrationName]) {
                error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
              }
            }
            registrationNameDependencies[registrationName] = dependencies;
            {
              var lowerCasedName = registrationName.toLowerCase();
              possibleRegistrationNames[lowerCasedName] = registrationName;
              if (registrationName === "onDoubleClick") {
                possibleRegistrationNames.ondblclick = registrationName;
              }
            }
            for (var i = 0; i < dependencies.length; i++) {
              allNativeEvents.add(dependencies[i]);
            }
          }
          var canUseDOM3 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
          var RESERVED = 0;
          var STRING = 1;
          var BOOLEANISH_STRING = 2;
          var BOOLEAN = 3;
          var OVERLOADED_BOOLEAN = 4;
          var NUMERIC = 5;
          var POSITIVE_NUMERIC = 6;
          var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
          var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
          var ROOT_ATTRIBUTE_NAME = "data-reactroot";
          var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          var illegalAttributeNameCache = {};
          var validatedAttributeNameCache = {};
          function isAttributeNameSafe(attributeName) {
            if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
              return true;
            }
            if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
              return false;
            }
            if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
              validatedAttributeNameCache[attributeName] = true;
              return true;
            }
            illegalAttributeNameCache[attributeName] = true;
            {
              error("Invalid attribute name: `%s`", attributeName);
            }
            return false;
          }
          function shouldIgnoreAttribute(name2, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null) {
              return propertyInfo.type === RESERVED;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (name2.length > 2 && (name2[0] === "o" || name2[0] === "O") && (name2[1] === "n" || name2[1] === "N")) {
              return true;
            }
            return false;
          }
          function shouldRemoveAttributeWithWarning(name2, value, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null && propertyInfo.type === RESERVED) {
              return false;
            }
            switch (typeof value) {
              case "function":
              case "symbol":
                return true;
              case "boolean": {
                if (isCustomComponentTag) {
                  return false;
                }
                if (propertyInfo !== null) {
                  return !propertyInfo.acceptsBooleans;
                } else {
                  var prefix2 = name2.toLowerCase().slice(0, 5);
                  return prefix2 !== "data-" && prefix2 !== "aria-";
                }
              }
              default:
                return false;
            }
          }
          function shouldRemoveAttribute(name2, value, propertyInfo, isCustomComponentTag) {
            if (value === null || typeof value === "undefined") {
              return true;
            }
            if (shouldRemoveAttributeWithWarning(name2, value, propertyInfo, isCustomComponentTag)) {
              return true;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (propertyInfo !== null) {
              switch (propertyInfo.type) {
                case BOOLEAN:
                  return !value;
                case OVERLOADED_BOOLEAN:
                  return value === false;
                case NUMERIC:
                  return isNaN(value);
                case POSITIVE_NUMERIC:
                  return isNaN(value) || value < 1;
              }
            }
            return false;
          }
          function getPropertyInfo(name2) {
            return properties.hasOwnProperty(name2) ? properties[name2] : null;
          }
          function PropertyInfoRecord(name2, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
            this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
            this.attributeName = attributeName;
            this.attributeNamespace = attributeNamespace;
            this.mustUseProperty = mustUseProperty;
            this.propertyName = name2;
            this.type = type;
            this.sanitizeURL = sanitizeURL2;
            this.removeEmptyString = removeEmptyString;
          }
          var properties = {};
          var reservedProps = [
            "children",
            "dangerouslySetInnerHTML",
            // TODO: This prevents the assignment of defaultValue to regular
            // elements (not just inputs). Now that ReactDOMInput assigns to the
            // defaultValue property -- do we need this?
            "defaultValue",
            "defaultChecked",
            "innerHTML",
            "suppressContentEditableWarning",
            "suppressHydrationWarning",
            "style"
          ];
          reservedProps.forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              RESERVED,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref2) {
            var name2 = _ref2[0], attributeName = _ref2[1];
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEANISH_STRING,
              false,
              // mustUseProperty
              name2.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEANISH_STRING,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "allowFullScreen",
            "async",
            // Note: there is a special case that prevents it from being written to the DOM
            // on the client side because the browsers are inconsistent. Instead we call focus().
            "autoFocus",
            "autoPlay",
            "controls",
            "default",
            "defer",
            "disabled",
            "disablePictureInPicture",
            "disableRemotePlayback",
            "formNoValidate",
            "hidden",
            "loop",
            "noModule",
            "noValidate",
            "open",
            "playsInline",
            "readOnly",
            "required",
            "reversed",
            "scoped",
            "seamless",
            // Microdata
            "itemScope"
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEAN,
              false,
              // mustUseProperty
              name2.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "checked",
            // Note: `option.selected` is not updated if `select.multiple` is
            // disabled with `removeAttribute`. We have special logic for handling this.
            "multiple",
            "muted",
            "selected"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEAN,
              true,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "capture",
            "download"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              OVERLOADED_BOOLEAN,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "cols",
            "rows",
            "size",
            "span"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              POSITIVE_NUMERIC,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          ["rowSpan", "start"].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              NUMERIC,
              false,
              // mustUseProperty
              name2.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          var CAMELIZE = /[\-\:]([a-z])/g;
          var capitalize4 = function(token) {
            return token[1].toUpperCase();
          };
          [
            "accent-height",
            "alignment-baseline",
            "arabic-form",
            "baseline-shift",
            "cap-height",
            "clip-path",
            "clip-rule",
            "color-interpolation",
            "color-interpolation-filters",
            "color-profile",
            "color-rendering",
            "dominant-baseline",
            "enable-background",
            "fill-opacity",
            "fill-rule",
            "flood-color",
            "flood-opacity",
            "font-family",
            "font-size",
            "font-size-adjust",
            "font-stretch",
            "font-style",
            "font-variant",
            "font-weight",
            "glyph-name",
            "glyph-orientation-horizontal",
            "glyph-orientation-vertical",
            "horiz-adv-x",
            "horiz-origin-x",
            "image-rendering",
            "letter-spacing",
            "lighting-color",
            "marker-end",
            "marker-mid",
            "marker-start",
            "overline-position",
            "overline-thickness",
            "paint-order",
            "panose-1",
            "pointer-events",
            "rendering-intent",
            "shape-rendering",
            "stop-color",
            "stop-opacity",
            "strikethrough-position",
            "strikethrough-thickness",
            "stroke-dasharray",
            "stroke-dashoffset",
            "stroke-linecap",
            "stroke-linejoin",
            "stroke-miterlimit",
            "stroke-opacity",
            "stroke-width",
            "text-anchor",
            "text-decoration",
            "text-rendering",
            "underline-position",
            "underline-thickness",
            "unicode-bidi",
            "unicode-range",
            "units-per-em",
            "v-alphabetic",
            "v-hanging",
            "v-ideographic",
            "v-mathematical",
            "vector-effect",
            "vert-adv-y",
            "vert-origin-x",
            "vert-origin-y",
            "word-spacing",
            "writing-mode",
            "xmlns:xlink",
            "x-height"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(attributeName) {
            var name2 = attributeName.replace(CAMELIZE, capitalize4);
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "xlink:actuate",
            "xlink:arcrole",
            "xlink:role",
            "xlink:show",
            "xlink:title",
            "xlink:type"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(attributeName) {
            var name2 = attributeName.replace(CAMELIZE, capitalize4);
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              "http://www.w3.org/1999/xlink",
              false,
              // sanitizeURL
              false
            );
          });
          [
            "xml:base",
            "xml:lang",
            "xml:space"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(attributeName) {
            var name2 = attributeName.replace(CAMELIZE, capitalize4);
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              "http://www.w3.org/XML/1998/namespace",
              false,
              // sanitizeURL
              false
            );
          });
          ["tabIndex", "crossOrigin"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              // mustUseProperty
              attributeName.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          var xlinkHref = "xlinkHref";
          properties[xlinkHref] = new PropertyInfoRecord(
            "xlinkHref",
            STRING,
            false,
            // mustUseProperty
            "xlink:href",
            "http://www.w3.org/1999/xlink",
            true,
            // sanitizeURL
            false
          );
          ["src", "href", "action", "formAction"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              // mustUseProperty
              attributeName.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              true,
              // sanitizeURL
              true
            );
          });
          var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
          var didWarn = false;
          function sanitizeURL(url) {
            {
              if (!didWarn && isJavaScriptProtocol.test(url)) {
                didWarn = true;
                error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url));
              }
            }
          }
          function getValueForProperty(node, name2, expected, propertyInfo) {
            {
              if (propertyInfo.mustUseProperty) {
                var propertyName = propertyInfo.propertyName;
                return node[propertyName];
              } else {
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL("" + expected);
                }
                var attributeName = propertyInfo.attributeName;
                var stringValue = null;
                if (propertyInfo.type === OVERLOADED_BOOLEAN) {
                  if (node.hasAttribute(attributeName)) {
                    var value = node.getAttribute(attributeName);
                    if (value === "") {
                      return true;
                    }
                    if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                      return value;
                    }
                    if (value === "" + expected) {
                      return expected;
                    }
                    return value;
                  }
                } else if (node.hasAttribute(attributeName)) {
                  if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                    return node.getAttribute(attributeName);
                  }
                  if (propertyInfo.type === BOOLEAN) {
                    return expected;
                  }
                  stringValue = node.getAttribute(attributeName);
                }
                if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                  return stringValue === null ? expected : stringValue;
                } else if (stringValue === "" + expected) {
                  return expected;
                } else {
                  return stringValue;
                }
              }
            }
          }
          function getValueForAttribute(node, name2, expected) {
            {
              if (!isAttributeNameSafe(name2)) {
                return;
              }
              if (isOpaqueHydratingObject(expected)) {
                return expected;
              }
              if (!node.hasAttribute(name2)) {
                return expected === void 0 ? void 0 : null;
              }
              var value = node.getAttribute(name2);
              if (value === "" + expected) {
                return expected;
              }
              return value;
            }
          }
          function setValueForProperty(node, name2, value, isCustomComponentTag) {
            var propertyInfo = getPropertyInfo(name2);
            if (shouldIgnoreAttribute(name2, propertyInfo, isCustomComponentTag)) {
              return;
            }
            if (shouldRemoveAttribute(name2, value, propertyInfo, isCustomComponentTag)) {
              value = null;
            }
            if (isCustomComponentTag || propertyInfo === null) {
              if (isAttributeNameSafe(name2)) {
                var _attributeName = name2;
                if (value === null) {
                  node.removeAttribute(_attributeName);
                } else {
                  node.setAttribute(_attributeName, "" + value);
                }
              }
              return;
            }
            var mustUseProperty = propertyInfo.mustUseProperty;
            if (mustUseProperty) {
              var propertyName = propertyInfo.propertyName;
              if (value === null) {
                var type = propertyInfo.type;
                node[propertyName] = type === BOOLEAN ? false : "";
              } else {
                node[propertyName] = value;
              }
              return;
            }
            var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
            if (value === null) {
              node.removeAttribute(attributeName);
            } else {
              var _type = propertyInfo.type;
              var attributeValue;
              if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
                attributeValue = "";
              } else {
                {
                  attributeValue = "" + value;
                }
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL(attributeValue.toString());
                }
              }
              if (attributeNamespace) {
                node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
              } else {
                node.setAttribute(attributeName, attributeValue);
              }
            }
          }
          var REACT_ELEMENT_TYPE = 60103;
          var REACT_PORTAL_TYPE = 60106;
          var REACT_FRAGMENT_TYPE = 60107;
          var REACT_STRICT_MODE_TYPE = 60108;
          var REACT_PROFILER_TYPE = 60114;
          var REACT_PROVIDER_TYPE = 60109;
          var REACT_CONTEXT_TYPE = 60110;
          var REACT_FORWARD_REF_TYPE = 60112;
          var REACT_SUSPENSE_TYPE = 60113;
          var REACT_SUSPENSE_LIST_TYPE = 60120;
          var REACT_MEMO_TYPE = 60115;
          var REACT_LAZY_TYPE = 60116;
          var REACT_BLOCK_TYPE = 60121;
          var REACT_SERVER_BLOCK_TYPE = 60122;
          var REACT_FUNDAMENTAL_TYPE = 60117;
          var REACT_SCOPE_TYPE = 60119;
          var REACT_OPAQUE_ID_TYPE = 60128;
          var REACT_DEBUG_TRACING_MODE_TYPE = 60129;
          var REACT_OFFSCREEN_TYPE = 60130;
          var REACT_LEGACY_HIDDEN_TYPE = 60131;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor = Symbol.for;
            REACT_ELEMENT_TYPE = symbolFor("react.element");
            REACT_PORTAL_TYPE = symbolFor("react.portal");
            REACT_FRAGMENT_TYPE = symbolFor("react.fragment");
            REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode");
            REACT_PROFILER_TYPE = symbolFor("react.profiler");
            REACT_PROVIDER_TYPE = symbolFor("react.provider");
            REACT_CONTEXT_TYPE = symbolFor("react.context");
            REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref");
            REACT_SUSPENSE_TYPE = symbolFor("react.suspense");
            REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list");
            REACT_MEMO_TYPE = symbolFor("react.memo");
            REACT_LAZY_TYPE = symbolFor("react.lazy");
            REACT_BLOCK_TYPE = symbolFor("react.block");
            REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block");
            REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental");
            REACT_SCOPE_TYPE = symbolFor("react.scope");
            REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
            REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
            REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
            REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
          }
          var MAYBE_ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: _assign34({}, props, {
                    value: prevLog
                  }),
                  info: _assign34({}, props, {
                    value: prevInfo
                  }),
                  warn: _assign34({}, props, {
                    value: prevWarn
                  }),
                  error: _assign34({}, props, {
                    value: prevError
                  }),
                  group: _assign34({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: _assign34({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: _assign34({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name2, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x2) {
                  var match = x2.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name2;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame2 = componentFrameCache.get(fn);
              if (frame2 !== void 0) {
                return frame2;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher.current;
              ReactCurrentDispatcher.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x2) {
                    control = x2;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x2) {
                    control = x2;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x2) {
                  control = x2;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s2 = sampleLines.length - 1;
                var c2 = controlLines.length - 1;
                while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
                  c2--;
                }
                for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
                  if (sampleLines[s2] !== controlLines[c2]) {
                    if (s2 !== 1 || c2 !== 1) {
                      do {
                        s2--;
                        c2--;
                        if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
                          var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s2 >= 1 && c2 >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name2 = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeClassComponentFrame(ctor, source, ownerFn) {
            {
              return describeNativeComponentFrame(ctor, true);
            }
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component50) {
            var prototype = Component50.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case REACT_SUSPENSE_TYPE:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_BLOCK_TYPE:
                  return describeFunctionComponentFrame(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x2) {
                  }
                }
              }
            }
            return "";
          }
          function describeFiber(fiber) {
            var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
            var source = fiber._debugSource;
            switch (fiber.tag) {
              case HostComponent:
                return describeBuiltInComponentFrame(fiber.type);
              case LazyComponent:
                return describeBuiltInComponentFrame("Lazy");
              case SuspenseComponent:
                return describeBuiltInComponentFrame("Suspense");
              case SuspenseListComponent:
                return describeBuiltInComponentFrame("SuspenseList");
              case FunctionComponent:
              case IndeterminateComponent:
              case SimpleMemoComponent:
                return describeFunctionComponentFrame(fiber.type);
              case ForwardRef:
                return describeFunctionComponentFrame(fiber.type.render);
              case Block:
                return describeFunctionComponentFrame(fiber.type._render);
              case ClassComponent:
                return describeClassComponentFrame(fiber.type);
              default:
                return "";
            }
          }
          function getStackByFiberInDevAndProd(workInProgress2) {
            try {
              var info2 = "";
              var node = workInProgress2;
              do {
                info2 += describeFiber(node);
                node = node.return;
              } while (node);
              return info2;
            } catch (x2) {
              return "\nError generating stack: " + x2.message + "\n" + x2.stack;
            }
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var functionName = innerType.displayName || innerType.name || "";
            return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentName(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case REACT_FRAGMENT_TYPE:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              case REACT_PROFILER_TYPE:
                return "Profiler";
              case REACT_STRICT_MODE_TYPE:
                return "StrictMode";
              case REACT_SUSPENSE_TYPE:
                return "Suspense";
              case REACT_SUSPENSE_LIST_TYPE:
                return "SuspenseList";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  return getComponentName(type.type);
                case REACT_BLOCK_TYPE:
                  return getComponentName(type._render);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentName(init(payload));
                  } catch (x2) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
          var current = null;
          var isRendering = false;
          function getCurrentFiberOwnerNameInDevOrNull() {
            {
              if (current === null) {
                return null;
              }
              var owner = current._debugOwner;
              if (owner !== null && typeof owner !== "undefined") {
                return getComponentName(owner.type);
              }
            }
            return null;
          }
          function getCurrentFiberStackInDev() {
            {
              if (current === null) {
                return "";
              }
              return getStackByFiberInDevAndProd(current);
            }
          }
          function resetCurrentFiber() {
            {
              ReactDebugCurrentFrame.getCurrentStack = null;
              current = null;
              isRendering = false;
            }
          }
          function setCurrentFiber(fiber) {
            {
              ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
              current = fiber;
              isRendering = false;
            }
          }
          function setIsRendering(rendering) {
            {
              isRendering = rendering;
            }
          }
          function getIsRendering() {
            {
              return isRendering;
            }
          }
          function toString(value) {
            return "" + value;
          }
          function getToStringValue(value) {
            switch (typeof value) {
              case "boolean":
              case "number":
              case "object":
              case "string":
              case "undefined":
                return value;
              default:
                return "";
            }
          }
          var hasReadOnlyValue = {
            button: true,
            checkbox: true,
            image: true,
            hidden: true,
            radio: true,
            reset: true,
            submit: true
          };
          function checkControlledValueProps(tagName, props) {
            {
              if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
                error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");
              }
              if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
                error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
              }
            }
          }
          function isCheckable(elem) {
            var type = elem.type;
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
          }
          function getTracker(node) {
            return node._valueTracker;
          }
          function detachTracker(node) {
            node._valueTracker = null;
          }
          function getValueFromNode(node) {
            var value = "";
            if (!node) {
              return value;
            }
            if (isCheckable(node)) {
              value = node.checked ? "true" : "false";
            } else {
              value = node.value;
            }
            return value;
          }
          function trackValueOnNode(node) {
            var valueField = isCheckable(node) ? "checked" : "value";
            var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
            var currentValue = "" + node[valueField];
            if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
              return;
            }
            var get2 = descriptor.get, set2 = descriptor.set;
            Object.defineProperty(node, valueField, {
              configurable: true,
              get: function() {
                return get2.call(this);
              },
              set: function(value) {
                currentValue = "" + value;
                set2.call(this, value);
              }
            });
            Object.defineProperty(node, valueField, {
              enumerable: descriptor.enumerable
            });
            var tracker = {
              getValue: function() {
                return currentValue;
              },
              setValue: function(value) {
                currentValue = "" + value;
              },
              stopTracking: function() {
                detachTracker(node);
                delete node[valueField];
              }
            };
            return tracker;
          }
          function track(node) {
            if (getTracker(node)) {
              return;
            }
            node._valueTracker = trackValueOnNode(node);
          }
          function updateValueIfChanged(node) {
            if (!node) {
              return false;
            }
            var tracker = getTracker(node);
            if (!tracker) {
              return true;
            }
            var lastValue = tracker.getValue();
            var nextValue = getValueFromNode(node);
            if (nextValue !== lastValue) {
              tracker.setValue(nextValue);
              return true;
            }
            return false;
          }
          function getActiveElement(doc) {
            doc = doc || (typeof document !== "undefined" ? document : void 0);
            if (typeof doc === "undefined") {
              return null;
            }
            try {
              return doc.activeElement || doc.body;
            } catch (e) {
              return doc.body;
            }
          }
          var didWarnValueDefaultValue = false;
          var didWarnCheckedDefaultChecked = false;
          var didWarnControlledToUncontrolled = false;
          var didWarnUncontrolledToControlled = false;
          function isControlled(props) {
            var usesChecked = props.type === "checkbox" || props.type === "radio";
            return usesChecked ? props.checked != null : props.value != null;
          }
          function getHostProps(element, props) {
            var node = element;
            var checked = props.checked;
            var hostProps = _assign34({}, props, {
              defaultChecked: void 0,
              defaultValue: void 0,
              value: void 0,
              checked: checked != null ? checked : node._wrapperState.initialChecked
            });
            return hostProps;
          }
          function initWrapperState(element, props) {
            {
              checkControlledValueProps("input", props);
              if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
                error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnCheckedDefaultChecked = true;
              }
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
                error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnValueDefaultValue = true;
              }
            }
            var node = element;
            var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
            node._wrapperState = {
              initialChecked: props.checked != null ? props.checked : props.defaultChecked,
              initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
              controlled: isControlled(props)
            };
          }
          function updateChecked(element, props) {
            var node = element;
            var checked = props.checked;
            if (checked != null) {
              setValueForProperty(node, "checked", checked, false);
            }
          }
          function updateWrapper(element, props) {
            var node = element;
            {
              var controlled = isControlled(props);
              if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
                error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnUncontrolledToControlled = true;
              }
              if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
                error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnControlledToUncontrolled = true;
              }
            }
            updateChecked(element, props);
            var value = getToStringValue(props.value);
            var type = props.type;
            if (value != null) {
              if (type === "number") {
                if (value === 0 && node.value === "" || // We explicitly want to coerce to number here if possible.
                // eslint-disable-next-line
                node.value != value) {
                  node.value = toString(value);
                }
              } else if (node.value !== toString(value)) {
                node.value = toString(value);
              }
            } else if (type === "submit" || type === "reset") {
              node.removeAttribute("value");
              return;
            }
            {
              if (props.hasOwnProperty("value")) {
                setDefaultValue(node, props.type, value);
              } else if (props.hasOwnProperty("defaultValue")) {
                setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
              }
            }
            {
              if (props.checked == null && props.defaultChecked != null) {
                node.defaultChecked = !!props.defaultChecked;
              }
            }
          }
          function postMountWrapper(element, props, isHydrating2) {
            var node = element;
            if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
              var type = props.type;
              var isButton = type === "submit" || type === "reset";
              if (isButton && (props.value === void 0 || props.value === null)) {
                return;
              }
              var initialValue = toString(node._wrapperState.initialValue);
              if (!isHydrating2) {
                {
                  if (initialValue !== node.value) {
                    node.value = initialValue;
                  }
                }
              }
              {
                node.defaultValue = initialValue;
              }
            }
            var name2 = node.name;
            if (name2 !== "") {
              node.name = "";
            }
            {
              node.defaultChecked = !node.defaultChecked;
              node.defaultChecked = !!node._wrapperState.initialChecked;
            }
            if (name2 !== "") {
              node.name = name2;
            }
          }
          function restoreControlledState(element, props) {
            var node = element;
            updateWrapper(node, props);
            updateNamedCousins(node, props);
          }
          function updateNamedCousins(rootNode, props) {
            var name2 = props.name;
            if (props.type === "radio" && name2 != null) {
              var queryRoot = rootNode;
              while (queryRoot.parentNode) {
                queryRoot = queryRoot.parentNode;
              }
              var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name2) + '][type="radio"]');
              for (var i = 0; i < group.length; i++) {
                var otherNode = group[i];
                if (otherNode === rootNode || otherNode.form !== rootNode.form) {
                  continue;
                }
                var otherProps = getFiberCurrentPropsFromNode(otherNode);
                if (!otherProps) {
                  {
                    throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
                  }
                }
                updateValueIfChanged(otherNode);
                updateWrapper(otherNode, otherProps);
              }
            }
          }
          function setDefaultValue(node, type, value) {
            if (
              // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
              type !== "number" || getActiveElement(node.ownerDocument) !== node
            ) {
              if (value == null) {
                node.defaultValue = toString(node._wrapperState.initialValue);
              } else if (node.defaultValue !== toString(value)) {
                node.defaultValue = toString(value);
              }
            }
          }
          var didWarnSelectedSetOnOption = false;
          var didWarnInvalidChild = false;
          function flattenChildren(children) {
            var content = "";
            React395.Children.forEach(children, function(child) {
              if (child == null) {
                return;
              }
              content += child;
            });
            return content;
          }
          function validateProps(element, props) {
            {
              if (typeof props.children === "object" && props.children !== null) {
                React395.Children.forEach(props.children, function(child) {
                  if (child == null) {
                    return;
                  }
                  if (typeof child === "string" || typeof child === "number") {
                    return;
                  }
                  if (typeof child.type !== "string") {
                    return;
                  }
                  if (!didWarnInvalidChild) {
                    didWarnInvalidChild = true;
                    error("Only strings and numbers are supported as <option> children.");
                  }
                });
              }
              if (props.selected != null && !didWarnSelectedSetOnOption) {
                error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
                didWarnSelectedSetOnOption = true;
              }
            }
          }
          function postMountWrapper$1(element, props) {
            if (props.value != null) {
              element.setAttribute("value", toString(getToStringValue(props.value)));
            }
          }
          function getHostProps$1(element, props) {
            var hostProps = _assign34({
              children: void 0
            }, props);
            var content = flattenChildren(props.children);
            if (content) {
              hostProps.children = content;
            }
            return hostProps;
          }
          var didWarnValueDefaultValue$1;
          {
            didWarnValueDefaultValue$1 = false;
          }
          function getDeclarationErrorAddendum() {
            var ownerName = getCurrentFiberOwnerNameInDevOrNull();
            if (ownerName) {
              return "\n\nCheck the render method of `" + ownerName + "`.";
            }
            return "";
          }
          var valuePropNames = ["value", "defaultValue"];
          function checkSelectPropTypes(props) {
            {
              checkControlledValueProps("select", props);
              for (var i = 0; i < valuePropNames.length; i++) {
                var propName = valuePropNames[i];
                if (props[propName] == null) {
                  continue;
                }
                var isArray2 = Array.isArray(props[propName]);
                if (props.multiple && !isArray2) {
                  error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
                } else if (!props.multiple && isArray2) {
                  error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
                }
              }
            }
          }
          function updateOptions(node, multiple, propValue, setDefaultSelected) {
            var options5 = node.options;
            if (multiple) {
              var selectedValues = propValue;
              var selectedValue = {};
              for (var i = 0; i < selectedValues.length; i++) {
                selectedValue["$" + selectedValues[i]] = true;
              }
              for (var _i = 0; _i < options5.length; _i++) {
                var selected = selectedValue.hasOwnProperty("$" + options5[_i].value);
                if (options5[_i].selected !== selected) {
                  options5[_i].selected = selected;
                }
                if (selected && setDefaultSelected) {
                  options5[_i].defaultSelected = true;
                }
              }
            } else {
              var _selectedValue = toString(getToStringValue(propValue));
              var defaultSelected = null;
              for (var _i2 = 0; _i2 < options5.length; _i2++) {
                if (options5[_i2].value === _selectedValue) {
                  options5[_i2].selected = true;
                  if (setDefaultSelected) {
                    options5[_i2].defaultSelected = true;
                  }
                  return;
                }
                if (defaultSelected === null && !options5[_i2].disabled) {
                  defaultSelected = options5[_i2];
                }
              }
              if (defaultSelected !== null) {
                defaultSelected.selected = true;
              }
            }
          }
          function getHostProps$2(element, props) {
            return _assign34({}, props, {
              value: void 0
            });
          }
          function initWrapperState$1(element, props) {
            var node = element;
            {
              checkSelectPropTypes(props);
            }
            node._wrapperState = {
              wasMultiple: !!props.multiple
            };
            {
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
                error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components");
                didWarnValueDefaultValue$1 = true;
              }
            }
          }
          function postMountWrapper$2(element, props) {
            var node = element;
            node.multiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (props.defaultValue != null) {
              updateOptions(node, !!props.multiple, props.defaultValue, true);
            }
          }
          function postUpdateWrapper(element, props) {
            var node = element;
            var wasMultiple = node._wrapperState.wasMultiple;
            node._wrapperState.wasMultiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (wasMultiple !== !!props.multiple) {
              if (props.defaultValue != null) {
                updateOptions(node, !!props.multiple, props.defaultValue, true);
              } else {
                updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
              }
            }
          }
          function restoreControlledState$1(element, props) {
            var node = element;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            }
          }
          var didWarnValDefaultVal = false;
          function getHostProps$3(element, props) {
            var node = element;
            if (!(props.dangerouslySetInnerHTML == null)) {
              {
                throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
              }
            }
            var hostProps = _assign34({}, props, {
              value: void 0,
              defaultValue: void 0,
              children: toString(node._wrapperState.initialValue)
            });
            return hostProps;
          }
          function initWrapperState$2(element, props) {
            var node = element;
            {
              checkControlledValueProps("textarea", props);
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
                error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
                didWarnValDefaultVal = true;
              }
            }
            var initialValue = props.value;
            if (initialValue == null) {
              var children = props.children, defaultValue = props.defaultValue;
              if (children != null) {
                {
                  error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
                }
                {
                  if (!(defaultValue == null)) {
                    {
                      throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
                    }
                  }
                  if (Array.isArray(children)) {
                    if (!(children.length <= 1)) {
                      {
                        throw Error("<textarea> can only have at most one child.");
                      }
                    }
                    children = children[0];
                  }
                  defaultValue = children;
                }
              }
              if (defaultValue == null) {
                defaultValue = "";
              }
              initialValue = defaultValue;
            }
            node._wrapperState = {
              initialValue: getToStringValue(initialValue)
            };
          }
          function updateWrapper$1(element, props) {
            var node = element;
            var value = getToStringValue(props.value);
            var defaultValue = getToStringValue(props.defaultValue);
            if (value != null) {
              var newValue = toString(value);
              if (newValue !== node.value) {
                node.value = newValue;
              }
              if (props.defaultValue == null && node.defaultValue !== newValue) {
                node.defaultValue = newValue;
              }
            }
            if (defaultValue != null) {
              node.defaultValue = toString(defaultValue);
            }
          }
          function postMountWrapper$3(element, props) {
            var node = element;
            var textContent = node.textContent;
            if (textContent === node._wrapperState.initialValue) {
              if (textContent !== "" && textContent !== null) {
                node.value = textContent;
              }
            }
          }
          function restoreControlledState$2(element, props) {
            updateWrapper$1(element, props);
          }
          var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
          var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
          var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
          var Namespaces = {
            html: HTML_NAMESPACE,
            mathml: MATH_NAMESPACE,
            svg: SVG_NAMESPACE
          };
          function getIntrinsicNamespace(type) {
            switch (type) {
              case "svg":
                return SVG_NAMESPACE;
              case "math":
                return MATH_NAMESPACE;
              default:
                return HTML_NAMESPACE;
            }
          }
          function getChildNamespace(parentNamespace, type) {
            if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
              return getIntrinsicNamespace(type);
            }
            if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
              return HTML_NAMESPACE;
            }
            return parentNamespace;
          }
          var createMicrosoftUnsafeLocalFunction = function(func) {
            if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
              return function(arg0, arg1, arg2, arg3) {
                MSApp.execUnsafeLocalFunction(function() {
                  return func(arg0, arg1, arg2, arg3);
                });
              };
            } else {
              return func;
            }
          };
          var reusableSVGContainer;
          var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
            if (node.namespaceURI === Namespaces.svg) {
              if (!("innerHTML" in node)) {
                reusableSVGContainer = reusableSVGContainer || document.createElement("div");
                reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
                var svgNode = reusableSVGContainer.firstChild;
                while (node.firstChild) {
                  node.removeChild(node.firstChild);
                }
                while (svgNode.firstChild) {
                  node.appendChild(svgNode.firstChild);
                }
                return;
              }
            }
            node.innerHTML = html;
          });
          var ELEMENT_NODE = 1;
          var TEXT_NODE = 3;
          var COMMENT_NODE = 8;
          var DOCUMENT_NODE = 9;
          var DOCUMENT_FRAGMENT_NODE = 11;
          var setTextContent = function(node, text) {
            if (text) {
              var firstChild = node.firstChild;
              if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
                firstChild.nodeValue = text;
                return;
              }
            }
            node.textContent = text;
          };
          var shorthandToLonghand = {
            animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
            background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
            backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
            border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
            borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
            borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
            borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
            borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
            borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
            borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
            borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
            borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
            borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
            borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
            borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
            columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
            columns: ["columnCount", "columnWidth"],
            flex: ["flexBasis", "flexGrow", "flexShrink"],
            flexFlow: ["flexDirection", "flexWrap"],
            font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
            fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
            gap: ["columnGap", "rowGap"],
            grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
            gridColumn: ["gridColumnEnd", "gridColumnStart"],
            gridColumnGap: ["columnGap"],
            gridGap: ["columnGap", "rowGap"],
            gridRow: ["gridRowEnd", "gridRowStart"],
            gridRowGap: ["rowGap"],
            gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
            margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
            marker: ["markerEnd", "markerMid", "markerStart"],
            mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
            maskPosition: ["maskPositionX", "maskPositionY"],
            outline: ["outlineColor", "outlineStyle", "outlineWidth"],
            overflow: ["overflowX", "overflowY"],
            padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
            placeContent: ["alignContent", "justifyContent"],
            placeItems: ["alignItems", "justifyItems"],
            placeSelf: ["alignSelf", "justifySelf"],
            textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
            textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
            transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
            wordWrap: ["overflowWrap"]
          };
          var isUnitlessNumber = {
            animationIterationCount: true,
            borderImageOutset: true,
            borderImageSlice: true,
            borderImageWidth: true,
            boxFlex: true,
            boxFlexGroup: true,
            boxOrdinalGroup: true,
            columnCount: true,
            columns: true,
            flex: true,
            flexGrow: true,
            flexPositive: true,
            flexShrink: true,
            flexNegative: true,
            flexOrder: true,
            gridArea: true,
            gridRow: true,
            gridRowEnd: true,
            gridRowSpan: true,
            gridRowStart: true,
            gridColumn: true,
            gridColumnEnd: true,
            gridColumnSpan: true,
            gridColumnStart: true,
            fontWeight: true,
            lineClamp: true,
            lineHeight: true,
            opacity: true,
            order: true,
            orphans: true,
            tabSize: true,
            widows: true,
            zIndex: true,
            zoom: true,
            // SVG-related properties
            fillOpacity: true,
            floodOpacity: true,
            stopOpacity: true,
            strokeDasharray: true,
            strokeDashoffset: true,
            strokeMiterlimit: true,
            strokeOpacity: true,
            strokeWidth: true
          };
          function prefixKey(prefix2, key) {
            return prefix2 + key.charAt(0).toUpperCase() + key.substring(1);
          }
          var prefixes2 = ["Webkit", "ms", "Moz", "O"];
          Object.keys(isUnitlessNumber).forEach(function(prop) {
            prefixes2.forEach(function(prefix2) {
              isUnitlessNumber[prefixKey(prefix2, prop)] = isUnitlessNumber[prop];
            });
          });
          function dangerousStyleValue(name2, value, isCustomProperty) {
            var isEmpty = value == null || typeof value === "boolean" || value === "";
            if (isEmpty) {
              return "";
            }
            if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name2) && isUnitlessNumber[name2])) {
              return value + "px";
            }
            return ("" + value).trim();
          }
          var uppercasePattern = /([A-Z])/g;
          var msPattern = /^ms-/;
          function hyphenateStyleName(name2) {
            return name2.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
          }
          var warnValidStyle = function() {
          };
          {
            var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
            var msPattern$1 = /^-ms-/;
            var hyphenPattern = /-(.)/g;
            var badStyleValueWithSemicolonPattern = /;\s*$/;
            var warnedStyleNames = {};
            var warnedStyleValues = {};
            var warnedForNaNValue = false;
            var warnedForInfinityValue = false;
            var camelize4 = function(string) {
              return string.replace(hyphenPattern, function(_, character) {
                return character.toUpperCase();
              });
            };
            var warnHyphenatedStyleName = function(name2) {
              if (warnedStyleNames.hasOwnProperty(name2) && warnedStyleNames[name2]) {
                return;
              }
              warnedStyleNames[name2] = true;
              error(
                "Unsupported style property %s. Did you mean %s?",
                name2,
                // As Andi Smith suggests
                // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
                // is converted to lowercase `ms`.
                camelize4(name2.replace(msPattern$1, "ms-"))
              );
            };
            var warnBadVendoredStyleName = function(name2) {
              if (warnedStyleNames.hasOwnProperty(name2) && warnedStyleNames[name2]) {
                return;
              }
              warnedStyleNames[name2] = true;
              error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name2, name2.charAt(0).toUpperCase() + name2.slice(1));
            };
            var warnStyleValueWithSemicolon = function(name2, value) {
              if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
                return;
              }
              warnedStyleValues[value] = true;
              error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name2, value.replace(badStyleValueWithSemicolonPattern, ""));
            };
            var warnStyleValueIsNaN = function(name2, value) {
              if (warnedForNaNValue) {
                return;
              }
              warnedForNaNValue = true;
              error("`NaN` is an invalid value for the `%s` css style property.", name2);
            };
            var warnStyleValueIsInfinity = function(name2, value) {
              if (warnedForInfinityValue) {
                return;
              }
              warnedForInfinityValue = true;
              error("`Infinity` is an invalid value for the `%s` css style property.", name2);
            };
            warnValidStyle = function(name2, value) {
              if (name2.indexOf("-") > -1) {
                warnHyphenatedStyleName(name2);
              } else if (badVendoredStyleNamePattern.test(name2)) {
                warnBadVendoredStyleName(name2);
              } else if (badStyleValueWithSemicolonPattern.test(value)) {
                warnStyleValueWithSemicolon(name2, value);
              }
              if (typeof value === "number") {
                if (isNaN(value)) {
                  warnStyleValueIsNaN(name2, value);
                } else if (!isFinite(value)) {
                  warnStyleValueIsInfinity(name2, value);
                }
              }
            };
          }
          var warnValidStyle$1 = warnValidStyle;
          function createDangerousStringForStyles(styles164) {
            {
              var serialized = "";
              var delimiter = "";
              for (var styleName in styles164) {
                if (!styles164.hasOwnProperty(styleName)) {
                  continue;
                }
                var styleValue = styles164[styleName];
                if (styleValue != null) {
                  var isCustomProperty = styleName.indexOf("--") === 0;
                  serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
                  serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
                  delimiter = ";";
                }
              }
              return serialized || null;
            }
          }
          function setValueForStyles(node, styles164) {
            var style2 = node.style;
            for (var styleName in styles164) {
              if (!styles164.hasOwnProperty(styleName)) {
                continue;
              }
              var isCustomProperty = styleName.indexOf("--") === 0;
              {
                if (!isCustomProperty) {
                  warnValidStyle$1(styleName, styles164[styleName]);
                }
              }
              var styleValue = dangerousStyleValue(styleName, styles164[styleName], isCustomProperty);
              if (styleName === "float") {
                styleName = "cssFloat";
              }
              if (isCustomProperty) {
                style2.setProperty(styleName, styleValue);
              } else {
                style2[styleName] = styleValue;
              }
            }
          }
          function isValueEmpty(value) {
            return value == null || typeof value === "boolean" || value === "";
          }
          function expandShorthandMap(styles164) {
            var expanded = {};
            for (var key in styles164) {
              var longhands = shorthandToLonghand[key] || [key];
              for (var i = 0; i < longhands.length; i++) {
                expanded[longhands[i]] = key;
              }
            }
            return expanded;
          }
          function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
            {
              if (!nextStyles) {
                return;
              }
              var expandedUpdates = expandShorthandMap(styleUpdates);
              var expandedStyles = expandShorthandMap(nextStyles);
              var warnedAbout = {};
              for (var key in expandedUpdates) {
                var originalKey = expandedUpdates[key];
                var correctOriginalKey = expandedStyles[key];
                if (correctOriginalKey && originalKey !== correctOriginalKey) {
                  var warningKey = originalKey + "," + correctOriginalKey;
                  if (warnedAbout[warningKey]) {
                    continue;
                  }
                  warnedAbout[warningKey] = true;
                  error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey);
                }
              }
            }
          }
          var omittedCloseTags = {
            area: true,
            base: true,
            br: true,
            col: true,
            embed: true,
            hr: true,
            img: true,
            input: true,
            keygen: true,
            link: true,
            meta: true,
            param: true,
            source: true,
            track: true,
            wbr: true
            // NOTE: menuitem's close tag should be omitted, but that causes problems.
          };
          var voidElementTags = _assign34({
            menuitem: true
          }, omittedCloseTags);
          var HTML = "__html";
          function assertValidProps(tag, props) {
            if (!props) {
              return;
            }
            if (voidElementTags[tag]) {
              if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
                {
                  throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
                }
              }
            }
            if (props.dangerouslySetInnerHTML != null) {
              if (!(props.children == null)) {
                {
                  throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
                }
              }
              if (!(typeof props.dangerouslySetInnerHTML === "object" && HTML in props.dangerouslySetInnerHTML)) {
                {
                  throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
                }
              }
            }
            {
              if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
                error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");
              }
            }
            if (!(props.style == null || typeof props.style === "object")) {
              {
                throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
              }
            }
          }
          function isCustomComponent(tagName, props) {
            if (tagName.indexOf("-") === -1) {
              return typeof props.is === "string";
            }
            switch (tagName) {
              case "annotation-xml":
              case "color-profile":
              case "font-face":
              case "font-face-src":
              case "font-face-uri":
              case "font-face-format":
              case "font-face-name":
              case "missing-glyph":
                return false;
              default:
                return true;
            }
          }
          var possibleStandardNames = {
            // HTML
            accept: "accept",
            acceptcharset: "acceptCharset",
            "accept-charset": "acceptCharset",
            accesskey: "accessKey",
            action: "action",
            allowfullscreen: "allowFullScreen",
            alt: "alt",
            as: "as",
            async: "async",
            autocapitalize: "autoCapitalize",
            autocomplete: "autoComplete",
            autocorrect: "autoCorrect",
            autofocus: "autoFocus",
            autoplay: "autoPlay",
            autosave: "autoSave",
            capture: "capture",
            cellpadding: "cellPadding",
            cellspacing: "cellSpacing",
            challenge: "challenge",
            charset: "charSet",
            checked: "checked",
            children: "children",
            cite: "cite",
            class: "className",
            classid: "classID",
            classname: "className",
            cols: "cols",
            colspan: "colSpan",
            content: "content",
            contenteditable: "contentEditable",
            contextmenu: "contextMenu",
            controls: "controls",
            controlslist: "controlsList",
            coords: "coords",
            crossorigin: "crossOrigin",
            dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
            data: "data",
            datetime: "dateTime",
            default: "default",
            defaultchecked: "defaultChecked",
            defaultvalue: "defaultValue",
            defer: "defer",
            dir: "dir",
            disabled: "disabled",
            disablepictureinpicture: "disablePictureInPicture",
            disableremoteplayback: "disableRemotePlayback",
            download: "download",
            draggable: "draggable",
            enctype: "encType",
            enterkeyhint: "enterKeyHint",
            for: "htmlFor",
            form: "form",
            formmethod: "formMethod",
            formaction: "formAction",
            formenctype: "formEncType",
            formnovalidate: "formNoValidate",
            formtarget: "formTarget",
            frameborder: "frameBorder",
            headers: "headers",
            height: "height",
            hidden: "hidden",
            high: "high",
            href: "href",
            hreflang: "hrefLang",
            htmlfor: "htmlFor",
            httpequiv: "httpEquiv",
            "http-equiv": "httpEquiv",
            icon: "icon",
            id: "id",
            innerhtml: "innerHTML",
            inputmode: "inputMode",
            integrity: "integrity",
            is: "is",
            itemid: "itemID",
            itemprop: "itemProp",
            itemref: "itemRef",
            itemscope: "itemScope",
            itemtype: "itemType",
            keyparams: "keyParams",
            keytype: "keyType",
            kind: "kind",
            label: "label",
            lang: "lang",
            list: "list",
            loop: "loop",
            low: "low",
            manifest: "manifest",
            marginwidth: "marginWidth",
            marginheight: "marginHeight",
            max: "max",
            maxlength: "maxLength",
            media: "media",
            mediagroup: "mediaGroup",
            method: "method",
            min: "min",
            minlength: "minLength",
            multiple: "multiple",
            muted: "muted",
            name: "name",
            nomodule: "noModule",
            nonce: "nonce",
            novalidate: "noValidate",
            open: "open",
            optimum: "optimum",
            pattern: "pattern",
            placeholder: "placeholder",
            playsinline: "playsInline",
            poster: "poster",
            preload: "preload",
            profile: "profile",
            radiogroup: "radioGroup",
            readonly: "readOnly",
            referrerpolicy: "referrerPolicy",
            rel: "rel",
            required: "required",
            reversed: "reversed",
            role: "role",
            rows: "rows",
            rowspan: "rowSpan",
            sandbox: "sandbox",
            scope: "scope",
            scoped: "scoped",
            scrolling: "scrolling",
            seamless: "seamless",
            selected: "selected",
            shape: "shape",
            size: "size",
            sizes: "sizes",
            span: "span",
            spellcheck: "spellCheck",
            src: "src",
            srcdoc: "srcDoc",
            srclang: "srcLang",
            srcset: "srcSet",
            start: "start",
            step: "step",
            style: "style",
            summary: "summary",
            tabindex: "tabIndex",
            target: "target",
            title: "title",
            type: "type",
            usemap: "useMap",
            value: "value",
            width: "width",
            wmode: "wmode",
            wrap: "wrap",
            // SVG
            about: "about",
            accentheight: "accentHeight",
            "accent-height": "accentHeight",
            accumulate: "accumulate",
            additive: "additive",
            alignmentbaseline: "alignmentBaseline",
            "alignment-baseline": "alignmentBaseline",
            allowreorder: "allowReorder",
            alphabetic: "alphabetic",
            amplitude: "amplitude",
            arabicform: "arabicForm",
            "arabic-form": "arabicForm",
            ascent: "ascent",
            attributename: "attributeName",
            attributetype: "attributeType",
            autoreverse: "autoReverse",
            azimuth: "azimuth",
            basefrequency: "baseFrequency",
            baselineshift: "baselineShift",
            "baseline-shift": "baselineShift",
            baseprofile: "baseProfile",
            bbox: "bbox",
            begin: "begin",
            bias: "bias",
            by: "by",
            calcmode: "calcMode",
            capheight: "capHeight",
            "cap-height": "capHeight",
            clip: "clip",
            clippath: "clipPath",
            "clip-path": "clipPath",
            clippathunits: "clipPathUnits",
            cliprule: "clipRule",
            "clip-rule": "clipRule",
            color: "color",
            colorinterpolation: "colorInterpolation",
            "color-interpolation": "colorInterpolation",
            colorinterpolationfilters: "colorInterpolationFilters",
            "color-interpolation-filters": "colorInterpolationFilters",
            colorprofile: "colorProfile",
            "color-profile": "colorProfile",
            colorrendering: "colorRendering",
            "color-rendering": "colorRendering",
            contentscripttype: "contentScriptType",
            contentstyletype: "contentStyleType",
            cursor: "cursor",
            cx: "cx",
            cy: "cy",
            d: "d",
            datatype: "datatype",
            decelerate: "decelerate",
            descent: "descent",
            diffuseconstant: "diffuseConstant",
            direction: "direction",
            display: "display",
            divisor: "divisor",
            dominantbaseline: "dominantBaseline",
            "dominant-baseline": "dominantBaseline",
            dur: "dur",
            dx: "dx",
            dy: "dy",
            edgemode: "edgeMode",
            elevation: "elevation",
            enablebackground: "enableBackground",
            "enable-background": "enableBackground",
            end: "end",
            exponent: "exponent",
            externalresourcesrequired: "externalResourcesRequired",
            fill: "fill",
            fillopacity: "fillOpacity",
            "fill-opacity": "fillOpacity",
            fillrule: "fillRule",
            "fill-rule": "fillRule",
            filter: "filter",
            filterres: "filterRes",
            filterunits: "filterUnits",
            floodopacity: "floodOpacity",
            "flood-opacity": "floodOpacity",
            floodcolor: "floodColor",
            "flood-color": "floodColor",
            focusable: "focusable",
            fontfamily: "fontFamily",
            "font-family": "fontFamily",
            fontsize: "fontSize",
            "font-size": "fontSize",
            fontsizeadjust: "fontSizeAdjust",
            "font-size-adjust": "fontSizeAdjust",
            fontstretch: "fontStretch",
            "font-stretch": "fontStretch",
            fontstyle: "fontStyle",
            "font-style": "fontStyle",
            fontvariant: "fontVariant",
            "font-variant": "fontVariant",
            fontweight: "fontWeight",
            "font-weight": "fontWeight",
            format: "format",
            from: "from",
            fx: "fx",
            fy: "fy",
            g1: "g1",
            g2: "g2",
            glyphname: "glyphName",
            "glyph-name": "glyphName",
            glyphorientationhorizontal: "glyphOrientationHorizontal",
            "glyph-orientation-horizontal": "glyphOrientationHorizontal",
            glyphorientationvertical: "glyphOrientationVertical",
            "glyph-orientation-vertical": "glyphOrientationVertical",
            glyphref: "glyphRef",
            gradienttransform: "gradientTransform",
            gradientunits: "gradientUnits",
            hanging: "hanging",
            horizadvx: "horizAdvX",
            "horiz-adv-x": "horizAdvX",
            horizoriginx: "horizOriginX",
            "horiz-origin-x": "horizOriginX",
            ideographic: "ideographic",
            imagerendering: "imageRendering",
            "image-rendering": "imageRendering",
            in2: "in2",
            in: "in",
            inlist: "inlist",
            intercept: "intercept",
            k1: "k1",
            k2: "k2",
            k3: "k3",
            k4: "k4",
            k: "k",
            kernelmatrix: "kernelMatrix",
            kernelunitlength: "kernelUnitLength",
            kerning: "kerning",
            keypoints: "keyPoints",
            keysplines: "keySplines",
            keytimes: "keyTimes",
            lengthadjust: "lengthAdjust",
            letterspacing: "letterSpacing",
            "letter-spacing": "letterSpacing",
            lightingcolor: "lightingColor",
            "lighting-color": "lightingColor",
            limitingconeangle: "limitingConeAngle",
            local: "local",
            markerend: "markerEnd",
            "marker-end": "markerEnd",
            markerheight: "markerHeight",
            markermid: "markerMid",
            "marker-mid": "markerMid",
            markerstart: "markerStart",
            "marker-start": "markerStart",
            markerunits: "markerUnits",
            markerwidth: "markerWidth",
            mask: "mask",
            maskcontentunits: "maskContentUnits",
            maskunits: "maskUnits",
            mathematical: "mathematical",
            mode: "mode",
            numoctaves: "numOctaves",
            offset: "offset",
            opacity: "opacity",
            operator: "operator",
            order: "order",
            orient: "orient",
            orientation: "orientation",
            origin: "origin",
            overflow: "overflow",
            overlineposition: "overlinePosition",
            "overline-position": "overlinePosition",
            overlinethickness: "overlineThickness",
            "overline-thickness": "overlineThickness",
            paintorder: "paintOrder",
            "paint-order": "paintOrder",
            panose1: "panose1",
            "panose-1": "panose1",
            pathlength: "pathLength",
            patterncontentunits: "patternContentUnits",
            patterntransform: "patternTransform",
            patternunits: "patternUnits",
            pointerevents: "pointerEvents",
            "pointer-events": "pointerEvents",
            points: "points",
            pointsatx: "pointsAtX",
            pointsaty: "pointsAtY",
            pointsatz: "pointsAtZ",
            prefix: "prefix",
            preservealpha: "preserveAlpha",
            preserveaspectratio: "preserveAspectRatio",
            primitiveunits: "primitiveUnits",
            property: "property",
            r: "r",
            radius: "radius",
            refx: "refX",
            refy: "refY",
            renderingintent: "renderingIntent",
            "rendering-intent": "renderingIntent",
            repeatcount: "repeatCount",
            repeatdur: "repeatDur",
            requiredextensions: "requiredExtensions",
            requiredfeatures: "requiredFeatures",
            resource: "resource",
            restart: "restart",
            result: "result",
            results: "results",
            rotate: "rotate",
            rx: "rx",
            ry: "ry",
            scale: "scale",
            security: "security",
            seed: "seed",
            shaperendering: "shapeRendering",
            "shape-rendering": "shapeRendering",
            slope: "slope",
            spacing: "spacing",
            specularconstant: "specularConstant",
            specularexponent: "specularExponent",
            speed: "speed",
            spreadmethod: "spreadMethod",
            startoffset: "startOffset",
            stddeviation: "stdDeviation",
            stemh: "stemh",
            stemv: "stemv",
            stitchtiles: "stitchTiles",
            stopcolor: "stopColor",
            "stop-color": "stopColor",
            stopopacity: "stopOpacity",
            "stop-opacity": "stopOpacity",
            strikethroughposition: "strikethroughPosition",
            "strikethrough-position": "strikethroughPosition",
            strikethroughthickness: "strikethroughThickness",
            "strikethrough-thickness": "strikethroughThickness",
            string: "string",
            stroke: "stroke",
            strokedasharray: "strokeDasharray",
            "stroke-dasharray": "strokeDasharray",
            strokedashoffset: "strokeDashoffset",
            "stroke-dashoffset": "strokeDashoffset",
            strokelinecap: "strokeLinecap",
            "stroke-linecap": "strokeLinecap",
            strokelinejoin: "strokeLinejoin",
            "stroke-linejoin": "strokeLinejoin",
            strokemiterlimit: "strokeMiterlimit",
            "stroke-miterlimit": "strokeMiterlimit",
            strokewidth: "strokeWidth",
            "stroke-width": "strokeWidth",
            strokeopacity: "strokeOpacity",
            "stroke-opacity": "strokeOpacity",
            suppresscontenteditablewarning: "suppressContentEditableWarning",
            suppresshydrationwarning: "suppressHydrationWarning",
            surfacescale: "surfaceScale",
            systemlanguage: "systemLanguage",
            tablevalues: "tableValues",
            targetx: "targetX",
            targety: "targetY",
            textanchor: "textAnchor",
            "text-anchor": "textAnchor",
            textdecoration: "textDecoration",
            "text-decoration": "textDecoration",
            textlength: "textLength",
            textrendering: "textRendering",
            "text-rendering": "textRendering",
            to: "to",
            transform: "transform",
            typeof: "typeof",
            u1: "u1",
            u2: "u2",
            underlineposition: "underlinePosition",
            "underline-position": "underlinePosition",
            underlinethickness: "underlineThickness",
            "underline-thickness": "underlineThickness",
            unicode: "unicode",
            unicodebidi: "unicodeBidi",
            "unicode-bidi": "unicodeBidi",
            unicoderange: "unicodeRange",
            "unicode-range": "unicodeRange",
            unitsperem: "unitsPerEm",
            "units-per-em": "unitsPerEm",
            unselectable: "unselectable",
            valphabetic: "vAlphabetic",
            "v-alphabetic": "vAlphabetic",
            values: "values",
            vectoreffect: "vectorEffect",
            "vector-effect": "vectorEffect",
            version: "version",
            vertadvy: "vertAdvY",
            "vert-adv-y": "vertAdvY",
            vertoriginx: "vertOriginX",
            "vert-origin-x": "vertOriginX",
            vertoriginy: "vertOriginY",
            "vert-origin-y": "vertOriginY",
            vhanging: "vHanging",
            "v-hanging": "vHanging",
            videographic: "vIdeographic",
            "v-ideographic": "vIdeographic",
            viewbox: "viewBox",
            viewtarget: "viewTarget",
            visibility: "visibility",
            vmathematical: "vMathematical",
            "v-mathematical": "vMathematical",
            vocab: "vocab",
            widths: "widths",
            wordspacing: "wordSpacing",
            "word-spacing": "wordSpacing",
            writingmode: "writingMode",
            "writing-mode": "writingMode",
            x1: "x1",
            x2: "x2",
            x: "x",
            xchannelselector: "xChannelSelector",
            xheight: "xHeight",
            "x-height": "xHeight",
            xlinkactuate: "xlinkActuate",
            "xlink:actuate": "xlinkActuate",
            xlinkarcrole: "xlinkArcrole",
            "xlink:arcrole": "xlinkArcrole",
            xlinkhref: "xlinkHref",
            "xlink:href": "xlinkHref",
            xlinkrole: "xlinkRole",
            "xlink:role": "xlinkRole",
            xlinkshow: "xlinkShow",
            "xlink:show": "xlinkShow",
            xlinktitle: "xlinkTitle",
            "xlink:title": "xlinkTitle",
            xlinktype: "xlinkType",
            "xlink:type": "xlinkType",
            xmlbase: "xmlBase",
            "xml:base": "xmlBase",
            xmllang: "xmlLang",
            "xml:lang": "xmlLang",
            xmlns: "xmlns",
            "xml:space": "xmlSpace",
            xmlnsxlink: "xmlnsXlink",
            "xmlns:xlink": "xmlnsXlink",
            xmlspace: "xmlSpace",
            y1: "y1",
            y2: "y2",
            y: "y",
            ychannelselector: "yChannelSelector",
            z: "z",
            zoomandpan: "zoomAndPan"
          };
          var ariaProperties = {
            "aria-current": 0,
            // state
            "aria-details": 0,
            "aria-disabled": 0,
            // state
            "aria-hidden": 0,
            // state
            "aria-invalid": 0,
            // state
            "aria-keyshortcuts": 0,
            "aria-label": 0,
            "aria-roledescription": 0,
            // Widget Attributes
            "aria-autocomplete": 0,
            "aria-checked": 0,
            "aria-expanded": 0,
            "aria-haspopup": 0,
            "aria-level": 0,
            "aria-modal": 0,
            "aria-multiline": 0,
            "aria-multiselectable": 0,
            "aria-orientation": 0,
            "aria-placeholder": 0,
            "aria-pressed": 0,
            "aria-readonly": 0,
            "aria-required": 0,
            "aria-selected": 0,
            "aria-sort": 0,
            "aria-valuemax": 0,
            "aria-valuemin": 0,
            "aria-valuenow": 0,
            "aria-valuetext": 0,
            // Live Region Attributes
            "aria-atomic": 0,
            "aria-busy": 0,
            "aria-live": 0,
            "aria-relevant": 0,
            // Drag-and-Drop Attributes
            "aria-dropeffect": 0,
            "aria-grabbed": 0,
            // Relationship Attributes
            "aria-activedescendant": 0,
            "aria-colcount": 0,
            "aria-colindex": 0,
            "aria-colspan": 0,
            "aria-controls": 0,
            "aria-describedby": 0,
            "aria-errormessage": 0,
            "aria-flowto": 0,
            "aria-labelledby": 0,
            "aria-owns": 0,
            "aria-posinset": 0,
            "aria-rowcount": 0,
            "aria-rowindex": 0,
            "aria-rowspan": 0,
            "aria-setsize": 0
          };
          var warnedProperties = {};
          var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
          var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
          var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
          function validateProperty(tagName, name2) {
            {
              if (hasOwnProperty$1.call(warnedProperties, name2) && warnedProperties[name2]) {
                return true;
              }
              if (rARIACamel.test(name2)) {
                var ariaName = "aria-" + name2.slice(4).toLowerCase();
                var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
                if (correctName == null) {
                  error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name2);
                  warnedProperties[name2] = true;
                  return true;
                }
                if (name2 !== correctName) {
                  error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name2, correctName);
                  warnedProperties[name2] = true;
                  return true;
                }
              }
              if (rARIA.test(name2)) {
                var lowerCasedName = name2.toLowerCase();
                var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
                if (standardName == null) {
                  warnedProperties[name2] = true;
                  return false;
                }
                if (name2 !== standardName) {
                  error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name2, standardName);
                  warnedProperties[name2] = true;
                  return true;
                }
              }
            }
            return true;
          }
          function warnInvalidARIAProps(type, props) {
            {
              var invalidProps = [];
              for (var key in props) {
                var isValid = validateProperty(type, key);
                if (!isValid) {
                  invalidProps.push(key);
                }
              }
              var unknownPropString = invalidProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (invalidProps.length === 1) {
                error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              } else if (invalidProps.length > 1) {
                error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              }
            }
          }
          function validateProperties(type, props) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnInvalidARIAProps(type, props);
          }
          var didWarnValueNull = false;
          function validateProperties$1(type, props) {
            {
              if (type !== "input" && type !== "textarea" && type !== "select") {
                return;
              }
              if (props != null && props.value === null && !didWarnValueNull) {
                didWarnValueNull = true;
                if (type === "select" && props.multiple) {
                  error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type);
                } else {
                  error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
                }
              }
            }
          }
          var validateProperty$1 = function() {
          };
          {
            var warnedProperties$1 = {};
            var _hasOwnProperty = Object.prototype.hasOwnProperty;
            var EVENT_NAME_REGEX = /^on./;
            var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
            var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
            var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
            validateProperty$1 = function(tagName, name2, value, eventRegistry) {
              if (_hasOwnProperty.call(warnedProperties$1, name2) && warnedProperties$1[name2]) {
                return true;
              }
              var lowerCasedName = name2.toLowerCase();
              if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
                error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.");
                warnedProperties$1[name2] = true;
                return true;
              }
              if (eventRegistry != null) {
                var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
                if (registrationNameDependencies2.hasOwnProperty(name2)) {
                  return true;
                }
                var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
                if (registrationName != null) {
                  error("Invalid event handler property `%s`. Did you mean `%s`?", name2, registrationName);
                  warnedProperties$1[name2] = true;
                  return true;
                }
                if (EVENT_NAME_REGEX.test(name2)) {
                  error("Unknown event handler property `%s`. It will be ignored.", name2);
                  warnedProperties$1[name2] = true;
                  return true;
                }
              } else if (EVENT_NAME_REGEX.test(name2)) {
                if (INVALID_EVENT_NAME_REGEX.test(name2)) {
                  error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name2);
                }
                warnedProperties$1[name2] = true;
                return true;
              }
              if (rARIA$1.test(name2) || rARIACamel$1.test(name2)) {
                return true;
              }
              if (lowerCasedName === "innerhtml") {
                error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
                warnedProperties$1[name2] = true;
                return true;
              }
              if (lowerCasedName === "aria") {
                error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
                warnedProperties$1[name2] = true;
                return true;
              }
              if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
                error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
                warnedProperties$1[name2] = true;
                return true;
              }
              if (typeof value === "number" && isNaN(value)) {
                error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name2);
                warnedProperties$1[name2] = true;
                return true;
              }
              var propertyInfo = getPropertyInfo(name2);
              var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
              if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                var standardName = possibleStandardNames[lowerCasedName];
                if (standardName !== name2) {
                  error("Invalid DOM property `%s`. Did you mean `%s`?", name2, standardName);
                  warnedProperties$1[name2] = true;
                  return true;
                }
              } else if (!isReserved && name2 !== lowerCasedName) {
                error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name2, lowerCasedName);
                warnedProperties$1[name2] = true;
                return true;
              }
              if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name2, value, propertyInfo, false)) {
                if (value) {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', value, name2, name2, value, name2);
                } else {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', value, name2, name2, value, name2, name2, name2);
                }
                warnedProperties$1[name2] = true;
                return true;
              }
              if (isReserved) {
                return true;
              }
              if (shouldRemoveAttributeWithWarning(name2, value, propertyInfo, false)) {
                warnedProperties$1[name2] = true;
                return false;
              }
              if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
                error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name2, value === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', name2, value);
                warnedProperties$1[name2] = true;
                return true;
              }
              return true;
            };
          }
          var warnUnknownProperties = function(type, props, eventRegistry) {
            {
              var unknownProps = [];
              for (var key in props) {
                var isValid = validateProperty$1(type, key, props[key], eventRegistry);
                if (!isValid) {
                  unknownProps.push(key);
                }
              }
              var unknownPropString = unknownProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (unknownProps.length === 1) {
                error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              } else if (unknownProps.length > 1) {
                error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              }
            }
          };
          function validateProperties$2(type, props, eventRegistry) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnUnknownProperties(type, props, eventRegistry);
          }
          var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
          var IS_NON_DELEGATED = 1 << 1;
          var IS_CAPTURE_PHASE = 1 << 2;
          var IS_REPLAYED = 1 << 4;
          var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
          function getEventTarget(nativeEvent) {
            var target = nativeEvent.target || nativeEvent.srcElement || window;
            if (target.correspondingUseElement) {
              target = target.correspondingUseElement;
            }
            return target.nodeType === TEXT_NODE ? target.parentNode : target;
          }
          var restoreImpl = null;
          var restoreTarget = null;
          var restoreQueue = null;
          function restoreStateOfTarget(target) {
            var internalInstance = getInstanceFromNode(target);
            if (!internalInstance) {
              return;
            }
            if (!(typeof restoreImpl === "function")) {
              {
                throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            var stateNode = internalInstance.stateNode;
            if (stateNode) {
              var _props = getFiberCurrentPropsFromNode(stateNode);
              restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
            }
          }
          function setRestoreImplementation(impl) {
            restoreImpl = impl;
          }
          function enqueueStateRestore(target) {
            if (restoreTarget) {
              if (restoreQueue) {
                restoreQueue.push(target);
              } else {
                restoreQueue = [target];
              }
            } else {
              restoreTarget = target;
            }
          }
          function needsStateRestore() {
            return restoreTarget !== null || restoreQueue !== null;
          }
          function restoreStateIfNeeded() {
            if (!restoreTarget) {
              return;
            }
            var target = restoreTarget;
            var queuedTargets = restoreQueue;
            restoreTarget = null;
            restoreQueue = null;
            restoreStateOfTarget(target);
            if (queuedTargets) {
              for (var i = 0; i < queuedTargets.length; i++) {
                restoreStateOfTarget(queuedTargets[i]);
              }
            }
          }
          var batchedUpdatesImpl = function(fn, bookkeeping) {
            return fn(bookkeeping);
          };
          var discreteUpdatesImpl = function(fn, a2, b, c2, d) {
            return fn(a2, b, c2, d);
          };
          var flushDiscreteUpdatesImpl = function() {
          };
          var batchedEventUpdatesImpl = batchedUpdatesImpl;
          var isInsideEventHandler = false;
          var isBatchingEventUpdates = false;
          function finishEventHandler() {
            var controlledComponentsHavePendingUpdates = needsStateRestore();
            if (controlledComponentsHavePendingUpdates) {
              flushDiscreteUpdatesImpl();
              restoreStateIfNeeded();
            }
          }
          function batchedUpdates(fn, bookkeeping) {
            if (isInsideEventHandler) {
              return fn(bookkeeping);
            }
            isInsideEventHandler = true;
            try {
              return batchedUpdatesImpl(fn, bookkeeping);
            } finally {
              isInsideEventHandler = false;
              finishEventHandler();
            }
          }
          function batchedEventUpdates(fn, a2, b) {
            if (isBatchingEventUpdates) {
              return fn(a2, b);
            }
            isBatchingEventUpdates = true;
            try {
              return batchedEventUpdatesImpl(fn, a2, b);
            } finally {
              isBatchingEventUpdates = false;
              finishEventHandler();
            }
          }
          function discreteUpdates(fn, a2, b, c2, d) {
            var prevIsInsideEventHandler = isInsideEventHandler;
            isInsideEventHandler = true;
            try {
              return discreteUpdatesImpl(fn, a2, b, c2, d);
            } finally {
              isInsideEventHandler = prevIsInsideEventHandler;
              if (!isInsideEventHandler) {
                finishEventHandler();
              }
            }
          }
          function flushDiscreteUpdatesIfNeeded(timeStamp) {
            {
              if (!isInsideEventHandler) {
                flushDiscreteUpdatesImpl();
              }
            }
          }
          function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
            batchedUpdatesImpl = _batchedUpdatesImpl;
            discreteUpdatesImpl = _discreteUpdatesImpl;
            flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
            batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
          }
          function isInteractive(tag) {
            return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
          }
          function shouldPreventMouseEvent(name2, type, props) {
            switch (name2) {
              case "onClick":
              case "onClickCapture":
              case "onDoubleClick":
              case "onDoubleClickCapture":
              case "onMouseDown":
              case "onMouseDownCapture":
              case "onMouseMove":
              case "onMouseMoveCapture":
              case "onMouseUp":
              case "onMouseUpCapture":
              case "onMouseEnter":
                return !!(props.disabled && isInteractive(type));
              default:
                return false;
            }
          }
          function getListener(inst, registrationName) {
            var stateNode = inst.stateNode;
            if (stateNode === null) {
              return null;
            }
            var props = getFiberCurrentPropsFromNode(stateNode);
            if (props === null) {
              return null;
            }
            var listener3 = props[registrationName];
            if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
              return null;
            }
            if (!(!listener3 || typeof listener3 === "function")) {
              {
                throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener3 + "` type.");
              }
            }
            return listener3;
          }
          var passiveBrowserEventsSupported = false;
          if (canUseDOM3) {
            try {
              var options4 = {};
              Object.defineProperty(options4, "passive", {
                get: function() {
                  passiveBrowserEventsSupported = true;
                }
              });
              window.addEventListener("test", options4, options4);
              window.removeEventListener("test", options4, options4);
            } catch (e) {
              passiveBrowserEventsSupported = false;
            }
          }
          function invokeGuardedCallbackProd(name2, func, context, a2, b, c2, d, e, f) {
            var funcArgs = Array.prototype.slice.call(arguments, 3);
            try {
              func.apply(context, funcArgs);
            } catch (error2) {
              this.onError(error2);
            }
          }
          var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
          {
            if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
              var fakeNode = document.createElement("react");
              invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name2, func, context, a2, b, c2, d, e, f) {
                if (!(typeof document !== "undefined")) {
                  {
                    throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
                  }
                }
                var evt = document.createEvent("Event");
                var didCall = false;
                var didError = true;
                var windowEvent = window.event;
                var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
                function restoreAfterDispatch() {
                  fakeNode.removeEventListener(evtType, callCallback2, false);
                  if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
                    window.event = windowEvent;
                  }
                }
                var funcArgs = Array.prototype.slice.call(arguments, 3);
                function callCallback2() {
                  didCall = true;
                  restoreAfterDispatch();
                  func.apply(context, funcArgs);
                  didError = false;
                }
                var error2;
                var didSetError = false;
                var isCrossOriginError = false;
                function handleWindowError(event) {
                  error2 = event.error;
                  didSetError = true;
                  if (error2 === null && event.colno === 0 && event.lineno === 0) {
                    isCrossOriginError = true;
                  }
                  if (event.defaultPrevented) {
                    if (error2 != null && typeof error2 === "object") {
                      try {
                        error2._suppressLogging = true;
                      } catch (inner) {
                      }
                    }
                  }
                }
                var evtType = "react-" + (name2 ? name2 : "invokeguardedcallback");
                window.addEventListener("error", handleWindowError);
                fakeNode.addEventListener(evtType, callCallback2, false);
                evt.initEvent(evtType, false, false);
                fakeNode.dispatchEvent(evt);
                if (windowEventDescriptor) {
                  Object.defineProperty(window, "event", windowEventDescriptor);
                }
                if (didCall && didError) {
                  if (!didSetError) {
                    error2 = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);
                  } else if (isCrossOriginError) {
                    error2 = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");
                  }
                  this.onError(error2);
                }
                window.removeEventListener("error", handleWindowError);
                if (!didCall) {
                  restoreAfterDispatch();
                  return invokeGuardedCallbackProd.apply(this, arguments);
                }
              };
            }
          }
          var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
          var hasError = false;
          var caughtError = null;
          var hasRethrowError = false;
          var rethrowError = null;
          var reporter = {
            onError: function(error2) {
              hasError = true;
              caughtError = error2;
            }
          };
          function invokeGuardedCallback(name2, func, context, a2, b, c2, d, e, f) {
            hasError = false;
            caughtError = null;
            invokeGuardedCallbackImpl$1.apply(reporter, arguments);
          }
          function invokeGuardedCallbackAndCatchFirstError(name2, func, context, a2, b, c2, d, e, f) {
            invokeGuardedCallback.apply(this, arguments);
            if (hasError) {
              var error2 = clearCaughtError();
              if (!hasRethrowError) {
                hasRethrowError = true;
                rethrowError = error2;
              }
            }
          }
          function rethrowCaughtError() {
            if (hasRethrowError) {
              var error2 = rethrowError;
              hasRethrowError = false;
              rethrowError = null;
              throw error2;
            }
          }
          function hasCaughtError() {
            return hasError;
          }
          function clearCaughtError() {
            if (hasError) {
              var error2 = caughtError;
              hasError = false;
              caughtError = null;
              return error2;
            } else {
              {
                {
                  throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
          }
          function get(key) {
            return key._reactInternals;
          }
          function has(key) {
            return key._reactInternals !== void 0;
          }
          function set(key, value) {
            key._reactInternals = value;
          }
          var NoFlags = (
            /*                      */
            0
          );
          var PerformedWork = (
            /*                */
            1
          );
          var Placement = (
            /*                    */
            2
          );
          var Update = (
            /*                       */
            4
          );
          var PlacementAndUpdate = (
            /*           */
            6
          );
          var Deletion = (
            /*                     */
            8
          );
          var ContentReset = (
            /*                 */
            16
          );
          var Callback = (
            /*                     */
            32
          );
          var DidCapture = (
            /*                   */
            64
          );
          var Ref = (
            /*                          */
            128
          );
          var Snapshot = (
            /*                     */
            256
          );
          var Passive = (
            /*                      */
            512
          );
          var PassiveUnmountPendingDev = (
            /*     */
            8192
          );
          var Hydrating = (
            /*                    */
            1024
          );
          var HydratingAndUpdate = (
            /*           */
            1028
          );
          var LifecycleEffectMask = (
            /*          */
            932
          );
          var HostEffectMask = (
            /*               */
            2047
          );
          var Incomplete = (
            /*                   */
            2048
          );
          var ShouldCapture = (
            /*                */
            4096
          );
          var ForceUpdateForLegacySuspense = (
            /* */
            16384
          );
          var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
          function getNearestMountedFiber(fiber) {
            var node = fiber;
            var nearestMounted = fiber;
            if (!fiber.alternate) {
              var nextNode = node;
              do {
                node = nextNode;
                if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
                  nearestMounted = node.return;
                }
                nextNode = node.return;
              } while (nextNode);
            } else {
              while (node.return) {
                node = node.return;
              }
            }
            if (node.tag === HostRoot) {
              return nearestMounted;
            }
            return null;
          }
          function getSuspenseInstanceFromFiber(fiber) {
            if (fiber.tag === SuspenseComponent) {
              var suspenseState = fiber.memoizedState;
              if (suspenseState === null) {
                var current2 = fiber.alternate;
                if (current2 !== null) {
                  suspenseState = current2.memoizedState;
                }
              }
              if (suspenseState !== null) {
                return suspenseState.dehydrated;
              }
            }
            return null;
          }
          function getContainerFromFiber(fiber) {
            return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
          }
          function isFiberMounted(fiber) {
            return getNearestMountedFiber(fiber) === fiber;
          }
          function isMounted(component) {
            {
              var owner = ReactCurrentOwner.current;
              if (owner !== null && owner.tag === ClassComponent) {
                var ownerFiber = owner;
                var instance = ownerFiber.stateNode;
                if (!instance._warnedAboutRefsInRender) {
                  error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentName(ownerFiber.type) || "A component");
                }
                instance._warnedAboutRefsInRender = true;
              }
            }
            var fiber = get(component);
            if (!fiber) {
              return false;
            }
            return getNearestMountedFiber(fiber) === fiber;
          }
          function assertIsMounted(fiber) {
            if (!(getNearestMountedFiber(fiber) === fiber)) {
              {
                throw Error("Unable to find node on an unmounted component.");
              }
            }
          }
          function findCurrentFiberUsingSlowPath(fiber) {
            var alternate = fiber.alternate;
            if (!alternate) {
              var nearestMounted = getNearestMountedFiber(fiber);
              if (!(nearestMounted !== null)) {
                {
                  throw Error("Unable to find node on an unmounted component.");
                }
              }
              if (nearestMounted !== fiber) {
                return null;
              }
              return fiber;
            }
            var a2 = fiber;
            var b = alternate;
            while (true) {
              var parentA = a2.return;
              if (parentA === null) {
                break;
              }
              var parentB = parentA.alternate;
              if (parentB === null) {
                var nextParent = parentA.return;
                if (nextParent !== null) {
                  a2 = b = nextParent;
                  continue;
                }
                break;
              }
              if (parentA.child === parentB.child) {
                var child = parentA.child;
                while (child) {
                  if (child === a2) {
                    assertIsMounted(parentA);
                    return fiber;
                  }
                  if (child === b) {
                    assertIsMounted(parentA);
                    return alternate;
                  }
                  child = child.sibling;
                }
                {
                  {
                    throw Error("Unable to find node on an unmounted component.");
                  }
                }
              }
              if (a2.return !== b.return) {
                a2 = parentA;
                b = parentB;
              } else {
                var didFindChild = false;
                var _child = parentA.child;
                while (_child) {
                  if (_child === a2) {
                    didFindChild = true;
                    a2 = parentA;
                    b = parentB;
                    break;
                  }
                  if (_child === b) {
                    didFindChild = true;
                    b = parentA;
                    a2 = parentB;
                    break;
                  }
                  _child = _child.sibling;
                }
                if (!didFindChild) {
                  _child = parentB.child;
                  while (_child) {
                    if (_child === a2) {
                      didFindChild = true;
                      a2 = parentB;
                      b = parentA;
                      break;
                    }
                    if (_child === b) {
                      didFindChild = true;
                      b = parentB;
                      a2 = parentA;
                      break;
                    }
                    _child = _child.sibling;
                  }
                  if (!didFindChild) {
                    {
                      throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
                    }
                  }
                }
              }
              if (!(a2.alternate === b)) {
                {
                  throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
            if (!(a2.tag === HostRoot)) {
              {
                throw Error("Unable to find node on an unmounted component.");
              }
            }
            if (a2.stateNode.current === a2) {
              return fiber;
            }
            return alternate;
          }
          function findCurrentHostFiber(parent) {
            var currentParent = findCurrentFiberUsingSlowPath(parent);
            if (!currentParent) {
              return null;
            }
            var node = currentParent;
            while (true) {
              if (node.tag === HostComponent || node.tag === HostText) {
                return node;
              } else if (node.child) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === currentParent) {
                return null;
              }
              while (!node.sibling) {
                if (!node.return || node.return === currentParent) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          function findCurrentHostFiberWithNoPortals(parent) {
            var currentParent = findCurrentFiberUsingSlowPath(parent);
            if (!currentParent) {
              return null;
            }
            var node = currentParent;
            while (true) {
              if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI) {
                return node;
              } else if (node.child && node.tag !== HostPortal) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === currentParent) {
                return null;
              }
              while (!node.sibling) {
                if (!node.return || node.return === currentParent) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          function doesFiberContain(parentFiber, childFiber) {
            var node = childFiber;
            var parentFiberAlternate = parentFiber.alternate;
            while (node !== null) {
              if (node === parentFiber || node === parentFiberAlternate) {
                return true;
              }
              node = node.return;
            }
            return false;
          }
          var attemptUserBlockingHydration;
          function setAttemptUserBlockingHydration(fn) {
            attemptUserBlockingHydration = fn;
          }
          var attemptContinuousHydration;
          function setAttemptContinuousHydration(fn) {
            attemptContinuousHydration = fn;
          }
          var attemptHydrationAtCurrentPriority;
          function setAttemptHydrationAtCurrentPriority(fn) {
            attemptHydrationAtCurrentPriority = fn;
          }
          var attemptHydrationAtPriority;
          function setAttemptHydrationAtPriority(fn) {
            attemptHydrationAtPriority = fn;
          }
          var hasScheduledReplayAttempt = false;
          var queuedDiscreteEvents = [];
          var queuedFocus = null;
          var queuedDrag = null;
          var queuedMouse = null;
          var queuedPointers = /* @__PURE__ */ new Map();
          var queuedPointerCaptures = /* @__PURE__ */ new Map();
          var queuedExplicitHydrationTargets = [];
          function hasQueuedDiscreteEvents() {
            return queuedDiscreteEvents.length > 0;
          }
          var discreteReplayableEvents = [
            "mousedown",
            "mouseup",
            "touchcancel",
            "touchend",
            "touchstart",
            "auxclick",
            "dblclick",
            "pointercancel",
            "pointerdown",
            "pointerup",
            "dragend",
            "dragstart",
            "drop",
            "compositionend",
            "compositionstart",
            "keydown",
            "keypress",
            "keyup",
            "input",
            "textInput",
            // Intentionally camelCase
            "copy",
            "cut",
            "paste",
            "click",
            "change",
            "contextmenu",
            "reset",
            "submit"
          ];
          function isReplayableDiscreteEvent(eventType) {
            return discreteReplayableEvents.indexOf(eventType) > -1;
          }
          function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            return {
              blockedOn,
              domEventName,
              eventSystemFlags: eventSystemFlags | IS_REPLAYED,
              nativeEvent,
              targetContainers: [targetContainer]
            };
          }
          function queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
            queuedDiscreteEvents.push(queuedEvent);
          }
          function clearIfContinuousEvent(domEventName, nativeEvent) {
            switch (domEventName) {
              case "focusin":
              case "focusout":
                queuedFocus = null;
                break;
              case "dragenter":
              case "dragleave":
                queuedDrag = null;
                break;
              case "mouseover":
              case "mouseout":
                queuedMouse = null;
                break;
              case "pointerover":
              case "pointerout": {
                var pointerId = nativeEvent.pointerId;
                queuedPointers.delete(pointerId);
                break;
              }
              case "gotpointercapture":
              case "lostpointercapture": {
                var _pointerId = nativeEvent.pointerId;
                queuedPointerCaptures.delete(_pointerId);
                break;
              }
            }
          }
          function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
              var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
              if (blockedOn !== null) {
                var _fiber2 = getInstanceFromNode(blockedOn);
                if (_fiber2 !== null) {
                  attemptContinuousHydration(_fiber2);
                }
              }
              return queuedEvent;
            }
            existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
            var targetContainers = existingQueuedEvent.targetContainers;
            if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
              targetContainers.push(targetContainer);
            }
            return existingQueuedEvent;
          }
          function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            switch (domEventName) {
              case "focusin": {
                var focusEvent = nativeEvent;
                queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
                return true;
              }
              case "dragenter": {
                var dragEvent = nativeEvent;
                queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
                return true;
              }
              case "mouseover": {
                var mouseEvent = nativeEvent;
                queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
                return true;
              }
              case "pointerover": {
                var pointerEvent = nativeEvent;
                var pointerId = pointerEvent.pointerId;
                queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
                return true;
              }
              case "gotpointercapture": {
                var _pointerEvent = nativeEvent;
                var _pointerId2 = _pointerEvent.pointerId;
                queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
                return true;
              }
            }
            return false;
          }
          function attemptExplicitHydrationTarget(queuedTarget) {
            var targetInst = getClosestInstanceFromNode(queuedTarget.target);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted !== null) {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    queuedTarget.blockedOn = instance;
                    attemptHydrationAtPriority(queuedTarget.lanePriority, function() {
                      Scheduler.unstable_runWithPriority(queuedTarget.priority, function() {
                        attemptHydrationAtCurrentPriority(nearestMounted);
                      });
                    });
                    return;
                  }
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (root2.hydrate) {
                    queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
                    return;
                  }
                }
              }
            }
            queuedTarget.blockedOn = null;
          }
          function attemptReplayContinuousQueuedEvent(queuedEvent) {
            if (queuedEvent.blockedOn !== null) {
              return false;
            }
            var targetContainers = queuedEvent.targetContainers;
            while (targetContainers.length > 0) {
              var targetContainer = targetContainers[0];
              var nextBlockedOn = attemptToDispatchEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
              if (nextBlockedOn !== null) {
                var _fiber3 = getInstanceFromNode(nextBlockedOn);
                if (_fiber3 !== null) {
                  attemptContinuousHydration(_fiber3);
                }
                queuedEvent.blockedOn = nextBlockedOn;
                return false;
              }
              targetContainers.shift();
            }
            return true;
          }
          function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map2) {
            if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
              map2.delete(key);
            }
          }
          function replayUnblockedEvents() {
            hasScheduledReplayAttempt = false;
            while (queuedDiscreteEvents.length > 0) {
              var nextDiscreteEvent = queuedDiscreteEvents[0];
              if (nextDiscreteEvent.blockedOn !== null) {
                var _fiber4 = getInstanceFromNode(nextDiscreteEvent.blockedOn);
                if (_fiber4 !== null) {
                  attemptUserBlockingHydration(_fiber4);
                }
                break;
              }
              var targetContainers = nextDiscreteEvent.targetContainers;
              while (targetContainers.length > 0) {
                var targetContainer = targetContainers[0];
                var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.domEventName, nextDiscreteEvent.eventSystemFlags, targetContainer, nextDiscreteEvent.nativeEvent);
                if (nextBlockedOn !== null) {
                  nextDiscreteEvent.blockedOn = nextBlockedOn;
                  break;
                }
                targetContainers.shift();
              }
              if (nextDiscreteEvent.blockedOn === null) {
                queuedDiscreteEvents.shift();
              }
            }
            if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
              queuedFocus = null;
            }
            if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
              queuedDrag = null;
            }
            if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
              queuedMouse = null;
            }
            queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
            queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
          }
          function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
            if (queuedEvent.blockedOn === unblocked) {
              queuedEvent.blockedOn = null;
              if (!hasScheduledReplayAttempt) {
                hasScheduledReplayAttempt = true;
                Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
              }
            }
          }
          function retryIfBlockedOn(unblocked) {
            if (queuedDiscreteEvents.length > 0) {
              scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
              for (var i = 1; i < queuedDiscreteEvents.length; i++) {
                var queuedEvent = queuedDiscreteEvents[i];
                if (queuedEvent.blockedOn === unblocked) {
                  queuedEvent.blockedOn = null;
                }
              }
            }
            if (queuedFocus !== null) {
              scheduleCallbackIfUnblocked(queuedFocus, unblocked);
            }
            if (queuedDrag !== null) {
              scheduleCallbackIfUnblocked(queuedDrag, unblocked);
            }
            if (queuedMouse !== null) {
              scheduleCallbackIfUnblocked(queuedMouse, unblocked);
            }
            var unblock = function(queuedEvent2) {
              return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
            };
            queuedPointers.forEach(unblock);
            queuedPointerCaptures.forEach(unblock);
            for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
              var queuedTarget = queuedExplicitHydrationTargets[_i];
              if (queuedTarget.blockedOn === unblocked) {
                queuedTarget.blockedOn = null;
              }
            }
            while (queuedExplicitHydrationTargets.length > 0) {
              var nextExplicitTarget = queuedExplicitHydrationTargets[0];
              if (nextExplicitTarget.blockedOn !== null) {
                break;
              } else {
                attemptExplicitHydrationTarget(nextExplicitTarget);
                if (nextExplicitTarget.blockedOn === null) {
                  queuedExplicitHydrationTargets.shift();
                }
              }
            }
          }
          var DiscreteEvent = 0;
          var UserBlockingEvent = 1;
          var ContinuousEvent = 2;
          function makePrefixMap(styleProp, eventName) {
            var prefixes3 = {};
            prefixes3[styleProp.toLowerCase()] = eventName.toLowerCase();
            prefixes3["Webkit" + styleProp] = "webkit" + eventName;
            prefixes3["Moz" + styleProp] = "moz" + eventName;
            return prefixes3;
          }
          var vendorPrefixes = {
            animationend: makePrefixMap("Animation", "AnimationEnd"),
            animationiteration: makePrefixMap("Animation", "AnimationIteration"),
            animationstart: makePrefixMap("Animation", "AnimationStart"),
            transitionend: makePrefixMap("Transition", "TransitionEnd")
          };
          var prefixedEventNames = {};
          var style = {};
          if (canUseDOM3) {
            style = document.createElement("div").style;
            if (!("AnimationEvent" in window)) {
              delete vendorPrefixes.animationend.animation;
              delete vendorPrefixes.animationiteration.animation;
              delete vendorPrefixes.animationstart.animation;
            }
            if (!("TransitionEvent" in window)) {
              delete vendorPrefixes.transitionend.transition;
            }
          }
          function getVendorPrefixedEventName(eventName) {
            if (prefixedEventNames[eventName]) {
              return prefixedEventNames[eventName];
            } else if (!vendorPrefixes[eventName]) {
              return eventName;
            }
            var prefixMap = vendorPrefixes[eventName];
            for (var styleProp in prefixMap) {
              if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
                return prefixedEventNames[eventName] = prefixMap[styleProp];
              }
            }
            return eventName;
          }
          var ANIMATION_END = getVendorPrefixedEventName("animationend");
          var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
          var ANIMATION_START = getVendorPrefixedEventName("animationstart");
          var TRANSITION_END = getVendorPrefixedEventName("transitionend");
          var topLevelEventsToReactNames = /* @__PURE__ */ new Map();
          var eventPriorities = /* @__PURE__ */ new Map();
          var discreteEventPairsForSimpleEventPlugin = [
            "cancel",
            "cancel",
            "click",
            "click",
            "close",
            "close",
            "contextmenu",
            "contextMenu",
            "copy",
            "copy",
            "cut",
            "cut",
            "auxclick",
            "auxClick",
            "dblclick",
            "doubleClick",
            // Careful!
            "dragend",
            "dragEnd",
            "dragstart",
            "dragStart",
            "drop",
            "drop",
            "focusin",
            "focus",
            // Careful!
            "focusout",
            "blur",
            // Careful!
            "input",
            "input",
            "invalid",
            "invalid",
            "keydown",
            "keyDown",
            "keypress",
            "keyPress",
            "keyup",
            "keyUp",
            "mousedown",
            "mouseDown",
            "mouseup",
            "mouseUp",
            "paste",
            "paste",
            "pause",
            "pause",
            "play",
            "play",
            "pointercancel",
            "pointerCancel",
            "pointerdown",
            "pointerDown",
            "pointerup",
            "pointerUp",
            "ratechange",
            "rateChange",
            "reset",
            "reset",
            "seeked",
            "seeked",
            "submit",
            "submit",
            "touchcancel",
            "touchCancel",
            "touchend",
            "touchEnd",
            "touchstart",
            "touchStart",
            "volumechange",
            "volumeChange"
          ];
          var otherDiscreteEvents = ["change", "selectionchange", "textInput", "compositionstart", "compositionend", "compositionupdate"];
          var userBlockingPairsForSimpleEventPlugin = ["drag", "drag", "dragenter", "dragEnter", "dragexit", "dragExit", "dragleave", "dragLeave", "dragover", "dragOver", "mousemove", "mouseMove", "mouseout", "mouseOut", "mouseover", "mouseOver", "pointermove", "pointerMove", "pointerout", "pointerOut", "pointerover", "pointerOver", "scroll", "scroll", "toggle", "toggle", "touchmove", "touchMove", "wheel", "wheel"];
          var continuousPairsForSimpleEventPlugin = ["abort", "abort", ANIMATION_END, "animationEnd", ANIMATION_ITERATION, "animationIteration", ANIMATION_START, "animationStart", "canplay", "canPlay", "canplaythrough", "canPlayThrough", "durationchange", "durationChange", "emptied", "emptied", "encrypted", "encrypted", "ended", "ended", "error", "error", "gotpointercapture", "gotPointerCapture", "load", "load", "loadeddata", "loadedData", "loadedmetadata", "loadedMetadata", "loadstart", "loadStart", "lostpointercapture", "lostPointerCapture", "playing", "playing", "progress", "progress", "seeking", "seeking", "stalled", "stalled", "suspend", "suspend", "timeupdate", "timeUpdate", TRANSITION_END, "transitionEnd", "waiting", "waiting"];
          function registerSimplePluginEventsAndSetTheirPriorities(eventTypes, priority) {
            for (var i = 0; i < eventTypes.length; i += 2) {
              var topEvent = eventTypes[i];
              var event = eventTypes[i + 1];
              var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
              var reactName = "on" + capitalizedEvent;
              eventPriorities.set(topEvent, priority);
              topLevelEventsToReactNames.set(topEvent, reactName);
              registerTwoPhaseEvent(reactName, [topEvent]);
            }
          }
          function setEventPriorities(eventTypes, priority) {
            for (var i = 0; i < eventTypes.length; i++) {
              eventPriorities.set(eventTypes[i], priority);
            }
          }
          function getEventPriorityForPluginSystem(domEventName) {
            var priority = eventPriorities.get(domEventName);
            return priority === void 0 ? ContinuousEvent : priority;
          }
          function registerSimpleEvents() {
            registerSimplePluginEventsAndSetTheirPriorities(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
            registerSimplePluginEventsAndSetTheirPriorities(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
            registerSimplePluginEventsAndSetTheirPriorities(continuousPairsForSimpleEventPlugin, ContinuousEvent);
            setEventPriorities(otherDiscreteEvents, DiscreteEvent);
          }
          var Scheduler_now = Scheduler.unstable_now;
          {
            if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
              {
                throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
              }
            }
          }
          var ImmediatePriority = 99;
          var UserBlockingPriority = 98;
          var NormalPriority = 97;
          var LowPriority = 96;
          var IdlePriority = 95;
          var NoPriority = 90;
          var initialTimeMs = Scheduler_now();
          var SyncLanePriority = 15;
          var SyncBatchedLanePriority = 14;
          var InputDiscreteHydrationLanePriority = 13;
          var InputDiscreteLanePriority = 12;
          var InputContinuousHydrationLanePriority = 11;
          var InputContinuousLanePriority = 10;
          var DefaultHydrationLanePriority = 9;
          var DefaultLanePriority = 8;
          var TransitionHydrationPriority = 7;
          var TransitionPriority = 6;
          var RetryLanePriority = 5;
          var SelectiveHydrationLanePriority = 4;
          var IdleHydrationLanePriority = 3;
          var IdleLanePriority = 2;
          var OffscreenLanePriority = 1;
          var NoLanePriority = 0;
          var TotalLanes = 31;
          var NoLanes = (
            /*                        */
            0
          );
          var NoLane = (
            /*                          */
            0
          );
          var SyncLane = (
            /*                        */
            1
          );
          var SyncBatchedLane = (
            /*                 */
            2
          );
          var InputDiscreteHydrationLane = (
            /*      */
            4
          );
          var InputDiscreteLanes = (
            /*                    */
            24
          );
          var InputContinuousHydrationLane = (
            /*           */
            32
          );
          var InputContinuousLanes = (
            /*                  */
            192
          );
          var DefaultHydrationLane = (
            /*            */
            256
          );
          var DefaultLanes = (
            /*                   */
            3584
          );
          var TransitionHydrationLane = (
            /*                */
            4096
          );
          var TransitionLanes = (
            /*                       */
            4186112
          );
          var RetryLanes = (
            /*                            */
            62914560
          );
          var SomeRetryLane = (
            /*                  */
            33554432
          );
          var SelectiveHydrationLane = (
            /*          */
            67108864
          );
          var NonIdleLanes = (
            /*                                 */
            134217727
          );
          var IdleHydrationLane = (
            /*               */
            134217728
          );
          var IdleLanes = (
            /*                             */
            805306368
          );
          var OffscreenLane = (
            /*                   */
            1073741824
          );
          var NoTimestamp = -1;
          function setCurrentUpdateLanePriority(newLanePriority) {
          }
          var return_highestLanePriority = DefaultLanePriority;
          function getHighestPriorityLanes(lanes) {
            if ((SyncLane & lanes) !== NoLanes) {
              return_highestLanePriority = SyncLanePriority;
              return SyncLane;
            }
            if ((SyncBatchedLane & lanes) !== NoLanes) {
              return_highestLanePriority = SyncBatchedLanePriority;
              return SyncBatchedLane;
            }
            if ((InputDiscreteHydrationLane & lanes) !== NoLanes) {
              return_highestLanePriority = InputDiscreteHydrationLanePriority;
              return InputDiscreteHydrationLane;
            }
            var inputDiscreteLanes = InputDiscreteLanes & lanes;
            if (inputDiscreteLanes !== NoLanes) {
              return_highestLanePriority = InputDiscreteLanePriority;
              return inputDiscreteLanes;
            }
            if ((lanes & InputContinuousHydrationLane) !== NoLanes) {
              return_highestLanePriority = InputContinuousHydrationLanePriority;
              return InputContinuousHydrationLane;
            }
            var inputContinuousLanes = InputContinuousLanes & lanes;
            if (inputContinuousLanes !== NoLanes) {
              return_highestLanePriority = InputContinuousLanePriority;
              return inputContinuousLanes;
            }
            if ((lanes & DefaultHydrationLane) !== NoLanes) {
              return_highestLanePriority = DefaultHydrationLanePriority;
              return DefaultHydrationLane;
            }
            var defaultLanes = DefaultLanes & lanes;
            if (defaultLanes !== NoLanes) {
              return_highestLanePriority = DefaultLanePriority;
              return defaultLanes;
            }
            if ((lanes & TransitionHydrationLane) !== NoLanes) {
              return_highestLanePriority = TransitionHydrationPriority;
              return TransitionHydrationLane;
            }
            var transitionLanes = TransitionLanes & lanes;
            if (transitionLanes !== NoLanes) {
              return_highestLanePriority = TransitionPriority;
              return transitionLanes;
            }
            var retryLanes = RetryLanes & lanes;
            if (retryLanes !== NoLanes) {
              return_highestLanePriority = RetryLanePriority;
              return retryLanes;
            }
            if (lanes & SelectiveHydrationLane) {
              return_highestLanePriority = SelectiveHydrationLanePriority;
              return SelectiveHydrationLane;
            }
            if ((lanes & IdleHydrationLane) !== NoLanes) {
              return_highestLanePriority = IdleHydrationLanePriority;
              return IdleHydrationLane;
            }
            var idleLanes = IdleLanes & lanes;
            if (idleLanes !== NoLanes) {
              return_highestLanePriority = IdleLanePriority;
              return idleLanes;
            }
            if ((OffscreenLane & lanes) !== NoLanes) {
              return_highestLanePriority = OffscreenLanePriority;
              return OffscreenLane;
            }
            {
              error("Should have found matching lanes. This is a bug in React.");
            }
            return_highestLanePriority = DefaultLanePriority;
            return lanes;
          }
          function schedulerPriorityToLanePriority(schedulerPriorityLevel) {
            switch (schedulerPriorityLevel) {
              case ImmediatePriority:
                return SyncLanePriority;
              case UserBlockingPriority:
                return InputContinuousLanePriority;
              case NormalPriority:
              case LowPriority:
                return DefaultLanePriority;
              case IdlePriority:
                return IdleLanePriority;
              default:
                return NoLanePriority;
            }
          }
          function lanePriorityToSchedulerPriority(lanePriority) {
            switch (lanePriority) {
              case SyncLanePriority:
              case SyncBatchedLanePriority:
                return ImmediatePriority;
              case InputDiscreteHydrationLanePriority:
              case InputDiscreteLanePriority:
              case InputContinuousHydrationLanePriority:
              case InputContinuousLanePriority:
                return UserBlockingPriority;
              case DefaultHydrationLanePriority:
              case DefaultLanePriority:
              case TransitionHydrationPriority:
              case TransitionPriority:
              case SelectiveHydrationLanePriority:
              case RetryLanePriority:
                return NormalPriority;
              case IdleHydrationLanePriority:
              case IdleLanePriority:
              case OffscreenLanePriority:
                return IdlePriority;
              case NoLanePriority:
                return NoPriority;
              default: {
                {
                  throw Error("Invalid update priority: " + lanePriority + ". This is a bug in React.");
                }
              }
            }
          }
          function getNextLanes(root2, wipLanes) {
            var pendingLanes = root2.pendingLanes;
            if (pendingLanes === NoLanes) {
              return_highestLanePriority = NoLanePriority;
              return NoLanes;
            }
            var nextLanes = NoLanes;
            var nextLanePriority = NoLanePriority;
            var expiredLanes = root2.expiredLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            if (expiredLanes !== NoLanes) {
              nextLanes = expiredLanes;
              nextLanePriority = return_highestLanePriority = SyncLanePriority;
            } else {
              var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
              if (nonIdlePendingLanes !== NoLanes) {
                var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
                if (nonIdleUnblockedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
                  nextLanePriority = return_highestLanePriority;
                } else {
                  var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
                  if (nonIdlePingedLanes !== NoLanes) {
                    nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
                    nextLanePriority = return_highestLanePriority;
                  }
                }
              } else {
                var unblockedLanes = pendingLanes & ~suspendedLanes;
                if (unblockedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(unblockedLanes);
                  nextLanePriority = return_highestLanePriority;
                } else {
                  if (pingedLanes !== NoLanes) {
                    nextLanes = getHighestPriorityLanes(pingedLanes);
                    nextLanePriority = return_highestLanePriority;
                  }
                }
              }
            }
            if (nextLanes === NoLanes) {
              return NoLanes;
            }
            nextLanes = pendingLanes & getEqualOrHigherPriorityLanes(nextLanes);
            if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
            // bother waiting until the root is complete.
            (wipLanes & suspendedLanes) === NoLanes) {
              getHighestPriorityLanes(wipLanes);
              var wipLanePriority = return_highestLanePriority;
              if (nextLanePriority <= wipLanePriority) {
                return wipLanes;
              } else {
                return_highestLanePriority = nextLanePriority;
              }
            }
            var entangledLanes = root2.entangledLanes;
            if (entangledLanes !== NoLanes) {
              var entanglements = root2.entanglements;
              var lanes = nextLanes & entangledLanes;
              while (lanes > 0) {
                var index2 = pickArbitraryLaneIndex(lanes);
                var lane = 1 << index2;
                nextLanes |= entanglements[index2];
                lanes &= ~lane;
              }
            }
            return nextLanes;
          }
          function getMostRecentEventTime(root2, lanes) {
            var eventTimes = root2.eventTimes;
            var mostRecentEventTime = NoTimestamp;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var eventTime = eventTimes[index2];
              if (eventTime > mostRecentEventTime) {
                mostRecentEventTime = eventTime;
              }
              lanes &= ~lane;
            }
            return mostRecentEventTime;
          }
          function computeExpirationTime(lane, currentTime) {
            getHighestPriorityLanes(lane);
            var priority = return_highestLanePriority;
            if (priority >= InputContinuousLanePriority) {
              return currentTime + 250;
            } else if (priority >= TransitionPriority) {
              return currentTime + 5e3;
            } else {
              return NoTimestamp;
            }
          }
          function markStarvedLanesAsExpired(root2, currentTime) {
            var pendingLanes = root2.pendingLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = pendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var expirationTime = expirationTimes[index2];
              if (expirationTime === NoTimestamp) {
                if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
                  expirationTimes[index2] = computeExpirationTime(lane, currentTime);
                }
              } else if (expirationTime <= currentTime) {
                root2.expiredLanes |= lane;
              }
              lanes &= ~lane;
            }
          }
          function getLanesToRetrySynchronouslyOnError(root2) {
            var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
            if (everythingButOffscreen !== NoLanes) {
              return everythingButOffscreen;
            }
            if (everythingButOffscreen & OffscreenLane) {
              return OffscreenLane;
            }
            return NoLanes;
          }
          function returnNextLanesPriority() {
            return return_highestLanePriority;
          }
          function includesNonIdleWork(lanes) {
            return (lanes & NonIdleLanes) !== NoLanes;
          }
          function includesOnlyRetries(lanes) {
            return (lanes & RetryLanes) === lanes;
          }
          function includesOnlyTransitions(lanes) {
            return (lanes & TransitionLanes) === lanes;
          }
          function findUpdateLane(lanePriority, wipLanes) {
            switch (lanePriority) {
              case NoLanePriority:
                break;
              case SyncLanePriority:
                return SyncLane;
              case SyncBatchedLanePriority:
                return SyncBatchedLane;
              case InputDiscreteLanePriority: {
                var _lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes);
                if (_lane === NoLane) {
                  return findUpdateLane(InputContinuousLanePriority, wipLanes);
                }
                return _lane;
              }
              case InputContinuousLanePriority: {
                var _lane2 = pickArbitraryLane(InputContinuousLanes & ~wipLanes);
                if (_lane2 === NoLane) {
                  return findUpdateLane(DefaultLanePriority, wipLanes);
                }
                return _lane2;
              }
              case DefaultLanePriority: {
                var _lane3 = pickArbitraryLane(DefaultLanes & ~wipLanes);
                if (_lane3 === NoLane) {
                  _lane3 = pickArbitraryLane(TransitionLanes & ~wipLanes);
                  if (_lane3 === NoLane) {
                    _lane3 = pickArbitraryLane(DefaultLanes);
                  }
                }
                return _lane3;
              }
              case TransitionPriority:
              case RetryLanePriority:
                break;
              case IdleLanePriority:
                var lane = pickArbitraryLane(IdleLanes & ~wipLanes);
                if (lane === NoLane) {
                  lane = pickArbitraryLane(IdleLanes);
                }
                return lane;
            }
            {
              {
                throw Error("Invalid update priority: " + lanePriority + ". This is a bug in React.");
              }
            }
          }
          function findTransitionLane(wipLanes, pendingLanes) {
            var lane = pickArbitraryLane(TransitionLanes & ~pendingLanes);
            if (lane === NoLane) {
              lane = pickArbitraryLane(TransitionLanes & ~wipLanes);
              if (lane === NoLane) {
                lane = pickArbitraryLane(TransitionLanes);
              }
            }
            return lane;
          }
          function findRetryLane(wipLanes) {
            var lane = pickArbitraryLane(RetryLanes & ~wipLanes);
            if (lane === NoLane) {
              lane = pickArbitraryLane(RetryLanes);
            }
            return lane;
          }
          function getHighestPriorityLane(lanes) {
            return lanes & -lanes;
          }
          function getLowestPriorityLane(lanes) {
            var index2 = 31 - clz32(lanes);
            return index2 < 0 ? NoLanes : 1 << index2;
          }
          function getEqualOrHigherPriorityLanes(lanes) {
            return (getLowestPriorityLane(lanes) << 1) - 1;
          }
          function pickArbitraryLane(lanes) {
            return getHighestPriorityLane(lanes);
          }
          function pickArbitraryLaneIndex(lanes) {
            return 31 - clz32(lanes);
          }
          function laneToIndex(lane) {
            return pickArbitraryLaneIndex(lane);
          }
          function includesSomeLane(a2, b) {
            return (a2 & b) !== NoLanes;
          }
          function isSubsetOfLanes(set2, subset) {
            return (set2 & subset) === subset;
          }
          function mergeLanes(a2, b) {
            return a2 | b;
          }
          function removeLanes(set2, subset) {
            return set2 & ~subset;
          }
          function laneToLanes(lane) {
            return lane;
          }
          function higherPriorityLane(a2, b) {
            return a2 !== NoLane && a2 < b ? a2 : b;
          }
          function createLaneMap(initial2) {
            var laneMap = [];
            for (var i = 0; i < TotalLanes; i++) {
              laneMap.push(initial2);
            }
            return laneMap;
          }
          function markRootUpdated(root2, updateLane, eventTime) {
            root2.pendingLanes |= updateLane;
            var higherPriorityLanes = updateLane - 1;
            root2.suspendedLanes &= higherPriorityLanes;
            root2.pingedLanes &= higherPriorityLanes;
            var eventTimes = root2.eventTimes;
            var index2 = laneToIndex(updateLane);
            eventTimes[index2] = eventTime;
          }
          function markRootSuspended(root2, suspendedLanes) {
            root2.suspendedLanes |= suspendedLanes;
            root2.pingedLanes &= ~suspendedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = suspendedLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootPinged(root2, pingedLanes, eventTime) {
            root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
          }
          function markDiscreteUpdatesExpired(root2) {
            root2.expiredLanes |= InputDiscreteLanes & root2.pendingLanes;
          }
          function hasDiscreteLanes(lanes) {
            return (lanes & InputDiscreteLanes) !== NoLanes;
          }
          function markRootMutableRead(root2, updateLane) {
            root2.mutableReadLanes |= updateLane & root2.pendingLanes;
          }
          function markRootFinished(root2, remainingLanes) {
            var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
            root2.pendingLanes = remainingLanes;
            root2.suspendedLanes = 0;
            root2.pingedLanes = 0;
            root2.expiredLanes &= remainingLanes;
            root2.mutableReadLanes &= remainingLanes;
            root2.entangledLanes &= remainingLanes;
            var entanglements = root2.entanglements;
            var eventTimes = root2.eventTimes;
            var expirationTimes = root2.expirationTimes;
            var lanes = noLongerPendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              entanglements[index2] = NoLanes;
              eventTimes[index2] = NoTimestamp;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootEntangled(root2, entangledLanes) {
            root2.entangledLanes |= entangledLanes;
            var entanglements = root2.entanglements;
            var lanes = entangledLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              entanglements[index2] |= entangledLanes;
              lanes &= ~lane;
            }
          }
          var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
          var log3 = Math.log;
          var LN2 = Math.LN2;
          function clz32Fallback(lanes) {
            if (lanes === 0) {
              return 32;
            }
            return 31 - (log3(lanes) / LN2 | 0) | 0;
          }
          var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority, runWithPriority = Scheduler.unstable_runWithPriority;
          var _enabled = true;
          function setEnabled(enabled) {
            _enabled = !!enabled;
          }
          function isEnabled() {
            return _enabled;
          }
          function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
            var eventPriority = getEventPriorityForPluginSystem(domEventName);
            var listenerWrapper;
            switch (eventPriority) {
              case DiscreteEvent:
                listenerWrapper = dispatchDiscreteEvent;
                break;
              case UserBlockingEvent:
                listenerWrapper = dispatchUserBlockingUpdate;
                break;
              case ContinuousEvent:
              default:
                listenerWrapper = dispatchEvent;
                break;
            }
            return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
          }
          function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
            {
              flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
            }
            discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);
          }
          function dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {
            {
              runWithPriority(UserBlockingPriority$1, dispatchEvent.bind(null, domEventName, eventSystemFlags, container, nativeEvent));
            }
          }
          function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (!_enabled) {
              return;
            }
            var allowReplay = true;
            {
              allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0;
            }
            if (allowReplay && hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(domEventName)) {
              queueDiscreteEvent(
                null,
                // Flags that we're not actually blocked on anything as far as we know.
                domEventName,
                eventSystemFlags,
                targetContainer,
                nativeEvent
              );
              return;
            }
            var blockedOn = attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
            if (blockedOn === null) {
              if (allowReplay) {
                clearIfContinuousEvent(domEventName, nativeEvent);
              }
              return;
            }
            if (allowReplay) {
              if (isReplayableDiscreteEvent(domEventName)) {
                queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
                return;
              }
              if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
                return;
              }
              clearIfContinuousEvent(domEventName, nativeEvent);
            }
            dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
          }
          function attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            var nativeEventTarget = getEventTarget(nativeEvent);
            var targetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted === null) {
                targetInst = null;
              } else {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    return instance;
                  }
                  targetInst = null;
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (root2.hydrate) {
                    return getContainerFromFiber(nearestMounted);
                  }
                  targetInst = null;
                } else if (nearestMounted !== targetInst) {
                  targetInst = null;
                }
              }
            }
            dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer);
            return null;
          }
          function addEventBubbleListener(target, eventType, listener3) {
            target.addEventListener(eventType, listener3, false);
            return listener3;
          }
          function addEventCaptureListener(target, eventType, listener3) {
            target.addEventListener(eventType, listener3, true);
            return listener3;
          }
          function addEventCaptureListenerWithPassiveFlag(target, eventType, listener3, passive2) {
            target.addEventListener(eventType, listener3, {
              capture: true,
              passive: passive2
            });
            return listener3;
          }
          function addEventBubbleListenerWithPassiveFlag(target, eventType, listener3, passive2) {
            target.addEventListener(eventType, listener3, {
              passive: passive2
            });
            return listener3;
          }
          var root = null;
          var startText = null;
          var fallbackText = null;
          function initialize(nativeEventTarget) {
            root = nativeEventTarget;
            startText = getText2();
            return true;
          }
          function reset() {
            root = null;
            startText = null;
            fallbackText = null;
          }
          function getData3() {
            if (fallbackText) {
              return fallbackText;
            }
            var start2;
            var startValue = startText;
            var startLength = startValue.length;
            var end2;
            var endValue = getText2();
            var endLength = endValue.length;
            for (start2 = 0; start2 < startLength; start2++) {
              if (startValue[start2] !== endValue[start2]) {
                break;
              }
            }
            var minEnd = startLength - start2;
            for (end2 = 1; end2 <= minEnd; end2++) {
              if (startValue[startLength - end2] !== endValue[endLength - end2]) {
                break;
              }
            }
            var sliceTail = end2 > 1 ? 1 - end2 : void 0;
            fallbackText = endValue.slice(start2, sliceTail);
            return fallbackText;
          }
          function getText2() {
            if ("value" in root) {
              return root.value;
            }
            return root.textContent;
          }
          function getEventCharCode(nativeEvent) {
            var charCode;
            var keyCode = nativeEvent.keyCode;
            if ("charCode" in nativeEvent) {
              charCode = nativeEvent.charCode;
              if (charCode === 0 && keyCode === 13) {
                charCode = 13;
              }
            } else {
              charCode = keyCode;
            }
            if (charCode === 10) {
              charCode = 13;
            }
            if (charCode >= 32 || charCode === 13) {
              return charCode;
            }
            return 0;
          }
          function functionThatReturnsTrue() {
            return true;
          }
          function functionThatReturnsFalse() {
            return false;
          }
          function createSyntheticEvent(Interface) {
            function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
              this._reactName = reactName;
              this._targetInst = targetInst;
              this.type = reactEventType;
              this.nativeEvent = nativeEvent;
              this.target = nativeEventTarget;
              this.currentTarget = null;
              for (var _propName in Interface) {
                if (!Interface.hasOwnProperty(_propName)) {
                  continue;
                }
                var normalize2 = Interface[_propName];
                if (normalize2) {
                  this[_propName] = normalize2(nativeEvent);
                } else {
                  this[_propName] = nativeEvent[_propName];
                }
              }
              var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
              if (defaultPrevented) {
                this.isDefaultPrevented = functionThatReturnsTrue;
              } else {
                this.isDefaultPrevented = functionThatReturnsFalse;
              }
              this.isPropagationStopped = functionThatReturnsFalse;
              return this;
            }
            _assign34(SyntheticBaseEvent.prototype, {
              preventDefault: function() {
                this.defaultPrevented = true;
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.preventDefault) {
                  event.preventDefault();
                } else if (typeof event.returnValue !== "unknown") {
                  event.returnValue = false;
                }
                this.isDefaultPrevented = functionThatReturnsTrue;
              },
              stopPropagation: function() {
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.stopPropagation) {
                  event.stopPropagation();
                } else if (typeof event.cancelBubble !== "unknown") {
                  event.cancelBubble = true;
                }
                this.isPropagationStopped = functionThatReturnsTrue;
              },
              /**
               * We release all dispatched `SyntheticEvent`s after each event loop, adding
               * them back into the pool. This allows a way to hold onto a reference that
               * won't be added back into the pool.
               */
              persist: function() {
              },
              /**
               * Checks if this event should be released back into the pool.
               *
               * @return {boolean} True if this should not be released, false otherwise.
               */
              isPersistent: functionThatReturnsTrue
            });
            return SyntheticBaseEvent;
          }
          var EventInterface = {
            eventPhase: 0,
            bubbles: 0,
            cancelable: 0,
            timeStamp: function(event) {
              return event.timeStamp || Date.now();
            },
            defaultPrevented: 0,
            isTrusted: 0
          };
          var SyntheticEvent = createSyntheticEvent(EventInterface);
          var UIEventInterface = _assign34({}, EventInterface, {
            view: 0,
            detail: 0
          });
          var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
          var lastMovementX;
          var lastMovementY;
          var lastMouseEvent;
          function updateMouseMovementPolyfillState(event) {
            if (event !== lastMouseEvent) {
              if (lastMouseEvent && event.type === "mousemove") {
                lastMovementX = event.screenX - lastMouseEvent.screenX;
                lastMovementY = event.screenY - lastMouseEvent.screenY;
              } else {
                lastMovementX = 0;
                lastMovementY = 0;
              }
              lastMouseEvent = event;
            }
          }
          var MouseEventInterface = _assign34({}, UIEventInterface, {
            screenX: 0,
            screenY: 0,
            clientX: 0,
            clientY: 0,
            pageX: 0,
            pageY: 0,
            ctrlKey: 0,
            shiftKey: 0,
            altKey: 0,
            metaKey: 0,
            getModifierState: getEventModifierState,
            button: 0,
            buttons: 0,
            relatedTarget: function(event) {
              if (event.relatedTarget === void 0)
                return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
              return event.relatedTarget;
            },
            movementX: function(event) {
              if ("movementX" in event) {
                return event.movementX;
              }
              updateMouseMovementPolyfillState(event);
              return lastMovementX;
            },
            movementY: function(event) {
              if ("movementY" in event) {
                return event.movementY;
              }
              return lastMovementY;
            }
          });
          var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
          var DragEventInterface = _assign34({}, MouseEventInterface, {
            dataTransfer: 0
          });
          var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
          var FocusEventInterface = _assign34({}, UIEventInterface, {
            relatedTarget: 0
          });
          var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
          var AnimationEventInterface = _assign34({}, EventInterface, {
            animationName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
          var ClipboardEventInterface = _assign34({}, EventInterface, {
            clipboardData: function(event) {
              return "clipboardData" in event ? event.clipboardData : window.clipboardData;
            }
          });
          var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
          var CompositionEventInterface = _assign34({}, EventInterface, {
            data: 0
          });
          var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
          var SyntheticInputEvent = SyntheticCompositionEvent;
          var normalizeKey = {
            Esc: "Escape",
            Spacebar: " ",
            Left: "ArrowLeft",
            Up: "ArrowUp",
            Right: "ArrowRight",
            Down: "ArrowDown",
            Del: "Delete",
            Win: "OS",
            Menu: "ContextMenu",
            Apps: "ContextMenu",
            Scroll: "ScrollLock",
            MozPrintableKey: "Unidentified"
          };
          var translateToKey = {
            "8": "Backspace",
            "9": "Tab",
            "12": "Clear",
            "13": "Enter",
            "16": "Shift",
            "17": "Control",
            "18": "Alt",
            "19": "Pause",
            "20": "CapsLock",
            "27": "Escape",
            "32": " ",
            "33": "PageUp",
            "34": "PageDown",
            "35": "End",
            "36": "Home",
            "37": "ArrowLeft",
            "38": "ArrowUp",
            "39": "ArrowRight",
            "40": "ArrowDown",
            "45": "Insert",
            "46": "Delete",
            "112": "F1",
            "113": "F2",
            "114": "F3",
            "115": "F4",
            "116": "F5",
            "117": "F6",
            "118": "F7",
            "119": "F8",
            "120": "F9",
            "121": "F10",
            "122": "F11",
            "123": "F12",
            "144": "NumLock",
            "145": "ScrollLock",
            "224": "Meta"
          };
          function getEventKey2(nativeEvent) {
            if (nativeEvent.key) {
              var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
              if (key !== "Unidentified") {
                return key;
              }
            }
            if (nativeEvent.type === "keypress") {
              var charCode = getEventCharCode(nativeEvent);
              return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
            }
            if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
              return translateToKey[nativeEvent.keyCode] || "Unidentified";
            }
            return "";
          }
          var modifierKeyToProp = {
            Alt: "altKey",
            Control: "ctrlKey",
            Meta: "metaKey",
            Shift: "shiftKey"
          };
          function modifierStateGetter(keyArg) {
            var syntheticEvent = this;
            var nativeEvent = syntheticEvent.nativeEvent;
            if (nativeEvent.getModifierState) {
              return nativeEvent.getModifierState(keyArg);
            }
            var keyProp = modifierKeyToProp[keyArg];
            return keyProp ? !!nativeEvent[keyProp] : false;
          }
          function getEventModifierState(nativeEvent) {
            return modifierStateGetter;
          }
          var KeyboardEventInterface = _assign34({}, UIEventInterface, {
            key: getEventKey2,
            code: 0,
            location: 0,
            ctrlKey: 0,
            shiftKey: 0,
            altKey: 0,
            metaKey: 0,
            repeat: 0,
            locale: 0,
            getModifierState: getEventModifierState,
            // Legacy Interface
            charCode: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              return 0;
            },
            keyCode: function(event) {
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            },
            which: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            }
          });
          var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
          var PointerEventInterface = _assign34({}, MouseEventInterface, {
            pointerId: 0,
            width: 0,
            height: 0,
            pressure: 0,
            tangentialPressure: 0,
            tiltX: 0,
            tiltY: 0,
            twist: 0,
            pointerType: 0,
            isPrimary: 0
          });
          var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
          var TouchEventInterface = _assign34({}, UIEventInterface, {
            touches: 0,
            targetTouches: 0,
            changedTouches: 0,
            altKey: 0,
            metaKey: 0,
            ctrlKey: 0,
            shiftKey: 0,
            getModifierState: getEventModifierState
          });
          var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
          var TransitionEventInterface = _assign34({}, EventInterface, {
            propertyName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
          var WheelEventInterface = _assign34({}, MouseEventInterface, {
            deltaX: function(event) {
              return "deltaX" in event ? event.deltaX : (
                // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
                "wheelDeltaX" in event ? -event.wheelDeltaX : 0
              );
            },
            deltaY: function(event) {
              return "deltaY" in event ? event.deltaY : (
                // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
                "wheelDeltaY" in event ? -event.wheelDeltaY : (
                  // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
                  "wheelDelta" in event ? -event.wheelDelta : 0
                )
              );
            },
            deltaZ: 0,
            // Browsers without "deltaMode" is reporting in raw wheel delta where one
            // notch on the scroll is always +/- 120, roughly equivalent to pixels.
            // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
            // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
            deltaMode: 0
          });
          var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
          var END_KEYCODES = [9, 13, 27, 32];
          var START_KEYCODE = 229;
          var canUseCompositionEvent = canUseDOM3 && "CompositionEvent" in window;
          var documentMode = null;
          if (canUseDOM3 && "documentMode" in document) {
            documentMode = document.documentMode;
          }
          var canUseTextInputEvent = canUseDOM3 && "TextEvent" in window && !documentMode;
          var useFallbackCompositionData = canUseDOM3 && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
          var SPACEBAR_CODE = 32;
          var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
          function registerEvents() {
            registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
            registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
          }
          var hasSpaceKeypress = false;
          function isKeypressCommand(nativeEvent) {
            return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
            !(nativeEvent.ctrlKey && nativeEvent.altKey);
          }
          function getCompositionEventType(domEventName) {
            switch (domEventName) {
              case "compositionstart":
                return "onCompositionStart";
              case "compositionend":
                return "onCompositionEnd";
              case "compositionupdate":
                return "onCompositionUpdate";
            }
          }
          function isFallbackCompositionStart(domEventName, nativeEvent) {
            return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
          }
          function isFallbackCompositionEnd(domEventName, nativeEvent) {
            switch (domEventName) {
              case "keyup":
                return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
              case "keydown":
                return nativeEvent.keyCode !== START_KEYCODE;
              case "keypress":
              case "mousedown":
              case "focusout":
                return true;
              default:
                return false;
            }
          }
          function getDataFromCustomEvent(nativeEvent) {
            var detail = nativeEvent.detail;
            if (typeof detail === "object" && "data" in detail) {
              return detail.data;
            }
            return null;
          }
          function isUsingKoreanIME(nativeEvent) {
            return nativeEvent.locale === "ko";
          }
          var isComposing = false;
          function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var eventType;
            var fallbackData;
            if (canUseCompositionEvent) {
              eventType = getCompositionEventType(domEventName);
            } else if (!isComposing) {
              if (isFallbackCompositionStart(domEventName, nativeEvent)) {
                eventType = "onCompositionStart";
              }
            } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
              eventType = "onCompositionEnd";
            }
            if (!eventType) {
              return null;
            }
            if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
              if (!isComposing && eventType === "onCompositionStart") {
                isComposing = initialize(nativeEventTarget);
              } else if (eventType === "onCompositionEnd") {
                if (isComposing) {
                  fallbackData = getData3();
                }
              }
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
            if (listeners.length > 0) {
              var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              if (fallbackData) {
                event.data = fallbackData;
              } else {
                var customData = getDataFromCustomEvent(nativeEvent);
                if (customData !== null) {
                  event.data = customData;
                }
              }
            }
          }
          function getNativeBeforeInputChars(domEventName, nativeEvent) {
            switch (domEventName) {
              case "compositionend":
                return getDataFromCustomEvent(nativeEvent);
              case "keypress":
                var which = nativeEvent.which;
                if (which !== SPACEBAR_CODE) {
                  return null;
                }
                hasSpaceKeypress = true;
                return SPACEBAR_CHAR;
              case "textInput":
                var chars = nativeEvent.data;
                if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
                  return null;
                }
                return chars;
              default:
                return null;
            }
          }
          function getFallbackBeforeInputChars(domEventName, nativeEvent) {
            if (isComposing) {
              if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
                var chars = getData3();
                reset();
                isComposing = false;
                return chars;
              }
              return null;
            }
            switch (domEventName) {
              case "paste":
                return null;
              case "keypress":
                if (!isKeypressCommand(nativeEvent)) {
                  if (nativeEvent.char && nativeEvent.char.length > 1) {
                    return nativeEvent.char;
                  } else if (nativeEvent.which) {
                    return String.fromCharCode(nativeEvent.which);
                  }
                }
                return null;
              case "compositionend":
                return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
              default:
                return null;
            }
          }
          function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var chars;
            if (canUseTextInputEvent) {
              chars = getNativeBeforeInputChars(domEventName, nativeEvent);
            } else {
              chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
            }
            if (!chars) {
              return null;
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
            if (listeners.length > 0) {
              var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              event.data = chars;
            }
          }
          function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
          }
          var supportedInputTypes = {
            color: true,
            date: true,
            datetime: true,
            "datetime-local": true,
            email: true,
            month: true,
            number: true,
            password: true,
            range: true,
            search: true,
            tel: true,
            text: true,
            time: true,
            url: true,
            week: true
          };
          function isTextInputElement(elem) {
            var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
            if (nodeName === "input") {
              return !!supportedInputTypes[elem.type];
            }
            if (nodeName === "textarea") {
              return true;
            }
            return false;
          }
          function isEventSupported(eventNameSuffix) {
            if (!canUseDOM3) {
              return false;
            }
            var eventName = "on" + eventNameSuffix;
            var isSupported = eventName in document;
            if (!isSupported) {
              var element = document.createElement("div");
              element.setAttribute(eventName, "return;");
              isSupported = typeof element[eventName] === "function";
            }
            return isSupported;
          }
          function registerEvents$1() {
            registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
          }
          function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
            enqueueStateRestore(target);
            var listeners = accumulateTwoPhaseListeners(inst, "onChange");
            if (listeners.length > 0) {
              var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          var activeElement = null;
          var activeElementInst = null;
          function shouldUseChangeEvent(elem) {
            var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName === "select" || nodeName === "input" && elem.type === "file";
          }
          function manualDispatchChangeEvent(nativeEvent) {
            var dispatchQueue = [];
            createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
            batchedUpdates(runEventInBatch, dispatchQueue);
          }
          function runEventInBatch(dispatchQueue) {
            processDispatchQueue(dispatchQueue, 0);
          }
          function getInstIfValueChanged(targetInst) {
            var targetNode = getNodeFromInstance(targetInst);
            if (updateValueIfChanged(targetNode)) {
              return targetInst;
            }
          }
          function getTargetInstForChangeEvent(domEventName, targetInst) {
            if (domEventName === "change") {
              return targetInst;
            }
          }
          var isInputEventSupported = false;
          if (canUseDOM3) {
            isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
          }
          function startWatchingForValueChange(target, targetInst) {
            activeElement = target;
            activeElementInst = targetInst;
            activeElement.attachEvent("onpropertychange", handlePropertyChange);
          }
          function stopWatchingForValueChange() {
            if (!activeElement) {
              return;
            }
            activeElement.detachEvent("onpropertychange", handlePropertyChange);
            activeElement = null;
            activeElementInst = null;
          }
          function handlePropertyChange(nativeEvent) {
            if (nativeEvent.propertyName !== "value") {
              return;
            }
            if (getInstIfValueChanged(activeElementInst)) {
              manualDispatchChangeEvent(nativeEvent);
            }
          }
          function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
            if (domEventName === "focusin") {
              stopWatchingForValueChange();
              startWatchingForValueChange(target, targetInst);
            } else if (domEventName === "focusout") {
              stopWatchingForValueChange();
            }
          }
          function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
            if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
              return getInstIfValueChanged(activeElementInst);
            }
          }
          function shouldUseClickEvent(elem) {
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
          }
          function getTargetInstForClickEvent(domEventName, targetInst) {
            if (domEventName === "click") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
            if (domEventName === "input" || domEventName === "change") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function handleControlledInputBlur(node) {
            var state = node._wrapperState;
            if (!state || !state.controlled || node.type !== "number") {
              return;
            }
            {
              setDefaultValue(node, "number", node.value);
            }
          }
          function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            var getTargetInstFunc, handleEventFunc;
            if (shouldUseChangeEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForChangeEvent;
            } else if (isTextInputElement(targetNode)) {
              if (isInputEventSupported) {
                getTargetInstFunc = getTargetInstForInputOrChangeEvent;
              } else {
                getTargetInstFunc = getTargetInstForInputEventPolyfill;
                handleEventFunc = handleEventsForInputEventPolyfill;
              }
            } else if (shouldUseClickEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForClickEvent;
            }
            if (getTargetInstFunc) {
              var inst = getTargetInstFunc(domEventName, targetInst);
              if (inst) {
                createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
                return;
              }
            }
            if (handleEventFunc) {
              handleEventFunc(domEventName, targetNode, targetInst);
            }
            if (domEventName === "focusout") {
              handleControlledInputBlur(targetNode);
            }
          }
          function registerEvents$2() {
            registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
            registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
            registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
            registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
          }
          function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
            var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
            if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0) {
              var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
              if (related) {
                if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
                  return;
                }
              }
            }
            if (!isOutEvent && !isOverEvent) {
              return;
            }
            var win;
            if (nativeEventTarget.window === nativeEventTarget) {
              win = nativeEventTarget;
            } else {
              var doc = nativeEventTarget.ownerDocument;
              if (doc) {
                win = doc.defaultView || doc.parentWindow;
              } else {
                win = window;
              }
            }
            var from;
            var to;
            if (isOutEvent) {
              var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
              from = targetInst;
              to = _related ? getClosestInstanceFromNode(_related) : null;
              if (to !== null) {
                var nearestMounted = getNearestMountedFiber(to);
                if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
                  to = null;
                }
              }
            } else {
              from = null;
              to = targetInst;
            }
            if (from === to) {
              return;
            }
            var SyntheticEventCtor = SyntheticMouseEvent;
            var leaveEventType = "onMouseLeave";
            var enterEventType = "onMouseEnter";
            var eventTypePrefix = "mouse";
            if (domEventName === "pointerout" || domEventName === "pointerover") {
              SyntheticEventCtor = SyntheticPointerEvent;
              leaveEventType = "onPointerLeave";
              enterEventType = "onPointerEnter";
              eventTypePrefix = "pointer";
            }
            var fromNode = from == null ? win : getNodeFromInstance(from);
            var toNode = to == null ? win : getNodeFromInstance(to);
            var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
            leave.target = fromNode;
            leave.relatedTarget = toNode;
            var enter = null;
            var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (nativeTargetInst === targetInst) {
              var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
              enterEvent.target = toNode;
              enterEvent.relatedTarget = fromNode;
              enter = enterEvent;
            }
            accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
          }
          function is(x2, y2) {
            return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
          }
          var objectIs = typeof Object.is === "function" ? Object.is : is;
          var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
          function shallowEqual(objA, objB) {
            if (objectIs(objA, objB)) {
              return true;
            }
            if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
              return false;
            }
            var keysA = Object.keys(objA);
            var keysB = Object.keys(objB);
            if (keysA.length !== keysB.length) {
              return false;
            }
            for (var i = 0; i < keysA.length; i++) {
              if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
                return false;
              }
            }
            return true;
          }
          function getLeafNode(node) {
            while (node && node.firstChild) {
              node = node.firstChild;
            }
            return node;
          }
          function getSiblingNode(node) {
            while (node) {
              if (node.nextSibling) {
                return node.nextSibling;
              }
              node = node.parentNode;
            }
          }
          function getNodeForCharacterOffset(root2, offset2) {
            var node = getLeafNode(root2);
            var nodeStart = 0;
            var nodeEnd = 0;
            while (node) {
              if (node.nodeType === TEXT_NODE) {
                nodeEnd = nodeStart + node.textContent.length;
                if (nodeStart <= offset2 && nodeEnd >= offset2) {
                  return {
                    node,
                    offset: offset2 - nodeStart
                  };
                }
                nodeStart = nodeEnd;
              }
              node = getLeafNode(getSiblingNode(node));
            }
          }
          function getOffsets(outerNode) {
            var ownerDocument = outerNode.ownerDocument;
            var win = ownerDocument && ownerDocument.defaultView || window;
            var selection = win.getSelection && win.getSelection();
            if (!selection || selection.rangeCount === 0) {
              return null;
            }
            var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
            try {
              anchorNode.nodeType;
              focusNode.nodeType;
            } catch (e) {
              return null;
            }
            return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
          }
          function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
            var length = 0;
            var start2 = -1;
            var end2 = -1;
            var indexWithinAnchor = 0;
            var indexWithinFocus = 0;
            var node = outerNode;
            var parentNode = null;
            outer:
              while (true) {
                var next = null;
                while (true) {
                  if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
                    start2 = length + anchorOffset;
                  }
                  if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
                    end2 = length + focusOffset;
                  }
                  if (node.nodeType === TEXT_NODE) {
                    length += node.nodeValue.length;
                  }
                  if ((next = node.firstChild) === null) {
                    break;
                  }
                  parentNode = node;
                  node = next;
                }
                while (true) {
                  if (node === outerNode) {
                    break outer;
                  }
                  if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
                    start2 = length;
                  }
                  if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
                    end2 = length;
                  }
                  if ((next = node.nextSibling) !== null) {
                    break;
                  }
                  node = parentNode;
                  parentNode = node.parentNode;
                }
                node = next;
              }
            if (start2 === -1 || end2 === -1) {
              return null;
            }
            return {
              start: start2,
              end: end2
            };
          }
          function setOffsets(node, offsets) {
            var doc = node.ownerDocument || document;
            var win = doc && doc.defaultView || window;
            if (!win.getSelection) {
              return;
            }
            var selection = win.getSelection();
            var length = node.textContent.length;
            var start2 = Math.min(offsets.start, length);
            var end2 = offsets.end === void 0 ? start2 : Math.min(offsets.end, length);
            if (!selection.extend && start2 > end2) {
              var temp = end2;
              end2 = start2;
              start2 = temp;
            }
            var startMarker = getNodeForCharacterOffset(node, start2);
            var endMarker = getNodeForCharacterOffset(node, end2);
            if (startMarker && endMarker) {
              if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
                return;
              }
              var range2 = doc.createRange();
              range2.setStart(startMarker.node, startMarker.offset);
              selection.removeAllRanges();
              if (start2 > end2) {
                selection.addRange(range2);
                selection.extend(endMarker.node, endMarker.offset);
              } else {
                range2.setEnd(endMarker.node, endMarker.offset);
                selection.addRange(range2);
              }
            }
          }
          function isTextNode(node) {
            return node && node.nodeType === TEXT_NODE;
          }
          function containsNode(outerNode, innerNode) {
            if (!outerNode || !innerNode) {
              return false;
            } else if (outerNode === innerNode) {
              return true;
            } else if (isTextNode(outerNode)) {
              return false;
            } else if (isTextNode(innerNode)) {
              return containsNode(outerNode, innerNode.parentNode);
            } else if ("contains" in outerNode) {
              return outerNode.contains(innerNode);
            } else if (outerNode.compareDocumentPosition) {
              return !!(outerNode.compareDocumentPosition(innerNode) & 16);
            } else {
              return false;
            }
          }
          function isInDocument(node) {
            return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
          }
          function isSameOriginFrame(iframe) {
            try {
              return typeof iframe.contentWindow.location.href === "string";
            } catch (err) {
              return false;
            }
          }
          function getActiveElementDeep() {
            var win = window;
            var element = getActiveElement();
            while (element instanceof win.HTMLIFrameElement) {
              if (isSameOriginFrame(element)) {
                win = element.contentWindow;
              } else {
                return element;
              }
              element = getActiveElement(win.document);
            }
            return element;
          }
          function hasSelectionCapabilities(elem) {
            var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
          }
          function getSelectionInformation() {
            var focusedElem = getActiveElementDeep();
            return {
              focusedElem,
              selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
            };
          }
          function restoreSelection(priorSelectionInformation) {
            var curFocusedElem = getActiveElementDeep();
            var priorFocusedElem = priorSelectionInformation.focusedElem;
            var priorSelectionRange = priorSelectionInformation.selectionRange;
            if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
              if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
                setSelection(priorFocusedElem, priorSelectionRange);
              }
              var ancestors = [];
              var ancestor = priorFocusedElem;
              while (ancestor = ancestor.parentNode) {
                if (ancestor.nodeType === ELEMENT_NODE) {
                  ancestors.push({
                    element: ancestor,
                    left: ancestor.scrollLeft,
                    top: ancestor.scrollTop
                  });
                }
              }
              if (typeof priorFocusedElem.focus === "function") {
                priorFocusedElem.focus();
              }
              for (var i = 0; i < ancestors.length; i++) {
                var info2 = ancestors[i];
                info2.element.scrollLeft = info2.left;
                info2.element.scrollTop = info2.top;
              }
            }
          }
          function getSelection(input) {
            var selection;
            if ("selectionStart" in input) {
              selection = {
                start: input.selectionStart,
                end: input.selectionEnd
              };
            } else {
              selection = getOffsets(input);
            }
            return selection || {
              start: 0,
              end: 0
            };
          }
          function setSelection(input, offsets) {
            var start2 = offsets.start;
            var end2 = offsets.end;
            if (end2 === void 0) {
              end2 = start2;
            }
            if ("selectionStart" in input) {
              input.selectionStart = start2;
              input.selectionEnd = Math.min(end2, input.value.length);
            } else {
              setOffsets(input, offsets);
            }
          }
          var skipSelectionChangeEvent = canUseDOM3 && "documentMode" in document && document.documentMode <= 11;
          function registerEvents$3() {
            registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
          }
          var activeElement$1 = null;
          var activeElementInst$1 = null;
          var lastSelection = null;
          var mouseDown = false;
          function getSelection$1(node) {
            if ("selectionStart" in node && hasSelectionCapabilities(node)) {
              return {
                start: node.selectionStart,
                end: node.selectionEnd
              };
            } else {
              var win = node.ownerDocument && node.ownerDocument.defaultView || window;
              var selection = win.getSelection();
              return {
                anchorNode: selection.anchorNode,
                anchorOffset: selection.anchorOffset,
                focusNode: selection.focusNode,
                focusOffset: selection.focusOffset
              };
            }
          }
          function getEventTargetDocument(eventTarget) {
            return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
          }
          function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
            var doc = getEventTargetDocument(nativeEventTarget);
            if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
              return;
            }
            var currentSelection = getSelection$1(activeElement$1);
            if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
              lastSelection = currentSelection;
              var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
              if (listeners.length > 0) {
                var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event,
                  listeners
                });
                event.target = activeElement$1;
              }
            }
          }
          function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            switch (domEventName) {
              case "focusin":
                if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
                  activeElement$1 = targetNode;
                  activeElementInst$1 = targetInst;
                  lastSelection = null;
                }
                break;
              case "focusout":
                activeElement$1 = null;
                activeElementInst$1 = null;
                lastSelection = null;
                break;
              case "mousedown":
                mouseDown = true;
                break;
              case "contextmenu":
              case "mouseup":
              case "dragend":
                mouseDown = false;
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
                break;
              case "selectionchange":
                if (skipSelectionChangeEvent) {
                  break;
                }
              case "keydown":
              case "keyup":
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
            }
          }
          function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var reactName = topLevelEventsToReactNames.get(domEventName);
            if (reactName === void 0) {
              return;
            }
            var SyntheticEventCtor = SyntheticEvent;
            var reactEventType = domEventName;
            switch (domEventName) {
              case "keypress":
                if (getEventCharCode(nativeEvent) === 0) {
                  return;
                }
              case "keydown":
              case "keyup":
                SyntheticEventCtor = SyntheticKeyboardEvent;
                break;
              case "focusin":
                reactEventType = "focus";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "focusout":
                reactEventType = "blur";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "beforeblur":
              case "afterblur":
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "click":
                if (nativeEvent.button === 2) {
                  return;
                }
              case "auxclick":
              case "dblclick":
              case "mousedown":
              case "mousemove":
              case "mouseup":
              case "mouseout":
              case "mouseover":
              case "contextmenu":
                SyntheticEventCtor = SyntheticMouseEvent;
                break;
              case "drag":
              case "dragend":
              case "dragenter":
              case "dragexit":
              case "dragleave":
              case "dragover":
              case "dragstart":
              case "drop":
                SyntheticEventCtor = SyntheticDragEvent;
                break;
              case "touchcancel":
              case "touchend":
              case "touchmove":
              case "touchstart":
                SyntheticEventCtor = SyntheticTouchEvent;
                break;
              case ANIMATION_END:
              case ANIMATION_ITERATION:
              case ANIMATION_START:
                SyntheticEventCtor = SyntheticAnimationEvent;
                break;
              case TRANSITION_END:
                SyntheticEventCtor = SyntheticTransitionEvent;
                break;
              case "scroll":
                SyntheticEventCtor = SyntheticUIEvent;
                break;
              case "wheel":
                SyntheticEventCtor = SyntheticWheelEvent;
                break;
              case "copy":
              case "cut":
              case "paste":
                SyntheticEventCtor = SyntheticClipboardEvent;
                break;
              case "gotpointercapture":
              case "lostpointercapture":
              case "pointercancel":
              case "pointerdown":
              case "pointermove":
              case "pointerout":
              case "pointerover":
              case "pointerup":
                SyntheticEventCtor = SyntheticPointerEvent;
                break;
            }
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            {
              var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from
              // nonDelegatedEvents list in DOMPluginEventSystem.
              // Then we can remove this special list.
              // This is a breaking change that can wait until React 18.
              domEventName === "scroll";
              var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
              if (_listeners.length > 0) {
                var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event: _event,
                  listeners: _listeners
                });
              }
            }
          }
          registerSimpleEvents();
          registerEvents$2();
          registerEvents$1();
          registerEvents$3();
          registerEvents();
          function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
            if (shouldProcessPolyfillPlugins) {
              extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
              extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            }
          }
          var mediaEventTypes = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"];
          var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
          function executeDispatch(event, listener3, currentTarget) {
            var type = event.type || "unknown-event";
            event.currentTarget = currentTarget;
            invokeGuardedCallbackAndCatchFirstError(type, listener3, void 0, event);
            event.currentTarget = null;
          }
          function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
            var previousInstance;
            if (inCapturePhase) {
              for (var i = dispatchListeners.length - 1; i >= 0; i--) {
                var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener3 = _dispatchListeners$i.listener;
                if (instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, listener3, currentTarget);
                previousInstance = instance;
              }
            } else {
              for (var _i = 0; _i < dispatchListeners.length; _i++) {
                var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
                if (_instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, _listener, _currentTarget);
                previousInstance = _instance;
              }
            }
          }
          function processDispatchQueue(dispatchQueue, eventSystemFlags) {
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            for (var i = 0; i < dispatchQueue.length; i++) {
              var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
              processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
            }
            rethrowCaughtError();
          }
          function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var nativeEventTarget = getEventTarget(nativeEvent);
            var dispatchQueue = [];
            extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            processDispatchQueue(dispatchQueue, eventSystemFlags);
          }
          function listenToNonDelegatedEvent(domEventName, targetElement) {
            var isCapturePhaseListener = false;
            var listenerSet = getEventListenerSet(targetElement);
            var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
            if (!listenerSet.has(listenerSetKey)) {
              addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
              listenerSet.add(listenerSetKey);
            }
          }
          var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
          function listenToAllSupportedEvents(rootContainerElement) {
            {
              if (rootContainerElement[listeningMarker]) {
                return;
              }
              rootContainerElement[listeningMarker] = true;
              allNativeEvents.forEach(function(domEventName) {
                if (!nonDelegatedEvents.has(domEventName)) {
                  listenToNativeEvent(domEventName, false, rootContainerElement, null);
                }
                listenToNativeEvent(domEventName, true, rootContainerElement, null);
              });
            }
          }
          function listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {
            var eventSystemFlags = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
            var target = rootContainerElement;
            if (domEventName === "selectionchange" && rootContainerElement.nodeType !== DOCUMENT_NODE) {
              target = rootContainerElement.ownerDocument;
            }
            if (targetElement !== null && !isCapturePhaseListener && nonDelegatedEvents.has(domEventName)) {
              if (domEventName !== "scroll") {
                return;
              }
              eventSystemFlags |= IS_NON_DELEGATED;
              target = targetElement;
            }
            var listenerSet = getEventListenerSet(target);
            var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
            if (!listenerSet.has(listenerSetKey)) {
              if (isCapturePhaseListener) {
                eventSystemFlags |= IS_CAPTURE_PHASE;
              }
              addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
              listenerSet.add(listenerSetKey);
            }
          }
          function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
            var listener3 = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
            var isPassiveListener = void 0;
            if (passiveBrowserEventsSupported) {
              if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
                isPassiveListener = true;
              }
            }
            targetContainer = targetContainer;
            var unsubscribeListener;
            if (isCapturePhaseListener) {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener3, isPassiveListener);
              } else {
                unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener3);
              }
            } else {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener3, isPassiveListener);
              } else {
                unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener3);
              }
            }
          }
          function isMatchingRootContainer(grandContainer, targetContainer) {
            return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
          }
          function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var ancestorInst = targetInst;
            if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
              var targetContainerNode = targetContainer;
              if (targetInst !== null) {
                var node = targetInst;
                mainLoop:
                  while (true) {
                    if (node === null) {
                      return;
                    }
                    var nodeTag = node.tag;
                    if (nodeTag === HostRoot || nodeTag === HostPortal) {
                      var container = node.stateNode.containerInfo;
                      if (isMatchingRootContainer(container, targetContainerNode)) {
                        break;
                      }
                      if (nodeTag === HostPortal) {
                        var grandNode = node.return;
                        while (grandNode !== null) {
                          var grandTag = grandNode.tag;
                          if (grandTag === HostRoot || grandTag === HostPortal) {
                            var grandContainer = grandNode.stateNode.containerInfo;
                            if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
                              return;
                            }
                          }
                          grandNode = grandNode.return;
                        }
                      }
                      while (container !== null) {
                        var parentNode = getClosestInstanceFromNode(container);
                        if (parentNode === null) {
                          return;
                        }
                        var parentTag = parentNode.tag;
                        if (parentTag === HostComponent || parentTag === HostText) {
                          node = ancestorInst = parentNode;
                          continue mainLoop;
                        }
                        container = container.parentNode;
                      }
                    }
                    node = node.return;
                  }
              }
            }
            batchedEventUpdates(function() {
              return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
            });
          }
          function createDispatchListener(instance, listener3, currentTarget) {
            return {
              instance,
              listener: listener3,
              currentTarget
            };
          }
          function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {
            var captureName = reactName !== null ? reactName + "Capture" : null;
            var reactEventName = inCapturePhase ? captureName : reactName;
            var listeners = [];
            var instance = targetFiber;
            var lastHostComponent = null;
            while (instance !== null) {
              var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
              if (tag === HostComponent && stateNode !== null) {
                lastHostComponent = stateNode;
                if (reactEventName !== null) {
                  var listener3 = getListener(instance, reactEventName);
                  if (listener3 != null) {
                    listeners.push(createDispatchListener(instance, listener3, lastHostComponent));
                  }
                }
              }
              if (accumulateTargetOnly) {
                break;
              }
              instance = instance.return;
            }
            return listeners;
          }
          function accumulateTwoPhaseListeners(targetFiber, reactName) {
            var captureName = reactName + "Capture";
            var listeners = [];
            var instance = targetFiber;
            while (instance !== null) {
              var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                var captureListener = getListener(instance, captureName);
                if (captureListener != null) {
                  listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                }
                var bubbleListener = getListener(instance, reactName);
                if (bubbleListener != null) {
                  listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                }
              }
              instance = instance.return;
            }
            return listeners;
          }
          function getParent(inst) {
            if (inst === null) {
              return null;
            }
            do {
              inst = inst.return;
            } while (inst && inst.tag !== HostComponent);
            if (inst) {
              return inst;
            }
            return null;
          }
          function getLowestCommonAncestor(instA, instB) {
            var nodeA = instA;
            var nodeB = instB;
            var depthA = 0;
            for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
              depthA++;
            }
            var depthB = 0;
            for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
              depthB++;
            }
            while (depthA - depthB > 0) {
              nodeA = getParent(nodeA);
              depthA--;
            }
            while (depthB - depthA > 0) {
              nodeB = getParent(nodeB);
              depthB--;
            }
            var depth = depthA;
            while (depth--) {
              if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
                return nodeA;
              }
              nodeA = getParent(nodeA);
              nodeB = getParent(nodeB);
            }
            return null;
          }
          function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
            var registrationName = event._reactName;
            var listeners = [];
            var instance = target;
            while (instance !== null) {
              if (instance === common) {
                break;
              }
              var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
              if (alternate !== null && alternate === common) {
                break;
              }
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                if (inCapturePhase) {
                  var captureListener = getListener(instance, registrationName);
                  if (captureListener != null) {
                    listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                  }
                } else if (!inCapturePhase) {
                  var bubbleListener = getListener(instance, registrationName);
                  if (bubbleListener != null) {
                    listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                  }
                }
              }
              instance = instance.return;
            }
            if (listeners.length !== 0) {
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
            var common = from && to ? getLowestCommonAncestor(from, to) : null;
            if (from !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
            }
            if (to !== null && enterEvent !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
            }
          }
          function getListenerSetKey(domEventName, capture) {
            return domEventName + "__" + (capture ? "capture" : "bubble");
          }
          var didWarnInvalidHydration = false;
          var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
          var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
          var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
          var AUTOFOCUS = "autoFocus";
          var CHILDREN = "children";
          var STYLE = "style";
          var HTML$1 = "__html";
          var HTML_NAMESPACE$1 = Namespaces.html;
          var warnedUnknownTags;
          var suppressHydrationWarning;
          var validatePropertiesInDevelopment;
          var warnForTextDifference;
          var warnForPropDifference;
          var warnForExtraAttributes;
          var warnForInvalidEventListener;
          var canDiffStyleForHydrationWarning;
          var normalizeMarkupForTextOrAttribute;
          var normalizeHTML;
          {
            warnedUnknownTags = {
              // There are working polyfills for <dialog>. Let people use it.
              dialog: true,
              // Electron ships a custom <webview> tag to display external web content in
              // an isolated frame and process.
              // This tag is not present in non Electron environments such as JSDom which
              // is often used for testing purposes.
              // @see https://electronjs.org/docs/api/webview-tag
              webview: true
            };
            validatePropertiesInDevelopment = function(type, props) {
              validateProperties(type, props);
              validateProperties$1(type, props);
              validateProperties$2(type, props, {
                registrationNameDependencies,
                possibleRegistrationNames
              });
            };
            canDiffStyleForHydrationWarning = canUseDOM3 && !document.documentMode;
            var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
            var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
            normalizeMarkupForTextOrAttribute = function(markup) {
              var markupString = typeof markup === "string" ? markup : "" + markup;
              return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
            };
            warnForTextDifference = function(serverText, clientText) {
              if (didWarnInvalidHydration) {
                return;
              }
              var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
              var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
              if (normalizedServerText === normalizedClientText) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
            };
            warnForPropDifference = function(propName, serverValue, clientValue) {
              if (didWarnInvalidHydration) {
                return;
              }
              var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
              var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
              if (normalizedServerValue === normalizedClientValue) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
            };
            warnForExtraAttributes = function(attributeNames) {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              var names = [];
              attributeNames.forEach(function(name2) {
                names.push(name2);
              });
              error("Extra attributes from the server: %s", names);
            };
            warnForInvalidEventListener = function(registrationName, listener3) {
              if (listener3 === false) {
                error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName);
              } else {
                error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener3);
              }
            };
            normalizeHTML = function(parent, html) {
              var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
              testElement.innerHTML = html;
              return testElement.innerHTML;
            };
          }
          function getOwnerDocumentFromRootContainer(rootContainerElement) {
            return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
          }
          function noop4() {
          }
          function trapClickOnNonInteractiveElement(node) {
            node.onclick = noop4;
          }
          function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
            for (var propKey in nextProps) {
              if (!nextProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = nextProps[propKey];
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                setValueForStyles(domElement, nextProp);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  setInnerHTML(domElement, nextHtml);
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  var canSetTextContent = tag !== "textarea" || nextProp !== "";
                  if (canSetTextContent) {
                    setTextContent(domElement, nextProp);
                  }
                } else if (typeof nextProp === "number") {
                  setTextContent(domElement, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (propKey === AUTOFOCUS)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (nextProp != null) {
                setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
              }
            }
          }
          function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
            for (var i = 0; i < updatePayload.length; i += 2) {
              var propKey = updatePayload[i];
              var propValue = updatePayload[i + 1];
              if (propKey === STYLE) {
                setValueForStyles(domElement, propValue);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                setInnerHTML(domElement, propValue);
              } else if (propKey === CHILDREN) {
                setTextContent(domElement, propValue);
              } else {
                setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
              }
            }
          }
          function createElement220(type, props, rootContainerElement, parentNamespace) {
            var isCustomComponentTag;
            var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
            var domElement;
            var namespaceURI = parentNamespace;
            if (namespaceURI === HTML_NAMESPACE$1) {
              namespaceURI = getIntrinsicNamespace(type);
            }
            if (namespaceURI === HTML_NAMESPACE$1) {
              {
                isCustomComponentTag = isCustomComponent(type, props);
                if (!isCustomComponentTag && type !== type.toLowerCase()) {
                  error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
                }
              }
              if (type === "script") {
                var div = ownerDocument.createElement("div");
                div.innerHTML = "<script><\/script>";
                var firstChild = div.firstChild;
                domElement = div.removeChild(firstChild);
              } else if (typeof props.is === "string") {
                domElement = ownerDocument.createElement(type, {
                  is: props.is
                });
              } else {
                domElement = ownerDocument.createElement(type);
                if (type === "select") {
                  var node = domElement;
                  if (props.multiple) {
                    node.multiple = true;
                  } else if (props.size) {
                    node.size = props.size;
                  }
                }
              }
            } else {
              domElement = ownerDocument.createElementNS(namespaceURI, type);
            }
            {
              if (namespaceURI === HTML_NAMESPACE$1) {
                if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
                  warnedUnknownTags[type] = true;
                  error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type);
                }
              }
            }
            return domElement;
          }
          function createTextNode(text, rootContainerElement) {
            return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
          }
          function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
            var isCustomComponentTag = isCustomComponent(tag, rawProps);
            {
              validatePropertiesInDevelopment(tag, rawProps);
            }
            var props;
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                props = rawProps;
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                props = rawProps;
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                props = rawProps;
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                props = rawProps;
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                props = getHostProps(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                props = getHostProps$1(domElement, rawProps);
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                props = getHostProps$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                props = getHostProps$3(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              default:
                props = rawProps;
            }
            assertValidProps(tag, props);
            setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, false);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "option":
                postMountWrapper$1(domElement, rawProps);
                break;
              case "select":
                postMountWrapper$2(domElement, rawProps);
                break;
              default:
                if (typeof props.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
          }
          function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
            {
              validatePropertiesInDevelopment(tag, nextRawProps);
            }
            var updatePayload = null;
            var lastProps;
            var nextProps;
            switch (tag) {
              case "input":
                lastProps = getHostProps(domElement, lastRawProps);
                nextProps = getHostProps(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "option":
                lastProps = getHostProps$1(domElement, lastRawProps);
                nextProps = getHostProps$1(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "select":
                lastProps = getHostProps$2(domElement, lastRawProps);
                nextProps = getHostProps$2(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "textarea":
                lastProps = getHostProps$3(domElement, lastRawProps);
                nextProps = getHostProps$3(domElement, nextRawProps);
                updatePayload = [];
                break;
              default:
                lastProps = lastRawProps;
                nextProps = nextRawProps;
                if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            assertValidProps(tag, nextProps);
            var propKey;
            var styleName;
            var styleUpdates = null;
            for (propKey in lastProps) {
              if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
                continue;
              }
              if (propKey === STYLE) {
                var lastStyle = lastProps[propKey];
                for (styleName in lastStyle) {
                  if (lastStyle.hasOwnProperty(styleName)) {
                    if (!styleUpdates) {
                      styleUpdates = {};
                    }
                    styleUpdates[styleName] = "";
                  }
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN)
                ;
              else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (propKey === AUTOFOCUS)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (!updatePayload) {
                  updatePayload = [];
                }
              } else {
                (updatePayload = updatePayload || []).push(propKey, null);
              }
            }
            for (propKey in nextProps) {
              var nextProp = nextProps[propKey];
              var lastProp = lastProps != null ? lastProps[propKey] : void 0;
              if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
                continue;
              }
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                if (lastProp) {
                  for (styleName in lastProp) {
                    if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = "";
                    }
                  }
                  for (styleName in nextProp) {
                    if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = nextProp[styleName];
                    }
                  }
                } else {
                  if (!styleUpdates) {
                    if (!updatePayload) {
                      updatePayload = [];
                    }
                    updatePayload.push(propKey, styleUpdates);
                  }
                  styleUpdates = nextProp;
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  if (lastHtml !== nextHtml) {
                    (updatePayload = updatePayload || []).push(propKey, nextHtml);
                  }
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string" || typeof nextProp === "number") {
                  (updatePayload = updatePayload || []).push(propKey, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING)
                ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
                if (!updatePayload && lastProp !== nextProp) {
                  updatePayload = [];
                }
              } else if (typeof nextProp === "object" && nextProp !== null && nextProp.$$typeof === REACT_OPAQUE_ID_TYPE) {
                nextProp.toString();
              } else {
                (updatePayload = updatePayload || []).push(propKey, nextProp);
              }
            }
            if (styleUpdates) {
              {
                validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
              }
              (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
            }
            return updatePayload;
          }
          function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
            if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
              updateChecked(domElement, nextRawProps);
            }
            var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
            var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
            updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
            switch (tag) {
              case "input":
                updateWrapper(domElement, nextRawProps);
                break;
              case "textarea":
                updateWrapper$1(domElement, nextRawProps);
                break;
              case "select":
                postUpdateWrapper(domElement, nextRawProps);
                break;
            }
          }
          function getPossibleStandardName(propName) {
            {
              var lowerCasedName = propName.toLowerCase();
              if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                return null;
              }
              return possibleStandardNames[lowerCasedName] || null;
            }
          }
          function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
            var isCustomComponentTag;
            var extraAttributeNames;
            {
              suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
              isCustomComponentTag = isCustomComponent(tag, rawProps);
              validatePropertiesInDevelopment(tag, rawProps);
            }
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
            }
            assertValidProps(tag, rawProps);
            {
              extraAttributeNames = /* @__PURE__ */ new Set();
              var attributes = domElement.attributes;
              for (var _i = 0; _i < attributes.length; _i++) {
                var name2 = attributes[_i].name.toLowerCase();
                switch (name2) {
                  case "data-reactroot":
                    break;
                  case "value":
                    break;
                  case "checked":
                    break;
                  case "selected":
                    break;
                  default:
                    extraAttributeNames.add(attributes[_i].name);
                }
              }
            }
            var updatePayload = null;
            for (var propKey in rawProps) {
              if (!rawProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = rawProps[propKey];
              if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  if (domElement.textContent !== nextProp) {
                    if (!suppressHydrationWarning) {
                      warnForTextDifference(domElement.textContent, nextProp);
                    }
                    updatePayload = [CHILDREN, nextProp];
                  }
                } else if (typeof nextProp === "number") {
                  if (domElement.textContent !== "" + nextProp) {
                    if (!suppressHydrationWarning) {
                      warnForTextDifference(domElement.textContent, nextProp);
                    }
                    updatePayload = [CHILDREN, "" + nextProp];
                  }
                }
              } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (
                // Convince Flow we've calculated it (it's DEV-only in this method.)
                typeof isCustomComponentTag === "boolean"
              ) {
                var serverValue = void 0;
                var propertyInfo = getPropertyInfo(propKey);
                if (suppressHydrationWarning)
                  ;
                else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
                // TODO: Only ignore them on controlled tags.
                propKey === "value" || propKey === "checked" || propKey === "selected")
                  ;
                else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                  var serverHTML = domElement.innerHTML;
                  var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                  if (nextHtml != null) {
                    var expectedHTML = normalizeHTML(domElement, nextHtml);
                    if (expectedHTML !== serverHTML) {
                      warnForPropDifference(propKey, serverHTML, expectedHTML);
                    }
                  }
                } else if (propKey === STYLE) {
                  extraAttributeNames.delete(propKey);
                  if (canDiffStyleForHydrationWarning) {
                    var expectedStyle = createDangerousStringForStyles(nextProp);
                    serverValue = domElement.getAttribute("style");
                    if (expectedStyle !== serverValue) {
                      warnForPropDifference(propKey, serverValue, expectedStyle);
                    }
                  }
                } else if (isCustomComponentTag) {
                  extraAttributeNames.delete(propKey.toLowerCase());
                  serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  if (nextProp !== serverValue) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
                  var isMismatchDueToBadCasing = false;
                  if (propertyInfo !== null) {
                    extraAttributeNames.delete(propertyInfo.attributeName);
                    serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
                  } else {
                    var ownNamespace = parentNamespace;
                    if (ownNamespace === HTML_NAMESPACE$1) {
                      ownNamespace = getIntrinsicNamespace(tag);
                    }
                    if (ownNamespace === HTML_NAMESPACE$1) {
                      extraAttributeNames.delete(propKey.toLowerCase());
                    } else {
                      var standardName = getPossibleStandardName(propKey);
                      if (standardName !== null && standardName !== propKey) {
                        isMismatchDueToBadCasing = true;
                        extraAttributeNames.delete(standardName);
                      }
                      extraAttributeNames.delete(propKey);
                    }
                    serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  }
                  if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                }
              }
            }
            {
              if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
                warnForExtraAttributes(extraAttributeNames);
              }
            }
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, true);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "select":
              case "option":
                break;
              default:
                if (typeof rawProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            return updatePayload;
          }
          function diffHydratedText(textNode, text) {
            var isDifferent = textNode.nodeValue !== text;
            return isDifferent;
          }
          function warnForUnmatchedText(textNode, text) {
            {
              warnForTextDifference(textNode.nodeValue, text);
            }
          }
          function warnForDeletedHydratableElement(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
            }
          }
          function warnForDeletedHydratableText(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedElement(parentNode, tag, props) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedText(parentNode, text) {
            {
              if (text === "") {
                return;
              }
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
            }
          }
          function restoreControlledState$3(domElement, tag, props) {
            switch (tag) {
              case "input":
                restoreControlledState(domElement, props);
                return;
              case "textarea":
                restoreControlledState$2(domElement, props);
                return;
              case "select":
                restoreControlledState$1(domElement, props);
                return;
            }
          }
          var validateDOMNesting = function() {
          };
          var updatedAncestorInfo = function() {
          };
          {
            var specialTags = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"];
            var inScopeTags = [
              "applet",
              "caption",
              "html",
              "table",
              "td",
              "th",
              "marquee",
              "object",
              "template",
              // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
              // TODO: Distinguish by namespace here -- for <title>, including it here
              // errs on the side of fewer warnings
              "foreignObject",
              "desc",
              "title"
            ];
            var buttonScopeTags = inScopeTags.concat(["button"]);
            var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
            var emptyAncestorInfo = {
              current: null,
              formTag: null,
              aTagInScope: null,
              buttonTagInScope: null,
              nobrTagInScope: null,
              pTagInButtonScope: null,
              listItemTagAutoclosing: null,
              dlItemTagAutoclosing: null
            };
            updatedAncestorInfo = function(oldInfo, tag) {
              var ancestorInfo = _assign34({}, oldInfo || emptyAncestorInfo);
              var info2 = {
                tag
              };
              if (inScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.aTagInScope = null;
                ancestorInfo.buttonTagInScope = null;
                ancestorInfo.nobrTagInScope = null;
              }
              if (buttonScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.pTagInButtonScope = null;
              }
              if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
                ancestorInfo.listItemTagAutoclosing = null;
                ancestorInfo.dlItemTagAutoclosing = null;
              }
              ancestorInfo.current = info2;
              if (tag === "form") {
                ancestorInfo.formTag = info2;
              }
              if (tag === "a") {
                ancestorInfo.aTagInScope = info2;
              }
              if (tag === "button") {
                ancestorInfo.buttonTagInScope = info2;
              }
              if (tag === "nobr") {
                ancestorInfo.nobrTagInScope = info2;
              }
              if (tag === "p") {
                ancestorInfo.pTagInButtonScope = info2;
              }
              if (tag === "li") {
                ancestorInfo.listItemTagAutoclosing = info2;
              }
              if (tag === "dd" || tag === "dt") {
                ancestorInfo.dlItemTagAutoclosing = info2;
              }
              return ancestorInfo;
            };
            var isTagValidWithParent = function(tag, parentTag) {
              switch (parentTag) {
                case "select":
                  return tag === "option" || tag === "optgroup" || tag === "#text";
                case "optgroup":
                  return tag === "option" || tag === "#text";
                case "option":
                  return tag === "#text";
                case "tr":
                  return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
                case "tbody":
                case "thead":
                case "tfoot":
                  return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
                case "colgroup":
                  return tag === "col" || tag === "template";
                case "table":
                  return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
                case "head":
                  return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
                case "html":
                  return tag === "head" || tag === "body" || tag === "frameset";
                case "frameset":
                  return tag === "frame";
                case "#document":
                  return tag === "html";
              }
              switch (tag) {
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
                case "rp":
                case "rt":
                  return impliedEndTags.indexOf(parentTag) === -1;
                case "body":
                case "caption":
                case "col":
                case "colgroup":
                case "frameset":
                case "frame":
                case "head":
                case "html":
                case "tbody":
                case "td":
                case "tfoot":
                case "th":
                case "thead":
                case "tr":
                  return parentTag == null;
              }
              return true;
            };
            var findInvalidAncestorForTag = function(tag, ancestorInfo) {
              switch (tag) {
                case "address":
                case "article":
                case "aside":
                case "blockquote":
                case "center":
                case "details":
                case "dialog":
                case "dir":
                case "div":
                case "dl":
                case "fieldset":
                case "figcaption":
                case "figure":
                case "footer":
                case "header":
                case "hgroup":
                case "main":
                case "menu":
                case "nav":
                case "ol":
                case "p":
                case "section":
                case "summary":
                case "ul":
                case "pre":
                case "listing":
                case "table":
                case "hr":
                case "xmp":
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return ancestorInfo.pTagInButtonScope;
                case "form":
                  return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
                case "li":
                  return ancestorInfo.listItemTagAutoclosing;
                case "dd":
                case "dt":
                  return ancestorInfo.dlItemTagAutoclosing;
                case "button":
                  return ancestorInfo.buttonTagInScope;
                case "a":
                  return ancestorInfo.aTagInScope;
                case "nobr":
                  return ancestorInfo.nobrTagInScope;
              }
              return null;
            };
            var didWarn$1 = {};
            validateDOMNesting = function(childTag, childText, ancestorInfo) {
              ancestorInfo = ancestorInfo || emptyAncestorInfo;
              var parentInfo = ancestorInfo.current;
              var parentTag = parentInfo && parentInfo.tag;
              if (childText != null) {
                if (childTag != null) {
                  error("validateDOMNesting: when childText is passed, childTag should be null");
                }
                childTag = "#text";
              }
              var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
              var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
              var invalidParentOrAncestor = invalidParent || invalidAncestor;
              if (!invalidParentOrAncestor) {
                return;
              }
              var ancestorTag = invalidParentOrAncestor.tag;
              var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
              if (didWarn$1[warnKey]) {
                return;
              }
              didWarn$1[warnKey] = true;
              var tagDisplayName = childTag;
              var whitespaceInfo = "";
              if (childTag === "#text") {
                if (/\S/.test(childText)) {
                  tagDisplayName = "Text nodes";
                } else {
                  tagDisplayName = "Whitespace text nodes";
                  whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
                }
              } else {
                tagDisplayName = "<" + childTag + ">";
              }
              if (invalidParent) {
                var info2 = "";
                if (ancestorTag === "table" && childTag === "tr") {
                  info2 += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
                }
                error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info2);
              } else {
                error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
              }
            };
          }
          var SUPPRESS_HYDRATION_WARNING$1;
          {
            SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
          }
          var SUSPENSE_START_DATA = "$";
          var SUSPENSE_END_DATA = "/$";
          var SUSPENSE_PENDING_START_DATA = "$?";
          var SUSPENSE_FALLBACK_START_DATA = "$!";
          var STYLE$1 = "style";
          var eventsEnabled = null;
          var selectionInformation = null;
          function shouldAutoFocusHostComponent(type, props) {
            switch (type) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                return !!props.autoFocus;
            }
            return false;
          }
          function getRootHostContext(rootContainerInstance) {
            var type;
            var namespace2;
            var nodeType = rootContainerInstance.nodeType;
            switch (nodeType) {
              case DOCUMENT_NODE:
              case DOCUMENT_FRAGMENT_NODE: {
                type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
                var root2 = rootContainerInstance.documentElement;
                namespace2 = root2 ? root2.namespaceURI : getChildNamespace(null, "");
                break;
              }
              default: {
                var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
                var ownNamespace = container.namespaceURI || null;
                type = container.tagName;
                namespace2 = getChildNamespace(ownNamespace, type);
                break;
              }
            }
            {
              var validatedTag = type.toLowerCase();
              var ancestorInfo = updatedAncestorInfo(null, validatedTag);
              return {
                namespace: namespace2,
                ancestorInfo
              };
            }
          }
          function getChildHostContext(parentHostContext, type, rootContainerInstance) {
            {
              var parentHostContextDev = parentHostContext;
              var namespace2 = getChildNamespace(parentHostContextDev.namespace, type);
              var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
              return {
                namespace: namespace2,
                ancestorInfo
              };
            }
          }
          function getPublicInstance(instance) {
            return instance;
          }
          function prepareForCommit(containerInfo) {
            eventsEnabled = isEnabled();
            selectionInformation = getSelectionInformation();
            var activeInstance = null;
            setEnabled(false);
            return activeInstance;
          }
          function resetAfterCommit(containerInfo) {
            restoreSelection(selectionInformation);
            setEnabled(eventsEnabled);
            eventsEnabled = null;
            selectionInformation = null;
          }
          function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              validateDOMNesting(type, null, hostContextDev.ancestorInfo);
              if (typeof props.children === "string" || typeof props.children === "number") {
                var string = "" + props.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
              parentNamespace = hostContextDev.namespace;
            }
            var domElement = createElement220(type, props, rootContainerInstance, parentNamespace);
            precacheFiberNode(internalInstanceHandle, domElement);
            updateFiberProps(domElement, props);
            return domElement;
          }
          function appendInitialChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
            setInitialProperties(domElement, type, props, rootContainerInstance);
            return shouldAutoFocusHostComponent(type, props);
          }
          function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
            {
              var hostContextDev = hostContext;
              if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
                var string = "" + newProps.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
            }
            return diffProperties(domElement, type, oldProps, newProps);
          }
          function shouldSetTextContent(type, props) {
            return type === "textarea" || type === "option" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
          }
          function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
            {
              var hostContextDev = hostContext;
              validateDOMNesting(null, text, hostContextDev.ancestorInfo);
            }
            var textNode = createTextNode(text, rootContainerInstance);
            precacheFiberNode(internalInstanceHandle, textNode);
            return textNode;
          }
          var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
          var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
          var noTimeout = -1;
          function commitMount(domElement, type, newProps, internalInstanceHandle) {
            if (shouldAutoFocusHostComponent(type, newProps)) {
              domElement.focus();
            }
          }
          function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
            updateFiberProps(domElement, newProps);
            updateProperties(domElement, updatePayload, type, oldProps, newProps);
          }
          function resetTextContent(domElement) {
            setTextContent(domElement, "");
          }
          function commitTextUpdate(textInstance, oldText, newText) {
            textInstance.nodeValue = newText;
          }
          function appendChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function appendChildToContainer(container, child) {
            var parentNode;
            if (container.nodeType === COMMENT_NODE) {
              parentNode = container.parentNode;
              parentNode.insertBefore(child, container);
            } else {
              parentNode = container;
              parentNode.appendChild(child);
            }
            var reactRootContainer = container._reactRootContainer;
            if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
              trapClickOnNonInteractiveElement(parentNode);
            }
          }
          function insertBefore(parentInstance, child, beforeChild) {
            parentInstance.insertBefore(child, beforeChild);
          }
          function insertInContainerBefore(container, child, beforeChild) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.insertBefore(child, beforeChild);
            } else {
              container.insertBefore(child, beforeChild);
            }
          }
          function removeChild(parentInstance, child) {
            parentInstance.removeChild(child);
          }
          function removeChildFromContainer(container, child) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.removeChild(child);
            } else {
              container.removeChild(child);
            }
          }
          function hideInstance(instance) {
            instance = instance;
            var style2 = instance.style;
            if (typeof style2.setProperty === "function") {
              style2.setProperty("display", "none", "important");
            } else {
              style2.display = "none";
            }
          }
          function hideTextInstance(textInstance) {
            textInstance.nodeValue = "";
          }
          function unhideInstance(instance, props) {
            instance = instance;
            var styleProp = props[STYLE$1];
            var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
            instance.style.display = dangerousStyleValue("display", display);
          }
          function unhideTextInstance(textInstance, text) {
            textInstance.nodeValue = text;
          }
          function clearContainer(container) {
            if (container.nodeType === ELEMENT_NODE) {
              container.textContent = "";
            } else if (container.nodeType === DOCUMENT_NODE) {
              var body = container.body;
              if (body != null) {
                body.textContent = "";
              }
            }
          }
          function canHydrateInstance(instance, type, props) {
            if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
              return null;
            }
            return instance;
          }
          function canHydrateTextInstance(instance, text) {
            if (text === "" || instance.nodeType !== TEXT_NODE) {
              return null;
            }
            return instance;
          }
          function isSuspenseInstancePending(instance) {
            return instance.data === SUSPENSE_PENDING_START_DATA;
          }
          function isSuspenseInstanceFallback(instance) {
            return instance.data === SUSPENSE_FALLBACK_START_DATA;
          }
          function getNextHydratable(node) {
            for (; node != null; node = node.nextSibling) {
              var nodeType = node.nodeType;
              if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
                break;
              }
            }
            return node;
          }
          function getNextHydratableSibling(instance) {
            return getNextHydratable(instance.nextSibling);
          }
          function getFirstHydratableChild(parentInstance) {
            return getNextHydratable(parentInstance.firstChild);
          }
          function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
            precacheFiberNode(internalInstanceHandle, instance);
            updateFiberProps(instance, props);
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              parentNamespace = hostContextDev.namespace;
            }
            return diffHydratedProperties(instance, type, props, parentNamespace);
          }
          function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
            precacheFiberNode(internalInstanceHandle, textInstance);
            return diffHydratedText(textInstance, text);
          }
          function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
            var node = suspenseInstance.nextSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_END_DATA) {
                  if (depth === 0) {
                    return getNextHydratableSibling(node);
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  depth++;
                }
              }
              node = node.nextSibling;
            }
            return null;
          }
          function getParentSuspenseInstance(targetInstance) {
            var node = targetInstance.previousSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  if (depth === 0) {
                    return node;
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_END_DATA) {
                  depth++;
                }
              }
              node = node.previousSibling;
            }
            return null;
          }
          function commitHydratedContainer(container) {
            retryIfBlockedOn(container);
          }
          function commitHydratedSuspenseInstance(suspenseInstance) {
            retryIfBlockedOn(suspenseInstance);
          }
          function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
            {
              warnForUnmatchedText(textInstance, text);
            }
          }
          function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForUnmatchedText(textInstance, text);
            }
          }
          function didNotHydrateContainerInstance(parentContainer, instance) {
            {
              if (instance.nodeType === ELEMENT_NODE) {
                warnForDeletedHydratableElement(parentContainer, instance);
              } else if (instance.nodeType === COMMENT_NODE)
                ;
              else {
                warnForDeletedHydratableText(parentContainer, instance);
              }
            }
          }
          function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              if (instance.nodeType === ELEMENT_NODE) {
                warnForDeletedHydratableElement(parentInstance, instance);
              } else if (instance.nodeType === COMMENT_NODE)
                ;
              else {
                warnForDeletedHydratableText(parentInstance, instance);
              }
            }
          }
          function didNotFindHydratableContainerInstance(parentContainer, type, props) {
            {
              warnForInsertedHydratedElement(parentContainer, type);
            }
          }
          function didNotFindHydratableContainerTextInstance(parentContainer, text) {
            {
              warnForInsertedHydratedText(parentContainer, text);
            }
          }
          function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForInsertedHydratedElement(parentInstance, type);
            }
          }
          function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForInsertedHydratedText(parentInstance, text);
            }
          }
          function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true)
              ;
          }
          var clientId = 0;
          function makeClientIdInDEV(warnOnAccessInDEV) {
            var id = "r:" + (clientId++).toString(36);
            return {
              toString: function() {
                warnOnAccessInDEV();
                return id;
              },
              valueOf: function() {
                warnOnAccessInDEV();
                return id;
              }
            };
          }
          function isOpaqueHydratingObject(value) {
            return value !== null && typeof value === "object" && value.$$typeof === REACT_OPAQUE_ID_TYPE;
          }
          function makeOpaqueHydratingObject(attemptToReadValue) {
            return {
              $$typeof: REACT_OPAQUE_ID_TYPE,
              toString: attemptToReadValue,
              valueOf: attemptToReadValue
            };
          }
          function preparePortalMount(portalInstance) {
            {
              listenToAllSupportedEvents(portalInstance);
            }
          }
          var randomKey = Math.random().toString(36).slice(2);
          var internalInstanceKey = "__reactFiber$" + randomKey;
          var internalPropsKey = "__reactProps$" + randomKey;
          var internalContainerInstanceKey = "__reactContainer$" + randomKey;
          var internalEventHandlersKey = "__reactEvents$" + randomKey;
          function precacheFiberNode(hostInst, node) {
            node[internalInstanceKey] = hostInst;
          }
          function markContainerAsRoot(hostRoot, node) {
            node[internalContainerInstanceKey] = hostRoot;
          }
          function unmarkContainerAsRoot(node) {
            node[internalContainerInstanceKey] = null;
          }
          function isContainerMarkedAsRoot(node) {
            return !!node[internalContainerInstanceKey];
          }
          function getClosestInstanceFromNode(targetNode) {
            var targetInst = targetNode[internalInstanceKey];
            if (targetInst) {
              return targetInst;
            }
            var parentNode = targetNode.parentNode;
            while (parentNode) {
              targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
              if (targetInst) {
                var alternate = targetInst.alternate;
                if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
                  var suspenseInstance = getParentSuspenseInstance(targetNode);
                  while (suspenseInstance !== null) {
                    var targetSuspenseInst = suspenseInstance[internalInstanceKey];
                    if (targetSuspenseInst) {
                      return targetSuspenseInst;
                    }
                    suspenseInstance = getParentSuspenseInstance(suspenseInstance);
                  }
                }
                return targetInst;
              }
              targetNode = parentNode;
              parentNode = targetNode.parentNode;
            }
            return null;
          }
          function getInstanceFromNode(node) {
            var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
            if (inst) {
              if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
                return inst;
              } else {
                return null;
              }
            }
            return null;
          }
          function getNodeFromInstance(inst) {
            if (inst.tag === HostComponent || inst.tag === HostText) {
              return inst.stateNode;
            }
            {
              {
                throw Error("getNodeFromInstance: Invalid argument.");
              }
            }
          }
          function getFiberCurrentPropsFromNode(node) {
            return node[internalPropsKey] || null;
          }
          function updateFiberProps(node, props) {
            node[internalPropsKey] = props;
          }
          function getEventListenerSet(node) {
            var elementListenerSet = node[internalEventHandlersKey];
            if (elementListenerSet === void 0) {
              elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set();
            }
            return elementListenerSet;
          }
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has2 = Function.call.bind(Object.prototype.hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has2(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          var valueStack = [];
          var fiberStack;
          {
            fiberStack = [];
          }
          var index = -1;
          function createCursor(defaultValue) {
            return {
              current: defaultValue
            };
          }
          function pop(cursor, fiber) {
            if (index < 0) {
              {
                error("Unexpected pop.");
              }
              return;
            }
            {
              if (fiber !== fiberStack[index]) {
                error("Unexpected Fiber popped.");
              }
            }
            cursor.current = valueStack[index];
            valueStack[index] = null;
            {
              fiberStack[index] = null;
            }
            index--;
          }
          function push(cursor, value, fiber) {
            index++;
            valueStack[index] = cursor.current;
            {
              fiberStack[index] = fiber;
            }
            cursor.current = value;
          }
          var warnedAboutMissingGetChildContext;
          {
            warnedAboutMissingGetChildContext = {};
          }
          var emptyContextObject = {};
          {
            Object.freeze(emptyContextObject);
          }
          var contextStackCursor = createCursor(emptyContextObject);
          var didPerformWorkStackCursor = createCursor(false);
          var previousContext = emptyContextObject;
          function getUnmaskedContext(workInProgress2, Component50, didPushOwnContextIfProvider) {
            {
              if (didPushOwnContextIfProvider && isContextProvider(Component50)) {
                return previousContext;
              }
              return contextStackCursor.current;
            }
          }
          function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
            {
              var instance = workInProgress2.stateNode;
              instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
              instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
            }
          }
          function getMaskedContext(workInProgress2, unmaskedContext) {
            {
              var type = workInProgress2.type;
              var contextTypes = type.contextTypes;
              if (!contextTypes) {
                return emptyContextObject;
              }
              var instance = workInProgress2.stateNode;
              if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
                return instance.__reactInternalMemoizedMaskedChildContext;
              }
              var context = {};
              for (var key in contextTypes) {
                context[key] = unmaskedContext[key];
              }
              {
                var name2 = getComponentName(type) || "Unknown";
                checkPropTypes(contextTypes, context, "context", name2);
              }
              if (instance) {
                cacheContext(workInProgress2, unmaskedContext, context);
              }
              return context;
            }
          }
          function hasContextChanged() {
            {
              return didPerformWorkStackCursor.current;
            }
          }
          function isContextProvider(type) {
            {
              var childContextTypes = type.childContextTypes;
              return childContextTypes !== null && childContextTypes !== void 0;
            }
          }
          function popContext(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function popTopLevelContextObject(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function pushTopLevelContextObject(fiber, context, didChange) {
            {
              if (!(contextStackCursor.current === emptyContextObject)) {
                {
                  throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              push(contextStackCursor, context, fiber);
              push(didPerformWorkStackCursor, didChange, fiber);
            }
          }
          function processChildContext(fiber, type, parentContext) {
            {
              var instance = fiber.stateNode;
              var childContextTypes = type.childContextTypes;
              if (typeof instance.getChildContext !== "function") {
                {
                  var componentName = getComponentName(type) || "Unknown";
                  if (!warnedAboutMissingGetChildContext[componentName]) {
                    warnedAboutMissingGetChildContext[componentName] = true;
                    error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName);
                  }
                }
                return parentContext;
              }
              var childContext = instance.getChildContext();
              for (var contextKey in childContext) {
                if (!(contextKey in childContextTypes)) {
                  {
                    throw Error((getComponentName(type) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
                  }
                }
              }
              {
                var name2 = getComponentName(type) || "Unknown";
                checkPropTypes(childContextTypes, childContext, "child context", name2);
              }
              return _assign34({}, parentContext, childContext);
            }
          }
          function pushContextProvider(workInProgress2) {
            {
              var instance = workInProgress2.stateNode;
              var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
              previousContext = contextStackCursor.current;
              push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
              push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
              return true;
            }
          }
          function invalidateContextProvider(workInProgress2, type, didChange) {
            {
              var instance = workInProgress2.stateNode;
              if (!instance) {
                {
                  throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              if (didChange) {
                var mergedContext = processChildContext(workInProgress2, type, previousContext);
                instance.__reactInternalMemoizedMergedChildContext = mergedContext;
                pop(didPerformWorkStackCursor, workInProgress2);
                pop(contextStackCursor, workInProgress2);
                push(contextStackCursor, mergedContext, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              } else {
                pop(didPerformWorkStackCursor, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              }
            }
          }
          function findCurrentUnmaskedContext(fiber) {
            {
              if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
                {
                  throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              var node = fiber;
              do {
                switch (node.tag) {
                  case HostRoot:
                    return node.stateNode.context;
                  case ClassComponent: {
                    var Component50 = node.type;
                    if (isContextProvider(Component50)) {
                      return node.stateNode.__reactInternalMemoizedMergedChildContext;
                    }
                    break;
                  }
                }
                node = node.return;
              } while (node !== null);
              {
                {
                  throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
          }
          var LegacyRoot = 0;
          var BlockingRoot = 1;
          var ConcurrentRoot = 2;
          var rendererID = null;
          var injectedHook = null;
          var hasLoggedError = false;
          var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
          function injectInternals(internals) {
            if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
              return false;
            }
            var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
            if (hook.isDisabled) {
              return true;
            }
            if (!hook.supportsFiber) {
              {
                error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools");
              }
              return true;
            }
            try {
              rendererID = hook.inject(internals);
              injectedHook = hook;
            } catch (err) {
              {
                error("React instrumentation encountered an error: %s.", err);
              }
            }
            return true;
          }
          function onScheduleRoot(root2, children) {
            {
              if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
                try {
                  injectedHook.onScheduleFiberRoot(rendererID, root2, children);
                } catch (err) {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitRoot(root2, priorityLevel) {
            if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
              try {
                var didError = (root2.current.flags & DidCapture) === DidCapture;
                if (enableProfilerTimer) {
                  injectedHook.onCommitFiberRoot(rendererID, root2, priorityLevel, didError);
                } else {
                  injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
                }
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitUnmount(fiber) {
            if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
              try {
                injectedHook.onCommitFiberUnmount(rendererID, fiber);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority, Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback, Scheduler_cancelCallback = Scheduler.unstable_cancelCallback, Scheduler_shouldYield = Scheduler.unstable_shouldYield, Scheduler_requestPaint = Scheduler.unstable_requestPaint, Scheduler_now$1 = Scheduler.unstable_now, Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority, Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, Scheduler_NormalPriority = Scheduler.unstable_NormalPriority, Scheduler_LowPriority = Scheduler.unstable_LowPriority, Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
          {
            if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
              {
                throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling");
              }
            }
          }
          var fakeCallbackNode = {};
          var ImmediatePriority$1 = 99;
          var UserBlockingPriority$2 = 98;
          var NormalPriority$1 = 97;
          var LowPriority$1 = 96;
          var IdlePriority$1 = 95;
          var NoPriority$1 = 90;
          var shouldYield = Scheduler_shouldYield;
          var requestPaint = (
            // Fall back gracefully if we're running an older version of Scheduler.
            Scheduler_requestPaint !== void 0 ? Scheduler_requestPaint : function() {
            }
          );
          var syncQueue = null;
          var immediateQueueCallbackNode = null;
          var isFlushingSyncQueue = false;
          var initialTimeMs$1 = Scheduler_now$1();
          var now2 = initialTimeMs$1 < 1e4 ? Scheduler_now$1 : function() {
            return Scheduler_now$1() - initialTimeMs$1;
          };
          function getCurrentPriorityLevel() {
            switch (Scheduler_getCurrentPriorityLevel()) {
              case Scheduler_ImmediatePriority:
                return ImmediatePriority$1;
              case Scheduler_UserBlockingPriority:
                return UserBlockingPriority$2;
              case Scheduler_NormalPriority:
                return NormalPriority$1;
              case Scheduler_LowPriority:
                return LowPriority$1;
              case Scheduler_IdlePriority:
                return IdlePriority$1;
              default: {
                {
                  throw Error("Unknown priority level.");
                }
              }
            }
          }
          function reactPriorityToSchedulerPriority(reactPriorityLevel) {
            switch (reactPriorityLevel) {
              case ImmediatePriority$1:
                return Scheduler_ImmediatePriority;
              case UserBlockingPriority$2:
                return Scheduler_UserBlockingPriority;
              case NormalPriority$1:
                return Scheduler_NormalPriority;
              case LowPriority$1:
                return Scheduler_LowPriority;
              case IdlePriority$1:
                return Scheduler_IdlePriority;
              default: {
                {
                  throw Error("Unknown priority level.");
                }
              }
            }
          }
          function runWithPriority$1(reactPriorityLevel, fn) {
            var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
            return Scheduler_runWithPriority(priorityLevel, fn);
          }
          function scheduleCallback(reactPriorityLevel, callback, options5) {
            var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
            return Scheduler_scheduleCallback(priorityLevel, callback, options5);
          }
          function scheduleSyncCallback(callback) {
            if (syncQueue === null) {
              syncQueue = [callback];
              immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
            } else {
              syncQueue.push(callback);
            }
            return fakeCallbackNode;
          }
          function cancelCallback(callbackNode) {
            if (callbackNode !== fakeCallbackNode) {
              Scheduler_cancelCallback(callbackNode);
            }
          }
          function flushSyncCallbackQueue() {
            if (immediateQueueCallbackNode !== null) {
              var node = immediateQueueCallbackNode;
              immediateQueueCallbackNode = null;
              Scheduler_cancelCallback(node);
            }
            flushSyncCallbackQueueImpl();
          }
          function flushSyncCallbackQueueImpl() {
            if (!isFlushingSyncQueue && syncQueue !== null) {
              isFlushingSyncQueue = true;
              var i = 0;
              {
                try {
                  var _isSync2 = true;
                  var _queue = syncQueue;
                  runWithPriority$1(ImmediatePriority$1, function() {
                    for (; i < _queue.length; i++) {
                      var callback = _queue[i];
                      do {
                        callback = callback(_isSync2);
                      } while (callback !== null);
                    }
                  });
                  syncQueue = null;
                } catch (error2) {
                  if (syncQueue !== null) {
                    syncQueue = syncQueue.slice(i + 1);
                  }
                  Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
                  throw error2;
                } finally {
                  isFlushingSyncQueue = false;
                }
              }
            }
          }
          var ReactVersion = "17.0.2";
          var NoMode = 0;
          var StrictMode = 1;
          var BlockingMode = 2;
          var ConcurrentMode = 4;
          var ProfileMode = 8;
          var DebugTracingMode = 16;
          var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
          var NoTransition = 0;
          function requestCurrentTransition() {
            return ReactCurrentBatchConfig.transition;
          }
          var ReactStrictModeWarnings = {
            recordUnsafeLifecycleWarnings: function(fiber, instance) {
            },
            flushPendingUnsafeLifecycleWarnings: function() {
            },
            recordLegacyContextWarning: function(fiber, instance) {
            },
            flushLegacyContextWarning: function() {
            },
            discardPendingWarnings: function() {
            }
          };
          {
            var findStrictRoot = function(fiber) {
              var maybeStrictRoot = null;
              var node = fiber;
              while (node !== null) {
                if (node.mode & StrictMode) {
                  maybeStrictRoot = node;
                }
                node = node.return;
              }
              return maybeStrictRoot;
            };
            var setToSortedString = function(set2) {
              var array = [];
              set2.forEach(function(value) {
                array.push(value);
              });
              return array.sort().join(", ");
            };
            var pendingComponentWillMountWarnings = [];
            var pendingUNSAFE_ComponentWillMountWarnings = [];
            var pendingComponentWillReceivePropsWarnings = [];
            var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
            var pendingComponentWillUpdateWarnings = [];
            var pendingUNSAFE_ComponentWillUpdateWarnings = [];
            var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
              if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
                return;
              }
              if (typeof instance.componentWillMount === "function" && // Don't warn about react-lifecycles-compat polyfilled components.
              instance.componentWillMount.__suppressDeprecationWarning !== true) {
                pendingComponentWillMountWarnings.push(fiber);
              }
              if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === "function") {
                pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
              }
              if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                pendingComponentWillReceivePropsWarnings.push(fiber);
              }
              if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
              }
              if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                pendingComponentWillUpdateWarnings.push(fiber);
              }
              if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
                pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
              var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillMountWarnings.length > 0) {
                pendingComponentWillMountWarnings.forEach(function(fiber) {
                  componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillMountWarnings = [];
              }
              var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
                pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillMountWarnings = [];
              }
              var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillReceivePropsWarnings.length > 0) {
                pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillReceivePropsWarnings = [];
              }
              var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              }
              var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillUpdateWarnings.length > 0) {
                pendingComponentWillUpdateWarnings.forEach(function(fiber) {
                  componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillUpdateWarnings = [];
              }
              var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
                pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillUpdateWarnings = [];
              }
              if (UNSAFE_componentWillMountUniqueNames.size > 0) {
                var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
                error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", sortedNames);
              }
              if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
                error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", _sortedNames);
              }
              if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
                error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", _sortedNames2);
              }
              if (componentWillMountUniqueNames.size > 0) {
                var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
                warn2("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames3);
              }
              if (componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
                warn2("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames4);
              }
              if (componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
                warn2("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames5);
              }
            };
            var pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            var didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
              var strictRoot = findStrictRoot(fiber);
              if (strictRoot === null) {
                error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
                return;
              }
              if (didWarnAboutLegacyContext.has(fiber.type)) {
                return;
              }
              var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
              if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
                if (warningsForRoot === void 0) {
                  warningsForRoot = [];
                  pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
                }
                warningsForRoot.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushLegacyContextWarning = function() {
              pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
                if (fiberArray.length === 0) {
                  return;
                }
                var firstFiber = fiberArray[0];
                var uniqueNames = /* @__PURE__ */ new Set();
                fiberArray.forEach(function(fiber) {
                  uniqueNames.add(getComponentName(fiber.type) || "Component");
                  didWarnAboutLegacyContext.add(fiber.type);
                });
                var sortedNames = setToSortedString(uniqueNames);
                try {
                  setCurrentFiber(firstFiber);
                  error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames);
                } finally {
                  resetCurrentFiber();
                }
              });
            };
            ReactStrictModeWarnings.discardPendingWarnings = function() {
              pendingComponentWillMountWarnings = [];
              pendingUNSAFE_ComponentWillMountWarnings = [];
              pendingComponentWillReceivePropsWarnings = [];
              pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              pendingComponentWillUpdateWarnings = [];
              pendingUNSAFE_ComponentWillUpdateWarnings = [];
              pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            };
          }
          function resolveDefaultProps(Component50, baseProps4) {
            if (Component50 && Component50.defaultProps) {
              var props = _assign34({}, baseProps4);
              var defaultProps = Component50.defaultProps;
              for (var propName in defaultProps) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps[propName];
                }
              }
              return props;
            }
            return baseProps4;
          }
          var MAX_SIGNED_31_BIT_INT = 1073741823;
          var valueCursor = createCursor(null);
          var rendererSigil;
          {
            rendererSigil = {};
          }
          var currentlyRenderingFiber = null;
          var lastContextDependency = null;
          var lastContextWithAllBitsObserved = null;
          var isDisallowedContextReadInDEV = false;
          function resetContextDependencies() {
            currentlyRenderingFiber = null;
            lastContextDependency = null;
            lastContextWithAllBitsObserved = null;
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function enterDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = true;
            }
          }
          function exitDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function pushProvider(providerFiber, nextValue) {
            var context = providerFiber.type._context;
            {
              push(valueCursor, context._currentValue, providerFiber);
              context._currentValue = nextValue;
              {
                if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
                  error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
                }
                context._currentRenderer = rendererSigil;
              }
            }
          }
          function popProvider(providerFiber) {
            var currentValue = valueCursor.current;
            pop(valueCursor, providerFiber);
            var context = providerFiber.type._context;
            {
              context._currentValue = currentValue;
            }
          }
          function calculateChangedBits(context, newValue, oldValue) {
            if (objectIs(oldValue, newValue)) {
              return 0;
            } else {
              var changedBits = typeof context._calculateChangedBits === "function" ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
              {
                if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
                  error("calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s", changedBits);
                }
              }
              return changedBits | 0;
            }
          }
          function scheduleWorkOnParentPath(parent, renderLanes2) {
            var node = parent;
            while (node !== null) {
              var alternate = node.alternate;
              if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
                node.childLanes = mergeLanes(node.childLanes, renderLanes2);
                if (alternate !== null) {
                  alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
                }
              } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
                alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
              } else {
                break;
              }
              node = node.return;
            }
          }
          function propagateContextChange(workInProgress2, context, changedBits, renderLanes2) {
            var fiber = workInProgress2.child;
            if (fiber !== null) {
              fiber.return = workInProgress2;
            }
            while (fiber !== null) {
              var nextFiber = void 0;
              var list = fiber.dependencies;
              if (list !== null) {
                nextFiber = fiber.child;
                var dependency = list.firstContext;
                while (dependency !== null) {
                  if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
                    if (fiber.tag === ClassComponent) {
                      var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes2));
                      update.tag = ForceUpdate;
                      enqueueUpdate(fiber, update);
                    }
                    fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
                    var alternate = fiber.alternate;
                    if (alternate !== null) {
                      alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
                    }
                    scheduleWorkOnParentPath(fiber.return, renderLanes2);
                    list.lanes = mergeLanes(list.lanes, renderLanes2);
                    break;
                  }
                  dependency = dependency.next;
                }
              } else if (fiber.tag === ContextProvider) {
                nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
              } else {
                nextFiber = fiber.child;
              }
              if (nextFiber !== null) {
                nextFiber.return = fiber;
              } else {
                nextFiber = fiber;
                while (nextFiber !== null) {
                  if (nextFiber === workInProgress2) {
                    nextFiber = null;
                    break;
                  }
                  var sibling = nextFiber.sibling;
                  if (sibling !== null) {
                    sibling.return = nextFiber.return;
                    nextFiber = sibling;
                    break;
                  }
                  nextFiber = nextFiber.return;
                }
              }
              fiber = nextFiber;
            }
          }
          function prepareToReadContext(workInProgress2, renderLanes2) {
            currentlyRenderingFiber = workInProgress2;
            lastContextDependency = null;
            lastContextWithAllBitsObserved = null;
            var dependencies = workInProgress2.dependencies;
            if (dependencies !== null) {
              var firstContext = dependencies.firstContext;
              if (firstContext !== null) {
                if (includesSomeLane(dependencies.lanes, renderLanes2)) {
                  markWorkInProgressReceivedUpdate();
                }
                dependencies.firstContext = null;
              }
            }
          }
          function readContext(context, observedBits) {
            {
              if (isDisallowedContextReadInDEV) {
                error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
              }
            }
            if (lastContextWithAllBitsObserved === context)
              ;
            else if (observedBits === false || observedBits === 0)
              ;
            else {
              var resolvedObservedBits;
              if (typeof observedBits !== "number" || observedBits === MAX_SIGNED_31_BIT_INT) {
                lastContextWithAllBitsObserved = context;
                resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
              } else {
                resolvedObservedBits = observedBits;
              }
              var contextItem = {
                context,
                observedBits: resolvedObservedBits,
                next: null
              };
              if (lastContextDependency === null) {
                if (!(currentlyRenderingFiber !== null)) {
                  {
                    throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
                  }
                }
                lastContextDependency = contextItem;
                currentlyRenderingFiber.dependencies = {
                  lanes: NoLanes,
                  firstContext: contextItem,
                  responders: null
                };
              } else {
                lastContextDependency = lastContextDependency.next = contextItem;
              }
            }
            return context._currentValue;
          }
          var UpdateState = 0;
          var ReplaceState = 1;
          var ForceUpdate = 2;
          var CaptureUpdate = 3;
          var hasForceUpdate = false;
          var didWarnUpdateInsideUpdate;
          var currentlyProcessingQueue;
          {
            didWarnUpdateInsideUpdate = false;
            currentlyProcessingQueue = null;
          }
          function initializeUpdateQueue(fiber) {
            var queue = {
              baseState: fiber.memoizedState,
              firstBaseUpdate: null,
              lastBaseUpdate: null,
              shared: {
                pending: null
              },
              effects: null
            };
            fiber.updateQueue = queue;
          }
          function cloneUpdateQueue(current2, workInProgress2) {
            var queue = workInProgress2.updateQueue;
            var currentQueue = current2.updateQueue;
            if (queue === currentQueue) {
              var clone = {
                baseState: currentQueue.baseState,
                firstBaseUpdate: currentQueue.firstBaseUpdate,
                lastBaseUpdate: currentQueue.lastBaseUpdate,
                shared: currentQueue.shared,
                effects: currentQueue.effects
              };
              workInProgress2.updateQueue = clone;
            }
          }
          function createUpdate(eventTime, lane) {
            var update = {
              eventTime,
              lane,
              tag: UpdateState,
              payload: null,
              callback: null,
              next: null
            };
            return update;
          }
          function enqueueUpdate(fiber, update) {
            var updateQueue = fiber.updateQueue;
            if (updateQueue === null) {
              return;
            }
            var sharedQueue = updateQueue.shared;
            var pending = sharedQueue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            sharedQueue.pending = update;
            {
              if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
                error("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.");
                didWarnUpdateInsideUpdate = true;
              }
            }
          }
          function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
            var queue = workInProgress2.updateQueue;
            var current2 = workInProgress2.alternate;
            if (current2 !== null) {
              var currentQueue = current2.updateQueue;
              if (queue === currentQueue) {
                var newFirst = null;
                var newLast = null;
                var firstBaseUpdate = queue.firstBaseUpdate;
                if (firstBaseUpdate !== null) {
                  var update = firstBaseUpdate;
                  do {
                    var clone = {
                      eventTime: update.eventTime,
                      lane: update.lane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    if (newLast === null) {
                      newFirst = newLast = clone;
                    } else {
                      newLast.next = clone;
                      newLast = clone;
                    }
                    update = update.next;
                  } while (update !== null);
                  if (newLast === null) {
                    newFirst = newLast = capturedUpdate;
                  } else {
                    newLast.next = capturedUpdate;
                    newLast = capturedUpdate;
                  }
                } else {
                  newFirst = newLast = capturedUpdate;
                }
                queue = {
                  baseState: currentQueue.baseState,
                  firstBaseUpdate: newFirst,
                  lastBaseUpdate: newLast,
                  shared: currentQueue.shared,
                  effects: currentQueue.effects
                };
                workInProgress2.updateQueue = queue;
                return;
              }
            }
            var lastBaseUpdate = queue.lastBaseUpdate;
            if (lastBaseUpdate === null) {
              queue.firstBaseUpdate = capturedUpdate;
            } else {
              lastBaseUpdate.next = capturedUpdate;
            }
            queue.lastBaseUpdate = capturedUpdate;
          }
          function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
            switch (update.tag) {
              case ReplaceState: {
                var payload = update.payload;
                if (typeof payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  var nextState = payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictMode) {
                      disableLogs();
                      try {
                        payload.call(instance, prevState, nextProps);
                      } finally {
                        reenableLogs();
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                  return nextState;
                }
                return payload;
              }
              case CaptureUpdate: {
                workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
              }
              case UpdateState: {
                var _payload = update.payload;
                var partialState;
                if (typeof _payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  partialState = _payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictMode) {
                      disableLogs();
                      try {
                        _payload.call(instance, prevState, nextProps);
                      } finally {
                        reenableLogs();
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                } else {
                  partialState = _payload;
                }
                if (partialState === null || partialState === void 0) {
                  return prevState;
                }
                return _assign34({}, prevState, partialState);
              }
              case ForceUpdate: {
                hasForceUpdate = true;
                return prevState;
              }
            }
            return prevState;
          }
          function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
            var queue = workInProgress2.updateQueue;
            hasForceUpdate = false;
            {
              currentlyProcessingQueue = queue.shared;
            }
            var firstBaseUpdate = queue.firstBaseUpdate;
            var lastBaseUpdate = queue.lastBaseUpdate;
            var pendingQueue = queue.shared.pending;
            if (pendingQueue !== null) {
              queue.shared.pending = null;
              var lastPendingUpdate = pendingQueue;
              var firstPendingUpdate = lastPendingUpdate.next;
              lastPendingUpdate.next = null;
              if (lastBaseUpdate === null) {
                firstBaseUpdate = firstPendingUpdate;
              } else {
                lastBaseUpdate.next = firstPendingUpdate;
              }
              lastBaseUpdate = lastPendingUpdate;
              var current2 = workInProgress2.alternate;
              if (current2 !== null) {
                var currentQueue = current2.updateQueue;
                var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
                if (currentLastBaseUpdate !== lastBaseUpdate) {
                  if (currentLastBaseUpdate === null) {
                    currentQueue.firstBaseUpdate = firstPendingUpdate;
                  } else {
                    currentLastBaseUpdate.next = firstPendingUpdate;
                  }
                  currentQueue.lastBaseUpdate = lastPendingUpdate;
                }
              }
            }
            if (firstBaseUpdate !== null) {
              var newState = queue.baseState;
              var newLanes = NoLanes;
              var newBaseState = null;
              var newFirstBaseUpdate = null;
              var newLastBaseUpdate = null;
              var update = firstBaseUpdate;
              do {
                var updateLane = update.lane;
                var updateEventTime = update.eventTime;
                if (!isSubsetOfLanes(renderLanes2, updateLane)) {
                  var clone = {
                    eventTime: updateEventTime,
                    lane: updateLane,
                    tag: update.tag,
                    payload: update.payload,
                    callback: update.callback,
                    next: null
                  };
                  if (newLastBaseUpdate === null) {
                    newFirstBaseUpdate = newLastBaseUpdate = clone;
                    newBaseState = newState;
                  } else {
                    newLastBaseUpdate = newLastBaseUpdate.next = clone;
                  }
                  newLanes = mergeLanes(newLanes, updateLane);
                } else {
                  if (newLastBaseUpdate !== null) {
                    var _clone = {
                      eventTime: updateEventTime,
                      // This update is going to be committed so we never want uncommit
                      // it. Using NoLane works because 0 is a subset of all bitmasks, so
                      // this will never be skipped by the check above.
                      lane: NoLane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    newLastBaseUpdate = newLastBaseUpdate.next = _clone;
                  }
                  newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
                  var callback = update.callback;
                  if (callback !== null) {
                    workInProgress2.flags |= Callback;
                    var effects = queue.effects;
                    if (effects === null) {
                      queue.effects = [update];
                    } else {
                      effects.push(update);
                    }
                  }
                }
                update = update.next;
                if (update === null) {
                  pendingQueue = queue.shared.pending;
                  if (pendingQueue === null) {
                    break;
                  } else {
                    var _lastPendingUpdate = pendingQueue;
                    var _firstPendingUpdate = _lastPendingUpdate.next;
                    _lastPendingUpdate.next = null;
                    update = _firstPendingUpdate;
                    queue.lastBaseUpdate = _lastPendingUpdate;
                    queue.shared.pending = null;
                  }
                }
              } while (true);
              if (newLastBaseUpdate === null) {
                newBaseState = newState;
              }
              queue.baseState = newBaseState;
              queue.firstBaseUpdate = newFirstBaseUpdate;
              queue.lastBaseUpdate = newLastBaseUpdate;
              markSkippedUpdateLanes(newLanes);
              workInProgress2.lanes = newLanes;
              workInProgress2.memoizedState = newState;
            }
            {
              currentlyProcessingQueue = null;
            }
          }
          function callCallback(callback, context) {
            if (!(typeof callback === "function")) {
              {
                throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback);
              }
            }
            callback.call(context);
          }
          function resetHasForceUpdateBeforeProcessing() {
            hasForceUpdate = false;
          }
          function checkHasForceUpdateAfterProcessing() {
            return hasForceUpdate;
          }
          function commitUpdateQueue(finishedWork, finishedQueue, instance) {
            var effects = finishedQueue.effects;
            finishedQueue.effects = null;
            if (effects !== null) {
              for (var i = 0; i < effects.length; i++) {
                var effect4 = effects[i];
                var callback = effect4.callback;
                if (callback !== null) {
                  effect4.callback = null;
                  callCallback(callback, instance);
                }
              }
            }
          }
          var fakeInternalInstance = {};
          var isArray = Array.isArray;
          var emptyRefsObject = new React395.Component().refs;
          var didWarnAboutStateAssignmentForComponent;
          var didWarnAboutUninitializedState;
          var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
          var didWarnAboutLegacyLifecyclesAndDerivedState;
          var didWarnAboutUndefinedDerivedState;
          var warnOnUndefinedDerivedState;
          var warnOnInvalidCallback;
          var didWarnAboutDirectlyAssigningPropsToState;
          var didWarnAboutContextTypeAndContextTypes;
          var didWarnAboutInvalidateContextType;
          {
            didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
            didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
            didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
            didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
            didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set();
            didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
            var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
            warnOnInvalidCallback = function(callback, callerName) {
              if (callback === null || typeof callback === "function") {
                return;
              }
              var key = callerName + "_" + callback;
              if (!didWarnOnInvalidCallback.has(key)) {
                didWarnOnInvalidCallback.add(key);
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            };
            warnOnUndefinedDerivedState = function(type, partialState) {
              if (partialState === void 0) {
                var componentName = getComponentName(type) || "Component";
                if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
                  didWarnAboutUndefinedDerivedState.add(componentName);
                  error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
                }
              }
            };
            Object.defineProperty(fakeInternalInstance, "_processChildContext", {
              enumerable: false,
              value: function() {
                {
                  {
                    throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
                  }
                }
              }
            });
            Object.freeze(fakeInternalInstance);
          }
          function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
            var prevState = workInProgress2.memoizedState;
            {
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  getDerivedStateFromProps(nextProps, prevState);
                } finally {
                  reenableLogs();
                }
              }
            }
            var partialState = getDerivedStateFromProps(nextProps, prevState);
            {
              warnOnUndefinedDerivedState(ctor, partialState);
            }
            var memoizedState = partialState === null || partialState === void 0 ? prevState : _assign34({}, prevState, partialState);
            workInProgress2.memoizedState = memoizedState;
            if (workInProgress2.lanes === NoLanes) {
              var updateQueue = workInProgress2.updateQueue;
              updateQueue.baseState = memoizedState;
            }
          }
          var classComponentUpdater = {
            isMounted,
            enqueueSetState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "setState");
                }
                update.callback = callback;
              }
              enqueueUpdate(fiber, update);
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            },
            enqueueReplaceState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ReplaceState;
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "replaceState");
                }
                update.callback = callback;
              }
              enqueueUpdate(fiber, update);
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            },
            enqueueForceUpdate: function(inst, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ForceUpdate;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "forceUpdate");
                }
                update.callback = callback;
              }
              enqueueUpdate(fiber, update);
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            }
          };
          function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
            var instance = workInProgress2.stateNode;
            if (typeof instance.shouldComponentUpdate === "function") {
              {
                if (workInProgress2.mode & StrictMode) {
                  disableLogs();
                  try {
                    instance.shouldComponentUpdate(newProps, newState, nextContext);
                  } finally {
                    reenableLogs();
                  }
                }
              }
              var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
              {
                if (shouldUpdate === void 0) {
                  error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentName(ctor) || "Component");
                }
              }
              return shouldUpdate;
            }
            if (ctor.prototype && ctor.prototype.isPureReactComponent) {
              return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
            }
            return true;
          }
          function checkClassInstance(workInProgress2, ctor, newProps) {
            var instance = workInProgress2.stateNode;
            {
              var name2 = getComponentName(ctor) || "Component";
              var renderPresent = instance.render;
              if (!renderPresent) {
                if (ctor.prototype && typeof ctor.prototype.render === "function") {
                  error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name2);
                } else {
                  error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name2);
                }
              }
              if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
                error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name2);
              }
              if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name2);
              }
              if (instance.propTypes) {
                error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name2);
              }
              if (instance.contextType) {
                error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name2);
              }
              {
                if (instance.contextTypes) {
                  error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name2);
                }
                if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
                  didWarnAboutContextTypeAndContextTypes.add(ctor);
                  error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name2);
                }
              }
              if (typeof instance.componentShouldUpdate === "function") {
                error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name2);
              }
              if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
                error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentName(ctor) || "A pure component");
              }
              if (typeof instance.componentDidUnmount === "function") {
                error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name2);
              }
              if (typeof instance.componentDidReceiveProps === "function") {
                error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name2);
              }
              if (typeof instance.componentWillRecieveProps === "function") {
                error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name2);
              }
              if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
                error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name2);
              }
              var hasMutatedProps = instance.props !== newProps;
              if (instance.props !== void 0 && hasMutatedProps) {
                error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name2, name2);
              }
              if (instance.defaultProps) {
                error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name2, name2);
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
                didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
                error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentName(ctor));
              }
              if (typeof instance.getDerivedStateFromProps === "function") {
                error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name2);
              }
              if (typeof instance.getDerivedStateFromError === "function") {
                error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name2);
              }
              if (typeof ctor.getSnapshotBeforeUpdate === "function") {
                error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name2);
              }
              var _state = instance.state;
              if (_state && (typeof _state !== "object" || isArray(_state))) {
                error("%s.state: must be set to an object or null", name2);
              }
              if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
                error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name2);
              }
            }
          }
          function adoptClassInstance(workInProgress2, instance) {
            instance.updater = classComponentUpdater;
            workInProgress2.stateNode = instance;
            set(instance, workInProgress2);
            {
              instance._reactInternalInstance = fakeInternalInstance;
            }
          }
          function constructClassInstance(workInProgress2, ctor, props) {
            var isLegacyContextConsumer = false;
            var unmaskedContext = emptyContextObject;
            var context = emptyContextObject;
            var contextType = ctor.contextType;
            {
              if ("contextType" in ctor) {
                var isValid = (
                  // Allow null for conditional declaration
                  contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0
                );
                if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
                  didWarnAboutInvalidateContextType.add(ctor);
                  var addendum = "";
                  if (contextType === void 0) {
                    addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";
                  } else if (typeof contextType !== "object") {
                    addendum = " However, it is set to a " + typeof contextType + ".";
                  } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
                    addendum = " Did you accidentally pass the Context.Provider instead?";
                  } else if (contextType._context !== void 0) {
                    addendum = " Did you accidentally pass the Context.Consumer instead?";
                  } else {
                    addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
                  }
                  error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentName(ctor) || "Component", addendum);
                }
              }
            }
            if (typeof contextType === "object" && contextType !== null) {
              context = readContext(contextType);
            } else {
              unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              var contextTypes = ctor.contextTypes;
              isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
              context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
            }
            {
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  new ctor(props, context);
                } finally {
                  reenableLogs();
                }
              }
            }
            var instance = new ctor(props, context);
            var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
            adoptClassInstance(workInProgress2, instance);
            {
              if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
                var componentName = getComponentName(ctor) || "Component";
                if (!didWarnAboutUninitializedState.has(componentName)) {
                  didWarnAboutUninitializedState.add(componentName);
                  error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName);
                }
              }
              if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
                var foundWillMountName = null;
                var foundWillReceivePropsName = null;
                var foundWillUpdateName = null;
                if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
                  foundWillMountName = "componentWillMount";
                } else if (typeof instance.UNSAFE_componentWillMount === "function") {
                  foundWillMountName = "UNSAFE_componentWillMount";
                }
                if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                  foundWillReceivePropsName = "componentWillReceiveProps";
                } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                  foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
                }
                if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                  foundWillUpdateName = "componentWillUpdate";
                } else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  foundWillUpdateName = "UNSAFE_componentWillUpdate";
                }
                if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
                  var _componentName = getComponentName(ctor) || "Component";
                  var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
                  if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
                    didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
                    error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n  " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : "");
                  }
                }
              }
            }
            if (isLegacyContextConsumer) {
              cacheContext(workInProgress2, unmaskedContext, context);
            }
            return instance;
          }
          function callComponentWillMount(workInProgress2, instance) {
            var oldState = instance.state;
            if (typeof instance.componentWillMount === "function") {
              instance.componentWillMount();
            }
            if (typeof instance.UNSAFE_componentWillMount === "function") {
              instance.UNSAFE_componentWillMount();
            }
            if (oldState !== instance.state) {
              {
                error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentName(workInProgress2.type) || "Component");
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
            var oldState = instance.state;
            if (typeof instance.componentWillReceiveProps === "function") {
              instance.componentWillReceiveProps(newProps, nextContext);
            }
            if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
              instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
            }
            if (instance.state !== oldState) {
              {
                var componentName = getComponentName(workInProgress2.type) || "Component";
                if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
                  didWarnAboutStateAssignmentForComponent.add(componentName);
                  error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
                }
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            {
              checkClassInstance(workInProgress2, ctor, newProps);
            }
            var instance = workInProgress2.stateNode;
            instance.props = newProps;
            instance.state = workInProgress2.memoizedState;
            instance.refs = emptyRefsObject;
            initializeUpdateQueue(workInProgress2);
            var contextType = ctor.contextType;
            if (typeof contextType === "object" && contextType !== null) {
              instance.context = readContext(contextType);
            } else {
              var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              instance.context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            {
              if (instance.state === newProps) {
                var componentName = getComponentName(ctor) || "Component";
                if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
                  didWarnAboutDirectlyAssigningPropsToState.add(componentName);
                  error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName);
                }
              }
              if (workInProgress2.mode & StrictMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
              }
              {
                ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
              }
            }
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            instance.state = workInProgress2.memoizedState;
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
              callComponentWillMount(workInProgress2, instance);
              processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof instance.componentDidMount === "function") {
              workInProgress2.flags |= Update;
            }
          }
          function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            var oldProps = workInProgress2.memoizedProps;
            instance.props = oldProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (oldProps !== newProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
              if (typeof instance.componentDidMount === "function") {
                workInProgress2.flags |= Update;
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
                if (typeof instance.componentWillMount === "function") {
                  instance.componentWillMount();
                }
                if (typeof instance.UNSAFE_componentWillMount === "function") {
                  instance.UNSAFE_componentWillMount();
                }
              }
              if (typeof instance.componentDidMount === "function") {
                workInProgress2.flags |= Update;
              }
            } else {
              if (typeof instance.componentDidMount === "function") {
                workInProgress2.flags |= Update;
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            cloneUpdateQueue(current2, workInProgress2);
            var unresolvedOldProps = workInProgress2.memoizedProps;
            var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
            instance.props = oldProps;
            var unresolvedNewProps = workInProgress2.pendingProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
                if (typeof instance.componentWillUpdate === "function") {
                  instance.componentWillUpdate(newProps, newState, nextContext);
                }
                if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
                }
              }
              if (typeof instance.componentDidUpdate === "function") {
                workInProgress2.flags |= Update;
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                workInProgress2.flags |= Snapshot;
              }
            } else {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          var didWarnAboutMaps;
          var didWarnAboutGenerators;
          var didWarnAboutStringRefs;
          var ownerHasKeyUseWarning;
          var ownerHasFunctionTypeWarning;
          var warnForMissingKey = function(child, returnFiber) {
          };
          {
            didWarnAboutMaps = false;
            didWarnAboutGenerators = false;
            didWarnAboutStringRefs = {};
            ownerHasKeyUseWarning = {};
            ownerHasFunctionTypeWarning = {};
            warnForMissingKey = function(child, returnFiber) {
              if (child === null || typeof child !== "object") {
                return;
              }
              if (!child._store || child._store.validated || child.key != null) {
                return;
              }
              if (!(typeof child._store === "object")) {
                {
                  throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              child._store.validated = true;
              var componentName = getComponentName(returnFiber.type) || "Component";
              if (ownerHasKeyUseWarning[componentName]) {
                return;
              }
              ownerHasKeyUseWarning[componentName] = true;
              error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
            };
          }
          var isArray$1 = Array.isArray;
          function coerceRef(returnFiber, current2, element) {
            var mixedRef = element.ref;
            if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
              {
                if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
                // because these cannot be automatically converted to an arrow function
                // using a codemod. Therefore, we don't have to warn about string refs again.
                !(element._owner && element._self && element._owner.stateNode !== element._self)) {
                  var componentName = getComponentName(returnFiber.type) || "Component";
                  if (!didWarnAboutStringRefs[componentName]) {
                    {
                      error('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', mixedRef);
                    }
                    didWarnAboutStringRefs[componentName] = true;
                  }
                }
              }
              if (element._owner) {
                var owner = element._owner;
                var inst;
                if (owner) {
                  var ownerFiber = owner;
                  if (!(ownerFiber.tag === ClassComponent)) {
                    {
                      throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
                    }
                  }
                  inst = ownerFiber.stateNode;
                }
                if (!inst) {
                  {
                    throw Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
                  }
                }
                var stringRef = "" + mixedRef;
                if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
                  return current2.ref;
                }
                var ref = function(value) {
                  var refs = inst.refs;
                  if (refs === emptyRefsObject) {
                    refs = inst.refs = {};
                  }
                  if (value === null) {
                    delete refs[stringRef];
                  } else {
                    refs[stringRef] = value;
                  }
                };
                ref._stringRef = stringRef;
                return ref;
              } else {
                if (!(typeof mixedRef === "string")) {
                  {
                    throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
                  }
                }
                if (!element._owner) {
                  {
                    throw Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.");
                  }
                }
              }
            }
            return mixedRef;
          }
          function throwOnInvalidObjectType(returnFiber, newChild) {
            if (returnFiber.type !== "textarea") {
              {
                {
                  throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : newChild) + "). If you meant to render a collection of children, use an array instead.");
                }
              }
            }
          }
          function warnOnFunctionType(returnFiber) {
            {
              var componentName = getComponentName(returnFiber.type) || "Component";
              if (ownerHasFunctionTypeWarning[componentName]) {
                return;
              }
              ownerHasFunctionTypeWarning[componentName] = true;
              error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
            }
          }
          function ChildReconciler(shouldTrackSideEffects) {
            function deleteChild(returnFiber, childToDelete) {
              if (!shouldTrackSideEffects) {
                return;
              }
              var last = returnFiber.lastEffect;
              if (last !== null) {
                last.nextEffect = childToDelete;
                returnFiber.lastEffect = childToDelete;
              } else {
                returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
              }
              childToDelete.nextEffect = null;
              childToDelete.flags = Deletion;
            }
            function deleteRemainingChildren(returnFiber, currentFirstChild) {
              if (!shouldTrackSideEffects) {
                return null;
              }
              var childToDelete = currentFirstChild;
              while (childToDelete !== null) {
                deleteChild(returnFiber, childToDelete);
                childToDelete = childToDelete.sibling;
              }
              return null;
            }
            function mapRemainingChildren(returnFiber, currentFirstChild) {
              var existingChildren = /* @__PURE__ */ new Map();
              var existingChild = currentFirstChild;
              while (existingChild !== null) {
                if (existingChild.key !== null) {
                  existingChildren.set(existingChild.key, existingChild);
                } else {
                  existingChildren.set(existingChild.index, existingChild);
                }
                existingChild = existingChild.sibling;
              }
              return existingChildren;
            }
            function useFiber(fiber, pendingProps) {
              var clone = createWorkInProgress(fiber, pendingProps);
              clone.index = 0;
              clone.sibling = null;
              return clone;
            }
            function placeChild(newFiber, lastPlacedIndex, newIndex) {
              newFiber.index = newIndex;
              if (!shouldTrackSideEffects) {
                return lastPlacedIndex;
              }
              var current2 = newFiber.alternate;
              if (current2 !== null) {
                var oldIndex = current2.index;
                if (oldIndex < lastPlacedIndex) {
                  newFiber.flags = Placement;
                  return lastPlacedIndex;
                } else {
                  return oldIndex;
                }
              } else {
                newFiber.flags = Placement;
                return lastPlacedIndex;
              }
            }
            function placeSingleChild(newFiber) {
              if (shouldTrackSideEffects && newFiber.alternate === null) {
                newFiber.flags = Placement;
              }
              return newFiber;
            }
            function updateTextNode(returnFiber, current2, textContent, lanes) {
              if (current2 === null || current2.tag !== HostText) {
                var created = createFiberFromText(textContent, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, textContent);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateElement(returnFiber, current2, element, lanes) {
              if (current2 !== null) {
                if (current2.elementType === element.type || // Keep this check inline so it only runs on the false path:
                isCompatibleFamilyForHotReloading(current2, element)) {
                  var existing = useFiber(current2, element.props);
                  existing.ref = coerceRef(returnFiber, current2, element);
                  existing.return = returnFiber;
                  {
                    existing._debugSource = element._source;
                    existing._debugOwner = element._owner;
                  }
                  return existing;
                }
              }
              var created = createFiberFromElement(element, returnFiber.mode, lanes);
              created.ref = coerceRef(returnFiber, current2, element);
              created.return = returnFiber;
              return created;
            }
            function updatePortal(returnFiber, current2, portal, lanes) {
              if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
                var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, portal.children || []);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateFragment2(returnFiber, current2, fragment, lanes, key) {
              if (current2 === null || current2.tag !== Fragment38) {
                var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, fragment);
                existing.return = returnFiber;
                return existing;
              }
            }
            function createChild(returnFiber, newChild, lanes) {
              if (typeof newChild === "string" || typeof newChild === "number") {
                var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
                    _created.ref = coerceRef(returnFiber, null, newChild);
                    _created.return = returnFiber;
                    return _created;
                  }
                  case REACT_PORTAL_TYPE: {
                    var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
                    _created2.return = returnFiber;
                    return _created2;
                  }
                }
                if (isArray$1(newChild) || getIteratorFn(newChild)) {
                  var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
                  _created3.return = returnFiber;
                  return _created3;
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateSlot(returnFiber, oldFiber, newChild, lanes) {
              var key = oldFiber !== null ? oldFiber.key : null;
              if (typeof newChild === "string" || typeof newChild === "number") {
                if (key !== null) {
                  return null;
                }
                return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    if (newChild.key === key) {
                      if (newChild.type === REACT_FRAGMENT_TYPE) {
                        return updateFragment2(returnFiber, oldFiber, newChild.props.children, lanes, key);
                      }
                      return updateElement(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                  case REACT_PORTAL_TYPE: {
                    if (newChild.key === key) {
                      return updatePortal(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                }
                if (isArray$1(newChild) || getIteratorFn(newChild)) {
                  if (key !== null) {
                    return null;
                  }
                  return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
              if (typeof newChild === "string" || typeof newChild === "number") {
                var matchedFiber = existingChildren.get(newIdx) || null;
                return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    if (newChild.type === REACT_FRAGMENT_TYPE) {
                      return updateFragment2(returnFiber, _matchedFiber, newChild.props.children, lanes, newChild.key);
                    }
                    return updateElement(returnFiber, _matchedFiber, newChild, lanes);
                  }
                  case REACT_PORTAL_TYPE: {
                    var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
                  }
                }
                if (isArray$1(newChild) || getIteratorFn(newChild)) {
                  var _matchedFiber3 = existingChildren.get(newIdx) || null;
                  return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function warnOnInvalidKey(child, knownKeys, returnFiber) {
              {
                if (typeof child !== "object" || child === null) {
                  return knownKeys;
                }
                switch (child.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                  case REACT_PORTAL_TYPE:
                    warnForMissingKey(child, returnFiber);
                    var key = child.key;
                    if (typeof key !== "string") {
                      break;
                    }
                    if (knownKeys === null) {
                      knownKeys = /* @__PURE__ */ new Set();
                      knownKeys.add(key);
                      break;
                    }
                    if (!knownKeys.has(key)) {
                      knownKeys.add(key);
                      break;
                    }
                    error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key);
                    break;
                }
              }
              return knownKeys;
            }
            function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
              {
                var knownKeys = null;
                for (var i = 0; i < newChildren.length; i++) {
                  var child = newChildren[i];
                  knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                }
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (newIdx === newChildren.length) {
                deleteRemainingChildren(returnFiber, oldFiber);
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; newIdx < newChildren.length; newIdx++) {
                  var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
                  if (_newFiber === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber;
                  } else {
                    previousNewFiber.sibling = _newFiber;
                  }
                  previousNewFiber = _newFiber;
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; newIdx < newChildren.length; newIdx++) {
                var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
                if (_newFiber2 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber2.alternate !== null) {
                      existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber2;
                  } else {
                    previousNewFiber.sibling = _newFiber2;
                  }
                  previousNewFiber = _newFiber2;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              return resultingFirstChild;
            }
            function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
              var iteratorFn = getIteratorFn(newChildrenIterable);
              if (!(typeof iteratorFn === "function")) {
                {
                  throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              {
                if (typeof Symbol === "function" && // $FlowFixMe Flow doesn't know about toStringTag
                newChildrenIterable[Symbol.toStringTag] === "Generator") {
                  if (!didWarnAboutGenerators) {
                    error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");
                  }
                  didWarnAboutGenerators = true;
                }
                if (newChildrenIterable.entries === iteratorFn) {
                  if (!didWarnAboutMaps) {
                    error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
                  }
                  didWarnAboutMaps = true;
                }
                var _newChildren = iteratorFn.call(newChildrenIterable);
                if (_newChildren) {
                  var knownKeys = null;
                  var _step = _newChildren.next();
                  for (; !_step.done; _step = _newChildren.next()) {
                    var child = _step.value;
                    knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                  }
                }
              }
              var newChildren = iteratorFn.call(newChildrenIterable);
              if (!(newChildren != null)) {
                {
                  throw Error("An iterable object provided no iterator.");
                }
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              var step = newChildren.next();
              for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (step.done) {
                deleteRemainingChildren(returnFiber, oldFiber);
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; !step.done; newIdx++, step = newChildren.next()) {
                  var _newFiber3 = createChild(returnFiber, step.value, lanes);
                  if (_newFiber3 === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber3;
                  } else {
                    previousNewFiber.sibling = _newFiber3;
                  }
                  previousNewFiber = _newFiber3;
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; !step.done; newIdx++, step = newChildren.next()) {
                var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
                if (_newFiber4 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber4.alternate !== null) {
                      existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber4;
                  } else {
                    previousNewFiber.sibling = _newFiber4;
                  }
                  previousNewFiber = _newFiber4;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              return resultingFirstChild;
            }
            function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
              if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
                deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
                var existing = useFiber(currentFirstChild, textContent);
                existing.return = returnFiber;
                return existing;
              }
              deleteRemainingChildren(returnFiber, currentFirstChild);
              var created = createFiberFromText(textContent, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
              var key = element.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key) {
                  switch (child.tag) {
                    case Fragment38: {
                      if (element.type === REACT_FRAGMENT_TYPE) {
                        deleteRemainingChildren(returnFiber, child.sibling);
                        var existing = useFiber(child, element.props.children);
                        existing.return = returnFiber;
                        {
                          existing._debugSource = element._source;
                          existing._debugOwner = element._owner;
                        }
                        return existing;
                      }
                      break;
                    }
                    case Block:
                    default: {
                      if (child.elementType === element.type || // Keep this check inline so it only runs on the false path:
                      isCompatibleFamilyForHotReloading(child, element)) {
                        deleteRemainingChildren(returnFiber, child.sibling);
                        var _existing3 = useFiber(child, element.props);
                        _existing3.ref = coerceRef(returnFiber, child, element);
                        _existing3.return = returnFiber;
                        {
                          _existing3._debugSource = element._source;
                          _existing3._debugOwner = element._owner;
                        }
                        return _existing3;
                      }
                      break;
                    }
                  }
                  deleteRemainingChildren(returnFiber, child);
                  break;
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              if (element.type === REACT_FRAGMENT_TYPE) {
                var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
                created.return = returnFiber;
                return created;
              } else {
                var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
                _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
                _created4.return = returnFiber;
                return _created4;
              }
            }
            function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
              var key = portal.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key) {
                  if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var existing = useFiber(child, portal.children || []);
                    existing.return = returnFiber;
                    return existing;
                  } else {
                    deleteRemainingChildren(returnFiber, child);
                    break;
                  }
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
              var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
              if (isUnkeyedTopLevelFragment) {
                newChild = newChild.props.children;
              }
              var isObject = typeof newChild === "object" && newChild !== null;
              if (isObject) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                    return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
                  case REACT_PORTAL_TYPE:
                    return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
                }
              }
              if (typeof newChild === "string" || typeof newChild === "number") {
                return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
              }
              if (isArray$1(newChild)) {
                return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
              }
              if (getIteratorFn(newChild)) {
                return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
              }
              if (isObject) {
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              if (typeof newChild === "undefined" && !isUnkeyedTopLevelFragment) {
                switch (returnFiber.tag) {
                  case ClassComponent: {
                    {
                      var instance = returnFiber.stateNode;
                      if (instance.render._isMockFunction) {
                        break;
                      }
                    }
                  }
                  case Block:
                  case FunctionComponent:
                  case ForwardRef:
                  case SimpleMemoComponent: {
                    {
                      {
                        throw Error((getComponentName(returnFiber.type) || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
                      }
                    }
                  }
                }
              }
              return deleteRemainingChildren(returnFiber, currentFirstChild);
            }
            return reconcileChildFibers2;
          }
          var reconcileChildFibers = ChildReconciler(true);
          var mountChildFibers = ChildReconciler(false);
          function cloneChildFibers(current2, workInProgress2) {
            if (!(current2 === null || workInProgress2.child === current2.child)) {
              {
                throw Error("Resuming work not yet implemented.");
              }
            }
            if (workInProgress2.child === null) {
              return;
            }
            var currentChild = workInProgress2.child;
            var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
            workInProgress2.child = newChild;
            newChild.return = workInProgress2;
            while (currentChild.sibling !== null) {
              currentChild = currentChild.sibling;
              newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
              newChild.return = workInProgress2;
            }
            newChild.sibling = null;
          }
          function resetChildFibers(workInProgress2, lanes) {
            var child = workInProgress2.child;
            while (child !== null) {
              resetWorkInProgress(child, lanes);
              child = child.sibling;
            }
          }
          var NO_CONTEXT = {};
          var contextStackCursor$1 = createCursor(NO_CONTEXT);
          var contextFiberStackCursor = createCursor(NO_CONTEXT);
          var rootInstanceStackCursor = createCursor(NO_CONTEXT);
          function requiredContext(c2) {
            if (!(c2 !== NO_CONTEXT)) {
              {
                throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            return c2;
          }
          function getRootHostContainer() {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            return rootInstance;
          }
          function pushHostContainer(fiber, nextRootInstance) {
            push(rootInstanceStackCursor, nextRootInstance, fiber);
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, NO_CONTEXT, fiber);
            var nextRootContext = getRootHostContext(nextRootInstance);
            pop(contextStackCursor$1, fiber);
            push(contextStackCursor$1, nextRootContext, fiber);
          }
          function popHostContainer(fiber) {
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
            pop(rootInstanceStackCursor, fiber);
          }
          function getHostContext() {
            var context = requiredContext(contextStackCursor$1.current);
            return context;
          }
          function pushHostContext(fiber) {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            var context = requiredContext(contextStackCursor$1.current);
            var nextContext = getChildHostContext(context, fiber.type);
            if (context === nextContext) {
              return;
            }
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, nextContext, fiber);
          }
          function popHostContext(fiber) {
            if (contextFiberStackCursor.current !== fiber) {
              return;
            }
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
          }
          var DefaultSuspenseContext = 0;
          var SubtreeSuspenseContextMask = 1;
          var InvisibleParentSuspenseContext = 1;
          var ForceSuspenseFallback = 2;
          var suspenseStackCursor = createCursor(DefaultSuspenseContext);
          function hasSuspenseContext(parentContext, flag) {
            return (parentContext & flag) !== 0;
          }
          function setDefaultShallowSuspenseContext(parentContext) {
            return parentContext & SubtreeSuspenseContextMask;
          }
          function setShallowSuspenseContext(parentContext, shallowContext) {
            return parentContext & SubtreeSuspenseContextMask | shallowContext;
          }
          function addSubtreeSuspenseContext(parentContext, subtreeContext) {
            return parentContext | subtreeContext;
          }
          function pushSuspenseContext(fiber, newContext) {
            push(suspenseStackCursor, newContext, fiber);
          }
          function popSuspenseContext(fiber) {
            pop(suspenseStackCursor, fiber);
          }
          function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
            var nextState = workInProgress2.memoizedState;
            if (nextState !== null) {
              if (nextState.dehydrated !== null) {
                return true;
              }
              return false;
            }
            var props = workInProgress2.memoizedProps;
            if (props.fallback === void 0) {
              return false;
            }
            if (props.unstable_avoidThisFallback !== true) {
              return true;
            }
            if (hasInvisibleParent) {
              return false;
            }
            return true;
          }
          function findFirstSuspended(row) {
            var node = row;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  var dehydrated = state.dehydrated;
                  if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
                    return node;
                  }
                }
              } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
              // keep track of whether it suspended or not.
              node.memoizedProps.revealOrder !== void 0) {
                var didSuspend = (node.flags & DidCapture) !== NoFlags;
                if (didSuspend) {
                  return node;
                }
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === row) {
                return null;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === row) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          var NoFlags$1 = (
            /*  */
            0
          );
          var HasEffect = (
            /* */
            1
          );
          var Layout = (
            /*    */
            2
          );
          var Passive$1 = (
            /*   */
            4
          );
          var hydrationParentFiber = null;
          var nextHydratableInstance = null;
          var isHydrating = false;
          function enterHydrationState(fiber) {
            var parentInstance = fiber.stateNode.containerInfo;
            nextHydratableInstance = getFirstHydratableChild(parentInstance);
            hydrationParentFiber = fiber;
            isHydrating = true;
            return true;
          }
          function deleteHydratableInstance(returnFiber, instance) {
            {
              switch (returnFiber.tag) {
                case HostRoot:
                  didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
                  break;
                case HostComponent:
                  didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
                  break;
              }
            }
            var childToDelete = createFiberFromHostInstanceForDeletion();
            childToDelete.stateNode = instance;
            childToDelete.return = returnFiber;
            childToDelete.flags = Deletion;
            if (returnFiber.lastEffect !== null) {
              returnFiber.lastEffect.nextEffect = childToDelete;
              returnFiber.lastEffect = childToDelete;
            } else {
              returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
            }
          }
          function insertNonHydratedInstance(returnFiber, fiber) {
            fiber.flags = fiber.flags & ~Hydrating | Placement;
            {
              switch (returnFiber.tag) {
                case HostRoot: {
                  var parentContainer = returnFiber.stateNode.containerInfo;
                  switch (fiber.tag) {
                    case HostComponent:
                      var type = fiber.type;
                      var props = fiber.pendingProps;
                      didNotFindHydratableContainerInstance(parentContainer, type);
                      break;
                    case HostText:
                      var text = fiber.pendingProps;
                      didNotFindHydratableContainerTextInstance(parentContainer, text);
                      break;
                  }
                  break;
                }
                case HostComponent: {
                  var parentType = returnFiber.type;
                  var parentProps = returnFiber.memoizedProps;
                  var parentInstance = returnFiber.stateNode;
                  switch (fiber.tag) {
                    case HostComponent:
                      var _type = fiber.type;
                      var _props = fiber.pendingProps;
                      didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
                      break;
                    case HostText:
                      var _text = fiber.pendingProps;
                      didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
                      break;
                    case SuspenseComponent:
                      didNotFindHydratableSuspenseInstance(parentType, parentProps);
                      break;
                  }
                  break;
                }
                default:
                  return;
              }
            }
          }
          function tryHydrate(fiber, nextInstance) {
            switch (fiber.tag) {
              case HostComponent: {
                var type = fiber.type;
                var props = fiber.pendingProps;
                var instance = canHydrateInstance(nextInstance, type);
                if (instance !== null) {
                  fiber.stateNode = instance;
                  return true;
                }
                return false;
              }
              case HostText: {
                var text = fiber.pendingProps;
                var textInstance = canHydrateTextInstance(nextInstance, text);
                if (textInstance !== null) {
                  fiber.stateNode = textInstance;
                  return true;
                }
                return false;
              }
              case SuspenseComponent: {
                return false;
              }
              default:
                return false;
            }
          }
          function tryToClaimNextHydratableInstance(fiber) {
            if (!isHydrating) {
              return;
            }
            var nextInstance = nextHydratableInstance;
            if (!nextInstance) {
              insertNonHydratedInstance(hydrationParentFiber, fiber);
              isHydrating = false;
              hydrationParentFiber = fiber;
              return;
            }
            var firstAttemptedInstance = nextInstance;
            if (!tryHydrate(fiber, nextInstance)) {
              nextInstance = getNextHydratableSibling(firstAttemptedInstance);
              if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
                insertNonHydratedInstance(hydrationParentFiber, fiber);
                isHydrating = false;
                hydrationParentFiber = fiber;
                return;
              }
              deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
            }
            hydrationParentFiber = fiber;
            nextHydratableInstance = getFirstHydratableChild(nextInstance);
          }
          function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
            var instance = fiber.stateNode;
            var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
            fiber.updateQueue = updatePayload;
            if (updatePayload !== null) {
              return true;
            }
            return false;
          }
          function prepareToHydrateHostTextInstance(fiber) {
            var textInstance = fiber.stateNode;
            var textContent = fiber.memoizedProps;
            var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
            {
              if (shouldUpdate) {
                var returnFiber = hydrationParentFiber;
                if (returnFiber !== null) {
                  switch (returnFiber.tag) {
                    case HostRoot: {
                      var parentContainer = returnFiber.stateNode.containerInfo;
                      didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
                      break;
                    }
                    case HostComponent: {
                      var parentType = returnFiber.type;
                      var parentProps = returnFiber.memoizedProps;
                      var parentInstance = returnFiber.stateNode;
                      didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
                      break;
                    }
                  }
                }
              }
            }
            return shouldUpdate;
          }
          function skipPastDehydratedSuspenseInstance(fiber) {
            var suspenseState = fiber.memoizedState;
            var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
            if (!suspenseInstance) {
              {
                throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
          }
          function popToNextHostParent(fiber) {
            var parent = fiber.return;
            while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
              parent = parent.return;
            }
            hydrationParentFiber = parent;
          }
          function popHydrationState(fiber) {
            if (fiber !== hydrationParentFiber) {
              return false;
            }
            if (!isHydrating) {
              popToNextHostParent(fiber);
              isHydrating = true;
              return false;
            }
            var type = fiber.type;
            if (fiber.tag !== HostComponent || type !== "head" && type !== "body" && !shouldSetTextContent(type, fiber.memoizedProps)) {
              var nextInstance = nextHydratableInstance;
              while (nextInstance) {
                deleteHydratableInstance(fiber, nextInstance);
                nextInstance = getNextHydratableSibling(nextInstance);
              }
            }
            popToNextHostParent(fiber);
            if (fiber.tag === SuspenseComponent) {
              nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
            } else {
              nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
            }
            return true;
          }
          function resetHydrationState() {
            hydrationParentFiber = null;
            nextHydratableInstance = null;
            isHydrating = false;
          }
          function getIsHydrating() {
            return isHydrating;
          }
          var workInProgressSources = [];
          var rendererSigil$1;
          {
            rendererSigil$1 = {};
          }
          function markSourceAsDirty(mutableSource) {
            workInProgressSources.push(mutableSource);
          }
          function resetWorkInProgressVersions() {
            for (var i = 0; i < workInProgressSources.length; i++) {
              var mutableSource = workInProgressSources[i];
              {
                mutableSource._workInProgressVersionPrimary = null;
              }
            }
            workInProgressSources.length = 0;
          }
          function getWorkInProgressVersion(mutableSource) {
            {
              return mutableSource._workInProgressVersionPrimary;
            }
          }
          function setWorkInProgressVersion(mutableSource, version) {
            {
              mutableSource._workInProgressVersionPrimary = version;
            }
            workInProgressSources.push(mutableSource);
          }
          function warnAboutMultipleRenderersDEV(mutableSource) {
            {
              {
                if (mutableSource._currentPrimaryRenderer == null) {
                  mutableSource._currentPrimaryRenderer = rendererSigil$1;
                } else if (mutableSource._currentPrimaryRenderer !== rendererSigil$1) {
                  error("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.");
                }
              }
            }
          }
          var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
          var didWarnAboutMismatchedHooksForComponent;
          var didWarnAboutUseOpaqueIdentifier;
          {
            didWarnAboutUseOpaqueIdentifier = {};
            didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
          }
          var renderLanes = NoLanes;
          var currentlyRenderingFiber$1 = null;
          var currentHook = null;
          var workInProgressHook = null;
          var didScheduleRenderPhaseUpdate = false;
          var didScheduleRenderPhaseUpdateDuringThisPass = false;
          var RE_RENDER_LIMIT = 25;
          var currentHookNameInDev = null;
          var hookTypesDev = null;
          var hookTypesUpdateIndexDev = -1;
          var ignorePreviousDependencies = false;
          function mountHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev === null) {
                hookTypesDev = [hookName];
              } else {
                hookTypesDev.push(hookName);
              }
            }
          }
          function updateHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev !== null) {
                hookTypesUpdateIndexDev++;
                if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
                  warnOnHookMismatchInDev(hookName);
                }
              }
            }
          }
          function checkDepsAreArrayDev(deps) {
            {
              if (deps !== void 0 && deps !== null && !Array.isArray(deps)) {
                error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", currentHookNameInDev, typeof deps);
              }
            }
          }
          function warnOnHookMismatchInDev(currentHookName) {
            {
              var componentName = getComponentName(currentlyRenderingFiber$1.type);
              if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
                didWarnAboutMismatchedHooksForComponent.add(componentName);
                if (hookTypesDev !== null) {
                  var table = "";
                  var secondColumnStart = 30;
                  for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
                    var oldHookName = hookTypesDev[i];
                    var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
                    var row = i + 1 + ". " + oldHookName;
                    while (row.length < secondColumnStart) {
                      row += " ";
                    }
                    row += newHookName + "\n";
                    table += row;
                  }
                  error("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n   Previous render            Next render\n   ------------------------------------------------------\n%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
                }
              }
            }
          }
          function throwInvalidHookError() {
            {
              {
                throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
              }
            }
          }
          function areHookInputsEqual(nextDeps, prevDeps) {
            {
              if (ignorePreviousDependencies) {
                return false;
              }
            }
            if (prevDeps === null) {
              {
                error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev);
              }
              return false;
            }
            {
              if (nextDeps.length !== prevDeps.length) {
                error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]");
              }
            }
            for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
              if (objectIs(nextDeps[i], prevDeps[i])) {
                continue;
              }
              return false;
            }
            return true;
          }
          function renderWithHooks(current2, workInProgress2, Component50, props, secondArg, nextRenderLanes) {
            renderLanes = nextRenderLanes;
            currentlyRenderingFiber$1 = workInProgress2;
            {
              hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
              hookTypesUpdateIndexDev = -1;
              ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
            }
            workInProgress2.memoizedState = null;
            workInProgress2.updateQueue = null;
            workInProgress2.lanes = NoLanes;
            {
              if (current2 !== null && current2.memoizedState !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
              } else if (hookTypesDev !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
              } else {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
              }
            }
            var children = Component50(props, secondArg);
            if (didScheduleRenderPhaseUpdateDuringThisPass) {
              var numberOfReRenders = 0;
              do {
                didScheduleRenderPhaseUpdateDuringThisPass = false;
                if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
                  {
                    throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
                  }
                }
                numberOfReRenders += 1;
                {
                  ignorePreviousDependencies = false;
                }
                currentHook = null;
                workInProgressHook = null;
                workInProgress2.updateQueue = null;
                {
                  hookTypesUpdateIndexDev = -1;
                }
                ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
                children = Component50(props, secondArg);
              } while (didScheduleRenderPhaseUpdateDuringThisPass);
            }
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            {
              workInProgress2._debugHookTypes = hookTypesDev;
            }
            var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              currentHookNameInDev = null;
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
            }
            didScheduleRenderPhaseUpdate = false;
            if (!!didRenderTooFewHooks) {
              {
                throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
              }
            }
            return children;
          }
          function bailoutHooks(current2, workInProgress2, lanes) {
            workInProgress2.updateQueue = current2.updateQueue;
            workInProgress2.flags &= ~(Passive | Update);
            current2.lanes = removeLanes(current2.lanes, lanes);
          }
          function resetHooksAfterThrow() {
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            if (didScheduleRenderPhaseUpdate) {
              var hook = currentlyRenderingFiber$1.memoizedState;
              while (hook !== null) {
                var queue = hook.queue;
                if (queue !== null) {
                  queue.pending = null;
                }
                hook = hook.next;
              }
              didScheduleRenderPhaseUpdate = false;
            }
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
              currentHookNameInDev = null;
              isUpdatingOpaqueValueInRenderPhase = false;
            }
            didScheduleRenderPhaseUpdateDuringThisPass = false;
          }
          function mountWorkInProgressHook() {
            var hook = {
              memoizedState: null,
              baseState: null,
              baseQueue: null,
              queue: null,
              next: null
            };
            if (workInProgressHook === null) {
              currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
            } else {
              workInProgressHook = workInProgressHook.next = hook;
            }
            return workInProgressHook;
          }
          function updateWorkInProgressHook() {
            var nextCurrentHook;
            if (currentHook === null) {
              var current2 = currentlyRenderingFiber$1.alternate;
              if (current2 !== null) {
                nextCurrentHook = current2.memoizedState;
              } else {
                nextCurrentHook = null;
              }
            } else {
              nextCurrentHook = currentHook.next;
            }
            var nextWorkInProgressHook;
            if (workInProgressHook === null) {
              nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
            } else {
              nextWorkInProgressHook = workInProgressHook.next;
            }
            if (nextWorkInProgressHook !== null) {
              workInProgressHook = nextWorkInProgressHook;
              nextWorkInProgressHook = workInProgressHook.next;
              currentHook = nextCurrentHook;
            } else {
              if (!(nextCurrentHook !== null)) {
                {
                  throw Error("Rendered more hooks than during the previous render.");
                }
              }
              currentHook = nextCurrentHook;
              var newHook = {
                memoizedState: currentHook.memoizedState,
                baseState: currentHook.baseState,
                baseQueue: currentHook.baseQueue,
                queue: currentHook.queue,
                next: null
              };
              if (workInProgressHook === null) {
                currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
              } else {
                workInProgressHook = workInProgressHook.next = newHook;
              }
            }
            return workInProgressHook;
          }
          function createFunctionComponentUpdateQueue() {
            return {
              lastEffect: null
            };
          }
          function basicStateReducer(state, action) {
            return typeof action === "function" ? action(state) : action;
          }
          function mountReducer(reducer, initialArg, init) {
            var hook = mountWorkInProgressHook();
            var initialState;
            if (init !== void 0) {
              initialState = init(initialArg);
            } else {
              initialState = initialArg;
            }
            hook.memoizedState = hook.baseState = initialState;
            var queue = hook.queue = {
              pending: null,
              dispatch: null,
              lastRenderedReducer: reducer,
              lastRenderedState: initialState
            };
            var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateReducer(reducer, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (!(queue !== null)) {
              {
                throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
              }
            }
            queue.lastRenderedReducer = reducer;
            var current2 = currentHook;
            var baseQueue = current2.baseQueue;
            var pendingQueue = queue.pending;
            if (pendingQueue !== null) {
              if (baseQueue !== null) {
                var baseFirst = baseQueue.next;
                var pendingFirst = pendingQueue.next;
                baseQueue.next = pendingFirst;
                pendingQueue.next = baseFirst;
              }
              {
                if (current2.baseQueue !== baseQueue) {
                  error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
                }
              }
              current2.baseQueue = baseQueue = pendingQueue;
              queue.pending = null;
            }
            if (baseQueue !== null) {
              var first = baseQueue.next;
              var newState = current2.baseState;
              var newBaseState = null;
              var newBaseQueueFirst = null;
              var newBaseQueueLast = null;
              var update = first;
              do {
                var updateLane = update.lane;
                if (!isSubsetOfLanes(renderLanes, updateLane)) {
                  var clone = {
                    lane: updateLane,
                    action: update.action,
                    eagerReducer: update.eagerReducer,
                    eagerState: update.eagerState,
                    next: null
                  };
                  if (newBaseQueueLast === null) {
                    newBaseQueueFirst = newBaseQueueLast = clone;
                    newBaseState = newState;
                  } else {
                    newBaseQueueLast = newBaseQueueLast.next = clone;
                  }
                  currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
                  markSkippedUpdateLanes(updateLane);
                } else {
                  if (newBaseQueueLast !== null) {
                    var _clone = {
                      // This update is going to be committed so we never want uncommit
                      // it. Using NoLane works because 0 is a subset of all bitmasks, so
                      // this will never be skipped by the check above.
                      lane: NoLane,
                      action: update.action,
                      eagerReducer: update.eagerReducer,
                      eagerState: update.eagerState,
                      next: null
                    };
                    newBaseQueueLast = newBaseQueueLast.next = _clone;
                  }
                  if (update.eagerReducer === reducer) {
                    newState = update.eagerState;
                  } else {
                    var action = update.action;
                    newState = reducer(newState, action);
                  }
                }
                update = update.next;
              } while (update !== null && update !== first);
              if (newBaseQueueLast === null) {
                newBaseState = newState;
              } else {
                newBaseQueueLast.next = newBaseQueueFirst;
              }
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              hook.baseState = newBaseState;
              hook.baseQueue = newBaseQueueLast;
              queue.lastRenderedState = newState;
            }
            var dispatch = queue.dispatch;
            return [hook.memoizedState, dispatch];
          }
          function rerenderReducer(reducer, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (!(queue !== null)) {
              {
                throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
              }
            }
            queue.lastRenderedReducer = reducer;
            var dispatch = queue.dispatch;
            var lastRenderPhaseUpdate = queue.pending;
            var newState = hook.memoizedState;
            if (lastRenderPhaseUpdate !== null) {
              queue.pending = null;
              var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
              var update = firstRenderPhaseUpdate;
              do {
                var action = update.action;
                newState = reducer(newState, action);
                update = update.next;
              } while (update !== firstRenderPhaseUpdate);
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              if (hook.baseQueue === null) {
                hook.baseState = newState;
              }
              queue.lastRenderedState = newState;
            }
            return [newState, dispatch];
          }
          function readFromUnsubcribedMutableSource(root2, source, getSnapshot) {
            {
              warnAboutMultipleRenderersDEV(source);
            }
            var getVersion = source._getVersion;
            var version = getVersion(source._source);
            var isSafeToReadFromSource = false;
            var currentRenderVersion = getWorkInProgressVersion(source);
            if (currentRenderVersion !== null) {
              isSafeToReadFromSource = currentRenderVersion === version;
            } else {
              isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root2.mutableReadLanes);
              if (isSafeToReadFromSource) {
                setWorkInProgressVersion(source, version);
              }
            }
            if (isSafeToReadFromSource) {
              var snapshot = getSnapshot(source._source);
              {
                if (typeof snapshot === "function") {
                  error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing.");
                }
              }
              return snapshot;
            } else {
              markSourceAsDirty(source);
              {
                {
                  throw Error("Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.");
                }
              }
            }
          }
          function useMutableSource(hook, source, getSnapshot, subscribe) {
            var root2 = getWorkInProgressRoot();
            if (!(root2 !== null)) {
              {
                throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
              }
            }
            var getVersion = source._getVersion;
            var version = getVersion(source._source);
            var dispatcher = ReactCurrentDispatcher$1.current;
            var _dispatcher$useState = dispatcher.useState(function() {
              return readFromUnsubcribedMutableSource(root2, source, getSnapshot);
            }), currentSnapshot = _dispatcher$useState[0], setSnapshot = _dispatcher$useState[1];
            var snapshot = currentSnapshot;
            var stateHook = workInProgressHook;
            var memoizedState = hook.memoizedState;
            var refs = memoizedState.refs;
            var prevGetSnapshot = refs.getSnapshot;
            var prevSource = memoizedState.source;
            var prevSubscribe = memoizedState.subscribe;
            var fiber = currentlyRenderingFiber$1;
            hook.memoizedState = {
              refs,
              source,
              subscribe
            };
            dispatcher.useEffect(function() {
              refs.getSnapshot = getSnapshot;
              refs.setSnapshot = setSnapshot;
              var maybeNewVersion = getVersion(source._source);
              if (!objectIs(version, maybeNewVersion)) {
                var maybeNewSnapshot = getSnapshot(source._source);
                {
                  if (typeof maybeNewSnapshot === "function") {
                    error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing.");
                  }
                }
                if (!objectIs(snapshot, maybeNewSnapshot)) {
                  setSnapshot(maybeNewSnapshot);
                  var lane = requestUpdateLane(fiber);
                  markRootMutableRead(root2, lane);
                }
                markRootEntangled(root2, root2.mutableReadLanes);
              }
            }, [getSnapshot, source, subscribe]);
            dispatcher.useEffect(function() {
              var handleChange = function() {
                var latestGetSnapshot = refs.getSnapshot;
                var latestSetSnapshot = refs.setSnapshot;
                try {
                  latestSetSnapshot(latestGetSnapshot(source._source));
                  var lane = requestUpdateLane(fiber);
                  markRootMutableRead(root2, lane);
                } catch (error2) {
                  latestSetSnapshot(function() {
                    throw error2;
                  });
                }
              };
              var unsubscribe = subscribe(source._source, handleChange);
              {
                if (typeof unsubscribe !== "function") {
                  error("Mutable source subscribe function must return an unsubscribe function.");
                }
              }
              return unsubscribe;
            }, [source, subscribe]);
            if (!objectIs(prevGetSnapshot, getSnapshot) || !objectIs(prevSource, source) || !objectIs(prevSubscribe, subscribe)) {
              var newQueue = {
                pending: null,
                dispatch: null,
                lastRenderedReducer: basicStateReducer,
                lastRenderedState: snapshot
              };
              newQueue.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, newQueue);
              stateHook.queue = newQueue;
              stateHook.baseQueue = null;
              snapshot = readFromUnsubcribedMutableSource(root2, source, getSnapshot);
              stateHook.memoizedState = stateHook.baseState = snapshot;
            }
            return snapshot;
          }
          function mountMutableSource(source, getSnapshot, subscribe) {
            var hook = mountWorkInProgressHook();
            hook.memoizedState = {
              refs: {
                getSnapshot,
                setSnapshot: null
              },
              source,
              subscribe
            };
            return useMutableSource(hook, source, getSnapshot, subscribe);
          }
          function updateMutableSource(source, getSnapshot, subscribe) {
            var hook = updateWorkInProgressHook();
            return useMutableSource(hook, source, getSnapshot, subscribe);
          }
          function mountState(initialState) {
            var hook = mountWorkInProgressHook();
            if (typeof initialState === "function") {
              initialState = initialState();
            }
            hook.memoizedState = hook.baseState = initialState;
            var queue = hook.queue = {
              pending: null,
              dispatch: null,
              lastRenderedReducer: basicStateReducer,
              lastRenderedState: initialState
            };
            var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateState(initialState) {
            return updateReducer(basicStateReducer);
          }
          function rerenderState(initialState) {
            return rerenderReducer(basicStateReducer);
          }
          function pushEffect(tag, create, destroy, deps) {
            var effect4 = {
              tag,
              create,
              destroy,
              deps,
              // Circular
              next: null
            };
            var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
            if (componentUpdateQueue === null) {
              componentUpdateQueue = createFunctionComponentUpdateQueue();
              currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
              componentUpdateQueue.lastEffect = effect4.next = effect4;
            } else {
              var lastEffect = componentUpdateQueue.lastEffect;
              if (lastEffect === null) {
                componentUpdateQueue.lastEffect = effect4.next = effect4;
              } else {
                var firstEffect = lastEffect.next;
                lastEffect.next = effect4;
                effect4.next = firstEffect;
                componentUpdateQueue.lastEffect = effect4;
              }
            }
            return effect4;
          }
          function mountRef(initialValue) {
            var hook = mountWorkInProgressHook();
            var ref = {
              current: initialValue
            };
            {
              Object.seal(ref);
            }
            hook.memoizedState = ref;
            return ref;
          }
          function updateRef(initialValue) {
            var hook = updateWorkInProgressHook();
            return hook.memoizedState;
          }
          function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
          }
          function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var destroy = void 0;
            if (currentHook !== null) {
              var prevEffect = currentHook.memoizedState;
              destroy = prevEffect.destroy;
              if (nextDeps !== null) {
                var prevDeps = prevEffect.deps;
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  pushEffect(hookFlags, create, destroy, nextDeps);
                  return;
                }
              }
            }
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
          }
          function mountEffect(create, deps) {
            {
              if ("undefined" !== typeof jest) {
                warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
              }
            }
            return mountEffectImpl(Update | Passive, Passive$1, create, deps);
          }
          function updateEffect(create, deps) {
            {
              if ("undefined" !== typeof jest) {
                warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
              }
            }
            return updateEffectImpl(Update | Passive, Passive$1, create, deps);
          }
          function mountLayoutEffect(create, deps) {
            return mountEffectImpl(Update, Layout, create, deps);
          }
          function updateLayoutEffect(create, deps) {
            return updateEffectImpl(Update, Layout, create, deps);
          }
          function imperativeHandleEffect(create, ref) {
            if (typeof ref === "function") {
              var refCallback = ref;
              var _inst = create();
              refCallback(_inst);
              return function() {
                refCallback(null);
              };
            } else if (ref !== null && ref !== void 0) {
              var refObject = ref;
              {
                if (!refObject.hasOwnProperty("current")) {
                  error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
                }
              }
              var _inst2 = create();
              refObject.current = _inst2;
              return function() {
                refObject.current = null;
              };
            }
          }
          function mountImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function updateImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function mountDebugValue(value, formatterFn) {
          }
          var updateDebugValue = mountDebugValue;
          function mountCallback(callback, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function updateCallback(callback, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function mountMemo(nextCreate, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function updateMemo(nextCreate, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function mountDeferredValue(value) {
            var _mountState = mountState(value), prevValue = _mountState[0], setValue = _mountState[1];
            mountEffect(function() {
              var prevTransition = ReactCurrentBatchConfig$1.transition;
              ReactCurrentBatchConfig$1.transition = 1;
              try {
                setValue(value);
              } finally {
                ReactCurrentBatchConfig$1.transition = prevTransition;
              }
            }, [value]);
            return prevValue;
          }
          function updateDeferredValue(value) {
            var _updateState = updateState(), prevValue = _updateState[0], setValue = _updateState[1];
            updateEffect(function() {
              var prevTransition = ReactCurrentBatchConfig$1.transition;
              ReactCurrentBatchConfig$1.transition = 1;
              try {
                setValue(value);
              } finally {
                ReactCurrentBatchConfig$1.transition = prevTransition;
              }
            }, [value]);
            return prevValue;
          }
          function rerenderDeferredValue(value) {
            var _rerenderState = rerenderState(), prevValue = _rerenderState[0], setValue = _rerenderState[1];
            updateEffect(function() {
              var prevTransition = ReactCurrentBatchConfig$1.transition;
              ReactCurrentBatchConfig$1.transition = 1;
              try {
                setValue(value);
              } finally {
                ReactCurrentBatchConfig$1.transition = prevTransition;
              }
            }, [value]);
            return prevValue;
          }
          function startTransition(setPending, callback) {
            var priorityLevel = getCurrentPriorityLevel();
            {
              runWithPriority$1(priorityLevel < UserBlockingPriority$2 ? UserBlockingPriority$2 : priorityLevel, function() {
                setPending(true);
              });
              runWithPriority$1(priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel, function() {
                var prevTransition = ReactCurrentBatchConfig$1.transition;
                ReactCurrentBatchConfig$1.transition = 1;
                try {
                  setPending(false);
                  callback();
                } finally {
                  ReactCurrentBatchConfig$1.transition = prevTransition;
                }
              });
            }
          }
          function mountTransition() {
            var _mountState2 = mountState(false), isPending = _mountState2[0], setPending = _mountState2[1];
            var start2 = startTransition.bind(null, setPending);
            mountRef(start2);
            return [start2, isPending];
          }
          function updateTransition() {
            var _updateState2 = updateState(), isPending = _updateState2[0];
            var startRef = updateRef();
            var start2 = startRef.current;
            return [start2, isPending];
          }
          function rerenderTransition() {
            var _rerenderState2 = rerenderState(), isPending = _rerenderState2[0];
            var startRef = updateRef();
            var start2 = startRef.current;
            return [start2, isPending];
          }
          var isUpdatingOpaqueValueInRenderPhase = false;
          function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
            {
              return isUpdatingOpaqueValueInRenderPhase;
            }
          }
          function warnOnOpaqueIdentifierAccessInDEV(fiber) {
            {
              var name2 = getComponentName(fiber.type) || "Unknown";
              if (getIsRendering() && !didWarnAboutUseOpaqueIdentifier[name2]) {
                error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
                didWarnAboutUseOpaqueIdentifier[name2] = true;
              }
            }
          }
          function mountOpaqueIdentifier() {
            var makeId = makeClientIdInDEV.bind(null, warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1));
            if (getIsHydrating()) {
              var didUpgrade = false;
              var fiber = currentlyRenderingFiber$1;
              var readValue = function() {
                if (!didUpgrade) {
                  didUpgrade = true;
                  {
                    isUpdatingOpaqueValueInRenderPhase = true;
                    setId(makeId());
                    isUpdatingOpaqueValueInRenderPhase = false;
                    warnOnOpaqueIdentifierAccessInDEV(fiber);
                  }
                }
                {
                  {
                    throw Error("The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.");
                  }
                }
              };
              var id = makeOpaqueHydratingObject(readValue);
              var setId = mountState(id)[1];
              if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {
                currentlyRenderingFiber$1.flags |= Update | Passive;
                pushEffect(HasEffect | Passive$1, function() {
                  setId(makeId());
                }, void 0, null);
              }
              return id;
            } else {
              var _id = makeId();
              mountState(_id);
              return _id;
            }
          }
          function updateOpaqueIdentifier() {
            var id = updateState()[0];
            return id;
          }
          function rerenderOpaqueIdentifier() {
            var id = rerenderState()[0];
            return id;
          }
          function dispatchAction(fiber, queue, action) {
            {
              if (typeof arguments[3] === "function") {
                error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
              }
            }
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(fiber);
            var update = {
              lane,
              action,
              eagerReducer: null,
              eagerState: null,
              next: null
            };
            var pending = queue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            queue.pending = update;
            var alternate = fiber.alternate;
            if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
              didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
            } else {
              if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
                var lastRenderedReducer = queue.lastRenderedReducer;
                if (lastRenderedReducer !== null) {
                  var prevDispatcher;
                  {
                    prevDispatcher = ReactCurrentDispatcher$1.current;
                    ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                  }
                  try {
                    var currentState = queue.lastRenderedState;
                    var eagerState = lastRenderedReducer(currentState, action);
                    update.eagerReducer = lastRenderedReducer;
                    update.eagerState = eagerState;
                    if (objectIs(eagerState, currentState)) {
                      return;
                    }
                  } catch (error2) {
                  } finally {
                    {
                      ReactCurrentDispatcher$1.current = prevDispatcher;
                    }
                  }
                }
              }
              {
                if ("undefined" !== typeof jest) {
                  warnIfNotScopedWithMatchingAct(fiber);
                  warnIfNotCurrentlyActingUpdatesInDev(fiber);
                }
              }
              scheduleUpdateOnFiber(fiber, lane, eventTime);
            }
          }
          var ContextOnlyDispatcher = {
            readContext,
            useCallback: throwInvalidHookError,
            useContext: throwInvalidHookError,
            useEffect: throwInvalidHookError,
            useImperativeHandle: throwInvalidHookError,
            useLayoutEffect: throwInvalidHookError,
            useMemo: throwInvalidHookError,
            useReducer: throwInvalidHookError,
            useRef: throwInvalidHookError,
            useState: throwInvalidHookError,
            useDebugValue: throwInvalidHookError,
            useDeferredValue: throwInvalidHookError,
            useTransition: throwInvalidHookError,
            useMutableSource: throwInvalidHookError,
            useOpaqueIdentifier: throwInvalidHookError,
            unstable_isNewReconciler: enableNewReconciler
          };
          var HooksDispatcherOnMountInDEV = null;
          var HooksDispatcherOnMountWithHookTypesInDEV = null;
          var HooksDispatcherOnUpdateInDEV = null;
          var HooksDispatcherOnRerenderInDEV = null;
          var InvalidNestedHooksDispatcherOnMountInDEV = null;
          var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
          var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
          {
            var warnInvalidContextAccess = function() {
              error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
            };
            var warnInvalidHookAccess = function() {
              error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
            };
            HooksDispatcherOnMountInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                mountHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                mountHookTypesDev();
                return mountMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                mountHookTypesDev();
                return mountOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnMountWithHookTypesInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return mountMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                updateHookTypesDev();
                return mountOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnUpdateInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                updateHookTypesDev();
                return updateOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnRerenderInDEV = {
              readContext: function(context, observedBits) {
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                updateHookTypesDev();
                return rerenderOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnMountInDEV = {
              readContext: function(context, observedBits) {
                warnInvalidContextAccess();
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnUpdateInDEV = {
              readContext: function(context, observedBits) {
                warnInvalidContextAccess();
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnRerenderInDEV = {
              readContext: function(context, observedBits) {
                warnInvalidContextAccess();
                return readContext(context, observedBits);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context, observedBits) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context, observedBits);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderReducer(reducer, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderState(initialState);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource(source, getSnapshot, subscribe);
              },
              useOpaqueIdentifier: function() {
                currentHookNameInDev = "useOpaqueIdentifier";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderOpaqueIdentifier();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
          }
          var now$1 = Scheduler.unstable_now;
          var commitTime = 0;
          var profilerStartTime = -1;
          function getCommitTime() {
            return commitTime;
          }
          function recordCommitTime() {
            commitTime = now$1();
          }
          function startProfilerTimer(fiber) {
            profilerStartTime = now$1();
            if (fiber.actualStartTime < 0) {
              fiber.actualStartTime = now$1();
            }
          }
          function stopProfilerTimerIfRunning(fiber) {
            profilerStartTime = -1;
          }
          function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
            if (profilerStartTime >= 0) {
              var elapsedTime = now$1() - profilerStartTime;
              fiber.actualDuration += elapsedTime;
              if (overrideBaseTime) {
                fiber.selfBaseDuration = elapsedTime;
              }
              profilerStartTime = -1;
            }
          }
          function transferActualDuration(fiber) {
            var child = fiber.child;
            while (child) {
              fiber.actualDuration += child.actualDuration;
              child = child.sibling;
            }
          }
          var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
          var didReceiveUpdate = false;
          var didWarnAboutBadClass;
          var didWarnAboutModulePatternComponent;
          var didWarnAboutContextTypeOnFunctionComponent;
          var didWarnAboutGetDerivedStateOnFunctionComponent;
          var didWarnAboutFunctionRefs;
          var didWarnAboutReassigningProps;
          var didWarnAboutRevealOrder;
          var didWarnAboutTailOptions;
          {
            didWarnAboutBadClass = {};
            didWarnAboutModulePatternComponent = {};
            didWarnAboutContextTypeOnFunctionComponent = {};
            didWarnAboutGetDerivedStateOnFunctionComponent = {};
            didWarnAboutFunctionRefs = {};
            didWarnAboutReassigningProps = false;
            didWarnAboutRevealOrder = {};
            didWarnAboutTailOptions = {};
          }
          function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
            if (current2 === null) {
              workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
            }
          }
          function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
            workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
          }
          function updateForwardRef(current2, workInProgress2, Component50, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component50.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentName(Component50)
                  );
                }
              }
            }
            var render2 = Component50.render;
            var ref = workInProgress2.ref;
            var nextChildren;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
                } finally {
                  reenableLogs();
                }
              }
              setIsRendering(false);
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMemoComponent(current2, workInProgress2, Component50, nextProps, updateLanes, renderLanes2) {
            if (current2 === null) {
              var type = Component50.type;
              if (isSimpleFunctionComponent(type) && Component50.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
              Component50.defaultProps === void 0) {
                var resolvedType = type;
                {
                  resolvedType = resolveFunctionForHotReloading(type);
                }
                workInProgress2.tag = SimpleMemoComponent;
                workInProgress2.type = resolvedType;
                {
                  validateFunctionComponentInDev(workInProgress2, type);
                }
                return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, updateLanes, renderLanes2);
              }
              {
                var innerPropTypes = type.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentName(type)
                  );
                }
              }
              var child = createFiberFromTypeAndProps(Component50.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
              child.ref = workInProgress2.ref;
              child.return = workInProgress2;
              workInProgress2.child = child;
              return child;
            }
            {
              var _type = Component50.type;
              var _innerPropTypes = _type.propTypes;
              if (_innerPropTypes) {
                checkPropTypes(
                  _innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentName(_type)
                );
              }
            }
            var currentChild = current2.child;
            if (!includesSomeLane(updateLanes, renderLanes2)) {
              var prevProps = currentChild.memoizedProps;
              var compare = Component50.compare;
              compare = compare !== null ? compare : shallowEqual;
              if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              }
            }
            workInProgress2.flags |= PerformedWork;
            var newChild = createWorkInProgress(currentChild, nextProps);
            newChild.ref = workInProgress2.ref;
            newChild.return = workInProgress2;
            workInProgress2.child = newChild;
            return newChild;
          }
          function updateSimpleMemoComponent(current2, workInProgress2, Component50, nextProps, updateLanes, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var outerMemoType = workInProgress2.elementType;
                if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
                  var lazyComponent = outerMemoType;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    outerMemoType = init(payload);
                  } catch (x2) {
                    outerMemoType = null;
                  }
                  var outerPropTypes = outerMemoType && outerMemoType.propTypes;
                  if (outerPropTypes) {
                    checkPropTypes(
                      outerPropTypes,
                      nextProps,
                      // Resolved (SimpleMemoComponent has no defaultProps)
                      "prop",
                      getComponentName(outerMemoType)
                    );
                  }
                }
              }
            }
            if (current2 !== null) {
              var prevProps = current2.memoizedProps;
              if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && // Prevent bailout if the implementation changed due to hot reload.
              workInProgress2.type === current2.type) {
                didReceiveUpdate = false;
                if (!includesSomeLane(renderLanes2, updateLanes)) {
                  workInProgress2.lanes = current2.lanes;
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                }
              }
            }
            return updateFunctionComponent(current2, workInProgress2, Component50, nextProps, renderLanes2);
          }
          function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            var prevState = current2 !== null ? current2.memoizedState : null;
            if (nextProps.mode === "hidden" || nextProps.mode === "unstable-defer-without-hiding") {
              if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
                var nextState = {
                  baseLanes: NoLanes
                };
                workInProgress2.memoizedState = nextState;
                pushRenderLanes(workInProgress2, renderLanes2);
              } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
                var nextBaseLanes;
                if (prevState !== null) {
                  var prevBaseLanes = prevState.baseLanes;
                  nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
                } else {
                  nextBaseLanes = renderLanes2;
                }
                {
                  markSpawnedWork(OffscreenLane);
                }
                workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
                var _nextState = {
                  baseLanes: nextBaseLanes
                };
                workInProgress2.memoizedState = _nextState;
                pushRenderLanes(workInProgress2, nextBaseLanes);
                return null;
              } else {
                var _nextState2 = {
                  baseLanes: NoLanes
                };
                workInProgress2.memoizedState = _nextState2;
                var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
                pushRenderLanes(workInProgress2, subtreeRenderLanes2);
              }
            } else {
              var _subtreeRenderLanes;
              if (prevState !== null) {
                _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
                workInProgress2.memoizedState = null;
              } else {
                _subtreeRenderLanes = renderLanes2;
              }
              pushRenderLanes(workInProgress2, _subtreeRenderLanes);
            }
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          var updateLegacyHiddenComponent = updateOffscreenComponent;
          function updateFragment(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMode(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateProfiler(current2, workInProgress2, renderLanes2) {
            {
              workInProgress2.flags |= Update;
              var stateNode = workInProgress2.stateNode;
              stateNode.effectDuration = 0;
              stateNode.passiveEffectDuration = 0;
            }
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markRef(current2, workInProgress2) {
            var ref = workInProgress2.ref;
            if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
              workInProgress2.flags |= Ref;
            }
          }
          function updateFunctionComponent(current2, workInProgress2, Component50, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component50.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentName(Component50)
                  );
                }
              }
            }
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component50, true);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            var nextChildren;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, Component50, nextProps, context, renderLanes2);
              if (workInProgress2.mode & StrictMode) {
                disableLogs();
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, Component50, nextProps, context, renderLanes2);
                } finally {
                  reenableLogs();
                }
              }
              setIsRendering(false);
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateClassComponent(current2, workInProgress2, Component50, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component50.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentName(Component50)
                  );
                }
              }
            }
            var hasContext;
            if (isContextProvider(Component50)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var instance = workInProgress2.stateNode;
            var shouldUpdate;
            if (instance === null) {
              if (current2 !== null) {
                current2.alternate = null;
                workInProgress2.alternate = null;
                workInProgress2.flags |= Placement;
              }
              constructClassInstance(workInProgress2, Component50, nextProps);
              mountClassInstance(workInProgress2, Component50, nextProps, renderLanes2);
              shouldUpdate = true;
            } else if (current2 === null) {
              shouldUpdate = resumeMountClassInstance(workInProgress2, Component50, nextProps, renderLanes2);
            } else {
              shouldUpdate = updateClassInstance(current2, workInProgress2, Component50, nextProps, renderLanes2);
            }
            var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component50, shouldUpdate, hasContext, renderLanes2);
            {
              var inst = workInProgress2.stateNode;
              if (shouldUpdate && inst.props !== nextProps) {
                if (!didWarnAboutReassigningProps) {
                  error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentName(workInProgress2.type) || "a component");
                }
                didWarnAboutReassigningProps = true;
              }
            }
            return nextUnitOfWork;
          }
          function finishClassComponent(current2, workInProgress2, Component50, shouldUpdate, hasContext, renderLanes2) {
            markRef(current2, workInProgress2);
            var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (!shouldUpdate && !didCaptureError) {
              if (hasContext) {
                invalidateContextProvider(workInProgress2, Component50, false);
              }
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            var instance = workInProgress2.stateNode;
            ReactCurrentOwner$1.current = workInProgress2;
            var nextChildren;
            if (didCaptureError && typeof Component50.getDerivedStateFromError !== "function") {
              nextChildren = null;
              {
                stopProfilerTimerIfRunning();
              }
            } else {
              {
                setIsRendering(true);
                nextChildren = instance.render();
                if (workInProgress2.mode & StrictMode) {
                  disableLogs();
                  try {
                    instance.render();
                  } finally {
                    reenableLogs();
                  }
                }
                setIsRendering(false);
              }
            }
            workInProgress2.flags |= PerformedWork;
            if (current2 !== null && didCaptureError) {
              forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            workInProgress2.memoizedState = instance.state;
            if (hasContext) {
              invalidateContextProvider(workInProgress2, Component50, true);
            }
            return workInProgress2.child;
          }
          function pushHostRootContext(workInProgress2) {
            var root2 = workInProgress2.stateNode;
            if (root2.pendingContext) {
              pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
            } else if (root2.context) {
              pushTopLevelContextObject(workInProgress2, root2.context, false);
            }
            pushHostContainer(workInProgress2, root2.containerInfo);
          }
          function updateHostRoot(current2, workInProgress2, renderLanes2) {
            pushHostRootContext(workInProgress2);
            var updateQueue = workInProgress2.updateQueue;
            if (!(current2 !== null && updateQueue !== null)) {
              {
                throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            var nextProps = workInProgress2.pendingProps;
            var prevState = workInProgress2.memoizedState;
            var prevChildren = prevState !== null ? prevState.element : null;
            cloneUpdateQueue(current2, workInProgress2);
            processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
            var nextState = workInProgress2.memoizedState;
            var nextChildren = nextState.element;
            if (nextChildren === prevChildren) {
              resetHydrationState();
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            var root2 = workInProgress2.stateNode;
            if (root2.hydrate && enterHydrationState(workInProgress2)) {
              {
                var mutableSourceEagerHydrationData = root2.mutableSourceEagerHydrationData;
                if (mutableSourceEagerHydrationData != null) {
                  for (var i = 0; i < mutableSourceEagerHydrationData.length; i += 2) {
                    var mutableSource = mutableSourceEagerHydrationData[i];
                    var version = mutableSourceEagerHydrationData[i + 1];
                    setWorkInProgressVersion(mutableSource, version);
                  }
                }
              }
              var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
              workInProgress2.child = child;
              var node = child;
              while (node) {
                node.flags = node.flags & ~Placement | Hydrating;
                node = node.sibling;
              }
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
              resetHydrationState();
            }
            return workInProgress2.child;
          }
          function updateHostComponent(current2, workInProgress2, renderLanes2) {
            pushHostContext(workInProgress2);
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            var type = workInProgress2.type;
            var nextProps = workInProgress2.pendingProps;
            var prevProps = current2 !== null ? current2.memoizedProps : null;
            var nextChildren = nextProps.children;
            var isDirectTextChild = shouldSetTextContent(type, nextProps);
            if (isDirectTextChild) {
              nextChildren = null;
            } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
              workInProgress2.flags |= ContentReset;
            }
            markRef(current2, workInProgress2);
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateHostText(current2, workInProgress2) {
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            return null;
          }
          function mountLazyComponent(_current, workInProgress2, elementType, updateLanes, renderLanes2) {
            if (_current !== null) {
              _current.alternate = null;
              workInProgress2.alternate = null;
              workInProgress2.flags |= Placement;
            }
            var props = workInProgress2.pendingProps;
            var lazyComponent = elementType;
            var payload = lazyComponent._payload;
            var init = lazyComponent._init;
            var Component50 = init(payload);
            workInProgress2.type = Component50;
            var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component50);
            var resolvedProps = resolveDefaultProps(Component50, props);
            var child;
            switch (resolvedTag) {
              case FunctionComponent: {
                {
                  validateFunctionComponentInDev(workInProgress2, Component50);
                  workInProgress2.type = Component50 = resolveFunctionForHotReloading(Component50);
                }
                child = updateFunctionComponent(null, workInProgress2, Component50, resolvedProps, renderLanes2);
                return child;
              }
              case ClassComponent: {
                {
                  workInProgress2.type = Component50 = resolveClassForHotReloading(Component50);
                }
                child = updateClassComponent(null, workInProgress2, Component50, resolvedProps, renderLanes2);
                return child;
              }
              case ForwardRef: {
                {
                  workInProgress2.type = Component50 = resolveForwardRefForHotReloading(Component50);
                }
                child = updateForwardRef(null, workInProgress2, Component50, resolvedProps, renderLanes2);
                return child;
              }
              case MemoComponent: {
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = Component50.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        resolvedProps,
                        // Resolved for outer only
                        "prop",
                        getComponentName(Component50)
                      );
                    }
                  }
                }
                child = updateMemoComponent(
                  null,
                  workInProgress2,
                  Component50,
                  resolveDefaultProps(Component50.type, resolvedProps),
                  // The inner type can have defaults too
                  updateLanes,
                  renderLanes2
                );
                return child;
              }
            }
            var hint = "";
            {
              if (Component50 !== null && typeof Component50 === "object" && Component50.$$typeof === REACT_LAZY_TYPE) {
                hint = " Did you wrap a component in React.lazy() more than once?";
              }
            }
            {
              {
                throw Error("Element type is invalid. Received a promise that resolves to: " + Component50 + ". Lazy element type must resolve to a class or function." + hint);
              }
            }
          }
          function mountIncompleteClassComponent(_current, workInProgress2, Component50, nextProps, renderLanes2) {
            if (_current !== null) {
              _current.alternate = null;
              workInProgress2.alternate = null;
              workInProgress2.flags |= Placement;
            }
            workInProgress2.tag = ClassComponent;
            var hasContext;
            if (isContextProvider(Component50)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            constructClassInstance(workInProgress2, Component50, nextProps);
            mountClassInstance(workInProgress2, Component50, nextProps, renderLanes2);
            return finishClassComponent(null, workInProgress2, Component50, true, hasContext, renderLanes2);
          }
          function mountIndeterminateComponent(_current, workInProgress2, Component50, renderLanes2) {
            if (_current !== null) {
              _current.alternate = null;
              workInProgress2.alternate = null;
              workInProgress2.flags |= Placement;
            }
            var props = workInProgress2.pendingProps;
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component50, false);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var value;
            {
              if (Component50.prototype && typeof Component50.prototype.render === "function") {
                var componentName = getComponentName(Component50) || "Unknown";
                if (!didWarnAboutBadClass[componentName]) {
                  error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName);
                  didWarnAboutBadClass[componentName] = true;
                }
              }
              if (workInProgress2.mode & StrictMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
              }
              setIsRendering(true);
              ReactCurrentOwner$1.current = workInProgress2;
              value = renderWithHooks(null, workInProgress2, Component50, props, context, renderLanes2);
              setIsRendering(false);
            }
            workInProgress2.flags |= PerformedWork;
            {
              if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
                var _componentName = getComponentName(Component50) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName);
                  didWarnAboutModulePatternComponent[_componentName] = true;
                }
              }
            }
            if (
              // Run these checks in production only if the flag is off.
              // Eventually we'll delete this branch altogether.
              typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0
            ) {
              {
                var _componentName2 = getComponentName(Component50) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName2]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2);
                  didWarnAboutModulePatternComponent[_componentName2] = true;
                }
              }
              workInProgress2.tag = ClassComponent;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              var hasContext = false;
              if (isContextProvider(Component50)) {
                hasContext = true;
                pushContextProvider(workInProgress2);
              } else {
                hasContext = false;
              }
              workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
              initializeUpdateQueue(workInProgress2);
              var getDerivedStateFromProps = Component50.getDerivedStateFromProps;
              if (typeof getDerivedStateFromProps === "function") {
                applyDerivedStateFromProps(workInProgress2, Component50, getDerivedStateFromProps, props);
              }
              adoptClassInstance(workInProgress2, value);
              mountClassInstance(workInProgress2, Component50, props, renderLanes2);
              return finishClassComponent(null, workInProgress2, Component50, true, hasContext, renderLanes2);
            } else {
              workInProgress2.tag = FunctionComponent;
              {
                if (workInProgress2.mode & StrictMode) {
                  disableLogs();
                  try {
                    value = renderWithHooks(null, workInProgress2, Component50, props, context, renderLanes2);
                  } finally {
                    reenableLogs();
                  }
                }
              }
              reconcileChildren(null, workInProgress2, value, renderLanes2);
              {
                validateFunctionComponentInDev(workInProgress2, Component50);
              }
              return workInProgress2.child;
            }
          }
          function validateFunctionComponentInDev(workInProgress2, Component50) {
            {
              if (Component50) {
                if (Component50.childContextTypes) {
                  error("%s(...): childContextTypes cannot be defined on a function component.", Component50.displayName || Component50.name || "Component");
                }
              }
              if (workInProgress2.ref !== null) {
                var info2 = "";
                var ownerName = getCurrentFiberOwnerNameInDevOrNull();
                if (ownerName) {
                  info2 += "\n\nCheck the render method of `" + ownerName + "`.";
                }
                var warningKey = ownerName || workInProgress2._debugID || "";
                var debugSource = workInProgress2._debugSource;
                if (debugSource) {
                  warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
                }
                if (!didWarnAboutFunctionRefs[warningKey]) {
                  didWarnAboutFunctionRefs[warningKey] = true;
                  error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info2);
                }
              }
              if (typeof Component50.getDerivedStateFromProps === "function") {
                var _componentName3 = getComponentName(Component50) || "Unknown";
                if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
                  error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
                  didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
                }
              }
              if (typeof Component50.contextType === "object" && Component50.contextType !== null) {
                var _componentName4 = getComponentName(Component50) || "Unknown";
                if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
                  error("%s: Function components do not support contextType.", _componentName4);
                  didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
                }
              }
            }
          }
          var SUSPENDED_MARKER = {
            dehydrated: null,
            retryLane: NoLane
          };
          function mountSuspenseOffscreenState(renderLanes2) {
            return {
              baseLanes: renderLanes2
            };
          }
          function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
            return {
              baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2)
            };
          }
          function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              var suspenseState = current2.memoizedState;
              if (suspenseState === null) {
                return false;
              }
            }
            return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
          }
          function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
            return removeLanes(current2.childLanes, renderLanes2);
          }
          function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            {
              if (shouldSuspend(workInProgress2)) {
                workInProgress2.flags |= DidCapture;
              }
            }
            var suspenseContext = suspenseStackCursor.current;
            var showFallback = false;
            var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
              showFallback = true;
              workInProgress2.flags &= ~DidCapture;
            } else {
              if (current2 === null || current2.memoizedState !== null) {
                if (nextProps.fallback !== void 0 && nextProps.unstable_avoidThisFallback !== true) {
                  suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
                }
              }
            }
            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            pushSuspenseContext(workInProgress2, suspenseContext);
            if (current2 === null) {
              if (nextProps.fallback !== void 0) {
                tryToClaimNextHydratableInstance(workInProgress2);
              }
              var nextPrimaryChildren = nextProps.children;
              var nextFallbackChildren = nextProps.fallback;
              if (showFallback) {
                var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var primaryChildFragment = workInProgress2.child;
                primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackFragment;
              } else if (typeof nextProps.unstable_expectedLoadTime === "number") {
                var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var _primaryChildFragment = workInProgress2.child;
                _primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                workInProgress2.lanes = SomeRetryLane;
                {
                  markSpawnedWork(SomeRetryLane);
                }
                return _fallbackFragment;
              } else {
                return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren, renderLanes2);
              }
            } else {
              var prevState = current2.memoizedState;
              if (prevState !== null) {
                if (showFallback) {
                  var _nextFallbackChildren2 = nextProps.fallback;
                  var _nextPrimaryChildren2 = nextProps.children;
                  var _fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes2);
                  var _primaryChildFragment3 = workInProgress2.child;
                  var prevOffscreenState = current2.child.memoizedState;
                  _primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
                  _primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
                  workInProgress2.memoizedState = SUSPENDED_MARKER;
                  return _fallbackChildFragment;
                } else {
                  var _nextPrimaryChildren3 = nextProps.children;
                  var _primaryChildFragment4 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren3, renderLanes2);
                  workInProgress2.memoizedState = null;
                  return _primaryChildFragment4;
                }
              } else {
                if (showFallback) {
                  var _nextFallbackChildren3 = nextProps.fallback;
                  var _nextPrimaryChildren4 = nextProps.children;
                  var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes2);
                  var _primaryChildFragment5 = workInProgress2.child;
                  var _prevOffscreenState = current2.child.memoizedState;
                  _primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes2);
                  _primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
                  workInProgress2.memoizedState = SUSPENDED_MARKER;
                  return _fallbackChildFragment2;
                } else {
                  var _nextPrimaryChildren5 = nextProps.children;
                  var _primaryChildFragment6 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren5, renderLanes2);
                  workInProgress2.memoizedState = null;
                  return _primaryChildFragment6;
                }
              }
            }
          }
          function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var primaryChildProps = {
              mode: "visible",
              children: primaryChildren
            };
            var primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, renderLanes2, null);
            primaryChildFragment.return = workInProgress2;
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var progressedPrimaryFragment = workInProgress2.child;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            var fallbackChildFragment;
            if ((mode & BlockingMode) === NoMode && progressedPrimaryFragment !== null) {
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = 0;
                primaryChildFragment.treeBaseDuration = 0;
              }
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            } else {
              primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, NoLanes, null);
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            }
            primaryChildFragment.return = workInProgress2;
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function createWorkInProgressOffscreenFiber(current2, offscreenProps) {
            return createWorkInProgress(current2, offscreenProps);
          }
          function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
              mode: "visible",
              children: primaryChildren
            });
            if ((workInProgress2.mode & BlockingMode) === NoMode) {
              primaryChildFragment.lanes = renderLanes2;
            }
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = null;
            if (currentFallbackChildFragment !== null) {
              currentFallbackChildFragment.nextEffect = null;
              currentFallbackChildFragment.flags = Deletion;
              workInProgress2.firstEffect = workInProgress2.lastEffect = currentFallbackChildFragment;
            }
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            if (
              // In legacy mode, we commit the primary tree as if it successfully
              // completed, even though it's in an inconsistent state.
              (mode & BlockingMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
              // already cloned. In legacy mode, the only case where this isn't true is
              // when DevTools forces us to display a fallback; we skip the first render
              // pass entirely and go straight to rendering the fallback. (In Concurrent
              // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
              // only codepath.)
              workInProgress2.child !== currentPrimaryChildFragment
            ) {
              var progressedPrimaryFragment = workInProgress2.child;
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
                primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
              }
              var progressedLastEffect = primaryChildFragment.lastEffect;
              if (progressedLastEffect !== null) {
                workInProgress2.firstEffect = primaryChildFragment.firstEffect;
                workInProgress2.lastEffect = progressedLastEffect;
                progressedLastEffect.nextEffect = null;
              } else {
                workInProgress2.firstEffect = workInProgress2.lastEffect = null;
              }
            } else {
              primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
            }
            var fallbackChildFragment;
            if (currentFallbackChildFragment !== null) {
              fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
            } else {
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
              fallbackChildFragment.flags |= Placement;
            }
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function scheduleWorkOnFiber(fiber, renderLanes2) {
            fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
            var alternate = fiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
            }
            scheduleWorkOnParentPath(fiber.return, renderLanes2);
          }
          function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
            var node = firstChild;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  scheduleWorkOnFiber(node, renderLanes2);
                }
              } else if (node.tag === SuspenseListComponent) {
                scheduleWorkOnFiber(node, renderLanes2);
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === workInProgress2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === workInProgress2) {
                  return;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function findLastContentRow(firstChild) {
            var row = firstChild;
            var lastContentRow = null;
            while (row !== null) {
              var currentRow = row.alternate;
              if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                lastContentRow = row;
              }
              row = row.sibling;
            }
            return lastContentRow;
          }
          function validateRevealOrder(revealOrder) {
            {
              if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
                didWarnAboutRevealOrder[revealOrder] = true;
                if (typeof revealOrder === "string") {
                  switch (revealOrder.toLowerCase()) {
                    case "together":
                    case "forwards":
                    case "backwards": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    case "forward":
                    case "backward": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    default:
                      error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                      break;
                  }
                } else {
                  error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                }
              }
            }
          }
          function validateTailOptions(tailMode, revealOrder) {
            {
              if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
                if (tailMode !== "collapsed" && tailMode !== "hidden") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
                } else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
                }
              }
            }
          }
          function validateSuspenseListNestedChild(childSlot, index2) {
            {
              var isArray2 = Array.isArray(childSlot);
              var isIterable2 = !isArray2 && typeof getIteratorFn(childSlot) === "function";
              if (isArray2 || isIterable2) {
                var type = isArray2 ? "array" : "iterable";
                error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index2, type);
                return false;
              }
            }
            return true;
          }
          function validateSuspenseListChildren(children, revealOrder) {
            {
              if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
                if (Array.isArray(children)) {
                  for (var i = 0; i < children.length; i++) {
                    if (!validateSuspenseListNestedChild(children[i], i)) {
                      return;
                    }
                  }
                } else {
                  var iteratorFn = getIteratorFn(children);
                  if (typeof iteratorFn === "function") {
                    var childrenIterator = iteratorFn.call(children);
                    if (childrenIterator) {
                      var step = childrenIterator.next();
                      var _i = 0;
                      for (; !step.done; step = childrenIterator.next()) {
                        if (!validateSuspenseListNestedChild(step.value, _i)) {
                          return;
                        }
                        _i++;
                      }
                    }
                  } else {
                    error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', revealOrder);
                  }
                }
              }
            }
          }
          function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
            var renderState = workInProgress2.memoizedState;
            if (renderState === null) {
              workInProgress2.memoizedState = {
                isBackwards,
                rendering: null,
                renderingStartTime: 0,
                last: lastContentRow,
                tail,
                tailMode,
                lastEffect: lastEffectBeforeRendering
              };
            } else {
              renderState.isBackwards = isBackwards;
              renderState.rendering = null;
              renderState.renderingStartTime = 0;
              renderState.last = lastContentRow;
              renderState.tail = tail;
              renderState.tailMode = tailMode;
              renderState.lastEffect = lastEffectBeforeRendering;
            }
          }
          function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            var revealOrder = nextProps.revealOrder;
            var tailMode = nextProps.tail;
            var newChildren = nextProps.children;
            validateRevealOrder(revealOrder);
            validateTailOptions(tailMode, revealOrder);
            validateSuspenseListChildren(newChildren, revealOrder);
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            var suspenseContext = suspenseStackCursor.current;
            var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
            if (shouldForceFallback) {
              suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
              workInProgress2.flags |= DidCapture;
            } else {
              var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
              if (didSuspendBefore) {
                propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
              }
              suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            }
            pushSuspenseContext(workInProgress2, suspenseContext);
            if ((workInProgress2.mode & BlockingMode) === NoMode) {
              workInProgress2.memoizedState = null;
            } else {
              switch (revealOrder) {
                case "forwards": {
                  var lastContentRow = findLastContentRow(workInProgress2.child);
                  var tail;
                  if (lastContentRow === null) {
                    tail = workInProgress2.child;
                    workInProgress2.child = null;
                  } else {
                    tail = lastContentRow.sibling;
                    lastContentRow.sibling = null;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    // isBackwards
                    tail,
                    lastContentRow,
                    tailMode,
                    workInProgress2.lastEffect
                  );
                  break;
                }
                case "backwards": {
                  var _tail = null;
                  var row = workInProgress2.child;
                  workInProgress2.child = null;
                  while (row !== null) {
                    var currentRow = row.alternate;
                    if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                      workInProgress2.child = row;
                      break;
                    }
                    var nextRow = row.sibling;
                    row.sibling = _tail;
                    _tail = row;
                    row = nextRow;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    true,
                    // isBackwards
                    _tail,
                    null,
                    // last
                    tailMode,
                    workInProgress2.lastEffect
                  );
                  break;
                }
                case "together": {
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    // isBackwards
                    null,
                    // tail
                    null,
                    // last
                    void 0,
                    workInProgress2.lastEffect
                  );
                  break;
                }
                default: {
                  workInProgress2.memoizedState = null;
                }
              }
            }
            return workInProgress2.child;
          }
          function updatePortalComponent(current2, workInProgress2, renderLanes2) {
            pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
            var nextChildren = workInProgress2.pendingProps;
            if (current2 === null) {
              workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
          function updateContextProvider(current2, workInProgress2, renderLanes2) {
            var providerType = workInProgress2.type;
            var context = providerType._context;
            var newProps = workInProgress2.pendingProps;
            var oldProps = workInProgress2.memoizedProps;
            var newValue = newProps.value;
            {
              if (!("value" in newProps)) {
                if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
                  hasWarnedAboutUsingNoValuePropOnContextProvider = true;
                  error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
                }
              }
              var providerPropTypes = workInProgress2.type.propTypes;
              if (providerPropTypes) {
                checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
              }
            }
            pushProvider(workInProgress2, newValue);
            if (oldProps !== null) {
              var oldValue = oldProps.value;
              var changedBits = calculateChangedBits(context, newValue, oldValue);
              if (changedBits === 0) {
                if (oldProps.children === newProps.children && !hasContextChanged()) {
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                }
              } else {
                propagateContextChange(workInProgress2, context, changedBits, renderLanes2);
              }
            }
            var newChildren = newProps.children;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingContextAsConsumer = false;
          function updateContextConsumer(current2, workInProgress2, renderLanes2) {
            var context = workInProgress2.type;
            {
              if (context._context === void 0) {
                if (context !== context.Consumer) {
                  if (!hasWarnedAboutUsingContextAsConsumer) {
                    hasWarnedAboutUsingContextAsConsumer = true;
                    error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
                  }
                }
              } else {
                context = context._context;
              }
            }
            var newProps = workInProgress2.pendingProps;
            var render2 = newProps.children;
            {
              if (typeof render2 !== "function") {
                error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");
              }
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var newValue = readContext(context, newProps.unstable_observedBits);
            var newChildren;
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              newChildren = render2(newValue);
              setIsRendering(false);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markWorkInProgressReceivedUpdate() {
            didReceiveUpdate = true;
          }
          function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              workInProgress2.dependencies = current2.dependencies;
            }
            {
              stopProfilerTimerIfRunning();
            }
            markSkippedUpdateLanes(workInProgress2.lanes);
            if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
              return null;
            } else {
              cloneChildFibers(current2, workInProgress2);
              return workInProgress2.child;
            }
          }
          function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
            {
              var returnFiber = oldWorkInProgress.return;
              if (returnFiber === null) {
                throw new Error("Cannot swap the root fiber.");
              }
              current2.alternate = null;
              oldWorkInProgress.alternate = null;
              newWorkInProgress.index = oldWorkInProgress.index;
              newWorkInProgress.sibling = oldWorkInProgress.sibling;
              newWorkInProgress.return = oldWorkInProgress.return;
              newWorkInProgress.ref = oldWorkInProgress.ref;
              if (oldWorkInProgress === returnFiber.child) {
                returnFiber.child = newWorkInProgress;
              } else {
                var prevSibling = returnFiber.child;
                if (prevSibling === null) {
                  throw new Error("Expected parent to have a child.");
                }
                while (prevSibling.sibling !== oldWorkInProgress) {
                  prevSibling = prevSibling.sibling;
                  if (prevSibling === null) {
                    throw new Error("Expected to find the previous sibling.");
                  }
                }
                prevSibling.sibling = newWorkInProgress;
              }
              var last = returnFiber.lastEffect;
              if (last !== null) {
                last.nextEffect = current2;
                returnFiber.lastEffect = current2;
              } else {
                returnFiber.firstEffect = returnFiber.lastEffect = current2;
              }
              current2.nextEffect = null;
              current2.flags = Deletion;
              newWorkInProgress.flags |= Placement;
              return newWorkInProgress;
            }
          }
          function beginWork(current2, workInProgress2, renderLanes2) {
            var updateLanes = workInProgress2.lanes;
            {
              if (workInProgress2._debugNeedsRemount && current2 !== null) {
                return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
              }
            }
            if (current2 !== null) {
              var oldProps = current2.memoizedProps;
              var newProps = workInProgress2.pendingProps;
              if (oldProps !== newProps || hasContextChanged() || // Force a re-render if the implementation changed due to hot reload:
              workInProgress2.type !== current2.type) {
                didReceiveUpdate = true;
              } else if (!includesSomeLane(renderLanes2, updateLanes)) {
                didReceiveUpdate = false;
                switch (workInProgress2.tag) {
                  case HostRoot:
                    pushHostRootContext(workInProgress2);
                    resetHydrationState();
                    break;
                  case HostComponent:
                    pushHostContext(workInProgress2);
                    break;
                  case ClassComponent: {
                    var Component50 = workInProgress2.type;
                    if (isContextProvider(Component50)) {
                      pushContextProvider(workInProgress2);
                    }
                    break;
                  }
                  case HostPortal:
                    pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
                    break;
                  case ContextProvider: {
                    var newValue = workInProgress2.memoizedProps.value;
                    pushProvider(workInProgress2, newValue);
                    break;
                  }
                  case Profiler:
                    {
                      var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                      if (hasChildWork) {
                        workInProgress2.flags |= Update;
                      }
                      var stateNode = workInProgress2.stateNode;
                      stateNode.effectDuration = 0;
                      stateNode.passiveEffectDuration = 0;
                    }
                    break;
                  case SuspenseComponent: {
                    var state = workInProgress2.memoizedState;
                    if (state !== null) {
                      var primaryChildFragment = workInProgress2.child;
                      var primaryChildLanes = primaryChildFragment.childLanes;
                      if (includesSomeLane(renderLanes2, primaryChildLanes)) {
                        return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
                      } else {
                        pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                        var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                        if (child !== null) {
                          return child.sibling;
                        } else {
                          return null;
                        }
                      }
                    } else {
                      pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                    }
                    break;
                  }
                  case SuspenseListComponent: {
                    var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
                    var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                    if (didSuspendBefore) {
                      if (_hasChildWork) {
                        return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
                      }
                      workInProgress2.flags |= DidCapture;
                    }
                    var renderState = workInProgress2.memoizedState;
                    if (renderState !== null) {
                      renderState.rendering = null;
                      renderState.tail = null;
                      renderState.lastEffect = null;
                    }
                    pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
                    if (_hasChildWork) {
                      break;
                    } else {
                      return null;
                    }
                  }
                  case OffscreenComponent:
                  case LegacyHiddenComponent: {
                    workInProgress2.lanes = NoLanes;
                    return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
                  }
                }
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              } else {
                if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                } else {
                  didReceiveUpdate = false;
                }
              }
            } else {
              didReceiveUpdate = false;
            }
            workInProgress2.lanes = NoLanes;
            switch (workInProgress2.tag) {
              case IndeterminateComponent: {
                return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
              }
              case LazyComponent: {
                var elementType = workInProgress2.elementType;
                return mountLazyComponent(current2, workInProgress2, elementType, updateLanes, renderLanes2);
              }
              case FunctionComponent: {
                var _Component = workInProgress2.type;
                var unresolvedProps = workInProgress2.pendingProps;
                var resolvedProps = workInProgress2.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
                return updateFunctionComponent(current2, workInProgress2, _Component, resolvedProps, renderLanes2);
              }
              case ClassComponent: {
                var _Component2 = workInProgress2.type;
                var _unresolvedProps = workInProgress2.pendingProps;
                var _resolvedProps = workInProgress2.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
                return updateClassComponent(current2, workInProgress2, _Component2, _resolvedProps, renderLanes2);
              }
              case HostRoot:
                return updateHostRoot(current2, workInProgress2, renderLanes2);
              case HostComponent:
                return updateHostComponent(current2, workInProgress2, renderLanes2);
              case HostText:
                return updateHostText(current2, workInProgress2);
              case SuspenseComponent:
                return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
              case HostPortal:
                return updatePortalComponent(current2, workInProgress2, renderLanes2);
              case ForwardRef: {
                var type = workInProgress2.type;
                var _unresolvedProps2 = workInProgress2.pendingProps;
                var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
                return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
              }
              case Fragment38:
                return updateFragment(current2, workInProgress2, renderLanes2);
              case Mode:
                return updateMode(current2, workInProgress2, renderLanes2);
              case Profiler:
                return updateProfiler(current2, workInProgress2, renderLanes2);
              case ContextProvider:
                return updateContextProvider(current2, workInProgress2, renderLanes2);
              case ContextConsumer:
                return updateContextConsumer(current2, workInProgress2, renderLanes2);
              case MemoComponent: {
                var _type2 = workInProgress2.type;
                var _unresolvedProps3 = workInProgress2.pendingProps;
                var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = _type2.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        _resolvedProps3,
                        // Resolved for outer only
                        "prop",
                        getComponentName(_type2)
                      );
                    }
                  }
                }
                _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
                return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, updateLanes, renderLanes2);
              }
              case SimpleMemoComponent: {
                return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, updateLanes, renderLanes2);
              }
              case IncompleteClassComponent: {
                var _Component3 = workInProgress2.type;
                var _unresolvedProps4 = workInProgress2.pendingProps;
                var _resolvedProps4 = workInProgress2.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
                return mountIncompleteClassComponent(current2, workInProgress2, _Component3, _resolvedProps4, renderLanes2);
              }
              case SuspenseListComponent: {
                return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
              }
              case FundamentalComponent: {
                break;
              }
              case ScopeComponent: {
                break;
              }
              case Block: {
                break;
              }
              case OffscreenComponent: {
                return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
              }
              case LegacyHiddenComponent: {
                return updateLegacyHiddenComponent(current2, workInProgress2, renderLanes2);
              }
            }
            {
              {
                throw Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function markUpdate(workInProgress2) {
            workInProgress2.flags |= Update;
          }
          function markRef$1(workInProgress2) {
            workInProgress2.flags |= Ref;
          }
          var appendAllChildren;
          var updateHostContainer;
          var updateHostComponent$1;
          var updateHostText$1;
          {
            appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden3) {
              var node = workInProgress2.child;
              while (node !== null) {
                if (node.tag === HostComponent || node.tag === HostText) {
                  appendInitialChild(parent, node.stateNode);
                } else if (node.tag === HostPortal)
                  ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === workInProgress2) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === workInProgress2) {
                    return;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            };
            updateHostContainer = function(workInProgress2) {
            };
            updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
              var oldProps = current2.memoizedProps;
              if (oldProps === newProps) {
                return;
              }
              var instance = workInProgress2.stateNode;
              var currentHostContext = getHostContext();
              var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
              workInProgress2.updateQueue = updatePayload;
              if (updatePayload) {
                markUpdate(workInProgress2);
              }
            };
            updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
              if (oldText !== newText) {
                markUpdate(workInProgress2);
              }
            };
          }
          function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
            if (getIsHydrating()) {
              return;
            }
            switch (renderState.tailMode) {
              case "hidden": {
                var tailNode = renderState.tail;
                var lastTailNode = null;
                while (tailNode !== null) {
                  if (tailNode.alternate !== null) {
                    lastTailNode = tailNode;
                  }
                  tailNode = tailNode.sibling;
                }
                if (lastTailNode === null) {
                  renderState.tail = null;
                } else {
                  lastTailNode.sibling = null;
                }
                break;
              }
              case "collapsed": {
                var _tailNode = renderState.tail;
                var _lastTailNode = null;
                while (_tailNode !== null) {
                  if (_tailNode.alternate !== null) {
                    _lastTailNode = _tailNode;
                  }
                  _tailNode = _tailNode.sibling;
                }
                if (_lastTailNode === null) {
                  if (!hasRenderedATailFallback && renderState.tail !== null) {
                    renderState.tail.sibling = null;
                  } else {
                    renderState.tail = null;
                  }
                } else {
                  _lastTailNode.sibling = null;
                }
                break;
              }
            }
          }
          function completeWork(current2, workInProgress2, renderLanes2) {
            var newProps = workInProgress2.pendingProps;
            switch (workInProgress2.tag) {
              case IndeterminateComponent:
              case LazyComponent:
              case SimpleMemoComponent:
              case FunctionComponent:
              case ForwardRef:
              case Fragment38:
              case Mode:
              case Profiler:
              case ContextConsumer:
              case MemoComponent:
                return null;
              case ClassComponent: {
                var Component50 = workInProgress2.type;
                if (isContextProvider(Component50)) {
                  popContext(workInProgress2);
                }
                return null;
              }
              case HostRoot: {
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                var fiberRoot = workInProgress2.stateNode;
                if (fiberRoot.pendingContext) {
                  fiberRoot.context = fiberRoot.pendingContext;
                  fiberRoot.pendingContext = null;
                }
                if (current2 === null || current2.child === null) {
                  var wasHydrated = popHydrationState(workInProgress2);
                  if (wasHydrated) {
                    markUpdate(workInProgress2);
                  } else if (!fiberRoot.hydrate) {
                    workInProgress2.flags |= Snapshot;
                  }
                }
                updateHostContainer(workInProgress2);
                return null;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                var rootContainerInstance = getRootHostContainer();
                var type = workInProgress2.type;
                if (current2 !== null && workInProgress2.stateNode != null) {
                  updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
                  if (current2.ref !== workInProgress2.ref) {
                    markRef$1(workInProgress2);
                  }
                } else {
                  if (!newProps) {
                    if (!(workInProgress2.stateNode !== null)) {
                      {
                        throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                      }
                    }
                    return null;
                  }
                  var currentHostContext = getHostContext();
                  var _wasHydrated = popHydrationState(workInProgress2);
                  if (_wasHydrated) {
                    if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
                    appendAllChildren(instance, workInProgress2, false, false);
                    workInProgress2.stateNode = instance;
                    if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
                      markUpdate(workInProgress2);
                    }
                  }
                  if (workInProgress2.ref !== null) {
                    markRef$1(workInProgress2);
                  }
                }
                return null;
              }
              case HostText: {
                var newText = newProps;
                if (current2 && workInProgress2.stateNode != null) {
                  var oldText = current2.memoizedProps;
                  updateHostText$1(current2, workInProgress2, oldText, newText);
                } else {
                  if (typeof newText !== "string") {
                    if (!(workInProgress2.stateNode !== null)) {
                      {
                        throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                      }
                    }
                  }
                  var _rootContainerInstance = getRootHostContainer();
                  var _currentHostContext = getHostContext();
                  var _wasHydrated2 = popHydrationState(workInProgress2);
                  if (_wasHydrated2) {
                    if (prepareToHydrateHostTextInstance(workInProgress2)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
                  }
                }
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var nextState = workInProgress2.memoizedState;
                if ((workInProgress2.flags & DidCapture) !== NoFlags) {
                  workInProgress2.lanes = renderLanes2;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                var nextDidTimeout = nextState !== null;
                var prevDidTimeout = false;
                if (current2 === null) {
                  if (workInProgress2.memoizedProps.fallback !== void 0) {
                    popHydrationState(workInProgress2);
                  }
                } else {
                  var prevState = current2.memoizedState;
                  prevDidTimeout = prevState !== null;
                }
                if (nextDidTimeout && !prevDidTimeout) {
                  if ((workInProgress2.mode & BlockingMode) !== NoMode) {
                    var hasInvisibleChildContext = current2 === null && workInProgress2.memoizedProps.unstable_avoidThisFallback !== true;
                    if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
                      renderDidSuspend();
                    } else {
                      renderDidSuspendDelayIfPossible();
                    }
                  }
                }
                {
                  if (nextDidTimeout || prevDidTimeout) {
                    workInProgress2.flags |= Update;
                  }
                }
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                updateHostContainer(workInProgress2);
                if (current2 === null) {
                  preparePortalMount(workInProgress2.stateNode.containerInfo);
                }
                return null;
              case ContextProvider:
                popProvider(workInProgress2);
                return null;
              case IncompleteClassComponent: {
                var _Component = workInProgress2.type;
                if (isContextProvider(_Component)) {
                  popContext(workInProgress2);
                }
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                var renderState = workInProgress2.memoizedState;
                if (renderState === null) {
                  return null;
                }
                var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
                var renderedTail = renderState.rendering;
                if (renderedTail === null) {
                  if (!didSuspendAlready) {
                    var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
                    if (!cannotBeSuspended) {
                      var row = workInProgress2.child;
                      while (row !== null) {
                        var suspended = findFirstSuspended(row);
                        if (suspended !== null) {
                          didSuspendAlready = true;
                          workInProgress2.flags |= DidCapture;
                          cutOffTailIfNeeded(renderState, false);
                          var newThennables = suspended.updateQueue;
                          if (newThennables !== null) {
                            workInProgress2.updateQueue = newThennables;
                            workInProgress2.flags |= Update;
                          }
                          if (renderState.lastEffect === null) {
                            workInProgress2.firstEffect = null;
                          }
                          workInProgress2.lastEffect = renderState.lastEffect;
                          resetChildFibers(workInProgress2, renderLanes2);
                          pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                          return workInProgress2.child;
                        }
                        row = row.sibling;
                      }
                    }
                    if (renderState.tail !== null && now2() > getRenderTargetTime()) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                      {
                        markSpawnedWork(SomeRetryLane);
                      }
                    }
                  } else {
                    cutOffTailIfNeeded(renderState, false);
                  }
                } else {
                  if (!didSuspendAlready) {
                    var _suspended = findFirstSuspended(renderedTail);
                    if (_suspended !== null) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      var _newThennables = _suspended.updateQueue;
                      if (_newThennables !== null) {
                        workInProgress2.updateQueue = _newThennables;
                        workInProgress2.flags |= Update;
                      }
                      cutOffTailIfNeeded(renderState, true);
                      if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
                        var lastEffect = workInProgress2.lastEffect = renderState.lastEffect;
                        if (lastEffect !== null) {
                          lastEffect.nextEffect = null;
                        }
                        return null;
                      }
                    } else if (
                      // The time it took to render last row is greater than the remaining
                      // time we have to render. So rendering one more row would likely
                      // exceed it.
                      now2() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane
                    ) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                      {
                        markSpawnedWork(SomeRetryLane);
                      }
                    }
                  }
                  if (renderState.isBackwards) {
                    renderedTail.sibling = workInProgress2.child;
                    workInProgress2.child = renderedTail;
                  } else {
                    var previousSibling = renderState.last;
                    if (previousSibling !== null) {
                      previousSibling.sibling = renderedTail;
                    } else {
                      workInProgress2.child = renderedTail;
                    }
                    renderState.last = renderedTail;
                  }
                }
                if (renderState.tail !== null) {
                  var next = renderState.tail;
                  renderState.rendering = next;
                  renderState.tail = next.sibling;
                  renderState.lastEffect = workInProgress2.lastEffect;
                  renderState.renderingStartTime = now2();
                  next.sibling = null;
                  var suspenseContext = suspenseStackCursor.current;
                  if (didSuspendAlready) {
                    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
                  } else {
                    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
                  }
                  pushSuspenseContext(workInProgress2, suspenseContext);
                  return next;
                }
                return null;
              }
              case FundamentalComponent: {
                break;
              }
              case ScopeComponent: {
                break;
              }
              case Block:
                break;
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                popRenderLanes(workInProgress2);
                if (current2 !== null) {
                  var _nextState = workInProgress2.memoizedState;
                  var _prevState = current2.memoizedState;
                  var prevIsHidden = _prevState !== null;
                  var nextIsHidden = _nextState !== null;
                  if (prevIsHidden !== nextIsHidden && newProps.mode !== "unstable-defer-without-hiding") {
                    workInProgress2.flags |= Update;
                  }
                }
                return null;
              }
            }
            {
              {
                throw Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function unwindWork(workInProgress2, renderLanes2) {
            switch (workInProgress2.tag) {
              case ClassComponent: {
                var Component50 = workInProgress2.type;
                if (isContextProvider(Component50)) {
                  popContext(workInProgress2);
                }
                var flags = workInProgress2.flags;
                if (flags & ShouldCapture) {
                  workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case HostRoot: {
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                var _flags = workInProgress2.flags;
                if (!((_flags & DidCapture) === NoFlags)) {
                  {
                    throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
                  }
                }
                workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
                return workInProgress2;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var _flags2 = workInProgress2.flags;
                if (_flags2 & ShouldCapture) {
                  workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                return null;
              case ContextProvider:
                popProvider(workInProgress2);
                return null;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(workInProgress2);
                return null;
              default:
                return null;
            }
          }
          function unwindInterruptedWork(interruptedWork) {
            switch (interruptedWork.tag) {
              case ClassComponent: {
                var childContextTypes = interruptedWork.type.childContextTypes;
                if (childContextTypes !== null && childContextTypes !== void 0) {
                  popContext(interruptedWork);
                }
                break;
              }
              case HostRoot: {
                popHostContainer(interruptedWork);
                popTopLevelContextObject(interruptedWork);
                resetWorkInProgressVersions();
                break;
              }
              case HostComponent: {
                popHostContext(interruptedWork);
                break;
              }
              case HostPortal:
                popHostContainer(interruptedWork);
                break;
              case SuspenseComponent:
                popSuspenseContext(interruptedWork);
                break;
              case SuspenseListComponent:
                popSuspenseContext(interruptedWork);
                break;
              case ContextProvider:
                popProvider(interruptedWork);
                break;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(interruptedWork);
                break;
            }
          }
          function createCapturedValue(value, source) {
            return {
              value,
              source,
              stack: getStackByFiberInDevAndProd(source)
            };
          }
          function showErrorDialog(boundary, errorInfo) {
            return true;
          }
          function logCapturedError(boundary, errorInfo) {
            try {
              var logError = showErrorDialog(boundary, errorInfo);
              if (logError === false) {
                return;
              }
              var error2 = errorInfo.value;
              if (true) {
                var source = errorInfo.source;
                var stack = errorInfo.stack;
                var componentStack = stack !== null ? stack : "";
                if (error2 != null && error2._suppressLogging) {
                  if (boundary.tag === ClassComponent) {
                    return;
                  }
                  console["error"](error2);
                }
                var componentName = source ? getComponentName(source.type) : null;
                var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
                var errorBoundaryMessage;
                var errorBoundaryName = getComponentName(boundary.type);
                if (errorBoundaryName) {
                  errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
                } else {
                  errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
                }
                var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
                console["error"](combinedMessage);
              } else {
                console["error"](error2);
              }
            } catch (e) {
              setTimeout(function() {
                throw e;
              });
            }
          }
          var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
          function createRootErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            update.payload = {
              element: null
            };
            var error2 = errorInfo.value;
            update.callback = function() {
              onUncaughtError(error2);
              logCapturedError(fiber, errorInfo);
            };
            return update;
          }
          function createClassErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
            if (typeof getDerivedStateFromError === "function") {
              var error$1 = errorInfo.value;
              update.payload = function() {
                logCapturedError(fiber, errorInfo);
                return getDerivedStateFromError(error$1);
              };
            }
            var inst = fiber.stateNode;
            if (inst !== null && typeof inst.componentDidCatch === "function") {
              update.callback = function callback() {
                {
                  markFailedErrorBoundaryForHotReloading(fiber);
                }
                if (typeof getDerivedStateFromError !== "function") {
                  markLegacyErrorBoundaryAsFailed(this);
                  logCapturedError(fiber, errorInfo);
                }
                var error$12 = errorInfo.value;
                var stack = errorInfo.stack;
                this.componentDidCatch(error$12, {
                  componentStack: stack !== null ? stack : ""
                });
                {
                  if (typeof getDerivedStateFromError !== "function") {
                    if (!includesSomeLane(fiber.lanes, SyncLane)) {
                      error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentName(fiber.type) || "Unknown");
                    }
                  }
                }
              };
            } else {
              update.callback = function() {
                markFailedErrorBoundaryForHotReloading(fiber);
              };
            }
            return update;
          }
          function attachPingListener(root2, wakeable, lanes) {
            var pingCache = root2.pingCache;
            var threadIDs;
            if (pingCache === null) {
              pingCache = root2.pingCache = new PossiblyWeakMap$1();
              threadIDs = /* @__PURE__ */ new Set();
              pingCache.set(wakeable, threadIDs);
            } else {
              threadIDs = pingCache.get(wakeable);
              if (threadIDs === void 0) {
                threadIDs = /* @__PURE__ */ new Set();
                pingCache.set(wakeable, threadIDs);
              }
            }
            if (!threadIDs.has(lanes)) {
              threadIDs.add(lanes);
              var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
              wakeable.then(ping, ping);
            }
          }
          function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
            sourceFiber.flags |= Incomplete;
            sourceFiber.firstEffect = sourceFiber.lastEffect = null;
            if (value !== null && typeof value === "object" && typeof value.then === "function") {
              var wakeable = value;
              if ((sourceFiber.mode & BlockingMode) === NoMode) {
                var currentSource = sourceFiber.alternate;
                if (currentSource) {
                  sourceFiber.updateQueue = currentSource.updateQueue;
                  sourceFiber.memoizedState = currentSource.memoizedState;
                  sourceFiber.lanes = currentSource.lanes;
                } else {
                  sourceFiber.updateQueue = null;
                  sourceFiber.memoizedState = null;
                }
              }
              var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext);
              var _workInProgress = returnFiber;
              do {
                if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
                  var wakeables = _workInProgress.updateQueue;
                  if (wakeables === null) {
                    var updateQueue = /* @__PURE__ */ new Set();
                    updateQueue.add(wakeable);
                    _workInProgress.updateQueue = updateQueue;
                  } else {
                    wakeables.add(wakeable);
                  }
                  if ((_workInProgress.mode & BlockingMode) === NoMode) {
                    _workInProgress.flags |= DidCapture;
                    sourceFiber.flags |= ForceUpdateForLegacySuspense;
                    sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
                    if (sourceFiber.tag === ClassComponent) {
                      var currentSourceFiber = sourceFiber.alternate;
                      if (currentSourceFiber === null) {
                        sourceFiber.tag = IncompleteClassComponent;
                      } else {
                        var update = createUpdate(NoTimestamp, SyncLane);
                        update.tag = ForceUpdate;
                        enqueueUpdate(sourceFiber, update);
                      }
                    }
                    sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
                    return;
                  }
                  attachPingListener(root2, wakeable, rootRenderLanes);
                  _workInProgress.flags |= ShouldCapture;
                  _workInProgress.lanes = rootRenderLanes;
                  return;
                }
                _workInProgress = _workInProgress.return;
              } while (_workInProgress !== null);
              value = new Error((getComponentName(sourceFiber.type) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.");
            }
            renderDidError();
            value = createCapturedValue(value, sourceFiber);
            var workInProgress2 = returnFiber;
            do {
              switch (workInProgress2.tag) {
                case HostRoot: {
                  var _errorInfo = value;
                  workInProgress2.flags |= ShouldCapture;
                  var lane = pickArbitraryLane(rootRenderLanes);
                  workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                  var _update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
                  enqueueCapturedUpdate(workInProgress2, _update);
                  return;
                }
                case ClassComponent:
                  var errorInfo = value;
                  var ctor = workInProgress2.type;
                  var instance = workInProgress2.stateNode;
                  if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
                    workInProgress2.flags |= ShouldCapture;
                    var _lane = pickArbitraryLane(rootRenderLanes);
                    workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
                    var _update2 = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
                    enqueueCapturedUpdate(workInProgress2, _update2);
                    return;
                  }
                  break;
              }
              workInProgress2 = workInProgress2.return;
            } while (workInProgress2 !== null);
          }
          var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
          {
            didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
          }
          var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
          var callComponentWillUnmountWithTimer = function(current2, instance) {
            instance.props = current2.memoizedProps;
            instance.state = current2.memoizedState;
            {
              instance.componentWillUnmount();
            }
          };
          function safelyCallComponentWillUnmount(current2, instance) {
            {
              invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current2, instance);
              if (hasCaughtError()) {
                var unmountError = clearCaughtError();
                captureCommitPhaseError(current2, unmountError);
              }
            }
          }
          function safelyDetachRef(current2) {
            var ref = current2.ref;
            if (ref !== null) {
              if (typeof ref === "function") {
                {
                  invokeGuardedCallback(null, ref, null, null);
                  if (hasCaughtError()) {
                    var refError = clearCaughtError();
                    captureCommitPhaseError(current2, refError);
                  }
                }
              } else {
                ref.current = null;
              }
            }
          }
          function safelyCallDestroy(current2, destroy) {
            {
              invokeGuardedCallback(null, destroy, null);
              if (hasCaughtError()) {
                var error2 = clearCaughtError();
                captureCommitPhaseError(current2, error2);
              }
            }
          }
          function commitBeforeMutationLifeCycles(current2, finishedWork) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent:
              case Block: {
                return;
              }
              case ClassComponent: {
                if (finishedWork.flags & Snapshot) {
                  if (current2 !== null) {
                    var prevProps = current2.memoizedProps;
                    var prevState = current2.memoizedState;
                    var instance = finishedWork.stateNode;
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                      }
                    }
                    var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
                    {
                      var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
                      if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
                        didWarnSet.add(finishedWork.type);
                        error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentName(finishedWork.type));
                      }
                    }
                    instance.__reactInternalSnapshotBeforeUpdate = snapshot;
                  }
                }
                return;
              }
              case HostRoot: {
                {
                  if (finishedWork.flags & Snapshot) {
                    var root2 = finishedWork.stateNode;
                    clearContainer(root2.containerInfo);
                  }
                }
                return;
              }
              case HostComponent:
              case HostText:
              case HostPortal:
              case IncompleteClassComponent:
                return;
            }
            {
              {
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function commitHookEffectListUnmount(tag, finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect4 = firstEffect;
              do {
                if ((effect4.tag & tag) === tag) {
                  var destroy = effect4.destroy;
                  effect4.destroy = void 0;
                  if (destroy !== void 0) {
                    destroy();
                  }
                }
                effect4 = effect4.next;
              } while (effect4 !== firstEffect);
            }
          }
          function commitHookEffectListMount(tag, finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect4 = firstEffect;
              do {
                if ((effect4.tag & tag) === tag) {
                  var create = effect4.create;
                  effect4.destroy = create();
                  {
                    var destroy = effect4.destroy;
                    if (destroy !== void 0 && typeof destroy !== "function") {
                      var addendum = void 0;
                      if (destroy === null) {
                        addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
                      } else if (typeof destroy.then === "function") {
                        addendum = "\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\nuseEffect(() => {\n  async function fetchData() {\n    // You can await here\n    const response = await MyAPI.getData(someId);\n    // ...\n  }\n  fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching";
                      } else {
                        addendum = " You returned: " + destroy;
                      }
                      error("An effect function must not return anything besides a function, which is used for clean-up.%s", addendum);
                    }
                  }
                }
                effect4 = effect4.next;
              } while (effect4 !== firstEffect);
            }
          }
          function schedulePassiveEffects(finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect4 = firstEffect;
              do {
                var _effect = effect4, next = _effect.next, tag = _effect.tag;
                if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {
                  enqueuePendingPassiveHookEffectUnmount(finishedWork, effect4);
                  enqueuePendingPassiveHookEffectMount(finishedWork, effect4);
                }
                effect4 = next;
              } while (effect4 !== firstEffect);
            }
          }
          function commitLifeCycles(finishedRoot, current2, finishedWork, committedLanes) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent:
              case Block: {
                {
                  commitHookEffectListMount(Layout | HasEffect, finishedWork);
                }
                schedulePassiveEffects(finishedWork);
                return;
              }
              case ClassComponent: {
                var instance = finishedWork.stateNode;
                if (finishedWork.flags & Update) {
                  if (current2 === null) {
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                      }
                    }
                    {
                      instance.componentDidMount();
                    }
                  } else {
                    var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
                    var prevState = current2.memoizedState;
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                        }
                      }
                    }
                    {
                      instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                    }
                  }
                }
                var updateQueue = finishedWork.updateQueue;
                if (updateQueue !== null) {
                  {
                    if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                      if (instance.props !== finishedWork.memoizedProps) {
                        error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                      }
                      if (instance.state !== finishedWork.memoizedState) {
                        error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentName(finishedWork.type) || "instance");
                      }
                    }
                  }
                  commitUpdateQueue(finishedWork, updateQueue, instance);
                }
                return;
              }
              case HostRoot: {
                var _updateQueue = finishedWork.updateQueue;
                if (_updateQueue !== null) {
                  var _instance = null;
                  if (finishedWork.child !== null) {
                    switch (finishedWork.child.tag) {
                      case HostComponent:
                        _instance = getPublicInstance(finishedWork.child.stateNode);
                        break;
                      case ClassComponent:
                        _instance = finishedWork.child.stateNode;
                        break;
                    }
                  }
                  commitUpdateQueue(finishedWork, _updateQueue, _instance);
                }
                return;
              }
              case HostComponent: {
                var _instance2 = finishedWork.stateNode;
                if (current2 === null && finishedWork.flags & Update) {
                  var type = finishedWork.type;
                  var props = finishedWork.memoizedProps;
                  commitMount(_instance2, type, props);
                }
                return;
              }
              case HostText: {
                return;
              }
              case HostPortal: {
                return;
              }
              case Profiler: {
                {
                  var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
                  var effectDuration = finishedWork.stateNode.effectDuration;
                  var commitTime2 = getCommitTime();
                  if (typeof onRender === "function") {
                    {
                      onRender(finishedWork.memoizedProps.id, current2 === null ? "mount" : "update", finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2, finishedRoot.memoizedInteractions);
                    }
                  }
                }
                return;
              }
              case SuspenseComponent: {
                commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
                return;
              }
              case SuspenseListComponent:
              case IncompleteClassComponent:
              case FundamentalComponent:
              case ScopeComponent:
              case OffscreenComponent:
              case LegacyHiddenComponent:
                return;
            }
            {
              {
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function hideOrUnhideAllChildren(finishedWork, isHidden3) {
            {
              var node = finishedWork;
              while (true) {
                if (node.tag === HostComponent) {
                  var instance = node.stateNode;
                  if (isHidden3) {
                    hideInstance(instance);
                  } else {
                    unhideInstance(node.stateNode, node.memoizedProps);
                  }
                } else if (node.tag === HostText) {
                  var _instance3 = node.stateNode;
                  if (isHidden3) {
                    hideTextInstance(_instance3);
                  } else {
                    unhideTextInstance(_instance3, node.memoizedProps);
                  }
                } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork)
                  ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === finishedWork) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === finishedWork) {
                    return;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
          }
          function commitAttachRef(finishedWork) {
            var ref = finishedWork.ref;
            if (ref !== null) {
              var instance = finishedWork.stateNode;
              var instanceToUse;
              switch (finishedWork.tag) {
                case HostComponent:
                  instanceToUse = getPublicInstance(instance);
                  break;
                default:
                  instanceToUse = instance;
              }
              if (typeof ref === "function") {
                ref(instanceToUse);
              } else {
                {
                  if (!ref.hasOwnProperty("current")) {
                    error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentName(finishedWork.type));
                  }
                }
                ref.current = instanceToUse;
              }
            }
          }
          function commitDetachRef(current2) {
            var currentRef = current2.ref;
            if (currentRef !== null) {
              if (typeof currentRef === "function") {
                currentRef(null);
              } else {
                currentRef.current = null;
              }
            }
          }
          function commitUnmount(finishedRoot, current2, renderPriorityLevel) {
            onCommitUnmount(current2);
            switch (current2.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent:
              case Block: {
                var updateQueue = current2.updateQueue;
                if (updateQueue !== null) {
                  var lastEffect = updateQueue.lastEffect;
                  if (lastEffect !== null) {
                    var firstEffect = lastEffect.next;
                    var effect4 = firstEffect;
                    do {
                      var _effect2 = effect4, destroy = _effect2.destroy, tag = _effect2.tag;
                      if (destroy !== void 0) {
                        if ((tag & Passive$1) !== NoFlags$1) {
                          enqueuePendingPassiveHookEffectUnmount(current2, effect4);
                        } else {
                          {
                            safelyCallDestroy(current2, destroy);
                          }
                        }
                      }
                      effect4 = effect4.next;
                    } while (effect4 !== firstEffect);
                  }
                }
                return;
              }
              case ClassComponent: {
                safelyDetachRef(current2);
                var instance = current2.stateNode;
                if (typeof instance.componentWillUnmount === "function") {
                  safelyCallComponentWillUnmount(current2, instance);
                }
                return;
              }
              case HostComponent: {
                safelyDetachRef(current2);
                return;
              }
              case HostPortal: {
                {
                  unmountHostComponents(finishedRoot, current2);
                }
                return;
              }
              case FundamentalComponent: {
                return;
              }
              case DehydratedFragment: {
                return;
              }
              case ScopeComponent: {
                return;
              }
            }
          }
          function commitNestedUnmounts(finishedRoot, root2, renderPriorityLevel) {
            var node = root2;
            while (true) {
              commitUnmount(finishedRoot, node);
              if (node.child !== null && // If we use mutation we drill down into portals using commitUnmount above.
              // If we don't use mutation we drill down into portals here instead.
              node.tag !== HostPortal) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === root2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === root2) {
                  return;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function detachFiberMutation(fiber) {
            fiber.alternate = null;
            fiber.child = null;
            fiber.dependencies = null;
            fiber.firstEffect = null;
            fiber.lastEffect = null;
            fiber.memoizedProps = null;
            fiber.memoizedState = null;
            fiber.pendingProps = null;
            fiber.return = null;
            fiber.updateQueue = null;
            {
              fiber._debugOwner = null;
            }
          }
          function getHostParentFiber(fiber) {
            var parent = fiber.return;
            while (parent !== null) {
              if (isHostParent(parent)) {
                return parent;
              }
              parent = parent.return;
            }
            {
              {
                throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function isHostParent(fiber) {
            return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
          }
          function getHostSibling(fiber) {
            var node = fiber;
            siblings:
              while (true) {
                while (node.sibling === null) {
                  if (node.return === null || isHostParent(node.return)) {
                    return null;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
                while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
                  if (node.flags & Placement) {
                    continue siblings;
                  }
                  if (node.child === null || node.tag === HostPortal) {
                    continue siblings;
                  } else {
                    node.child.return = node;
                    node = node.child;
                  }
                }
                if (!(node.flags & Placement)) {
                  return node.stateNode;
                }
              }
          }
          function commitPlacement(finishedWork) {
            var parentFiber = getHostParentFiber(finishedWork);
            var parent;
            var isContainer;
            var parentStateNode = parentFiber.stateNode;
            switch (parentFiber.tag) {
              case HostComponent:
                parent = parentStateNode;
                isContainer = false;
                break;
              case HostRoot:
                parent = parentStateNode.containerInfo;
                isContainer = true;
                break;
              case HostPortal:
                parent = parentStateNode.containerInfo;
                isContainer = true;
                break;
              case FundamentalComponent:
              default: {
                {
                  throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
            if (parentFiber.flags & ContentReset) {
              resetTextContent(parent);
              parentFiber.flags &= ~ContentReset;
            }
            var before = getHostSibling(finishedWork);
            if (isContainer) {
              insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);
            } else {
              insertOrAppendPlacementNode(finishedWork, before, parent);
            }
          }
          function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost || enableFundamentalAPI) {
              var stateNode = isHost ? node.stateNode : node.stateNode.instance;
              if (before) {
                insertInContainerBefore(parent, stateNode, before);
              } else {
                appendChildToContainer(parent, stateNode);
              }
            } else if (tag === HostPortal)
              ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNodeIntoContainer(child, before, parent);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          function insertOrAppendPlacementNode(node, before, parent) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost || enableFundamentalAPI) {
              var stateNode = isHost ? node.stateNode : node.stateNode.instance;
              if (before) {
                insertBefore(parent, stateNode, before);
              } else {
                appendChild(parent, stateNode);
              }
            } else if (tag === HostPortal)
              ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNode(child, before, parent);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNode(sibling, before, parent);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          function unmountHostComponents(finishedRoot, current2, renderPriorityLevel) {
            var node = current2;
            var currentParentIsValid = false;
            var currentParent;
            var currentParentIsContainer;
            while (true) {
              if (!currentParentIsValid) {
                var parent = node.return;
                findParent:
                  while (true) {
                    if (!(parent !== null)) {
                      {
                        throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
                      }
                    }
                    var parentStateNode = parent.stateNode;
                    switch (parent.tag) {
                      case HostComponent:
                        currentParent = parentStateNode;
                        currentParentIsContainer = false;
                        break findParent;
                      case HostRoot:
                        currentParent = parentStateNode.containerInfo;
                        currentParentIsContainer = true;
                        break findParent;
                      case HostPortal:
                        currentParent = parentStateNode.containerInfo;
                        currentParentIsContainer = true;
                        break findParent;
                    }
                    parent = parent.return;
                  }
                currentParentIsValid = true;
              }
              if (node.tag === HostComponent || node.tag === HostText) {
                commitNestedUnmounts(finishedRoot, node);
                if (currentParentIsContainer) {
                  removeChildFromContainer(currentParent, node.stateNode);
                } else {
                  removeChild(currentParent, node.stateNode);
                }
              } else if (node.tag === HostPortal) {
                if (node.child !== null) {
                  currentParent = node.stateNode.containerInfo;
                  currentParentIsContainer = true;
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
              } else {
                commitUnmount(finishedRoot, node);
                if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
              }
              if (node === current2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === current2) {
                  return;
                }
                node = node.return;
                if (node.tag === HostPortal) {
                  currentParentIsValid = false;
                }
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function commitDeletion(finishedRoot, current2, renderPriorityLevel) {
            {
              unmountHostComponents(finishedRoot, current2);
            }
            var alternate = current2.alternate;
            detachFiberMutation(current2);
            if (alternate !== null) {
              detachFiberMutation(alternate);
            }
          }
          function commitWork(current2, finishedWork) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent:
              case Block: {
                {
                  commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
                }
                return;
              }
              case ClassComponent: {
                return;
              }
              case HostComponent: {
                var instance = finishedWork.stateNode;
                if (instance != null) {
                  var newProps = finishedWork.memoizedProps;
                  var oldProps = current2 !== null ? current2.memoizedProps : newProps;
                  var type = finishedWork.type;
                  var updatePayload = finishedWork.updateQueue;
                  finishedWork.updateQueue = null;
                  if (updatePayload !== null) {
                    commitUpdate(instance, updatePayload, type, oldProps, newProps);
                  }
                }
                return;
              }
              case HostText: {
                if (!(finishedWork.stateNode !== null)) {
                  {
                    throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
                  }
                }
                var textInstance = finishedWork.stateNode;
                var newText = finishedWork.memoizedProps;
                var oldText = current2 !== null ? current2.memoizedProps : newText;
                commitTextUpdate(textInstance, oldText, newText);
                return;
              }
              case HostRoot: {
                {
                  var _root = finishedWork.stateNode;
                  if (_root.hydrate) {
                    _root.hydrate = false;
                    commitHydratedContainer(_root.containerInfo);
                  }
                }
                return;
              }
              case Profiler: {
                return;
              }
              case SuspenseComponent: {
                commitSuspenseComponent(finishedWork);
                attachSuspenseRetryListeners(finishedWork);
                return;
              }
              case SuspenseListComponent: {
                attachSuspenseRetryListeners(finishedWork);
                return;
              }
              case IncompleteClassComponent: {
                return;
              }
              case FundamentalComponent: {
                break;
              }
              case ScopeComponent: {
                break;
              }
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                var newState = finishedWork.memoizedState;
                var isHidden3 = newState !== null;
                hideOrUnhideAllChildren(finishedWork, isHidden3);
                return;
              }
            }
            {
              {
                throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function commitSuspenseComponent(finishedWork) {
            var newState = finishedWork.memoizedState;
            if (newState !== null) {
              markCommitTimeOfFallback();
              {
                var primaryChildParent = finishedWork.child;
                hideOrUnhideAllChildren(primaryChildParent, true);
              }
            }
          }
          function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
            var newState = finishedWork.memoizedState;
            if (newState === null) {
              var current2 = finishedWork.alternate;
              if (current2 !== null) {
                var prevState = current2.memoizedState;
                if (prevState !== null) {
                  var suspenseInstance = prevState.dehydrated;
                  if (suspenseInstance !== null) {
                    commitHydratedSuspenseInstance(suspenseInstance);
                  }
                }
              }
            }
          }
          function attachSuspenseRetryListeners(finishedWork) {
            var wakeables = finishedWork.updateQueue;
            if (wakeables !== null) {
              finishedWork.updateQueue = null;
              var retryCache = finishedWork.stateNode;
              if (retryCache === null) {
                retryCache = finishedWork.stateNode = new PossiblyWeakSet();
              }
              wakeables.forEach(function(wakeable) {
                var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
                if (!retryCache.has(wakeable)) {
                  {
                    if (wakeable.__reactDoNotTraceInteractions !== true) {
                      retry = tracing.unstable_wrap(retry);
                    }
                  }
                  retryCache.add(wakeable);
                  wakeable.then(retry, retry);
                }
              });
            }
          }
          function isSuspenseBoundaryBeingHidden(current2, finishedWork) {
            if (current2 !== null) {
              var oldState = current2.memoizedState;
              if (oldState === null || oldState.dehydrated !== null) {
                var newState = finishedWork.memoizedState;
                return newState !== null && newState.dehydrated === null;
              }
            }
            return false;
          }
          function commitResetTextContent(current2) {
            resetTextContent(current2.stateNode);
          }
          var COMPONENT_TYPE = 0;
          var HAS_PSEUDO_CLASS_TYPE = 1;
          var ROLE_TYPE = 2;
          var TEST_NAME_TYPE = 3;
          var TEXT_TYPE = 4;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor$1 = Symbol.for;
            COMPONENT_TYPE = symbolFor$1("selector.component");
            HAS_PSEUDO_CLASS_TYPE = symbolFor$1("selector.has_pseudo_class");
            ROLE_TYPE = symbolFor$1("selector.role");
            TEST_NAME_TYPE = symbolFor$1("selector.test_id");
            TEXT_TYPE = symbolFor$1("selector.text");
          }
          var commitHooks = [];
          function onCommitRoot$1() {
            {
              commitHooks.forEach(function(commitHook) {
                return commitHook();
              });
            }
          }
          var ceil = Math.ceil;
          var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
          var NoContext = (
            /*             */
            0
          );
          var BatchedContext = (
            /*               */
            1
          );
          var EventContext = (
            /*                 */
            2
          );
          var DiscreteEventContext = (
            /*         */
            4
          );
          var LegacyUnbatchedContext = (
            /*       */
            8
          );
          var RenderContext = (
            /*                */
            16
          );
          var CommitContext = (
            /*                */
            32
          );
          var RetryAfterError = (
            /*       */
            64
          );
          var RootIncomplete = 0;
          var RootFatalErrored = 1;
          var RootErrored = 2;
          var RootSuspended = 3;
          var RootSuspendedWithDelay = 4;
          var RootCompleted = 5;
          var executionContext = NoContext;
          var workInProgressRoot = null;
          var workInProgress = null;
          var workInProgressRootRenderLanes = NoLanes;
          var subtreeRenderLanes = NoLanes;
          var subtreeRenderLanesCursor = createCursor(NoLanes);
          var workInProgressRootExitStatus = RootIncomplete;
          var workInProgressRootFatalError = null;
          var workInProgressRootIncludedLanes = NoLanes;
          var workInProgressRootSkippedLanes = NoLanes;
          var workInProgressRootUpdatedLanes = NoLanes;
          var workInProgressRootPingedLanes = NoLanes;
          var mostRecentlyUpdatedRoot = null;
          var globalMostRecentFallbackTime = 0;
          var FALLBACK_THROTTLE_MS = 500;
          var workInProgressRootRenderTargetTime = Infinity;
          var RENDER_TIMEOUT_MS = 500;
          function resetRenderTimer() {
            workInProgressRootRenderTargetTime = now2() + RENDER_TIMEOUT_MS;
          }
          function getRenderTargetTime() {
            return workInProgressRootRenderTargetTime;
          }
          var nextEffect = null;
          var hasUncaughtError = false;
          var firstUncaughtError = null;
          var legacyErrorBoundariesThatAlreadyFailed = null;
          var rootDoesHavePassiveEffects = false;
          var rootWithPendingPassiveEffects = null;
          var pendingPassiveEffectsRenderPriority = NoPriority$1;
          var pendingPassiveEffectsLanes = NoLanes;
          var pendingPassiveHookEffectsMount = [];
          var pendingPassiveHookEffectsUnmount = [];
          var rootsWithPendingDiscreteUpdates = null;
          var NESTED_UPDATE_LIMIT = 50;
          var nestedUpdateCount = 0;
          var rootWithNestedUpdates = null;
          var NESTED_PASSIVE_UPDATE_LIMIT = 50;
          var nestedPassiveUpdateCount = 0;
          var spawnedWorkDuringRender = null;
          var currentEventTime = NoTimestamp;
          var currentEventWipLanes = NoLanes;
          var currentEventPendingLanes = NoLanes;
          var isFlushingPassiveEffects = false;
          var focusedInstanceHandle = null;
          var shouldFireAfterActiveInstanceBlur = false;
          function getWorkInProgressRoot() {
            return workInProgressRoot;
          }
          function requestEventTime() {
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              return now2();
            }
            if (currentEventTime !== NoTimestamp) {
              return currentEventTime;
            }
            currentEventTime = now2();
            return currentEventTime;
          }
          function requestUpdateLane(fiber) {
            var mode = fiber.mode;
            if ((mode & BlockingMode) === NoMode) {
              return SyncLane;
            } else if ((mode & ConcurrentMode) === NoMode) {
              return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
            }
            if (currentEventWipLanes === NoLanes) {
              currentEventWipLanes = workInProgressRootIncludedLanes;
            }
            var isTransition = requestCurrentTransition() !== NoTransition;
            if (isTransition) {
              if (currentEventPendingLanes !== NoLanes) {
                currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;
              }
              return findTransitionLane(currentEventWipLanes, currentEventPendingLanes);
            }
            var schedulerPriority = getCurrentPriorityLevel();
            var lane;
            if (
              // TODO: Temporary. We're removing the concept of discrete updates.
              (executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingPriority$2
            ) {
              lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes);
            } else {
              var schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority);
              lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);
            }
            return lane;
          }
          function requestRetryLane(fiber) {
            var mode = fiber.mode;
            if ((mode & BlockingMode) === NoMode) {
              return SyncLane;
            } else if ((mode & ConcurrentMode) === NoMode) {
              return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;
            }
            if (currentEventWipLanes === NoLanes) {
              currentEventWipLanes = workInProgressRootIncludedLanes;
            }
            return findRetryLane(currentEventWipLanes);
          }
          function scheduleUpdateOnFiber(fiber, lane, eventTime) {
            checkForNestedUpdates();
            warnAboutRenderPhaseUpdatesInDEV(fiber);
            var root2 = markUpdateLaneFromFiberToRoot(fiber, lane);
            if (root2 === null) {
              warnAboutUpdateOnUnmountedFiberInDEV(fiber);
              return null;
            }
            markRootUpdated(root2, lane, eventTime);
            if (root2 === workInProgressRoot) {
              {
                workInProgressRootUpdatedLanes = mergeLanes(workInProgressRootUpdatedLanes, lane);
              }
              if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
                markRootSuspended$1(root2, workInProgressRootRenderLanes);
              }
            }
            var priorityLevel = getCurrentPriorityLevel();
            if (lane === SyncLane) {
              if (
                // Check if we're inside unbatchedUpdates
                (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering
                (executionContext & (RenderContext | CommitContext)) === NoContext
              ) {
                schedulePendingInteractions(root2, lane);
                performSyncWorkOnRoot(root2);
              } else {
                ensureRootIsScheduled(root2, eventTime);
                schedulePendingInteractions(root2, lane);
                if (executionContext === NoContext) {
                  resetRenderTimer();
                  flushSyncCallbackQueue();
                }
              }
            } else {
              if ((executionContext & DiscreteEventContext) !== NoContext && // Only updates at user-blocking priority or greater are considered
              // discrete, even inside a discrete event.
              (priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority$1)) {
                if (rootsWithPendingDiscreteUpdates === null) {
                  rootsWithPendingDiscreteUpdates = /* @__PURE__ */ new Set([root2]);
                } else {
                  rootsWithPendingDiscreteUpdates.add(root2);
                }
              }
              ensureRootIsScheduled(root2, eventTime);
              schedulePendingInteractions(root2, lane);
            }
            mostRecentlyUpdatedRoot = root2;
          }
          function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
            sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
            var alternate = sourceFiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, lane);
            }
            {
              if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
                warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
              }
            }
            var node = sourceFiber;
            var parent = sourceFiber.return;
            while (parent !== null) {
              parent.childLanes = mergeLanes(parent.childLanes, lane);
              alternate = parent.alternate;
              if (alternate !== null) {
                alternate.childLanes = mergeLanes(alternate.childLanes, lane);
              } else {
                {
                  if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
                    warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
                  }
                }
              }
              node = parent;
              parent = parent.return;
            }
            if (node.tag === HostRoot) {
              var root2 = node.stateNode;
              return root2;
            } else {
              return null;
            }
          }
          function ensureRootIsScheduled(root2, currentTime) {
            var existingCallbackNode = root2.callbackNode;
            markStarvedLanesAsExpired(root2, currentTime);
            var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            var newCallbackPriority = returnNextLanesPriority();
            if (nextLanes === NoLanes) {
              if (existingCallbackNode !== null) {
                cancelCallback(existingCallbackNode);
                root2.callbackNode = null;
                root2.callbackPriority = NoLanePriority;
              }
              return;
            }
            if (existingCallbackNode !== null) {
              var existingCallbackPriority = root2.callbackPriority;
              if (existingCallbackPriority === newCallbackPriority) {
                return;
              }
              cancelCallback(existingCallbackNode);
            }
            var newCallbackNode;
            if (newCallbackPriority === SyncLanePriority) {
              newCallbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
            } else if (newCallbackPriority === SyncBatchedLanePriority) {
              newCallbackNode = scheduleCallback(ImmediatePriority$1, performSyncWorkOnRoot.bind(null, root2));
            } else {
              var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);
              newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
            }
            root2.callbackPriority = newCallbackPriority;
            root2.callbackNode = newCallbackNode;
          }
          function performConcurrentWorkOnRoot(root2) {
            currentEventTime = NoTimestamp;
            currentEventWipLanes = NoLanes;
            currentEventPendingLanes = NoLanes;
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Should not already be working.");
              }
            }
            var originalCallbackNode = root2.callbackNode;
            var didFlushPassiveEffects = flushPassiveEffects();
            if (didFlushPassiveEffects) {
              if (root2.callbackNode !== originalCallbackNode) {
                return null;
              }
            }
            var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            if (lanes === NoLanes) {
              return null;
            }
            var exitStatus = renderRootConcurrent(root2, lanes);
            if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
              prepareFreshStack(root2, NoLanes);
            } else if (exitStatus !== RootIncomplete) {
              if (exitStatus === RootErrored) {
                executionContext |= RetryAfterError;
                if (root2.hydrate) {
                  root2.hydrate = false;
                  clearContainer(root2.containerInfo);
                }
                lanes = getLanesToRetrySynchronouslyOnError(root2);
                if (lanes !== NoLanes) {
                  exitStatus = renderRootSync(root2, lanes);
                }
              }
              if (exitStatus === RootFatalErrored) {
                var fatalError = workInProgressRootFatalError;
                prepareFreshStack(root2, NoLanes);
                markRootSuspended$1(root2, lanes);
                ensureRootIsScheduled(root2, now2());
                throw fatalError;
              }
              var finishedWork = root2.current.alternate;
              root2.finishedWork = finishedWork;
              root2.finishedLanes = lanes;
              finishConcurrentRender(root2, exitStatus, lanes);
            }
            ensureRootIsScheduled(root2, now2());
            if (root2.callbackNode === originalCallbackNode) {
              return performConcurrentWorkOnRoot.bind(null, root2);
            }
            return null;
          }
          function finishConcurrentRender(root2, exitStatus, lanes) {
            switch (exitStatus) {
              case RootIncomplete:
              case RootFatalErrored: {
                {
                  {
                    throw Error("Root did not complete. This is a bug in React.");
                  }
                }
              }
              case RootErrored: {
                commitRoot(root2);
                break;
              }
              case RootSuspended: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
                !shouldForceFlushFallbacksInDEV()) {
                  var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now2();
                  if (msUntilTimeout > 10) {
                    var nextLanes = getNextLanes(root2, NoLanes);
                    if (nextLanes !== NoLanes) {
                      break;
                    }
                    var suspendedLanes = root2.suspendedLanes;
                    if (!isSubsetOfLanes(suspendedLanes, lanes)) {
                      var eventTime = requestEventTime();
                      markRootPinged(root2, suspendedLanes);
                      break;
                    }
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2);
                break;
              }
              case RootSuspendedWithDelay: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyTransitions(lanes)) {
                  break;
                }
                if (!shouldForceFlushFallbacksInDEV()) {
                  var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
                  var eventTimeMs = mostRecentEventTime;
                  var timeElapsedMs = now2() - eventTimeMs;
                  var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
                  if (_msUntilTimeout > 10) {
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), _msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2);
                break;
              }
              case RootCompleted: {
                commitRoot(root2);
                break;
              }
              default: {
                {
                  {
                    throw Error("Unknown root exit status.");
                  }
                }
              }
            }
          }
          function markRootSuspended$1(root2, suspendedLanes) {
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootUpdatedLanes);
            markRootSuspended(root2, suspendedLanes);
          }
          function performSyncWorkOnRoot(root2) {
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Should not already be working.");
              }
            }
            flushPassiveEffects();
            var lanes;
            var exitStatus;
            if (root2 === workInProgressRoot && includesSomeLane(root2.expiredLanes, workInProgressRootRenderLanes)) {
              lanes = workInProgressRootRenderLanes;
              exitStatus = renderRootSync(root2, lanes);
              if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {
                lanes = getNextLanes(root2, lanes);
                exitStatus = renderRootSync(root2, lanes);
              }
            } else {
              lanes = getNextLanes(root2, NoLanes);
              exitStatus = renderRootSync(root2, lanes);
            }
            if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
              executionContext |= RetryAfterError;
              if (root2.hydrate) {
                root2.hydrate = false;
                clearContainer(root2.containerInfo);
              }
              lanes = getLanesToRetrySynchronouslyOnError(root2);
              if (lanes !== NoLanes) {
                exitStatus = renderRootSync(root2, lanes);
              }
            }
            if (exitStatus === RootFatalErrored) {
              var fatalError = workInProgressRootFatalError;
              prepareFreshStack(root2, NoLanes);
              markRootSuspended$1(root2, lanes);
              ensureRootIsScheduled(root2, now2());
              throw fatalError;
            }
            var finishedWork = root2.current.alternate;
            root2.finishedWork = finishedWork;
            root2.finishedLanes = lanes;
            commitRoot(root2);
            ensureRootIsScheduled(root2, now2());
            return null;
          }
          function flushDiscreteUpdates() {
            if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
              {
                if ((executionContext & RenderContext) !== NoContext) {
                  error("unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.");
                }
              }
              return;
            }
            flushPendingDiscreteUpdates();
            flushPassiveEffects();
          }
          function flushPendingDiscreteUpdates() {
            if (rootsWithPendingDiscreteUpdates !== null) {
              var roots = rootsWithPendingDiscreteUpdates;
              rootsWithPendingDiscreteUpdates = null;
              roots.forEach(function(root2) {
                markDiscreteUpdatesExpired(root2);
                ensureRootIsScheduled(root2, now2());
              });
            }
            flushSyncCallbackQueue();
          }
          function batchedUpdates$1(fn, a2) {
            var prevExecutionContext = executionContext;
            executionContext |= BatchedContext;
            try {
              return fn(a2);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext) {
                resetRenderTimer();
                flushSyncCallbackQueue();
              }
            }
          }
          function batchedEventUpdates$1(fn, a2) {
            var prevExecutionContext = executionContext;
            executionContext |= EventContext;
            try {
              return fn(a2);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext) {
                resetRenderTimer();
                flushSyncCallbackQueue();
              }
            }
          }
          function discreteUpdates$1(fn, a2, b, c2, d) {
            var prevExecutionContext = executionContext;
            executionContext |= DiscreteEventContext;
            {
              try {
                return runWithPriority$1(UserBlockingPriority$2, fn.bind(null, a2, b, c2, d));
              } finally {
                executionContext = prevExecutionContext;
                if (executionContext === NoContext) {
                  resetRenderTimer();
                  flushSyncCallbackQueue();
                }
              }
            }
          }
          function unbatchedUpdates(fn, a2) {
            var prevExecutionContext = executionContext;
            executionContext &= ~BatchedContext;
            executionContext |= LegacyUnbatchedContext;
            try {
              return fn(a2);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext) {
                resetRenderTimer();
                flushSyncCallbackQueue();
              }
            }
          }
          function flushSync(fn, a2) {
            var prevExecutionContext = executionContext;
            if ((prevExecutionContext & (RenderContext | CommitContext)) !== NoContext) {
              {
                error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
              }
              return fn(a2);
            }
            executionContext |= BatchedContext;
            {
              try {
                if (fn) {
                  return runWithPriority$1(ImmediatePriority$1, fn.bind(null, a2));
                } else {
                  return void 0;
                }
              } finally {
                executionContext = prevExecutionContext;
                flushSyncCallbackQueue();
              }
            }
          }
          function pushRenderLanes(fiber, lanes) {
            push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
            subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
            workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
          }
          function popRenderLanes(fiber) {
            subtreeRenderLanes = subtreeRenderLanesCursor.current;
            pop(subtreeRenderLanesCursor, fiber);
          }
          function prepareFreshStack(root2, lanes) {
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            var timeoutHandle = root2.timeoutHandle;
            if (timeoutHandle !== noTimeout) {
              root2.timeoutHandle = noTimeout;
              cancelTimeout(timeoutHandle);
            }
            if (workInProgress !== null) {
              var interruptedWork = workInProgress.return;
              while (interruptedWork !== null) {
                unwindInterruptedWork(interruptedWork);
                interruptedWork = interruptedWork.return;
              }
            }
            workInProgressRoot = root2;
            workInProgress = createWorkInProgress(root2.current, null);
            workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
            workInProgressRootExitStatus = RootIncomplete;
            workInProgressRootFatalError = null;
            workInProgressRootSkippedLanes = NoLanes;
            workInProgressRootUpdatedLanes = NoLanes;
            workInProgressRootPingedLanes = NoLanes;
            {
              spawnedWorkDuringRender = null;
            }
            {
              ReactStrictModeWarnings.discardPendingWarnings();
            }
          }
          function handleError(root2, thrownValue) {
            do {
              var erroredWork = workInProgress;
              try {
                resetContextDependencies();
                resetHooksAfterThrow();
                resetCurrentFiber();
                ReactCurrentOwner$2.current = null;
                if (erroredWork === null || erroredWork.return === null) {
                  workInProgressRootExitStatus = RootFatalErrored;
                  workInProgressRootFatalError = thrownValue;
                  workInProgress = null;
                  return;
                }
                if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
                }
                throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
                completeUnitOfWork(erroredWork);
              } catch (yetAnotherThrownValue) {
                thrownValue = yetAnotherThrownValue;
                if (workInProgress === erroredWork && erroredWork !== null) {
                  erroredWork = erroredWork.return;
                  workInProgress = erroredWork;
                } else {
                  erroredWork = workInProgress;
                }
                continue;
              }
              return;
            } while (true);
          }
          function pushDispatcher() {
            var prevDispatcher = ReactCurrentDispatcher$2.current;
            ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
            if (prevDispatcher === null) {
              return ContextOnlyDispatcher;
            } else {
              return prevDispatcher;
            }
          }
          function popDispatcher(prevDispatcher) {
            ReactCurrentDispatcher$2.current = prevDispatcher;
          }
          function pushInteractions(root2) {
            {
              var prevInteractions = tracing.__interactionsRef.current;
              tracing.__interactionsRef.current = root2.memoizedInteractions;
              return prevInteractions;
            }
          }
          function popInteractions(prevInteractions) {
            {
              tracing.__interactionsRef.current = prevInteractions;
            }
          }
          function markCommitTimeOfFallback() {
            globalMostRecentFallbackTime = now2();
          }
          function markSkippedUpdateLanes(lane) {
            workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
          }
          function renderDidSuspend() {
            if (workInProgressRootExitStatus === RootIncomplete) {
              workInProgressRootExitStatus = RootSuspended;
            }
          }
          function renderDidSuspendDelayIfPossible() {
            if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
              workInProgressRootExitStatus = RootSuspendedWithDelay;
            }
            if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootUpdatedLanes))) {
              markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
            }
          }
          function renderDidError() {
            if (workInProgressRootExitStatus !== RootCompleted) {
              workInProgressRootExitStatus = RootErrored;
            }
          }
          function renderHasNotSuspendedYet() {
            return workInProgressRootExitStatus === RootIncomplete;
          }
          function renderRootSync(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              prepareFreshStack(root2, lanes);
              startWorkOnPendingInteractions(root2, lanes);
            }
            var prevInteractions = pushInteractions(root2);
            do {
              try {
                workLoopSync();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            {
              popInteractions(prevInteractions);
            }
            executionContext = prevExecutionContext;
            popDispatcher(prevDispatcher);
            if (workInProgress !== null) {
              {
                {
                  throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
            }
            workInProgressRoot = null;
            workInProgressRootRenderLanes = NoLanes;
            return workInProgressRootExitStatus;
          }
          function workLoopSync() {
            while (workInProgress !== null) {
              performUnitOfWork(workInProgress);
            }
          }
          function renderRootConcurrent(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              resetRenderTimer();
              prepareFreshStack(root2, lanes);
              startWorkOnPendingInteractions(root2, lanes);
            }
            var prevInteractions = pushInteractions(root2);
            do {
              try {
                workLoopConcurrent();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            {
              popInteractions(prevInteractions);
            }
            popDispatcher(prevDispatcher);
            executionContext = prevExecutionContext;
            if (workInProgress !== null) {
              return RootIncomplete;
            } else {
              workInProgressRoot = null;
              workInProgressRootRenderLanes = NoLanes;
              return workInProgressRootExitStatus;
            }
          }
          function workLoopConcurrent() {
            while (workInProgress !== null && !shouldYield()) {
              performUnitOfWork(workInProgress);
            }
          }
          function performUnitOfWork(unitOfWork) {
            var current2 = unitOfWork.alternate;
            setCurrentFiber(unitOfWork);
            var next;
            if ((unitOfWork.mode & ProfileMode) !== NoMode) {
              startProfilerTimer(unitOfWork);
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
              stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
            } else {
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
            }
            resetCurrentFiber();
            unitOfWork.memoizedProps = unitOfWork.pendingProps;
            if (next === null) {
              completeUnitOfWork(unitOfWork);
            } else {
              workInProgress = next;
            }
            ReactCurrentOwner$2.current = null;
          }
          function completeUnitOfWork(unitOfWork) {
            var completedWork = unitOfWork;
            do {
              var current2 = completedWork.alternate;
              var returnFiber = completedWork.return;
              if ((completedWork.flags & Incomplete) === NoFlags) {
                setCurrentFiber(completedWork);
                var next = void 0;
                if ((completedWork.mode & ProfileMode) === NoMode) {
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                } else {
                  startProfilerTimer(completedWork);
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                }
                resetCurrentFiber();
                if (next !== null) {
                  workInProgress = next;
                  return;
                }
                resetChildLanes(completedWork);
                if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete
                (returnFiber.flags & Incomplete) === NoFlags) {
                  if (returnFiber.firstEffect === null) {
                    returnFiber.firstEffect = completedWork.firstEffect;
                  }
                  if (completedWork.lastEffect !== null) {
                    if (returnFiber.lastEffect !== null) {
                      returnFiber.lastEffect.nextEffect = completedWork.firstEffect;
                    }
                    returnFiber.lastEffect = completedWork.lastEffect;
                  }
                  var flags = completedWork.flags;
                  if (flags > PerformedWork) {
                    if (returnFiber.lastEffect !== null) {
                      returnFiber.lastEffect.nextEffect = completedWork;
                    } else {
                      returnFiber.firstEffect = completedWork;
                    }
                    returnFiber.lastEffect = completedWork;
                  }
                }
              } else {
                var _next = unwindWork(completedWork);
                if (_next !== null) {
                  _next.flags &= HostEffectMask;
                  workInProgress = _next;
                  return;
                }
                if ((completedWork.mode & ProfileMode) !== NoMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                  var actualDuration = completedWork.actualDuration;
                  var child = completedWork.child;
                  while (child !== null) {
                    actualDuration += child.actualDuration;
                    child = child.sibling;
                  }
                  completedWork.actualDuration = actualDuration;
                }
                if (returnFiber !== null) {
                  returnFiber.firstEffect = returnFiber.lastEffect = null;
                  returnFiber.flags |= Incomplete;
                }
              }
              var siblingFiber = completedWork.sibling;
              if (siblingFiber !== null) {
                workInProgress = siblingFiber;
                return;
              }
              completedWork = returnFiber;
              workInProgress = completedWork;
            } while (completedWork !== null);
            if (workInProgressRootExitStatus === RootIncomplete) {
              workInProgressRootExitStatus = RootCompleted;
            }
          }
          function resetChildLanes(completedWork) {
            if (
              // TODO: Move this check out of the hot path by moving `resetChildLanes`
              // to switch statement in `completeWork`.
              (completedWork.tag === LegacyHiddenComponent || completedWork.tag === OffscreenComponent) && completedWork.memoizedState !== null && !includesSomeLane(subtreeRenderLanes, OffscreenLane) && (completedWork.mode & ConcurrentMode) !== NoLanes
            ) {
              return;
            }
            var newChildLanes = NoLanes;
            if ((completedWork.mode & ProfileMode) !== NoMode) {
              var actualDuration = completedWork.actualDuration;
              var treeBaseDuration = completedWork.selfBaseDuration;
              var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
              var child = completedWork.child;
              while (child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
                if (shouldBubbleActualDurations) {
                  actualDuration += child.actualDuration;
                }
                treeBaseDuration += child.treeBaseDuration;
                child = child.sibling;
              }
              var isTimedOutSuspense = completedWork.tag === SuspenseComponent && completedWork.memoizedState !== null;
              if (isTimedOutSuspense) {
                var primaryChildFragment = completedWork.child;
                if (primaryChildFragment !== null) {
                  treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                }
              }
              completedWork.actualDuration = actualDuration;
              completedWork.treeBaseDuration = treeBaseDuration;
            } else {
              var _child = completedWork.child;
              while (_child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
                _child = _child.sibling;
              }
            }
            completedWork.childLanes = newChildLanes;
          }
          function commitRoot(root2) {
            var renderPriorityLevel = getCurrentPriorityLevel();
            runWithPriority$1(ImmediatePriority$1, commitRootImpl.bind(null, root2, renderPriorityLevel));
            return null;
          }
          function commitRootImpl(root2, renderPriorityLevel) {
            do {
              flushPassiveEffects();
            } while (rootWithPendingPassiveEffects !== null);
            flushRenderPhaseStrictModeWarningsInDEV();
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Should not already be working.");
              }
            }
            var finishedWork = root2.finishedWork;
            var lanes = root2.finishedLanes;
            if (finishedWork === null) {
              return null;
            }
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            if (!(finishedWork !== root2.current)) {
              {
                throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            root2.callbackNode = null;
            var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
            markRootFinished(root2, remainingLanes);
            if (rootsWithPendingDiscreteUpdates !== null) {
              if (!hasDiscreteLanes(remainingLanes) && rootsWithPendingDiscreteUpdates.has(root2)) {
                rootsWithPendingDiscreteUpdates.delete(root2);
              }
            }
            if (root2 === workInProgressRoot) {
              workInProgressRoot = null;
              workInProgress = null;
              workInProgressRootRenderLanes = NoLanes;
            }
            var firstEffect;
            if (finishedWork.flags > PerformedWork) {
              if (finishedWork.lastEffect !== null) {
                finishedWork.lastEffect.nextEffect = finishedWork;
                firstEffect = finishedWork.firstEffect;
              } else {
                firstEffect = finishedWork;
              }
            } else {
              firstEffect = finishedWork.firstEffect;
            }
            if (firstEffect !== null) {
              var prevExecutionContext = executionContext;
              executionContext |= CommitContext;
              var prevInteractions = pushInteractions(root2);
              ReactCurrentOwner$2.current = null;
              focusedInstanceHandle = prepareForCommit(root2.containerInfo);
              shouldFireAfterActiveInstanceBlur = false;
              nextEffect = firstEffect;
              do {
                {
                  invokeGuardedCallback(null, commitBeforeMutationEffects, null);
                  if (hasCaughtError()) {
                    if (!(nextEffect !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var error2 = clearCaughtError();
                    captureCommitPhaseError(nextEffect, error2);
                    nextEffect = nextEffect.nextEffect;
                  }
                }
              } while (nextEffect !== null);
              focusedInstanceHandle = null;
              {
                recordCommitTime();
              }
              nextEffect = firstEffect;
              do {
                {
                  invokeGuardedCallback(null, commitMutationEffects, null, root2, renderPriorityLevel);
                  if (hasCaughtError()) {
                    if (!(nextEffect !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var _error = clearCaughtError();
                    captureCommitPhaseError(nextEffect, _error);
                    nextEffect = nextEffect.nextEffect;
                  }
                }
              } while (nextEffect !== null);
              resetAfterCommit(root2.containerInfo);
              root2.current = finishedWork;
              nextEffect = firstEffect;
              do {
                {
                  invokeGuardedCallback(null, commitLayoutEffects, null, root2, lanes);
                  if (hasCaughtError()) {
                    if (!(nextEffect !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var _error2 = clearCaughtError();
                    captureCommitPhaseError(nextEffect, _error2);
                    nextEffect = nextEffect.nextEffect;
                  }
                }
              } while (nextEffect !== null);
              nextEffect = null;
              requestPaint();
              {
                popInteractions(prevInteractions);
              }
              executionContext = prevExecutionContext;
            } else {
              root2.current = finishedWork;
              {
                recordCommitTime();
              }
            }
            var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
            if (rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = false;
              rootWithPendingPassiveEffects = root2;
              pendingPassiveEffectsLanes = lanes;
              pendingPassiveEffectsRenderPriority = renderPriorityLevel;
            } else {
              nextEffect = firstEffect;
              while (nextEffect !== null) {
                var nextNextEffect = nextEffect.nextEffect;
                nextEffect.nextEffect = null;
                if (nextEffect.flags & Deletion) {
                  detachFiberAfterEffects(nextEffect);
                }
                nextEffect = nextNextEffect;
              }
            }
            remainingLanes = root2.pendingLanes;
            if (remainingLanes !== NoLanes) {
              {
                if (spawnedWorkDuringRender !== null) {
                  var expirationTimes = spawnedWorkDuringRender;
                  spawnedWorkDuringRender = null;
                  for (var i = 0; i < expirationTimes.length; i++) {
                    scheduleInteractions(root2, expirationTimes[i], root2.memoizedInteractions);
                  }
                }
                schedulePendingInteractions(root2, remainingLanes);
              }
            } else {
              legacyErrorBoundariesThatAlreadyFailed = null;
            }
            {
              if (!rootDidHavePassiveEffects) {
                finishPendingInteractions(root2, lanes);
              }
            }
            if (remainingLanes === SyncLane) {
              if (root2 === rootWithNestedUpdates) {
                nestedUpdateCount++;
              } else {
                nestedUpdateCount = 0;
                rootWithNestedUpdates = root2;
              }
            } else {
              nestedUpdateCount = 0;
            }
            onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
            {
              onCommitRoot$1();
            }
            ensureRootIsScheduled(root2, now2());
            if (hasUncaughtError) {
              hasUncaughtError = false;
              var _error3 = firstUncaughtError;
              firstUncaughtError = null;
              throw _error3;
            }
            if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
              return null;
            }
            flushSyncCallbackQueue();
            return null;
          }
          function commitBeforeMutationEffects() {
            while (nextEffect !== null) {
              var current2 = nextEffect.alternate;
              if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
                if ((nextEffect.flags & Deletion) !== NoFlags) {
                  if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
                    shouldFireAfterActiveInstanceBlur = true;
                  }
                } else {
                  if (nextEffect.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current2, nextEffect) && doesFiberContain(nextEffect, focusedInstanceHandle)) {
                    shouldFireAfterActiveInstanceBlur = true;
                  }
                }
              }
              var flags = nextEffect.flags;
              if ((flags & Snapshot) !== NoFlags) {
                setCurrentFiber(nextEffect);
                commitBeforeMutationLifeCycles(current2, nextEffect);
                resetCurrentFiber();
              }
              if ((flags & Passive) !== NoFlags) {
                if (!rootDoesHavePassiveEffects) {
                  rootDoesHavePassiveEffects = true;
                  scheduleCallback(NormalPriority$1, function() {
                    flushPassiveEffects();
                    return null;
                  });
                }
              }
              nextEffect = nextEffect.nextEffect;
            }
          }
          function commitMutationEffects(root2, renderPriorityLevel) {
            while (nextEffect !== null) {
              setCurrentFiber(nextEffect);
              var flags = nextEffect.flags;
              if (flags & ContentReset) {
                commitResetTextContent(nextEffect);
              }
              if (flags & Ref) {
                var current2 = nextEffect.alternate;
                if (current2 !== null) {
                  commitDetachRef(current2);
                }
              }
              var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);
              switch (primaryFlags) {
                case Placement: {
                  commitPlacement(nextEffect);
                  nextEffect.flags &= ~Placement;
                  break;
                }
                case PlacementAndUpdate: {
                  commitPlacement(nextEffect);
                  nextEffect.flags &= ~Placement;
                  var _current = nextEffect.alternate;
                  commitWork(_current, nextEffect);
                  break;
                }
                case Hydrating: {
                  nextEffect.flags &= ~Hydrating;
                  break;
                }
                case HydratingAndUpdate: {
                  nextEffect.flags &= ~Hydrating;
                  var _current2 = nextEffect.alternate;
                  commitWork(_current2, nextEffect);
                  break;
                }
                case Update: {
                  var _current3 = nextEffect.alternate;
                  commitWork(_current3, nextEffect);
                  break;
                }
                case Deletion: {
                  commitDeletion(root2, nextEffect);
                  break;
                }
              }
              resetCurrentFiber();
              nextEffect = nextEffect.nextEffect;
            }
          }
          function commitLayoutEffects(root2, committedLanes) {
            while (nextEffect !== null) {
              setCurrentFiber(nextEffect);
              var flags = nextEffect.flags;
              if (flags & (Update | Callback)) {
                var current2 = nextEffect.alternate;
                commitLifeCycles(root2, current2, nextEffect);
              }
              {
                if (flags & Ref) {
                  commitAttachRef(nextEffect);
                }
              }
              resetCurrentFiber();
              nextEffect = nextEffect.nextEffect;
            }
          }
          function flushPassiveEffects() {
            if (pendingPassiveEffectsRenderPriority !== NoPriority$1) {
              var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority;
              pendingPassiveEffectsRenderPriority = NoPriority$1;
              {
                return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
              }
            }
            return false;
          }
          function enqueuePendingPassiveHookEffectMount(fiber, effect4) {
            pendingPassiveHookEffectsMount.push(effect4, fiber);
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              scheduleCallback(NormalPriority$1, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
          function enqueuePendingPassiveHookEffectUnmount(fiber, effect4) {
            pendingPassiveHookEffectsUnmount.push(effect4, fiber);
            {
              fiber.flags |= PassiveUnmountPendingDev;
              var alternate = fiber.alternate;
              if (alternate !== null) {
                alternate.flags |= PassiveUnmountPendingDev;
              }
            }
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              scheduleCallback(NormalPriority$1, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
          function invokePassiveEffectCreate(effect4) {
            var create = effect4.create;
            effect4.destroy = create();
          }
          function flushPassiveEffectsImpl() {
            if (rootWithPendingPassiveEffects === null) {
              return false;
            }
            var root2 = rootWithPendingPassiveEffects;
            var lanes = pendingPassiveEffectsLanes;
            rootWithPendingPassiveEffects = null;
            pendingPassiveEffectsLanes = NoLanes;
            if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
              {
                throw Error("Cannot flush passive effects while already rendering.");
              }
            }
            {
              isFlushingPassiveEffects = true;
            }
            var prevExecutionContext = executionContext;
            executionContext |= CommitContext;
            var prevInteractions = pushInteractions(root2);
            var unmountEffects = pendingPassiveHookEffectsUnmount;
            pendingPassiveHookEffectsUnmount = [];
            for (var i = 0; i < unmountEffects.length; i += 2) {
              var _effect = unmountEffects[i];
              var fiber = unmountEffects[i + 1];
              var destroy = _effect.destroy;
              _effect.destroy = void 0;
              {
                fiber.flags &= ~PassiveUnmountPendingDev;
                var alternate = fiber.alternate;
                if (alternate !== null) {
                  alternate.flags &= ~PassiveUnmountPendingDev;
                }
              }
              if (typeof destroy === "function") {
                {
                  setCurrentFiber(fiber);
                  {
                    invokeGuardedCallback(null, destroy, null);
                  }
                  if (hasCaughtError()) {
                    if (!(fiber !== null)) {
                      {
                        throw Error("Should be working on an effect.");
                      }
                    }
                    var error2 = clearCaughtError();
                    captureCommitPhaseError(fiber, error2);
                  }
                  resetCurrentFiber();
                }
              }
            }
            var mountEffects = pendingPassiveHookEffectsMount;
            pendingPassiveHookEffectsMount = [];
            for (var _i = 0; _i < mountEffects.length; _i += 2) {
              var _effect2 = mountEffects[_i];
              var _fiber = mountEffects[_i + 1];
              {
                setCurrentFiber(_fiber);
                {
                  invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);
                }
                if (hasCaughtError()) {
                  if (!(_fiber !== null)) {
                    {
                      throw Error("Should be working on an effect.");
                    }
                  }
                  var _error4 = clearCaughtError();
                  captureCommitPhaseError(_fiber, _error4);
                }
                resetCurrentFiber();
              }
            }
            var effect4 = root2.current.firstEffect;
            while (effect4 !== null) {
              var nextNextEffect = effect4.nextEffect;
              effect4.nextEffect = null;
              if (effect4.flags & Deletion) {
                detachFiberAfterEffects(effect4);
              }
              effect4 = nextNextEffect;
            }
            {
              popInteractions(prevInteractions);
              finishPendingInteractions(root2, lanes);
            }
            {
              isFlushingPassiveEffects = false;
            }
            executionContext = prevExecutionContext;
            flushSyncCallbackQueue();
            nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
            return true;
          }
          function isAlreadyFailedLegacyErrorBoundary(instance) {
            return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
          }
          function markLegacyErrorBoundaryAsFailed(instance) {
            if (legacyErrorBoundariesThatAlreadyFailed === null) {
              legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([instance]);
            } else {
              legacyErrorBoundariesThatAlreadyFailed.add(instance);
            }
          }
          function prepareToThrowUncaughtError(error2) {
            if (!hasUncaughtError) {
              hasUncaughtError = true;
              firstUncaughtError = error2;
            }
          }
          var onUncaughtError = prepareToThrowUncaughtError;
          function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
            var errorInfo = createCapturedValue(error2, sourceFiber);
            var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
            enqueueUpdate(rootFiber, update);
            var eventTime = requestEventTime();
            var root2 = markUpdateLaneFromFiberToRoot(rootFiber, SyncLane);
            if (root2 !== null) {
              markRootUpdated(root2, SyncLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
              schedulePendingInteractions(root2, SyncLane);
            }
          }
          function captureCommitPhaseError(sourceFiber, error2) {
            if (sourceFiber.tag === HostRoot) {
              captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error2);
              return;
            }
            var fiber = sourceFiber.return;
            while (fiber !== null) {
              if (fiber.tag === HostRoot) {
                captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error2);
                return;
              } else if (fiber.tag === ClassComponent) {
                var ctor = fiber.type;
                var instance = fiber.stateNode;
                if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
                  var errorInfo = createCapturedValue(error2, sourceFiber);
                  var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
                  enqueueUpdate(fiber, update);
                  var eventTime = requestEventTime();
                  var root2 = markUpdateLaneFromFiberToRoot(fiber, SyncLane);
                  if (root2 !== null) {
                    markRootUpdated(root2, SyncLane, eventTime);
                    ensureRootIsScheduled(root2, eventTime);
                    schedulePendingInteractions(root2, SyncLane);
                  } else {
                    if (typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
                      try {
                        instance.componentDidCatch(error2, errorInfo);
                      } catch (errorToIgnore) {
                      }
                    }
                  }
                  return;
                }
              }
              fiber = fiber.return;
            }
          }
          function pingSuspendedRoot(root2, wakeable, pingedLanes) {
            var pingCache = root2.pingCache;
            if (pingCache !== null) {
              pingCache.delete(wakeable);
            }
            var eventTime = requestEventTime();
            markRootPinged(root2, pingedLanes);
            if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
              if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now2() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
                prepareFreshStack(root2, NoLanes);
              } else {
                workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
              }
            }
            ensureRootIsScheduled(root2, eventTime);
            schedulePendingInteractions(root2, pingedLanes);
          }
          function retryTimedOutBoundary(boundaryFiber, retryLane) {
            if (retryLane === NoLane) {
              retryLane = requestRetryLane(boundaryFiber);
            }
            var eventTime = requestEventTime();
            var root2 = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);
            if (root2 !== null) {
              markRootUpdated(root2, retryLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
              schedulePendingInteractions(root2, retryLane);
            }
          }
          function resolveRetryWakeable(boundaryFiber, wakeable) {
            var retryLane = NoLane;
            var retryCache;
            {
              retryCache = boundaryFiber.stateNode;
            }
            if (retryCache !== null) {
              retryCache.delete(wakeable);
            }
            retryTimedOutBoundary(boundaryFiber, retryLane);
          }
          function jnd(timeElapsed) {
            return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
          }
          function checkForNestedUpdates() {
            if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
              nestedUpdateCount = 0;
              rootWithNestedUpdates = null;
              {
                {
                  throw Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
                }
              }
            }
            {
              if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
                nestedPassiveUpdateCount = 0;
                error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.");
              }
            }
          }
          function flushRenderPhaseStrictModeWarningsInDEV() {
            {
              ReactStrictModeWarnings.flushLegacyContextWarning();
              {
                ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
              }
            }
          }
          var didWarnStateUpdateForNotYetMountedComponent = null;
          function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
            {
              if ((executionContext & RenderContext) !== NoContext) {
                return;
              }
              if (!(fiber.mode & (BlockingMode | ConcurrentMode))) {
                return;
              }
              var tag = fiber.tag;
              if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
                return;
              }
              var componentName = getComponentName(fiber.type) || "ReactComponent";
              if (didWarnStateUpdateForNotYetMountedComponent !== null) {
                if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
                  return;
                }
                didWarnStateUpdateForNotYetMountedComponent.add(componentName);
              } else {
                didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([componentName]);
              }
              var previousFiber = current;
              try {
                setCurrentFiber(fiber);
                error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
              } finally {
                if (previousFiber) {
                  setCurrentFiber(fiber);
                } else {
                  resetCurrentFiber();
                }
              }
            }
          }
          var didWarnStateUpdateForUnmountedComponent = null;
          function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
            {
              var tag = fiber.tag;
              if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
                return;
              }
              if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {
                return;
              }
              var componentName = getComponentName(fiber.type) || "ReactComponent";
              if (didWarnStateUpdateForUnmountedComponent !== null) {
                if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
                  return;
                }
                didWarnStateUpdateForUnmountedComponent.add(componentName);
              } else {
                didWarnStateUpdateForUnmountedComponent = /* @__PURE__ */ new Set([componentName]);
              }
              if (isFlushingPassiveEffects)
                ;
              else {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.", tag === ClassComponent ? "the componentWillUnmount method" : "a useEffect cleanup function");
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          var beginWork$1;
          {
            var dummyFiber = null;
            beginWork$1 = function(current2, unitOfWork, lanes) {
              var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
              try {
                return beginWork(current2, unitOfWork, lanes);
              } catch (originalError) {
                if (originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
                  throw originalError;
                }
                resetContextDependencies();
                resetHooksAfterThrow();
                unwindInterruptedWork(unitOfWork);
                assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
                if (unitOfWork.mode & ProfileMode) {
                  startProfilerTimer(unitOfWork);
                }
                invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
                if (hasCaughtError()) {
                  var replayError = clearCaughtError();
                  throw replayError;
                } else {
                  throw originalError;
                }
              }
            };
          }
          var didWarnAboutUpdateInRender = false;
          var didWarnAboutUpdateInRenderForAnotherComponent;
          {
            didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
          }
          function warnAboutRenderPhaseUpdatesInDEV(fiber) {
            {
              if (isRendering && (executionContext & RenderContext) !== NoContext && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
                switch (fiber.tag) {
                  case FunctionComponent:
                  case ForwardRef:
                  case SimpleMemoComponent: {
                    var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || "Unknown";
                    var dedupeKey = renderingComponentName;
                    if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
                      didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
                      var setStateComponentName = getComponentName(fiber.type) || "Unknown";
                      error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName);
                    }
                    break;
                  }
                  case ClassComponent: {
                    if (!didWarnAboutUpdateInRender) {
                      error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
                      didWarnAboutUpdateInRender = true;
                    }
                    break;
                  }
                }
              }
            }
          }
          var IsThisRendererActing = {
            current: false
          };
          function warnIfNotScopedWithMatchingAct(fiber) {
            {
              if (IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("It looks like you're using the wrong act() around your test interactions.\nBe sure to use the matching version of act() corresponding to your renderer:\n\n// for react-dom:\nimport {act} from 'react-dom/test-utils';\n// ...\nact(() => ...);\n\n// for react-test-renderer:\nimport TestRenderer from react-test-renderer';\nconst {act} = TestRenderer;\n// ...\nact(() => ...);");
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
            {
              if ((fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
                error("An update to %s ran an effect, but was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n  /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentName(fiber.type));
              }
            }
          }
          function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
            {
              if (executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n  /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentName(fiber.type));
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV;
          var didWarnAboutUnmockedScheduler = false;
          function warnIfUnmockedScheduler(fiber) {
            {
              if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === void 0) {
                if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
                  didWarnAboutUnmockedScheduler = true;
                  error(`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: 
jest.mock('scheduler', () => require('scheduler/unstable_mock'));

For more info, visit https://reactjs.org/link/mock-scheduler`);
                }
              }
            }
          }
          function computeThreadID(root2, lane) {
            return lane * 1e3 + root2.interactionThreadID;
          }
          function markSpawnedWork(lane) {
            if (spawnedWorkDuringRender === null) {
              spawnedWorkDuringRender = [lane];
            } else {
              spawnedWorkDuringRender.push(lane);
            }
          }
          function scheduleInteractions(root2, lane, interactions) {
            if (interactions.size > 0) {
              var pendingInteractionMap = root2.pendingInteractionMap;
              var pendingInteractions = pendingInteractionMap.get(lane);
              if (pendingInteractions != null) {
                interactions.forEach(function(interaction) {
                  if (!pendingInteractions.has(interaction)) {
                    interaction.__count++;
                  }
                  pendingInteractions.add(interaction);
                });
              } else {
                pendingInteractionMap.set(lane, new Set(interactions));
                interactions.forEach(function(interaction) {
                  interaction.__count++;
                });
              }
              var subscriber = tracing.__subscriberRef.current;
              if (subscriber !== null) {
                var threadID = computeThreadID(root2, lane);
                subscriber.onWorkScheduled(interactions, threadID);
              }
            }
          }
          function schedulePendingInteractions(root2, lane) {
            scheduleInteractions(root2, lane, tracing.__interactionsRef.current);
          }
          function startWorkOnPendingInteractions(root2, lanes) {
            var interactions = /* @__PURE__ */ new Set();
            root2.pendingInteractionMap.forEach(function(scheduledInteractions, scheduledLane) {
              if (includesSomeLane(lanes, scheduledLane)) {
                scheduledInteractions.forEach(function(interaction) {
                  return interactions.add(interaction);
                });
              }
            });
            root2.memoizedInteractions = interactions;
            if (interactions.size > 0) {
              var subscriber = tracing.__subscriberRef.current;
              if (subscriber !== null) {
                var threadID = computeThreadID(root2, lanes);
                try {
                  subscriber.onWorkStarted(interactions, threadID);
                } catch (error2) {
                  scheduleCallback(ImmediatePriority$1, function() {
                    throw error2;
                  });
                }
              }
            }
          }
          function finishPendingInteractions(root2, committedLanes) {
            var remainingLanesAfterCommit = root2.pendingLanes;
            var subscriber;
            try {
              subscriber = tracing.__subscriberRef.current;
              if (subscriber !== null && root2.memoizedInteractions.size > 0) {
                var threadID = computeThreadID(root2, committedLanes);
                subscriber.onWorkStopped(root2.memoizedInteractions, threadID);
              }
            } catch (error2) {
              scheduleCallback(ImmediatePriority$1, function() {
                throw error2;
              });
            } finally {
              var pendingInteractionMap = root2.pendingInteractionMap;
              pendingInteractionMap.forEach(function(scheduledInteractions, lane) {
                if (!includesSomeLane(remainingLanesAfterCommit, lane)) {
                  pendingInteractionMap.delete(lane);
                  scheduledInteractions.forEach(function(interaction) {
                    interaction.__count--;
                    if (subscriber !== null && interaction.__count === 0) {
                      try {
                        subscriber.onInteractionScheduledWorkCompleted(interaction);
                      } catch (error2) {
                        scheduleCallback(ImmediatePriority$1, function() {
                          throw error2;
                        });
                      }
                    }
                  });
                }
              });
            }
          }
          function shouldForceFlushFallbacksInDEV() {
            return actingUpdatesScopeDepth > 0;
          }
          var actingUpdatesScopeDepth = 0;
          function detachFiberAfterEffects(fiber) {
            fiber.sibling = null;
            fiber.stateNode = null;
          }
          var resolveFamily = null;
          var failedBoundaries = null;
          var setRefreshHandler = function(handler) {
            {
              resolveFamily = handler;
            }
          };
          function resolveFunctionForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                return type;
              }
              return family.current;
            }
          }
          function resolveClassForHotReloading(type) {
            return resolveFunctionForHotReloading(type);
          }
          function resolveForwardRefForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                if (type !== null && type !== void 0 && typeof type.render === "function") {
                  var currentRender = resolveFunctionForHotReloading(type.render);
                  if (type.render !== currentRender) {
                    var syntheticType = {
                      $$typeof: REACT_FORWARD_REF_TYPE,
                      render: currentRender
                    };
                    if (type.displayName !== void 0) {
                      syntheticType.displayName = type.displayName;
                    }
                    return syntheticType;
                  }
                }
                return type;
              }
              return family.current;
            }
          }
          function isCompatibleFamilyForHotReloading(fiber, element) {
            {
              if (resolveFamily === null) {
                return false;
              }
              var prevType = fiber.elementType;
              var nextType = element.type;
              var needsCompareFamilies = false;
              var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
              switch (fiber.tag) {
                case ClassComponent: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case FunctionComponent: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case ForwardRef: {
                  if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case MemoComponent:
                case SimpleMemoComponent: {
                  if ($$typeofNextType === REACT_MEMO_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                default:
                  return false;
              }
              if (needsCompareFamilies) {
                var prevFamily = resolveFamily(prevType);
                if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
                  return true;
                }
              }
              return false;
            }
          }
          function markFailedErrorBoundaryForHotReloading(fiber) {
            {
              if (resolveFamily === null) {
                return;
              }
              if (typeof WeakSet !== "function") {
                return;
              }
              if (failedBoundaries === null) {
                failedBoundaries = /* @__PURE__ */ new WeakSet();
              }
              failedBoundaries.add(fiber);
            }
          }
          var scheduleRefresh = function(root2, update) {
            {
              if (resolveFamily === null) {
                return;
              }
              var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
              flushPassiveEffects();
              flushSync(function() {
                scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
              });
            }
          };
          var scheduleRoot = function(root2, element) {
            {
              if (root2.context !== emptyContextObject) {
                return;
              }
              flushPassiveEffects();
              flushSync(function() {
                updateContainer(element, root2, null, null);
              });
            }
          };
          function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
            {
              var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              if (resolveFamily === null) {
                throw new Error("Expected resolveFamily to be set during hot reload.");
              }
              var needsRender = false;
              var needsRemount = false;
              if (candidateType !== null) {
                var family = resolveFamily(candidateType);
                if (family !== void 0) {
                  if (staleFamilies.has(family)) {
                    needsRemount = true;
                  } else if (updatedFamilies.has(family)) {
                    if (tag === ClassComponent) {
                      needsRemount = true;
                    } else {
                      needsRender = true;
                    }
                  }
                }
              }
              if (failedBoundaries !== null) {
                if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
                  needsRemount = true;
                }
              }
              if (needsRemount) {
                fiber._debugNeedsRemount = true;
              }
              if (needsRemount || needsRender) {
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
              if (child !== null && !needsRemount) {
                scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
              }
              if (sibling !== null) {
                scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
              }
            }
          }
          var findHostInstancesForRefresh = function(root2, families) {
            {
              var hostInstances = /* @__PURE__ */ new Set();
              var types = new Set(families.map(function(family) {
                return family.current;
              }));
              findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
              return hostInstances;
            }
          };
          function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
            {
              var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              var didMatch = false;
              if (candidateType !== null) {
                if (types.has(candidateType)) {
                  didMatch = true;
                }
              }
              if (didMatch) {
                findHostInstancesForFiberShallowly(fiber, hostInstances);
              } else {
                if (child !== null) {
                  findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
                }
              }
              if (sibling !== null) {
                findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
              }
            }
          }
          function findHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
              if (foundHostInstances) {
                return;
              }
              var node = fiber;
              while (true) {
                switch (node.tag) {
                  case HostComponent:
                    hostInstances.add(node.stateNode);
                    return;
                  case HostPortal:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                  case HostRoot:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                }
                if (node.return === null) {
                  throw new Error("Expected to reach root first.");
                }
                node = node.return;
              }
            }
          }
          function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var node = fiber;
              var foundHostInstances = false;
              while (true) {
                if (node.tag === HostComponent) {
                  foundHostInstances = true;
                  hostInstances.add(node.stateNode);
                } else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === fiber) {
                  return foundHostInstances;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === fiber) {
                    return foundHostInstances;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
            return false;
          }
          var hasBadMapPolyfill;
          {
            hasBadMapPolyfill = false;
            try {
              var nonExtensibleObject = Object.preventExtensions({});
              /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
              /* @__PURE__ */ new Set([nonExtensibleObject]);
            } catch (e) {
              hasBadMapPolyfill = true;
            }
          }
          var debugCounter = 1;
          function FiberNode(tag, pendingProps, key, mode) {
            this.tag = tag;
            this.key = key;
            this.elementType = null;
            this.type = null;
            this.stateNode = null;
            this.return = null;
            this.child = null;
            this.sibling = null;
            this.index = 0;
            this.ref = null;
            this.pendingProps = pendingProps;
            this.memoizedProps = null;
            this.updateQueue = null;
            this.memoizedState = null;
            this.dependencies = null;
            this.mode = mode;
            this.flags = NoFlags;
            this.nextEffect = null;
            this.firstEffect = null;
            this.lastEffect = null;
            this.lanes = NoLanes;
            this.childLanes = NoLanes;
            this.alternate = null;
            {
              this.actualDuration = Number.NaN;
              this.actualStartTime = Number.NaN;
              this.selfBaseDuration = Number.NaN;
              this.treeBaseDuration = Number.NaN;
              this.actualDuration = 0;
              this.actualStartTime = -1;
              this.selfBaseDuration = 0;
              this.treeBaseDuration = 0;
            }
            {
              this._debugID = debugCounter++;
              this._debugSource = null;
              this._debugOwner = null;
              this._debugNeedsRemount = false;
              this._debugHookTypes = null;
              if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
                Object.preventExtensions(this);
              }
            }
          }
          var createFiber = function(tag, pendingProps, key, mode) {
            return new FiberNode(tag, pendingProps, key, mode);
          };
          function shouldConstruct$1(Component50) {
            var prototype = Component50.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function isSimpleFunctionComponent(type) {
            return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
          }
          function resolveLazyComponentTag(Component50) {
            if (typeof Component50 === "function") {
              return shouldConstruct$1(Component50) ? ClassComponent : FunctionComponent;
            } else if (Component50 !== void 0 && Component50 !== null) {
              var $$typeof = Component50.$$typeof;
              if ($$typeof === REACT_FORWARD_REF_TYPE) {
                return ForwardRef;
              }
              if ($$typeof === REACT_MEMO_TYPE) {
                return MemoComponent;
              }
            }
            return IndeterminateComponent;
          }
          function createWorkInProgress(current2, pendingProps) {
            var workInProgress2 = current2.alternate;
            if (workInProgress2 === null) {
              workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
              workInProgress2.elementType = current2.elementType;
              workInProgress2.type = current2.type;
              workInProgress2.stateNode = current2.stateNode;
              {
                workInProgress2._debugID = current2._debugID;
                workInProgress2._debugSource = current2._debugSource;
                workInProgress2._debugOwner = current2._debugOwner;
                workInProgress2._debugHookTypes = current2._debugHookTypes;
              }
              workInProgress2.alternate = current2;
              current2.alternate = workInProgress2;
            } else {
              workInProgress2.pendingProps = pendingProps;
              workInProgress2.type = current2.type;
              workInProgress2.flags = NoFlags;
              workInProgress2.nextEffect = null;
              workInProgress2.firstEffect = null;
              workInProgress2.lastEffect = null;
              {
                workInProgress2.actualDuration = 0;
                workInProgress2.actualStartTime = -1;
              }
            }
            workInProgress2.childLanes = current2.childLanes;
            workInProgress2.lanes = current2.lanes;
            workInProgress2.child = current2.child;
            workInProgress2.memoizedProps = current2.memoizedProps;
            workInProgress2.memoizedState = current2.memoizedState;
            workInProgress2.updateQueue = current2.updateQueue;
            var currentDependencies = current2.dependencies;
            workInProgress2.dependencies = currentDependencies === null ? null : {
              lanes: currentDependencies.lanes,
              firstContext: currentDependencies.firstContext
            };
            workInProgress2.sibling = current2.sibling;
            workInProgress2.index = current2.index;
            workInProgress2.ref = current2.ref;
            {
              workInProgress2.selfBaseDuration = current2.selfBaseDuration;
              workInProgress2.treeBaseDuration = current2.treeBaseDuration;
            }
            {
              workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
              switch (workInProgress2.tag) {
                case IndeterminateComponent:
                case FunctionComponent:
                case SimpleMemoComponent:
                  workInProgress2.type = resolveFunctionForHotReloading(current2.type);
                  break;
                case ClassComponent:
                  workInProgress2.type = resolveClassForHotReloading(current2.type);
                  break;
                case ForwardRef:
                  workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
                  break;
              }
            }
            return workInProgress2;
          }
          function resetWorkInProgress(workInProgress2, renderLanes2) {
            workInProgress2.flags &= Placement;
            workInProgress2.nextEffect = null;
            workInProgress2.firstEffect = null;
            workInProgress2.lastEffect = null;
            var current2 = workInProgress2.alternate;
            if (current2 === null) {
              workInProgress2.childLanes = NoLanes;
              workInProgress2.lanes = renderLanes2;
              workInProgress2.child = null;
              workInProgress2.memoizedProps = null;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              workInProgress2.dependencies = null;
              workInProgress2.stateNode = null;
              {
                workInProgress2.selfBaseDuration = 0;
                workInProgress2.treeBaseDuration = 0;
              }
            } else {
              workInProgress2.childLanes = current2.childLanes;
              workInProgress2.lanes = current2.lanes;
              workInProgress2.child = current2.child;
              workInProgress2.memoizedProps = current2.memoizedProps;
              workInProgress2.memoizedState = current2.memoizedState;
              workInProgress2.updateQueue = current2.updateQueue;
              workInProgress2.type = current2.type;
              var currentDependencies = current2.dependencies;
              workInProgress2.dependencies = currentDependencies === null ? null : {
                lanes: currentDependencies.lanes,
                firstContext: currentDependencies.firstContext
              };
              {
                workInProgress2.selfBaseDuration = current2.selfBaseDuration;
                workInProgress2.treeBaseDuration = current2.treeBaseDuration;
              }
            }
            return workInProgress2;
          }
          function createHostRootFiber(tag) {
            var mode;
            if (tag === ConcurrentRoot) {
              mode = ConcurrentMode | BlockingMode | StrictMode;
            } else if (tag === BlockingRoot) {
              mode = BlockingMode | StrictMode;
            } else {
              mode = NoMode;
            }
            if (isDevToolsPresent) {
              mode |= ProfileMode;
            }
            return createFiber(HostRoot, null, null, mode);
          }
          function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
            var fiberTag = IndeterminateComponent;
            var resolvedType = type;
            if (typeof type === "function") {
              if (shouldConstruct$1(type)) {
                fiberTag = ClassComponent;
                {
                  resolvedType = resolveClassForHotReloading(resolvedType);
                }
              } else {
                {
                  resolvedType = resolveFunctionForHotReloading(resolvedType);
                }
              }
            } else if (typeof type === "string") {
              fiberTag = HostComponent;
            } else {
              getTag:
                switch (type) {
                  case REACT_FRAGMENT_TYPE:
                    return createFiberFromFragment(pendingProps.children, mode, lanes, key);
                  case REACT_DEBUG_TRACING_MODE_TYPE:
                    fiberTag = Mode;
                    mode |= DebugTracingMode;
                    break;
                  case REACT_STRICT_MODE_TYPE:
                    fiberTag = Mode;
                    mode |= StrictMode;
                    break;
                  case REACT_PROFILER_TYPE:
                    return createFiberFromProfiler(pendingProps, mode, lanes, key);
                  case REACT_SUSPENSE_TYPE:
                    return createFiberFromSuspense(pendingProps, mode, lanes, key);
                  case REACT_SUSPENSE_LIST_TYPE:
                    return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
                  case REACT_OFFSCREEN_TYPE:
                    return createFiberFromOffscreen(pendingProps, mode, lanes, key);
                  case REACT_LEGACY_HIDDEN_TYPE:
                    return createFiberFromLegacyHidden(pendingProps, mode, lanes, key);
                  case REACT_SCOPE_TYPE:
                  default: {
                    if (typeof type === "object" && type !== null) {
                      switch (type.$$typeof) {
                        case REACT_PROVIDER_TYPE:
                          fiberTag = ContextProvider;
                          break getTag;
                        case REACT_CONTEXT_TYPE:
                          fiberTag = ContextConsumer;
                          break getTag;
                        case REACT_FORWARD_REF_TYPE:
                          fiberTag = ForwardRef;
                          {
                            resolvedType = resolveForwardRefForHotReloading(resolvedType);
                          }
                          break getTag;
                        case REACT_MEMO_TYPE:
                          fiberTag = MemoComponent;
                          break getTag;
                        case REACT_LAZY_TYPE:
                          fiberTag = LazyComponent;
                          resolvedType = null;
                          break getTag;
                        case REACT_BLOCK_TYPE:
                          fiberTag = Block;
                          break getTag;
                      }
                    }
                    var info2 = "";
                    {
                      if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                        info2 += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
                      }
                      var ownerName = owner ? getComponentName(owner.type) : null;
                      if (ownerName) {
                        info2 += "\n\nCheck the render method of `" + ownerName + "`.";
                      }
                    }
                    {
                      {
                        throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info2);
                      }
                    }
                  }
                }
            }
            var fiber = createFiber(fiberTag, pendingProps, key, mode);
            fiber.elementType = type;
            fiber.type = resolvedType;
            fiber.lanes = lanes;
            {
              fiber._debugOwner = owner;
            }
            return fiber;
          }
          function createFiberFromElement(element, mode, lanes) {
            var owner = null;
            {
              owner = element._owner;
            }
            var type = element.type;
            var key = element.key;
            var pendingProps = element.props;
            var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
            {
              fiber._debugSource = element._source;
              fiber._debugOwner = element._owner;
            }
            return fiber;
          }
          function createFiberFromFragment(elements, mode, lanes, key) {
            var fiber = createFiber(Fragment38, elements, key, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromProfiler(pendingProps, mode, lanes, key) {
            {
              if (typeof pendingProps.id !== "string") {
                error('Profiler must specify an "id" as a prop');
              }
            }
            var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
            fiber.elementType = REACT_PROFILER_TYPE;
            fiber.type = REACT_PROFILER_TYPE;
            fiber.lanes = lanes;
            {
              fiber.stateNode = {
                effectDuration: 0,
                passiveEffectDuration: 0
              };
            }
            return fiber;
          }
          function createFiberFromSuspense(pendingProps, mode, lanes, key) {
            var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
            fiber.type = REACT_SUSPENSE_TYPE;
            fiber.elementType = REACT_SUSPENSE_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
            var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
            {
              fiber.type = REACT_SUSPENSE_LIST_TYPE;
            }
            fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
            var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
            {
              fiber.type = REACT_OFFSCREEN_TYPE;
            }
            fiber.elementType = REACT_OFFSCREEN_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromLegacyHidden(pendingProps, mode, lanes, key) {
            var fiber = createFiber(LegacyHiddenComponent, pendingProps, key, mode);
            {
              fiber.type = REACT_LEGACY_HIDDEN_TYPE;
            }
            fiber.elementType = REACT_LEGACY_HIDDEN_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromText(content, mode, lanes) {
            var fiber = createFiber(HostText, content, null, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromHostInstanceForDeletion() {
            var fiber = createFiber(HostComponent, null, null, NoMode);
            fiber.elementType = "DELETED";
            fiber.type = "DELETED";
            return fiber;
          }
          function createFiberFromPortal(portal, mode, lanes) {
            var pendingProps = portal.children !== null ? portal.children : [];
            var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
            fiber.lanes = lanes;
            fiber.stateNode = {
              containerInfo: portal.containerInfo,
              pendingChildren: null,
              // Used by persistent updates
              implementation: portal.implementation
            };
            return fiber;
          }
          function assignFiberPropertiesInDEV(target, source) {
            if (target === null) {
              target = createFiber(IndeterminateComponent, null, null, NoMode);
            }
            target.tag = source.tag;
            target.key = source.key;
            target.elementType = source.elementType;
            target.type = source.type;
            target.stateNode = source.stateNode;
            target.return = source.return;
            target.child = source.child;
            target.sibling = source.sibling;
            target.index = source.index;
            target.ref = source.ref;
            target.pendingProps = source.pendingProps;
            target.memoizedProps = source.memoizedProps;
            target.updateQueue = source.updateQueue;
            target.memoizedState = source.memoizedState;
            target.dependencies = source.dependencies;
            target.mode = source.mode;
            target.flags = source.flags;
            target.nextEffect = source.nextEffect;
            target.firstEffect = source.firstEffect;
            target.lastEffect = source.lastEffect;
            target.lanes = source.lanes;
            target.childLanes = source.childLanes;
            target.alternate = source.alternate;
            {
              target.actualDuration = source.actualDuration;
              target.actualStartTime = source.actualStartTime;
              target.selfBaseDuration = source.selfBaseDuration;
              target.treeBaseDuration = source.treeBaseDuration;
            }
            target._debugID = source._debugID;
            target._debugSource = source._debugSource;
            target._debugOwner = source._debugOwner;
            target._debugNeedsRemount = source._debugNeedsRemount;
            target._debugHookTypes = source._debugHookTypes;
            return target;
          }
          function FiberRootNode(containerInfo, tag, hydrate2) {
            this.tag = tag;
            this.containerInfo = containerInfo;
            this.pendingChildren = null;
            this.current = null;
            this.pingCache = null;
            this.finishedWork = null;
            this.timeoutHandle = noTimeout;
            this.context = null;
            this.pendingContext = null;
            this.hydrate = hydrate2;
            this.callbackNode = null;
            this.callbackPriority = NoLanePriority;
            this.eventTimes = createLaneMap(NoLanes);
            this.expirationTimes = createLaneMap(NoTimestamp);
            this.pendingLanes = NoLanes;
            this.suspendedLanes = NoLanes;
            this.pingedLanes = NoLanes;
            this.expiredLanes = NoLanes;
            this.mutableReadLanes = NoLanes;
            this.finishedLanes = NoLanes;
            this.entangledLanes = NoLanes;
            this.entanglements = createLaneMap(NoLanes);
            {
              this.mutableSourceEagerHydrationData = null;
            }
            {
              this.interactionThreadID = tracing.unstable_getThreadID();
              this.memoizedInteractions = /* @__PURE__ */ new Set();
              this.pendingInteractionMap = /* @__PURE__ */ new Map();
            }
            {
              switch (tag) {
                case BlockingRoot:
                  this._debugRootType = "createBlockingRoot()";
                  break;
                case ConcurrentRoot:
                  this._debugRootType = "createRoot()";
                  break;
                case LegacyRoot:
                  this._debugRootType = "createLegacyRoot()";
                  break;
              }
            }
          }
          function createFiberRoot(containerInfo, tag, hydrate2, hydrationCallbacks) {
            var root2 = new FiberRootNode(containerInfo, tag, hydrate2);
            var uninitializedFiber = createHostRootFiber(tag);
            root2.current = uninitializedFiber;
            uninitializedFiber.stateNode = root2;
            initializeUpdateQueue(uninitializedFiber);
            return root2;
          }
          function registerMutableSourceForHydration(root2, mutableSource) {
            var getVersion = mutableSource._getVersion;
            var version = getVersion(mutableSource._source);
            if (root2.mutableSourceEagerHydrationData == null) {
              root2.mutableSourceEagerHydrationData = [mutableSource, version];
            } else {
              root2.mutableSourceEagerHydrationData.push(mutableSource, version);
            }
          }
          function createPortal4(children, containerInfo, implementation) {
            var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
            return {
              // This tag allow us to uniquely identify this as a React Portal
              $$typeof: REACT_PORTAL_TYPE,
              key: key == null ? null : "" + key,
              children,
              containerInfo,
              implementation
            };
          }
          var didWarnAboutNestedUpdates;
          var didWarnAboutFindNodeInStrictMode;
          {
            didWarnAboutNestedUpdates = false;
            didWarnAboutFindNodeInStrictMode = {};
          }
          function getContextForSubtree(parentComponent) {
            if (!parentComponent) {
              return emptyContextObject;
            }
            var fiber = get(parentComponent);
            var parentContext = findCurrentUnmaskedContext(fiber);
            if (fiber.tag === ClassComponent) {
              var Component50 = fiber.type;
              if (isContextProvider(Component50)) {
                return processChildContext(fiber, Component50, parentContext);
              }
            }
            return parentContext;
          }
          function findHostInstanceWithWarning(component, methodName) {
            {
              var fiber = get(component);
              if (fiber === void 0) {
                if (typeof component.render === "function") {
                  {
                    {
                      throw Error("Unable to find node on an unmounted component.");
                    }
                  }
                } else {
                  {
                    {
                      throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
                    }
                  }
                }
              }
              var hostFiber = findCurrentHostFiber(fiber);
              if (hostFiber === null) {
                return null;
              }
              if (hostFiber.mode & StrictMode) {
                var componentName = getComponentName(fiber.type) || "Component";
                if (!didWarnAboutFindNodeInStrictMode[componentName]) {
                  didWarnAboutFindNodeInStrictMode[componentName] = true;
                  var previousFiber = current;
                  try {
                    setCurrentFiber(hostFiber);
                    if (fiber.mode & StrictMode) {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    } else {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    }
                  } finally {
                    if (previousFiber) {
                      setCurrentFiber(previousFiber);
                    } else {
                      resetCurrentFiber();
                    }
                  }
                }
              }
              return hostFiber.stateNode;
            }
          }
          function createContainer(containerInfo, tag, hydrate2, hydrationCallbacks) {
            return createFiberRoot(containerInfo, tag, hydrate2);
          }
          function updateContainer(element, container, parentComponent, callback) {
            {
              onScheduleRoot(container, element);
            }
            var current$1 = container.current;
            var eventTime = requestEventTime();
            {
              if ("undefined" !== typeof jest) {
                warnIfUnmockedScheduler(current$1);
                warnIfNotScopedWithMatchingAct(current$1);
              }
            }
            var lane = requestUpdateLane(current$1);
            var context = getContextForSubtree(parentComponent);
            if (container.context === null) {
              container.context = context;
            } else {
              container.pendingContext = context;
            }
            {
              if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
                didWarnAboutNestedUpdates = true;
                error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentName(current.type) || "Unknown");
              }
            }
            var update = createUpdate(eventTime, lane);
            update.payload = {
              element
            };
            callback = callback === void 0 ? null : callback;
            if (callback !== null) {
              {
                if (typeof callback !== "function") {
                  error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
                }
              }
              update.callback = callback;
            }
            enqueueUpdate(current$1, update);
            scheduleUpdateOnFiber(current$1, lane, eventTime);
            return lane;
          }
          function getPublicRootInstance(container) {
            var containerFiber = container.current;
            if (!containerFiber.child) {
              return null;
            }
            switch (containerFiber.child.tag) {
              case HostComponent:
                return getPublicInstance(containerFiber.child.stateNode);
              default:
                return containerFiber.child.stateNode;
            }
          }
          function markRetryLaneImpl(fiber, retryLane) {
            var suspenseState = fiber.memoizedState;
            if (suspenseState !== null && suspenseState.dehydrated !== null) {
              suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
            }
          }
          function markRetryLaneIfNotHydrated(fiber, retryLane) {
            markRetryLaneImpl(fiber, retryLane);
            var alternate = fiber.alternate;
            if (alternate) {
              markRetryLaneImpl(alternate, retryLane);
            }
          }
          function attemptUserBlockingHydration$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var eventTime = requestEventTime();
            var lane = InputDiscreteHydrationLane;
            scheduleUpdateOnFiber(fiber, lane, eventTime);
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function attemptContinuousHydration$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var eventTime = requestEventTime();
            var lane = SelectiveHydrationLane;
            scheduleUpdateOnFiber(fiber, lane, eventTime);
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function attemptHydrationAtCurrentPriority$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(fiber);
            scheduleUpdateOnFiber(fiber, lane, eventTime);
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function runWithPriority$2(priority, fn) {
            try {
              setCurrentUpdateLanePriority(priority);
              return fn();
            } finally {
            }
          }
          function findHostInstanceWithNoPortals(fiber) {
            var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
            if (hostFiber === null) {
              return null;
            }
            if (hostFiber.tag === FundamentalComponent) {
              return hostFiber.stateNode.instance;
            }
            return hostFiber.stateNode;
          }
          var shouldSuspendImpl = function(fiber) {
            return false;
          };
          function shouldSuspend(fiber) {
            return shouldSuspendImpl(fiber);
          }
          var overrideHookState = null;
          var overrideHookStateDeletePath = null;
          var overrideHookStateRenamePath = null;
          var overrideProps = null;
          var overridePropsDeletePath = null;
          var overridePropsRenamePath = null;
          var scheduleUpdate = null;
          var setSuspenseHandler = null;
          {
            var copyWithDeleteImpl = function(obj, path2, index2) {
              var key = path2[index2];
              var updated = Array.isArray(obj) ? obj.slice() : _assign34({}, obj);
              if (index2 + 1 === path2.length) {
                if (Array.isArray(updated)) {
                  updated.splice(key, 1);
                } else {
                  delete updated[key];
                }
                return updated;
              }
              updated[key] = copyWithDeleteImpl(obj[key], path2, index2 + 1);
              return updated;
            };
            var copyWithDelete = function(obj, path2) {
              return copyWithDeleteImpl(obj, path2, 0);
            };
            var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
              var oldKey = oldPath[index2];
              var updated = Array.isArray(obj) ? obj.slice() : _assign34({}, obj);
              if (index2 + 1 === oldPath.length) {
                var newKey = newPath[index2];
                updated[newKey] = updated[oldKey];
                if (Array.isArray(updated)) {
                  updated.splice(oldKey, 1);
                } else {
                  delete updated[oldKey];
                }
              } else {
                updated[oldKey] = copyWithRenameImpl(
                  // $FlowFixMe number or string is fine here
                  obj[oldKey],
                  oldPath,
                  newPath,
                  index2 + 1
                );
              }
              return updated;
            };
            var copyWithRename = function(obj, oldPath, newPath) {
              if (oldPath.length !== newPath.length) {
                warn2("copyWithRename() expects paths of the same length");
                return;
              } else {
                for (var i = 0; i < newPath.length - 1; i++) {
                  if (oldPath[i] !== newPath[i]) {
                    warn2("copyWithRename() expects paths to be the same except for the deepest key");
                    return;
                  }
                }
              }
              return copyWithRenameImpl(obj, oldPath, newPath, 0);
            };
            var copyWithSetImpl = function(obj, path2, index2, value) {
              if (index2 >= path2.length) {
                return value;
              }
              var key = path2[index2];
              var updated = Array.isArray(obj) ? obj.slice() : _assign34({}, obj);
              updated[key] = copyWithSetImpl(obj[key], path2, index2 + 1, value);
              return updated;
            };
            var copyWithSet = function(obj, path2, value) {
              return copyWithSetImpl(obj, path2, 0, value);
            };
            var findHook = function(fiber, id) {
              var currentHook2 = fiber.memoizedState;
              while (currentHook2 !== null && id > 0) {
                currentHook2 = currentHook2.next;
                id--;
              }
              return currentHook2;
            };
            overrideHookState = function(fiber, id, path2, value) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithSet(hook.memoizedState, path2, value);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = _assign34({}, fiber.memoizedProps);
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
            };
            overrideHookStateDeletePath = function(fiber, id, path2) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithDelete(hook.memoizedState, path2);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = _assign34({}, fiber.memoizedProps);
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
            };
            overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = _assign34({}, fiber.memoizedProps);
                scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
              }
            };
            overrideProps = function(fiber, path2, value) {
              fiber.pendingProps = copyWithSet(fiber.memoizedProps, path2, value);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            overridePropsDeletePath = function(fiber, path2) {
              fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path2);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            overridePropsRenamePath = function(fiber, oldPath, newPath) {
              fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            scheduleUpdate = function(fiber) {
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            };
            setSuspenseHandler = function(newShouldSuspendImpl) {
              shouldSuspendImpl = newShouldSuspendImpl;
            };
          }
          function findHostInstanceByFiber(fiber) {
            var hostFiber = findCurrentHostFiber(fiber);
            if (hostFiber === null) {
              return null;
            }
            return hostFiber.stateNode;
          }
          function emptyFindFiberByHostInstance(instance) {
            return null;
          }
          function getCurrentFiberForDevTools() {
            return current;
          }
          function injectIntoDevTools(devToolsConfig) {
            var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
            var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
            return injectInternals({
              bundleType: devToolsConfig.bundleType,
              version: devToolsConfig.version,
              rendererPackageName: devToolsConfig.rendererPackageName,
              rendererConfig: devToolsConfig.rendererConfig,
              overrideHookState,
              overrideHookStateDeletePath,
              overrideHookStateRenamePath,
              overrideProps,
              overridePropsDeletePath,
              overridePropsRenamePath,
              setSuspenseHandler,
              scheduleUpdate,
              currentDispatcherRef: ReactCurrentDispatcher2,
              findHostInstanceByFiber,
              findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
              // React Refresh
              findHostInstancesForRefresh,
              scheduleRefresh,
              scheduleRoot,
              setRefreshHandler,
              // Enables DevTools to append owner stacks to error messages in DEV mode.
              getCurrentFiber: getCurrentFiberForDevTools
            });
          }
          function ReactDOMRoot(container, options5) {
            this._internalRoot = createRootImpl(container, ConcurrentRoot, options5);
          }
          function ReactDOMBlockingRoot(container, tag, options5) {
            this._internalRoot = createRootImpl(container, tag, options5);
          }
          ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function(children) {
            var root2 = this._internalRoot;
            {
              if (typeof arguments[1] === "function") {
                error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              }
              var container = root2.containerInfo;
              if (container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(root2.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
                  }
                }
              }
            }
            updateContainer(children, root2, null, null);
          };
          ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function() {
            {
              if (typeof arguments[0] === "function") {
                error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              }
            }
            var root2 = this._internalRoot;
            var container = root2.containerInfo;
            updateContainer(null, root2, null, function() {
              unmarkContainerAsRoot(container);
            });
          };
          function createRootImpl(container, tag, options5) {
            var hydrate2 = options5 != null && options5.hydrate === true;
            var hydrationCallbacks = options5 != null && options5.hydrationOptions || null;
            var mutableSources = options5 != null && options5.hydrationOptions != null && options5.hydrationOptions.mutableSources || null;
            var root2 = createContainer(container, tag, hydrate2);
            markContainerAsRoot(root2.current, container);
            var containerNodeType = container.nodeType;
            {
              var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
              listenToAllSupportedEvents(rootContainerElement);
            }
            if (mutableSources) {
              for (var i = 0; i < mutableSources.length; i++) {
                var mutableSource = mutableSources[i];
                registerMutableSourceForHydration(root2, mutableSource);
              }
            }
            return root2;
          }
          function createLegacyRoot(container, options5) {
            return new ReactDOMBlockingRoot(container, LegacyRoot, options5);
          }
          function isValidContainer(node) {
            return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable "));
          }
          var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
          var topLevelUpdateWarnings;
          var warnedAboutHydrateAPI = false;
          {
            topLevelUpdateWarnings = function(container) {
              if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
                  }
                }
              }
              var isRootRenderedBySomeReact = !!container._reactRootContainer;
              var rootEl = getReactRootElementInContainer(container);
              var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
              if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
                error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");
              }
              if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
                error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
              }
            };
          }
          function getReactRootElementInContainer(container) {
            if (!container) {
              return null;
            }
            if (container.nodeType === DOCUMENT_NODE) {
              return container.documentElement;
            } else {
              return container.firstChild;
            }
          }
          function shouldHydrateDueToLegacyHeuristic(container) {
            var rootElement = getReactRootElementInContainer(container);
            return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
          }
          function legacyCreateRootFromDOMContainer(container, forceHydrate) {
            var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
            if (!shouldHydrate) {
              var warned = false;
              var rootSibling;
              while (rootSibling = container.lastChild) {
                {
                  if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
                    warned = true;
                    error("render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup.");
                  }
                }
                container.removeChild(rootSibling);
              }
            }
            {
              if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
                warnedAboutHydrateAPI = true;
                warn2("render(): Calling ReactDOM.render() to hydrate server-rendered markup will stop working in React v18. Replace the ReactDOM.render() call with ReactDOM.hydrate() if you want React to attach to the server HTML.");
              }
            }
            return createLegacyRoot(container, shouldHydrate ? {
              hydrate: true
            } : void 0);
          }
          function warnOnInvalidCallback$1(callback, callerName) {
            {
              if (callback !== null && typeof callback !== "function") {
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            }
          }
          function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
            {
              topLevelUpdateWarnings(container);
              warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
            }
            var root2 = container._reactRootContainer;
            var fiberRoot;
            if (!root2) {
              root2 = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
              fiberRoot = root2._internalRoot;
              if (typeof callback === "function") {
                var originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(fiberRoot);
                  originalCallback.call(instance);
                };
              }
              unbatchedUpdates(function() {
                updateContainer(children, fiberRoot, parentComponent, callback);
              });
            } else {
              fiberRoot = root2._internalRoot;
              if (typeof callback === "function") {
                var _originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(fiberRoot);
                  _originalCallback.call(instance);
                };
              }
              updateContainer(children, fiberRoot, parentComponent, callback);
            }
            return getPublicRootInstance(fiberRoot);
          }
          function findDOMNode4(componentOrElement) {
            {
              var owner = ReactCurrentOwner$3.current;
              if (owner !== null && owner.stateNode !== null) {
                var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
                if (!warnedAboutRefsInRender) {
                  error("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentName(owner.type) || "A component");
                }
                owner.stateNode._warnedAboutRefsInRender = true;
              }
            }
            if (componentOrElement == null) {
              return null;
            }
            if (componentOrElement.nodeType === ELEMENT_NODE) {
              return componentOrElement;
            }
            {
              return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
            }
          }
          function hydrate(element, container, callback) {
            if (!isValidContainer(container)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
          }
          function render(element, container, callback) {
            if (!isValidContainer(container)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
          }
          function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            if (!isValidContainer(containerNode)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            if (!(parentComponent != null && has(parentComponent))) {
              {
                throw Error("parentComponent must be a valid React Component");
              }
            }
            return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
          }
          function unmountComponentAtNode(container) {
            if (!isValidContainer(container)) {
              {
                throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
              }
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?");
              }
            }
            if (container._reactRootContainer) {
              {
                var rootEl = getReactRootElementInContainer(container);
                var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
                if (renderedByDifferentReact) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
                }
              }
              unbatchedUpdates(function() {
                legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
                  container._reactRootContainer = null;
                  unmarkContainerAsRoot(container);
                });
              });
              return true;
            } else {
              {
                var _rootEl = getReactRootElementInContainer(container);
                var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
                var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
                if (hasNonRootReactChild) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
                }
              }
              return false;
            }
          }
          setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
          setAttemptContinuousHydration(attemptContinuousHydration$1);
          setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
          setAttemptHydrationAtPriority(runWithPriority$2);
          var didWarnAboutUnstableCreatePortal = false;
          {
            if (typeof Map !== "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
            Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
            Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
              error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
            }
          }
          setRestoreImplementation(restoreControlledState$3);
          setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
          function createPortal$1(children, container) {
            var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
            if (!isValidContainer(container)) {
              {
                throw Error("Target container is not a DOM element.");
              }
            }
            return createPortal4(children, container, null, key);
          }
          function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
          }
          function unstable_createPortal(children, container) {
            var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
            {
              if (!didWarnAboutUnstableCreatePortal) {
                didWarnAboutUnstableCreatePortal = true;
                warn2('The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 18+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.');
              }
            }
            return createPortal$1(children, container, key);
          }
          var Internals = {
            // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.
            // This is an array for better minification.
            Events: [
              getInstanceFromNode,
              getNodeFromInstance,
              getFiberCurrentPropsFromNode,
              enqueueStateRestore,
              restoreStateIfNeeded,
              flushPassiveEffects,
              // TODO: This is related to `act`, not events. Move to separate key?
              IsThisRendererActing
            ]
          };
          var foundDevTools = injectIntoDevTools({
            findFiberByHostInstance: getClosestInstanceFromNode,
            bundleType: 1,
            version: ReactVersion,
            rendererPackageName: "react-dom"
          });
          {
            if (!foundDevTools && canUseDOM3 && window.top === window.self) {
              if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
                var protocol = window.location.protocol;
                if (/^(https?|file):$/.test(protocol)) {
                  console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold");
                }
              }
            }
          }
          exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
          exports.createPortal = createPortal$1;
          exports.findDOMNode = findDOMNode4;
          exports.flushSync = flushSync;
          exports.hydrate = hydrate;
          exports.render = render;
          exports.unmountComponentAtNode = unmountComponentAtNode;
          exports.unstable_batchedUpdates = batchedUpdates$1;
          exports.unstable_createPortal = unstable_createPortal;
          exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
          exports.version = ReactVersion;
        })();
      }
    }
  });

  // node_modules/react-dom/index.js
  var require_react_dom = __commonJS({
    "node_modules/react-dom/index.js"(exports, module) {
      "use strict";
      if (false) {
        checkDCE();
        module.exports = null;
      } else {
        module.exports = require_react_dom_development();
      }
    }
  });

  // node_modules/react-is/cjs/react-is.development.js
  var require_react_is_development = __commonJS({
    "node_modules/react-is/cjs/react-is.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var hasSymbol = typeof Symbol === "function" && Symbol.for;
          var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
          var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
          var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
          var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
          var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
          var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
          var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
          var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
          var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
          var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
          var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
          var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
          var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
          var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
          var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
          var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
          var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
          var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
          function isValidElementType(type) {
            return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
            type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
          }
          function typeOf(object) {
            if (typeof object === "object" && object !== null) {
              var $$typeof = object.$$typeof;
              switch ($$typeof) {
                case REACT_ELEMENT_TYPE:
                  var type = object.type;
                  switch (type) {
                    case REACT_ASYNC_MODE_TYPE:
                    case REACT_CONCURRENT_MODE_TYPE:
                    case REACT_FRAGMENT_TYPE:
                    case REACT_PROFILER_TYPE:
                    case REACT_STRICT_MODE_TYPE:
                    case REACT_SUSPENSE_TYPE:
                      return type;
                    default:
                      var $$typeofType = type && type.$$typeof;
                      switch ($$typeofType) {
                        case REACT_CONTEXT_TYPE:
                        case REACT_FORWARD_REF_TYPE:
                        case REACT_LAZY_TYPE:
                        case REACT_MEMO_TYPE:
                        case REACT_PROVIDER_TYPE:
                          return $$typeofType;
                        default:
                          return $$typeof;
                      }
                  }
                case REACT_PORTAL_TYPE:
                  return $$typeof;
              }
            }
            return void 0;
          }
          var AsyncMode = REACT_ASYNC_MODE_TYPE;
          var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
          var ContextConsumer = REACT_CONTEXT_TYPE;
          var ContextProvider = REACT_PROVIDER_TYPE;
          var Element2 = REACT_ELEMENT_TYPE;
          var ForwardRef = REACT_FORWARD_REF_TYPE;
          var Fragment38 = REACT_FRAGMENT_TYPE;
          var Lazy = REACT_LAZY_TYPE;
          var Memo = REACT_MEMO_TYPE;
          var Portal2 = REACT_PORTAL_TYPE;
          var Profiler = REACT_PROFILER_TYPE;
          var StrictMode = REACT_STRICT_MODE_TYPE;
          var Suspense = REACT_SUSPENSE_TYPE;
          var hasWarnedAboutDeprecatedIsAsyncMode = false;
          function isAsyncMode(object) {
            {
              if (!hasWarnedAboutDeprecatedIsAsyncMode) {
                hasWarnedAboutDeprecatedIsAsyncMode = true;
                console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
              }
            }
            return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
          }
          function isConcurrentMode(object) {
            return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
          }
          function isContextConsumer(object) {
            return typeOf(object) === REACT_CONTEXT_TYPE;
          }
          function isContextProvider(object) {
            return typeOf(object) === REACT_PROVIDER_TYPE;
          }
          function isElement2(object) {
            return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
          }
          function isForwardRef(object) {
            return typeOf(object) === REACT_FORWARD_REF_TYPE;
          }
          function isFragment(object) {
            return typeOf(object) === REACT_FRAGMENT_TYPE;
          }
          function isLazy(object) {
            return typeOf(object) === REACT_LAZY_TYPE;
          }
          function isMemo(object) {
            return typeOf(object) === REACT_MEMO_TYPE;
          }
          function isPortal(object) {
            return typeOf(object) === REACT_PORTAL_TYPE;
          }
          function isProfiler(object) {
            return typeOf(object) === REACT_PROFILER_TYPE;
          }
          function isStrictMode(object) {
            return typeOf(object) === REACT_STRICT_MODE_TYPE;
          }
          function isSuspense(object) {
            return typeOf(object) === REACT_SUSPENSE_TYPE;
          }
          exports.AsyncMode = AsyncMode;
          exports.ConcurrentMode = ConcurrentMode;
          exports.ContextConsumer = ContextConsumer;
          exports.ContextProvider = ContextProvider;
          exports.Element = Element2;
          exports.ForwardRef = ForwardRef;
          exports.Fragment = Fragment38;
          exports.Lazy = Lazy;
          exports.Memo = Memo;
          exports.Portal = Portal2;
          exports.Profiler = Profiler;
          exports.StrictMode = StrictMode;
          exports.Suspense = Suspense;
          exports.isAsyncMode = isAsyncMode;
          exports.isConcurrentMode = isConcurrentMode;
          exports.isContextConsumer = isContextConsumer;
          exports.isContextProvider = isContextProvider;
          exports.isElement = isElement2;
          exports.isForwardRef = isForwardRef;
          exports.isFragment = isFragment;
          exports.isLazy = isLazy;
          exports.isMemo = isMemo;
          exports.isPortal = isPortal;
          exports.isProfiler = isProfiler;
          exports.isStrictMode = isStrictMode;
          exports.isSuspense = isSuspense;
          exports.isValidElementType = isValidElementType;
          exports.typeOf = typeOf;
        })();
      }
    }
  });

  // node_modules/react-is/index.js
  var require_react_is = __commonJS({
    "node_modules/react-is/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_react_is_development();
      }
    }
  });

  // node_modules/prop-types/lib/ReactPropTypesSecret.js
  var require_ReactPropTypesSecret = __commonJS({
    "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
      "use strict";
      var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
      module.exports = ReactPropTypesSecret;
    }
  });

  // node_modules/prop-types/lib/has.js
  var require_has = __commonJS({
    "node_modules/prop-types/lib/has.js"(exports, module) {
      module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
    }
  });

  // node_modules/prop-types/checkPropTypes.js
  var require_checkPropTypes = __commonJS({
    "node_modules/prop-types/checkPropTypes.js"(exports, module) {
      "use strict";
      var printWarning = function() {
      };
      if (true) {
        ReactPropTypesSecret = require_ReactPropTypesSecret();
        loggedTypeFailures = {};
        has = require_has();
        printWarning = function(text) {
          var message = "Warning: " + text;
          if (typeof console !== "undefined") {
            console.error(message);
          }
          try {
            throw new Error(message);
          } catch (x2) {
          }
        };
      }
      var ReactPropTypesSecret;
      var loggedTypeFailures;
      var has;
      function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
        if (true) {
          for (var typeSpecName in typeSpecs) {
            if (has(typeSpecs, typeSpecName)) {
              var error;
              try {
                if (typeof typeSpecs[typeSpecName] !== "function") {
                  var err = Error(
                    (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
                  );
                  err.name = "Invariant Violation";
                  throw err;
                }
                error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
              } catch (ex) {
                error = ex;
              }
              if (error && !(error instanceof Error)) {
                printWarning(
                  (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
                );
              }
              if (error instanceof Error && !(error.message in loggedTypeFailures)) {
                loggedTypeFailures[error.message] = true;
                var stack = getStack ? getStack() : "";
                printWarning(
                  "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
                );
              }
            }
          }
        }
      }
      checkPropTypes.resetWarningCache = function() {
        if (true) {
          loggedTypeFailures = {};
        }
      };
      module.exports = checkPropTypes;
    }
  });

  // node_modules/prop-types/factoryWithTypeCheckers.js
  var require_factoryWithTypeCheckers = __commonJS({
    "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
      "use strict";
      var ReactIs = require_react_is();
      var assign = require_object_assign();
      var ReactPropTypesSecret = require_ReactPropTypesSecret();
      var has = require_has();
      var checkPropTypes = require_checkPropTypes();
      var printWarning = function() {
      };
      if (true) {
        printWarning = function(text) {
          var message = "Warning: " + text;
          if (typeof console !== "undefined") {
            console.error(message);
          }
          try {
            throw new Error(message);
          } catch (x2) {
          }
        };
      }
      function emptyFunctionThatReturnsNull() {
        return null;
      }
      module.exports = function(isValidElement9, throwOnDirectAccess) {
        var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
        var FAUX_ITERATOR_SYMBOL = "@@iterator";
        function getIteratorFn(maybeIterable) {
          var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
          if (typeof iteratorFn === "function") {
            return iteratorFn;
          }
        }
        var ANONYMOUS = "<<anonymous>>";
        var ReactPropTypes = {
          array: createPrimitiveTypeChecker("array"),
          bigint: createPrimitiveTypeChecker("bigint"),
          bool: createPrimitiveTypeChecker("boolean"),
          func: createPrimitiveTypeChecker("function"),
          number: createPrimitiveTypeChecker("number"),
          object: createPrimitiveTypeChecker("object"),
          string: createPrimitiveTypeChecker("string"),
          symbol: createPrimitiveTypeChecker("symbol"),
          any: createAnyTypeChecker(),
          arrayOf: createArrayOfTypeChecker,
          element: createElementTypeChecker(),
          elementType: createElementTypeTypeChecker(),
          instanceOf: createInstanceTypeChecker,
          node: createNodeChecker(),
          objectOf: createObjectOfTypeChecker,
          oneOf: createEnumTypeChecker,
          oneOfType: createUnionTypeChecker,
          shape: createShapeTypeChecker,
          exact: createStrictShapeTypeChecker
        };
        function is(x2, y2) {
          if (x2 === y2) {
            return x2 !== 0 || 1 / x2 === 1 / y2;
          } else {
            return x2 !== x2 && y2 !== y2;
          }
        }
        function PropTypeError(message, data) {
          this.message = message;
          this.data = data && typeof data === "object" ? data : {};
          this.stack = "";
        }
        PropTypeError.prototype = Error.prototype;
        function createChainableTypeChecker(validate) {
          if (true) {
            var manualPropTypeCallCache = {};
            var manualPropTypeWarningCount = 0;
          }
          function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
            componentName = componentName || ANONYMOUS;
            propFullName = propFullName || propName;
            if (secret !== ReactPropTypesSecret) {
              if (throwOnDirectAccess) {
                var err = new Error(
                  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
                );
                err.name = "Invariant Violation";
                throw err;
              } else if (typeof console !== "undefined") {
                var cacheKey = componentName + ":" + propName;
                if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
                manualPropTypeWarningCount < 3) {
                  printWarning(
                    "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
                  );
                  manualPropTypeCallCache[cacheKey] = true;
                  manualPropTypeWarningCount++;
                }
              }
            }
            if (props[propName] == null) {
              if (isRequired) {
                if (props[propName] === null) {
                  return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
                }
                return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
              }
              return null;
            } else {
              return validate(props, propName, componentName, location, propFullName);
            }
          }
          var chainedCheckType = checkType.bind(null, false);
          chainedCheckType.isRequired = checkType.bind(null, true);
          return chainedCheckType;
        }
        function createPrimitiveTypeChecker(expectedType) {
          function validate(props, propName, componentName, location, propFullName, secret) {
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== expectedType) {
              var preciseType = getPreciseType(propValue);
              return new PropTypeError(
                "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
                { expectedType }
              );
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createAnyTypeChecker() {
          return createChainableTypeChecker(emptyFunctionThatReturnsNull);
        }
        function createArrayOfTypeChecker(typeChecker) {
          function validate(props, propName, componentName, location, propFullName) {
            if (typeof typeChecker !== "function") {
              return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
            }
            var propValue = props[propName];
            if (!Array.isArray(propValue)) {
              var propType = getPropType(propValue);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
            }
            for (var i = 0; i < propValue.length; i++) {
              var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
              if (error instanceof Error) {
                return error;
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createElementTypeChecker() {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            if (!isValidElement9(propValue)) {
              var propType = getPropType(propValue);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createElementTypeTypeChecker() {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            if (!ReactIs.isValidElementType(propValue)) {
              var propType = getPropType(propValue);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createInstanceTypeChecker(expectedClass) {
          function validate(props, propName, componentName, location, propFullName) {
            if (!(props[propName] instanceof expectedClass)) {
              var expectedClassName = expectedClass.name || ANONYMOUS;
              var actualClassName = getClassName2(props[propName]);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createEnumTypeChecker(expectedValues) {
          if (!Array.isArray(expectedValues)) {
            if (true) {
              if (arguments.length > 1) {
                printWarning(
                  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
                );
              } else {
                printWarning("Invalid argument supplied to oneOf, expected an array.");
              }
            }
            return emptyFunctionThatReturnsNull;
          }
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            for (var i = 0; i < expectedValues.length; i++) {
              if (is(propValue, expectedValues[i])) {
                return null;
              }
            }
            var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
              var type = getPreciseType(value);
              if (type === "symbol") {
                return String(value);
              }
              return value;
            });
            return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
          }
          return createChainableTypeChecker(validate);
        }
        function createObjectOfTypeChecker(typeChecker) {
          function validate(props, propName, componentName, location, propFullName) {
            if (typeof typeChecker !== "function") {
              return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
            }
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== "object") {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
            }
            for (var key in propValue) {
              if (has(propValue, key)) {
                var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
                if (error instanceof Error) {
                  return error;
                }
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createUnionTypeChecker(arrayOfTypeCheckers) {
          if (!Array.isArray(arrayOfTypeCheckers)) {
            true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
            return emptyFunctionThatReturnsNull;
          }
          for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
            var checker = arrayOfTypeCheckers[i];
            if (typeof checker !== "function") {
              printWarning(
                "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
              );
              return emptyFunctionThatReturnsNull;
            }
          }
          function validate(props, propName, componentName, location, propFullName) {
            var expectedTypes = [];
            for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
              var checker2 = arrayOfTypeCheckers[i2];
              var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
              if (checkerResult == null) {
                return null;
              }
              if (checkerResult.data && has(checkerResult.data, "expectedType")) {
                expectedTypes.push(checkerResult.data.expectedType);
              }
            }
            var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
            return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
          }
          return createChainableTypeChecker(validate);
        }
        function createNodeChecker() {
          function validate(props, propName, componentName, location, propFullName) {
            if (!isNode2(props[propName])) {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function invalidValidatorError(componentName, location, propFullName, key, type) {
          return new PropTypeError(
            (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
          );
        }
        function createShapeTypeChecker(shapeTypes) {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== "object") {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
            }
            for (var key in shapeTypes) {
              var checker = shapeTypes[key];
              if (typeof checker !== "function") {
                return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
              }
              var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
              if (error) {
                return error;
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createStrictShapeTypeChecker(shapeTypes) {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== "object") {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
            }
            var allKeys = assign({}, props[propName], shapeTypes);
            for (var key in allKeys) {
              var checker = shapeTypes[key];
              if (has(shapeTypes, key) && typeof checker !== "function") {
                return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
              }
              if (!checker) {
                return new PropTypeError(
                  "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, "  ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, "  ")
                );
              }
              var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
              if (error) {
                return error;
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function isNode2(propValue) {
          switch (typeof propValue) {
            case "number":
            case "string":
            case "undefined":
              return true;
            case "boolean":
              return !propValue;
            case "object":
              if (Array.isArray(propValue)) {
                return propValue.every(isNode2);
              }
              if (propValue === null || isValidElement9(propValue)) {
                return true;
              }
              var iteratorFn = getIteratorFn(propValue);
              if (iteratorFn) {
                var iterator = iteratorFn.call(propValue);
                var step;
                if (iteratorFn !== propValue.entries) {
                  while (!(step = iterator.next()).done) {
                    if (!isNode2(step.value)) {
                      return false;
                    }
                  }
                } else {
                  while (!(step = iterator.next()).done) {
                    var entry = step.value;
                    if (entry) {
                      if (!isNode2(entry[1])) {
                        return false;
                      }
                    }
                  }
                }
              } else {
                return false;
              }
              return true;
            default:
              return false;
          }
        }
        function isSymbol(propType, propValue) {
          if (propType === "symbol") {
            return true;
          }
          if (!propValue) {
            return false;
          }
          if (propValue["@@toStringTag"] === "Symbol") {
            return true;
          }
          if (typeof Symbol === "function" && propValue instanceof Symbol) {
            return true;
          }
          return false;
        }
        function getPropType(propValue) {
          var propType = typeof propValue;
          if (Array.isArray(propValue)) {
            return "array";
          }
          if (propValue instanceof RegExp) {
            return "object";
          }
          if (isSymbol(propType, propValue)) {
            return "symbol";
          }
          return propType;
        }
        function getPreciseType(propValue) {
          if (typeof propValue === "undefined" || propValue === null) {
            return "" + propValue;
          }
          var propType = getPropType(propValue);
          if (propType === "object") {
            if (propValue instanceof Date) {
              return "date";
            } else if (propValue instanceof RegExp) {
              return "regexp";
            }
          }
          return propType;
        }
        function getPostfixForTypeWarning(value) {
          var type = getPreciseType(value);
          switch (type) {
            case "array":
            case "object":
              return "an " + type;
            case "boolean":
            case "date":
            case "regexp":
              return "a " + type;
            default:
              return type;
          }
        }
        function getClassName2(propValue) {
          if (!propValue.constructor || !propValue.constructor.name) {
            return ANONYMOUS;
          }
          return propValue.constructor.name;
        }
        ReactPropTypes.checkPropTypes = checkPropTypes;
        ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
        ReactPropTypes.PropTypes = ReactPropTypes;
        return ReactPropTypes;
      };
    }
  });

  // node_modules/prop-types/index.js
  var require_prop_types = __commonJS({
    "node_modules/prop-types/index.js"(exports, module) {
      if (true) {
        ReactIs = require_react_is();
        throwOnDirectAccess = true;
        module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
      } else {
        module.exports = null();
      }
      var ReactIs;
      var throwOnDirectAccess;
    }
  });

  // node_modules/tslib/tslib.es6.mjs
  var tslib_es6_exports = {};
  __export(tslib_es6_exports, {
    __assign: () => __assign,
    __asyncDelegator: () => __asyncDelegator,
    __asyncGenerator: () => __asyncGenerator,
    __asyncValues: () => __asyncValues,
    __await: () => __await,
    __awaiter: () => __awaiter,
    __classPrivateFieldGet: () => __classPrivateFieldGet,
    __classPrivateFieldIn: () => __classPrivateFieldIn,
    __classPrivateFieldSet: () => __classPrivateFieldSet,
    __createBinding: () => __createBinding,
    __decorate: () => __decorate,
    __esDecorate: () => __esDecorate,
    __exportStar: () => __exportStar,
    __extends: () => __extends,
    __generator: () => __generator,
    __importDefault: () => __importDefault,
    __importStar: () => __importStar,
    __makeTemplateObject: () => __makeTemplateObject,
    __metadata: () => __metadata,
    __param: () => __param,
    __propKey: () => __propKey,
    __read: () => __read,
    __rest: () => __rest,
    __runInitializers: () => __runInitializers,
    __setFunctionName: () => __setFunctionName,
    __spread: () => __spread,
    __spreadArray: () => __spreadArray,
    __spreadArrays: () => __spreadArrays,
    __values: () => __values,
    default: () => tslib_es6_default
  });
  function __extends(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  }
  function __rest(s2, e) {
    var t = {};
    for (var p2 in s2)
      if (Object.prototype.hasOwnProperty.call(s2, p2) && e.indexOf(p2) < 0)
        t[p2] = s2[p2];
    if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p2 = Object.getOwnPropertySymbols(s2); i < p2.length; i++) {
        if (e.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i]))
          t[p2[i]] = s2[p2[i]];
      }
    return t;
  }
  function __decorate(decorators, target, key, desc) {
    var c2 = arguments.length, r = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
      r = Reflect.decorate(decorators, target, key, desc);
    else
      for (var i = decorators.length - 1; i >= 0; i--)
        if (d = decorators[i])
          r = (c2 < 3 ? d(r) : c2 > 3 ? d(target, key, r) : d(target, key)) || r;
    return c2 > 3 && r && Object.defineProperty(target, key, r), r;
  }
  function __param(paramIndex, decorator) {
    return function(target, key) {
      decorator(target, key, paramIndex);
    };
  }
  function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) {
      if (f !== void 0 && typeof f !== "function")
        throw new TypeError("Function expected");
      return f;
    }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
      var context = {};
      for (var p2 in contextIn)
        context[p2] = p2 === "access" ? {} : contextIn[p2];
      for (var p2 in contextIn.access)
        context.access[p2] = contextIn.access[p2];
      context.addInitializer = function(f) {
        if (done)
          throw new TypeError("Cannot add initializers after decoration has completed");
        extraInitializers.push(accept(f || null));
      };
      var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
      if (kind === "accessor") {
        if (result === void 0)
          continue;
        if (result === null || typeof result !== "object")
          throw new TypeError("Object expected");
        if (_ = accept(result.get))
          descriptor.get = _;
        if (_ = accept(result.set))
          descriptor.set = _;
        if (_ = accept(result.init))
          initializers.unshift(_);
      } else if (_ = accept(result)) {
        if (kind === "field")
          initializers.unshift(_);
        else
          descriptor[key] = _;
      }
    }
    if (target)
      Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
  }
  function __runInitializers(thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
  }
  function __propKey(x2) {
    return typeof x2 === "symbol" ? x2 : "".concat(x2);
  }
  function __setFunctionName(f, name2, prefix) {
    if (typeof name2 === "symbol")
      name2 = name2.description ? "[".concat(name2.description, "]") : "";
    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 });
  }
  function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
      return Reflect.metadata(metadataKey, metadataValue);
  }
  function __awaiter(thisArg, _arguments, P2, generator) {
    function adopt(value) {
      return value instanceof P2 ? value : new P2(function(resolve2) {
        resolve2(value);
      });
    }
    return new (P2 || (P2 = Promise))(function(resolve2, reject2) {
      function fulfilled(value) {
        try {
          step(generator.next(value));
        } catch (e) {
          reject2(e);
        }
      }
      function rejected(value) {
        try {
          step(generator["throw"](value));
        } catch (e) {
          reject2(e);
        }
      }
      function step(result) {
        result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
      }
      step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
  }
  function __generator(thisArg, body) {
    var _ = { label: 0, sent: function() {
      if (t[0] & 1)
        throw t[1];
      return t[1];
    }, trys: [], ops: [] }, f, y2, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
      return this;
    }), g;
    function verb(n) {
      return function(v) {
        return step([n, v]);
      };
    }
    function step(op) {
      if (f)
        throw new TypeError("Generator is already executing.");
      while (g && (g = 0, op[0] && (_ = 0)), _)
        try {
          if (f = 1, y2 && (t = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t = y2["return"]) && t.call(y2), 0) : y2.next) && !(t = t.call(y2, op[1])).done)
            return t;
          if (y2 = 0, t)
            op = [op[0] & 2, t.value];
          switch (op[0]) {
            case 0:
            case 1:
              t = op;
              break;
            case 4:
              _.label++;
              return { value: op[1], done: false };
            case 5:
              _.label++;
              y2 = op[1];
              op = [0];
              continue;
            case 7:
              op = _.ops.pop();
              _.trys.pop();
              continue;
            default:
              if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                _ = 0;
                continue;
              }
              if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
                _.label = op[1];
                break;
              }
              if (op[0] === 6 && _.label < t[1]) {
                _.label = t[1];
                t = op;
                break;
              }
              if (t && _.label < t[2]) {
                _.label = t[2];
                _.ops.push(op);
                break;
              }
              if (t[2])
                _.ops.pop();
              _.trys.pop();
              continue;
          }
          op = body.call(thisArg, _);
        } catch (e) {
          op = [6, e];
          y2 = 0;
        } finally {
          f = t = 0;
        }
      if (op[0] & 5)
        throw op[1];
      return { value: op[0] ? op[1] : void 0, done: true };
    }
  }
  function __exportStar(m, o) {
    for (var p2 in m)
      if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(o, p2))
        __createBinding(o, m, p2);
  }
  function __values(o) {
    var s2 = typeof Symbol === "function" && Symbol.iterator, m = s2 && o[s2], i = 0;
    if (m)
      return m.call(o);
    if (o && typeof o.length === "number")
      return {
        next: function() {
          if (o && i >= o.length)
            o = void 0;
          return { value: o && o[i++], done: !o };
        }
      };
    throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined.");
  }
  function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m)
      return o;
    var i = m.call(o), r, ar = [], e;
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
        ar.push(r.value);
    } catch (error) {
      e = { error };
    } finally {
      try {
        if (r && !r.done && (m = i["return"]))
          m.call(i);
      } finally {
        if (e)
          throw e.error;
      }
    }
    return ar;
  }
  function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
      ar = ar.concat(__read(arguments[i]));
    return ar;
  }
  function __spreadArrays() {
    for (var s2 = 0, i = 0, il = arguments.length; i < il; i++)
      s2 += arguments[i].length;
    for (var r = Array(s2), k2 = 0, i = 0; i < il; i++)
      for (var a2 = arguments[i], j = 0, jl = a2.length; j < jl; j++, k2++)
        r[k2] = a2[j];
    return r;
  }
  function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2)
      for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
          if (!ar)
            ar = Array.prototype.slice.call(from, 0, i);
          ar[i] = from[i];
        }
      }
    return to.concat(ar || Array.prototype.slice.call(from));
  }
  function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
  }
  function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator)
      throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
      return this;
    }, i;
    function verb(n) {
      if (g[n])
        i[n] = function(v) {
          return new Promise(function(a2, b) {
            q.push([n, v, a2, b]) > 1 || resume(n, v);
          });
        };
    }
    function resume(n, v) {
      try {
        step(g[n](v));
      } catch (e) {
        settle(q[0][3], e);
      }
    }
    function step(r) {
      r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill2, reject2) : settle(q[0][2], r);
    }
    function fulfill2(value) {
      resume("next", value);
    }
    function reject2(value) {
      resume("throw", value);
    }
    function settle(f, v) {
      if (f(v), q.shift(), q.length)
        resume(q[0][0], q[0][1]);
    }
  }
  function __asyncDelegator(o) {
    var i, p2;
    return i = {}, verb("next"), verb("throw", function(e) {
      throw e;
    }), verb("return"), i[Symbol.iterator] = function() {
      return this;
    }, i;
    function verb(n, f) {
      i[n] = o[n] ? function(v) {
        return (p2 = !p2) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
      } : f;
    }
  }
  function __asyncValues(o) {
    if (!Symbol.asyncIterator)
      throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
      return this;
    }, i);
    function verb(n) {
      i[n] = o[n] && function(v) {
        return new Promise(function(resolve2, reject2) {
          v = o[n](v), settle(resolve2, reject2, v.done, v.value);
        });
      };
    }
    function settle(resolve2, reject2, d, v) {
      Promise.resolve(v).then(function(v2) {
        resolve2({ value: v2, done: d });
      }, reject2);
    }
  }
  function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) {
      Object.defineProperty(cooked, "raw", { value: raw });
    } else {
      cooked.raw = raw;
    }
    return cooked;
  }
  function __importStar(mod) {
    if (mod && mod.__esModule)
      return mod;
    var result = {};
    if (mod != null) {
      for (var k2 in mod)
        if (k2 !== "default" && Object.prototype.hasOwnProperty.call(mod, k2))
          __createBinding(result, mod, k2);
    }
    __setModuleDefault(result, mod);
    return result;
  }
  function __importDefault(mod) {
    return mod && mod.__esModule ? mod : { default: mod };
  }
  function __classPrivateFieldGet(receiver, state, kind, f) {
    if (kind === "a" && !f)
      throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
      throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  }
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
    if (kind === "m")
      throw new TypeError("Private method is not writable");
    if (kind === "a" && !f)
      throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
      throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
  }
  function __classPrivateFieldIn(state, receiver) {
    if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function")
      throw new TypeError("Cannot use 'in' operator on non-object");
    return typeof state === "function" ? receiver === state : state.has(receiver);
  }
  var extendStatics, __assign, __createBinding, __setModuleDefault, tslib_es6_default;
  var init_tslib_es6 = __esm({
    "node_modules/tslib/tslib.es6.mjs"() {
      extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b10) {
          d2.__proto__ = b10;
        } || function(d2, b10) {
          for (var p2 in b10)
            if (Object.prototype.hasOwnProperty.call(b10, p2))
              d2[p2] = b10[p2];
        };
        return extendStatics(d, b);
      };
      __assign = function() {
        __assign = Object.assign || function __assign2(t) {
          for (var s2, i = 1, n = arguments.length; i < n; i++) {
            s2 = arguments[i];
            for (var p2 in s2)
              if (Object.prototype.hasOwnProperty.call(s2, p2))
                t[p2] = s2[p2];
          }
          return t;
        };
        return __assign.apply(this, arguments);
      };
      __createBinding = Object.create ? function(o, m, k2, k22) {
        if (k22 === void 0)
          k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      } : function(o, m, k2, k22) {
        if (k22 === void 0)
          k22 = k2;
        o[k22] = m[k2];
      };
      __setModuleDefault = Object.create ? function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      } : function(o, v) {
        o["default"] = v;
      };
      tslib_es6_default = {
        __extends,
        __assign,
        __rest,
        __decorate,
        __param,
        __metadata,
        __awaiter,
        __generator,
        __createBinding,
        __exportStar,
        __values,
        __read,
        __spread,
        __spreadArrays,
        __spreadArray,
        __await,
        __asyncGenerator,
        __asyncDelegator,
        __asyncValues,
        __makeTemplateObject,
        __importStar,
        __importDefault,
        __classPrivateFieldGet,
        __classPrivateFieldSet,
        __classPrivateFieldIn
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Backdrop/backdrop.css
  var require_ = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Backdrop/backdrop.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Backdrop/backdrop.js
  var require_backdrop = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Backdrop/backdrop.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_();
      exports.default = {
        "backdrop": "pf-c-backdrop",
        "backdropOpen": "pf-c-backdrop__open"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/layouts/Bullseye/bullseye.css
  var require_2 = __commonJS({
    "node_modules/@patternfly/react-styles/css/layouts/Bullseye/bullseye.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/layouts/Bullseye/bullseye.js
  var require_bullseye = __commonJS({
    "node_modules/@patternfly/react-styles/css/layouts/Bullseye/bullseye.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_2();
      exports.default = {
        "bullseye": "pf-l-bullseye"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Content/content.css
  var require_3 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Content/content.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Content/content.js
  var require_content = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Content/content.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_3();
      exports.default = {
        "content": "pf-c-content",
        "modifiers": {
          "visited": "pf-m-visited",
          "plain": "pf-m-plain",
          "overpassFont": "pf-m-overpass-font"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Title/title.css
  var require_4 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Title/title.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Title/title.js
  var require_title = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Title/title.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_4();
      exports.default = {
        "modifiers": {
          "4xl": "pf-m-4xl",
          "3xl": "pf-m-3xl",
          "2xl": "pf-m-2xl",
          "xl": "pf-m-xl",
          "lg": "pf-m-lg",
          "md": "pf-m-md",
          "overpassFont": "pf-m-overpass-font"
        },
        "title": "pf-c-title"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Button/button.css
  var require_5 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Button/button.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Button/button.js
  var require_button = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Button/button.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_5();
      exports.default = {
        "badge": "pf-c-badge",
        "button": "pf-c-button",
        "buttonCount": "pf-c-button__count",
        "buttonIcon": "pf-c-button__icon",
        "buttonProgress": "pf-c-button__progress",
        "modifiers": {
          "active": "pf-m-active",
          "block": "pf-m-block",
          "small": "pf-m-small",
          "primary": "pf-m-primary",
          "displayLg": "pf-m-display-lg",
          "secondary": "pf-m-secondary",
          "tertiary": "pf-m-tertiary",
          "link": "pf-m-link",
          "unread": "pf-m-unread",
          "inline": "pf-m-inline",
          "danger": "pf-m-danger",
          "warning": "pf-m-warning",
          "control": "pf-m-control",
          "expanded": "pf-m-expanded",
          "plain": "pf-m-plain",
          "disabled": "pf-m-disabled",
          "ariaDisabled": "pf-m-aria-disabled",
          "progress": "pf-m-progress",
          "inProgress": "pf-m-in-progress",
          "start": "pf-m-start",
          "end": "pf-m-end",
          "overpassFont": "pf-m-overpass-font"
        },
        "spinner": "pf-c-spinner",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Spinner/spinner.css
  var require_6 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Spinner/spinner.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Spinner/spinner.js
  var require_spinner = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Spinner/spinner.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_6();
      exports.default = {
        "modifiers": {
          "inline": "pf-m-inline",
          "sm": "pf-m-sm",
          "md": "pf-m-md",
          "lg": "pf-m-lg",
          "xl": "pf-m-xl"
        },
        "spinner": "pf-c-spinner",
        "spinnerClipper": "pf-c-spinner__clipper",
        "spinnerLeadBall": "pf-c-spinner__lead-ball",
        "spinnerPath": "pf-c-spinner__path",
        "spinnerTailBall": "pf-c-spinner__tail-ball"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Badge/badge.css
  var require_7 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Badge/badge.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Badge/badge.js
  var require_badge = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Badge/badge.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_7();
      exports.default = {
        "badge": "pf-c-badge",
        "modifiers": {
          "read": "pf-m-read",
          "unread": "pf-m-unread"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Alert/alert.css
  var require_8 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Alert/alert.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Alert/alert.js
  var require_alert = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Alert/alert.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_8();
      exports.default = {
        "alert": "pf-c-alert",
        "alertAction": "pf-c-alert__action",
        "alertActionGroup": "pf-c-alert__action-group",
        "alertDescription": "pf-c-alert__description",
        "alertIcon": "pf-c-alert__icon",
        "alertTitle": "pf-c-alert__title",
        "alertToggle": "pf-c-alert__toggle",
        "alertToggleIcon": "pf-c-alert__toggle-icon",
        "button": "pf-c-button",
        "modifiers": {
          "success": "pf-m-success",
          "danger": "pf-m-danger",
          "warning": "pf-m-warning",
          "info": "pf-m-info",
          "inline": "pf-m-inline",
          "plain": "pf-m-plain",
          "expandable": "pf-m-expandable",
          "expanded": "pf-m-expanded",
          "truncate": "pf-m-truncate",
          "overpassFont": "pf-m-overpass-font"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/utilities/Accessibility/accessibility.css
  var require_9 = __commonJS({
    "node_modules/@patternfly/react-styles/css/utilities/Accessibility/accessibility.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/utilities/Accessibility/accessibility.js
  var require_accessibility = __commonJS({
    "node_modules/@patternfly/react-styles/css/utilities/Accessibility/accessibility.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_9();
      exports.default = {
        "hidden": "pf-u-hidden",
        "hiddenOnLg": "pf-u-hidden-on-lg",
        "hiddenOnMd": "pf-u-hidden-on-md",
        "hiddenOnSm": "pf-u-hidden-on-sm",
        "hiddenOnXl": "pf-u-hidden-on-xl",
        "hiddenOn_2xl": "pf-u-hidden-on-2xl",
        "screenReader": "pf-u-screen-reader",
        "screenReaderOnLg": "pf-u-screen-reader-on-lg",
        "screenReaderOnMd": "pf-u-screen-reader-on-md",
        "screenReaderOnSm": "pf-u-screen-reader-on-sm",
        "screenReaderOnXl": "pf-u-screen-reader-on-xl",
        "screenReaderOn_2xl": "pf-u-screen-reader-on-2xl",
        "visible": "pf-u-visible",
        "visibleOnLg": "pf-u-visible-on-lg",
        "visibleOnMd": "pf-u-visible-on-md",
        "visibleOnSm": "pf-u-visible-on-sm",
        "visibleOnXl": "pf-u-visible-on-xl",
        "visibleOn_2xl": "pf-u-visible-on-2xl"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Tooltip/tooltip.css
  var require_10 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Tooltip/tooltip.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Tooltip/tooltip.js
  var require_tooltip = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Tooltip/tooltip.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_10();
      exports.default = {
        "modifiers": {
          "top": "pf-m-top",
          "topLeft": "pf-m-top-left",
          "topRight": "pf-m-top-right",
          "bottom": "pf-m-bottom",
          "bottomLeft": "pf-m-bottom-left",
          "bottomRight": "pf-m-bottom-right",
          "left": "pf-m-left",
          "leftTop": "pf-m-left-top",
          "leftBottom": "pf-m-left-bottom",
          "right": "pf-m-right",
          "rightTop": "pf-m-right-top",
          "rightBottom": "pf-m-right-bottom",
          "textAlignLeft": "pf-m-text-align-left"
        },
        "themeDark": "pf-theme-dark",
        "tooltip": "pf-c-tooltip",
        "tooltipArrow": "pf-c-tooltip__arrow",
        "tooltipContent": "pf-c-tooltip__content"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/AlertGroup/alert-group.css
  var require_11 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/AlertGroup/alert-group.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/AlertGroup/alert-group.js
  var require_alert_group = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/AlertGroup/alert-group.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_11();
      exports.default = {
        "alertGroup": "pf-c-alert-group",
        "alertGroupOverflowButton": "pf-c-alert-group__overflow-button",
        "modifiers": {
          "toast": "pf-m-toast"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/FormControl/form-control.css
  var require_12 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/FormControl/form-control.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/FormControl/form-control.js
  var require_form_control = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/FormControl/form-control.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_12();
      exports.default = {
        "formControl": "pf-c-form-control",
        "modifiers": {
          "success": "pf-m-success",
          "plain": "pf-m-plain",
          "expanded": "pf-m-expanded",
          "icon": "pf-m-icon",
          "warning": "pf-m-warning",
          "search": "pf-m-search",
          "calendar": "pf-m-calendar",
          "clock": "pf-m-clock",
          "iconSprite": "pf-m-icon-sprite",
          "placeholder": "pf-m-placeholder",
          "resizeVertical": "pf-m-resize-vertical",
          "resizeHorizontal": "pf-m-resize-horizontal"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Dropdown/dropdown.css
  var require_13 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Dropdown/dropdown.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Dropdown/dropdown.js
  var require_dropdown = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Dropdown/dropdown.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_13();
      exports.default = {
        "badge": "pf-c-badge",
        "check": "pf-c-check",
        "divider": "pf-c-divider",
        "dropdown": "pf-c-dropdown",
        "dropdownGroup": "pf-c-dropdown__group",
        "dropdownGroupTitle": "pf-c-dropdown__group-title",
        "dropdownMenu": "pf-c-dropdown__menu",
        "dropdownMenuItem": "pf-c-dropdown__menu-item",
        "dropdownMenuItemDescription": "pf-c-dropdown__menu-item-description",
        "dropdownMenuItemIcon": "pf-c-dropdown__menu-item-icon",
        "dropdownMenuItemMain": "pf-c-dropdown__menu-item-main",
        "dropdownToggle": "pf-c-dropdown__toggle",
        "dropdownToggleButton": "pf-c-dropdown__toggle-button",
        "dropdownToggleCheck": "pf-c-dropdown__toggle-check",
        "dropdownToggleIcon": "pf-c-dropdown__toggle-icon",
        "dropdownToggleImage": "pf-c-dropdown__toggle-image",
        "dropdownToggleProgress": "pf-c-dropdown__toggle-progress",
        "dropdownToggleText": "pf-c-dropdown__toggle-text",
        "menu": "pf-c-menu",
        "modifiers": {
          "fullHeight": "pf-m-full-height",
          "expanded": "pf-m-expanded",
          "action": "pf-m-action",
          "disabled": "pf-m-disabled",
          "plain": "pf-m-plain",
          "text": "pf-m-text",
          "splitButton": "pf-m-split-button",
          "primary": "pf-m-primary",
          "inProgress": "pf-m-in-progress",
          "active": "pf-m-active",
          "secondary": "pf-m-secondary",
          "top": "pf-m-top",
          "static": "pf-m-static",
          "alignRight": "pf-m-align-right",
          "alignLeft": "pf-m-align-left",
          "alignRightOnSm": "pf-m-align-right-on-sm",
          "alignLeftOnSm": "pf-m-align-left-on-sm",
          "alignRightOnMd": "pf-m-align-right-on-md",
          "alignLeftOnMd": "pf-m-align-left-on-md",
          "alignRightOnLg": "pf-m-align-right-on-lg",
          "alignLeftOnLg": "pf-m-align-left-on-lg",
          "alignRightOnXl": "pf-m-align-right-on-xl",
          "alignLeftOnXl": "pf-m-align-left-on-xl",
          "alignRightOn_2xl": "pf-m-align-right-on-2xl",
          "alignLeftOn_2xl": "pf-m-align-left-on-2xl",
          "ariaDisabled": "pf-m-aria-disabled",
          "icon": "pf-m-icon",
          "description": "pf-m-description"
        },
        "spinner": "pf-c-spinner",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Divider/divider.css
  var require_14 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Divider/divider.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Divider/divider.js
  var require_divider = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Divider/divider.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_14();
      exports.default = {
        "divider": "pf-c-divider",
        "modifiers": {
          "hidden": "pf-m-hidden",
          "hiddenOnSm": "pf-m-hidden-on-sm",
          "visibleOnSm": "pf-m-visible-on-sm",
          "hiddenOnMd": "pf-m-hidden-on-md",
          "visibleOnMd": "pf-m-visible-on-md",
          "hiddenOnLg": "pf-m-hidden-on-lg",
          "visibleOnLg": "pf-m-visible-on-lg",
          "hiddenOnXl": "pf-m-hidden-on-xl",
          "visibleOnXl": "pf-m-visible-on-xl",
          "hiddenOn_2xl": "pf-m-hidden-on-2xl",
          "visibleOn_2xl": "pf-m-visible-on-2xl",
          "vertical": "pf-m-vertical",
          "insetNone": "pf-m-inset-none",
          "insetXs": "pf-m-inset-xs",
          "insetSm": "pf-m-inset-sm",
          "insetMd": "pf-m-inset-md",
          "insetLg": "pf-m-inset-lg",
          "insetXl": "pf-m-inset-xl",
          "inset_2xl": "pf-m-inset-2xl",
          "inset_3xl": "pf-m-inset-3xl",
          "horizontalOnSm": "pf-m-horizontal-on-sm",
          "verticalOnSm": "pf-m-vertical-on-sm",
          "insetNoneOnSm": "pf-m-inset-none-on-sm",
          "insetXsOnSm": "pf-m-inset-xs-on-sm",
          "insetSmOnSm": "pf-m-inset-sm-on-sm",
          "insetMdOnSm": "pf-m-inset-md-on-sm",
          "insetLgOnSm": "pf-m-inset-lg-on-sm",
          "insetXlOnSm": "pf-m-inset-xl-on-sm",
          "inset_2xlOnSm": "pf-m-inset-2xl-on-sm",
          "inset_3xlOnSm": "pf-m-inset-3xl-on-sm",
          "horizontalOnMd": "pf-m-horizontal-on-md",
          "verticalOnMd": "pf-m-vertical-on-md",
          "insetNoneOnMd": "pf-m-inset-none-on-md",
          "insetXsOnMd": "pf-m-inset-xs-on-md",
          "insetSmOnMd": "pf-m-inset-sm-on-md",
          "insetMdOnMd": "pf-m-inset-md-on-md",
          "insetLgOnMd": "pf-m-inset-lg-on-md",
          "insetXlOnMd": "pf-m-inset-xl-on-md",
          "inset_2xlOnMd": "pf-m-inset-2xl-on-md",
          "inset_3xlOnMd": "pf-m-inset-3xl-on-md",
          "horizontalOnLg": "pf-m-horizontal-on-lg",
          "verticalOnLg": "pf-m-vertical-on-lg",
          "insetNoneOnLg": "pf-m-inset-none-on-lg",
          "insetXsOnLg": "pf-m-inset-xs-on-lg",
          "insetSmOnLg": "pf-m-inset-sm-on-lg",
          "insetMdOnLg": "pf-m-inset-md-on-lg",
          "insetLgOnLg": "pf-m-inset-lg-on-lg",
          "insetXlOnLg": "pf-m-inset-xl-on-lg",
          "inset_2xlOnLg": "pf-m-inset-2xl-on-lg",
          "inset_3xlOnLg": "pf-m-inset-3xl-on-lg",
          "horizontalOnXl": "pf-m-horizontal-on-xl",
          "verticalOnXl": "pf-m-vertical-on-xl",
          "insetNoneOnXl": "pf-m-inset-none-on-xl",
          "insetXsOnXl": "pf-m-inset-xs-on-xl",
          "insetSmOnXl": "pf-m-inset-sm-on-xl",
          "insetMdOnXl": "pf-m-inset-md-on-xl",
          "insetLgOnXl": "pf-m-inset-lg-on-xl",
          "insetXlOnXl": "pf-m-inset-xl-on-xl",
          "inset_2xlOnXl": "pf-m-inset-2xl-on-xl",
          "inset_3xlOnXl": "pf-m-inset-3xl-on-xl",
          "horizontalOn_2xl": "pf-m-horizontal-on-2xl",
          "verticalOn_2xl": "pf-m-vertical-on-2xl",
          "insetNoneOn_2xl": "pf-m-inset-none-on-2xl",
          "insetXsOn_2xl": "pf-m-inset-xs-on-2xl",
          "insetSmOn_2xl": "pf-m-inset-sm-on-2xl",
          "insetMdOn_2xl": "pf-m-inset-md-on-2xl",
          "insetLgOn_2xl": "pf-m-inset-lg-on-2xl",
          "insetXlOn_2xl": "pf-m-inset-xl-on-2xl",
          "inset_2xlOn_2xl": "pf-m-inset-2xl-on-2xl",
          "inset_3xlOn_2xl": "pf-m-inset-3xl-on-2xl"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Breadcrumb/breadcrumb.css
  var require_15 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Breadcrumb/breadcrumb.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Breadcrumb/breadcrumb.js
  var require_breadcrumb = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Breadcrumb/breadcrumb.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_15();
      exports.default = {
        "breadcrumb": "pf-c-breadcrumb",
        "breadcrumbDropdown": "pf-c-breadcrumb__dropdown",
        "breadcrumbHeading": "pf-c-breadcrumb__heading",
        "breadcrumbItem": "pf-c-breadcrumb__item",
        "breadcrumbItemDivider": "pf-c-breadcrumb__item-divider",
        "breadcrumbLink": "pf-c-breadcrumb__link",
        "breadcrumbList": "pf-c-breadcrumb__list",
        "dropdownToggle": "pf-c-dropdown__toggle",
        "modifiers": {
          "current": "pf-m-current",
          "overpassFont": "pf-m-overpass-font"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Select/select.css
  var require_16 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Select/select.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Select/select.js
  var require_select = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Select/select.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_16();
      exports.default = {
        "check": "pf-c-check",
        "checkLabel": "pf-c-check__label",
        "chipGroup": "pf-c-chip-group",
        "divider": "pf-c-divider",
        "formControl": "pf-c-form-control",
        "modifiers": {
          "invalid": "pf-m-invalid",
          "success": "pf-m-success",
          "warning": "pf-m-warning",
          "disabled": "pf-m-disabled",
          "active": "pf-m-active",
          "expanded": "pf-m-expanded",
          "plain": "pf-m-plain",
          "typeahead": "pf-m-typeahead",
          "placeholder": "pf-m-placeholder",
          "top": "pf-m-top",
          "alignRight": "pf-m-align-right",
          "static": "pf-m-static",
          "favorite": "pf-m-favorite",
          "favoriteAction": "pf-m-favorite-action",
          "focus": "pf-m-focus",
          "link": "pf-m-link",
          "action": "pf-m-action",
          "selected": "pf-m-selected",
          "description": "pf-m-description",
          "load": "pf-m-load",
          "loading": "pf-m-loading"
        },
        "select": "pf-c-select",
        "selectListItem": "pf-c-select__list-item",
        "selectMenu": "pf-c-select__menu",
        "selectMenuFieldset": "pf-c-select__menu-fieldset",
        "selectMenuFooter": "pf-c-select__menu-footer",
        "selectMenuGroup": "pf-c-select__menu-group",
        "selectMenuGroupTitle": "pf-c-select__menu-group-title",
        "selectMenuItem": "pf-c-select__menu-item",
        "selectMenuItemActionIcon": "pf-c-select__menu-item-action-icon",
        "selectMenuItemCount": "pf-c-select__menu-item-count",
        "selectMenuItemDescription": "pf-c-select__menu-item-description",
        "selectMenuItemIcon": "pf-c-select__menu-item-icon",
        "selectMenuItemMain": "pf-c-select__menu-item-main",
        "selectMenuItemMatch": "pf-c-select__menu-item--match",
        "selectMenuItemRow": "pf-c-select__menu-item-row",
        "selectMenuItemText": "pf-c-select__menu-item-text",
        "selectMenuSearch": "pf-c-select__menu-search",
        "selectMenuWrapper": "pf-c-select__menu-wrapper",
        "selectToggle": "pf-c-select__toggle",
        "selectToggleArrow": "pf-c-select__toggle-arrow",
        "selectToggleBadge": "pf-c-select__toggle-badge",
        "selectToggleButton": "pf-c-select__toggle-button",
        "selectToggleClear": "pf-c-select__toggle-clear",
        "selectToggleIcon": "pf-c-select__toggle-icon",
        "selectToggleStatusIcon": "pf-c-select__toggle-status-icon",
        "selectToggleText": "pf-c-select__toggle-text",
        "selectToggleTypeahead": "pf-c-select__toggle-typeahead",
        "selectToggleWrapper": "pf-c-select__toggle-wrapper",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Form/form.css
  var require_17 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Form/form.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Form/form.js
  var require_form = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Form/form.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_17();
      exports.default = {
        "form": "pf-c-form",
        "formActions": "pf-c-form__actions",
        "formFieldGroup": "pf-c-form__field-group",
        "formFieldGroupBody": "pf-c-form__field-group-body",
        "formFieldGroupHeader": "pf-c-form__field-group-header",
        "formFieldGroupHeaderActions": "pf-c-form__field-group-header-actions",
        "formFieldGroupHeaderDescription": "pf-c-form__field-group-header-description",
        "formFieldGroupHeaderMain": "pf-c-form__field-group-header-main",
        "formFieldGroupHeaderTitle": "pf-c-form__field-group-header-title",
        "formFieldGroupHeaderTitleText": "pf-c-form__field-group-header-title-text",
        "formFieldGroupToggle": "pf-c-form__field-group-toggle",
        "formFieldGroupToggleButton": "pf-c-form__field-group-toggle-button",
        "formFieldGroupToggleIcon": "pf-c-form__field-group-toggle-icon",
        "formFieldset": "pf-c-form__fieldset",
        "formGroup": "pf-c-form__group",
        "formGroupControl": "pf-c-form__group-control",
        "formGroupLabel": "pf-c-form__group-label",
        "formGroupLabelHelp": "pf-c-form__group-label-help",
        "formGroupLabelInfo": "pf-c-form__group-label-info",
        "formGroupLabelMain": "pf-c-form__group-label-main",
        "formHelperText": "pf-c-form__helper-text",
        "formHelperTextIcon": "pf-c-form__helper-text-icon",
        "formLabel": "pf-c-form__label",
        "formLabelRequired": "pf-c-form__label-required",
        "formLabelText": "pf-c-form__label-text",
        "formSection": "pf-c-form__section",
        "formSectionTitle": "pf-c-form__section-title",
        "modifiers": {
          "horizontal": "pf-m-horizontal",
          "alignRight": "pf-m-align-right",
          "noPaddingTop": "pf-m-no-padding-top",
          "horizontalOnXs": "pf-m-horizontal-on-xs",
          "horizontalOnSm": "pf-m-horizontal-on-sm",
          "horizontalOnMd": "pf-m-horizontal-on-md",
          "horizontalOnLg": "pf-m-horizontal-on-lg",
          "horizontalOnXl": "pf-m-horizontal-on-xl",
          "horizontalOn_2xl": "pf-m-horizontal-on-2xl",
          "limitWidth": "pf-m-limit-width",
          "action": "pf-m-action",
          "info": "pf-m-info",
          "disabled": "pf-m-disabled",
          "inline": "pf-m-inline",
          "stack": "pf-m-stack",
          "error": "pf-m-error",
          "success": "pf-m-success",
          "warning": "pf-m-warning",
          "inactive": "pf-m-inactive",
          "hidden": "pf-m-hidden",
          "expanded": "pf-m-expanded"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Check/check.css
  var require_18 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Check/check.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Check/check.js
  var require_check = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Check/check.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_18();
      exports.default = {
        "check": "pf-c-check",
        "checkBody": "pf-c-check__body",
        "checkDescription": "pf-c-check__description",
        "checkInput": "pf-c-check__input",
        "checkLabel": "pf-c-check__label",
        "checkLabelRequired": "pf-c-check__label-required",
        "modifiers": {
          "standalone": "pf-m-standalone",
          "disabled": "pf-m-disabled"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ChipGroup/chip-group.css
  var require_19 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ChipGroup/chip-group.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ChipGroup/chip-group.js
  var require_chip_group = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ChipGroup/chip-group.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_19();
      exports.default = {
        "chipGroup": "pf-c-chip-group",
        "chipGroupClose": "pf-c-chip-group__close",
        "chipGroupLabel": "pf-c-chip-group__label",
        "chipGroupList": "pf-c-chip-group__list",
        "chipGroupListItem": "pf-c-chip-group__list-item",
        "chipGroupMain": "pf-c-chip-group__main",
        "modifiers": {
          "category": "pf-m-category"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Chip/chip.css
  var require_20 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Chip/chip.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Chip/chip.js
  var require_chip = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Chip/chip.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_20();
      exports.default = {
        "badge": "pf-c-badge",
        "button": "pf-c-button",
        "chip": "pf-c-chip",
        "chipIcon": "pf-c-chip__icon",
        "chipText": "pf-c-chip__text",
        "modifiers": {
          "overflow": "pf-m-overflow",
          "draggable": "pf-m-draggable"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/InputGroup/input-group.css
  var require_21 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/InputGroup/input-group.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/InputGroup/input-group.js
  var require_input_group = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/InputGroup/input-group.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_21();
      exports.default = {
        "formControl": "pf-c-form-control",
        "inputGroup": "pf-c-input-group",
        "inputGroupText": "pf-c-input-group__text",
        "modifiers": {
          "plain": "pf-m-plain",
          "disabled": "pf-m-disabled"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Card/card.css
  var require_22 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Card/card.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Card/card.js
  var require_card = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Card/card.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_22();
      exports.default = {
        "card": "pf-c-card",
        "cardActions": "pf-c-card__actions",
        "cardBody": "pf-c-card__body",
        "cardExpandableContent": "pf-c-card__expandable-content",
        "cardFooter": "pf-c-card__footer",
        "cardHeader": "pf-c-card__header",
        "cardHeaderToggle": "pf-c-card__header-toggle",
        "cardHeaderToggleIcon": "pf-c-card__header-toggle-icon",
        "cardSrInput": "pf-c-card__sr-input",
        "cardTitle": "pf-c-card__title",
        "divider": "pf-c-divider",
        "modifiers": {
          "hoverable": "pf-m-hoverable",
          "selectable": "pf-m-selectable",
          "selected": "pf-m-selected",
          "hoverableRaised": "pf-m-hoverable-raised",
          "selectableRaised": "pf-m-selectable-raised",
          "nonSelectableRaised": "pf-m-non-selectable-raised",
          "selectedRaised": "pf-m-selected-raised",
          "compact": "pf-m-compact",
          "displayLg": "pf-m-display-lg",
          "flat": "pf-m-flat",
          "plain": "pf-m-plain",
          "rounded": "pf-m-rounded",
          "expanded": "pf-m-expanded",
          "fullHeight": "pf-m-full-height",
          "toggleRight": "pf-m-toggle-right",
          "noOffset": "pf-m-no-offset",
          "noFill": "pf-m-no-fill",
          "overpassFont": "pf-m-overpass-font"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy.css
  var require_23 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy.js
  var require_clipboard_copy = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_23();
      exports.default = {
        "button": "pf-c-button",
        "clipboardCopy": "pf-c-clipboard-copy",
        "clipboardCopyActions": "pf-c-clipboard-copy__actions",
        "clipboardCopyActionsItem": "pf-c-clipboard-copy__actions-item",
        "clipboardCopyExpandableContent": "pf-c-clipboard-copy__expandable-content",
        "clipboardCopyGroup": "pf-c-clipboard-copy__group",
        "clipboardCopyText": "pf-c-clipboard-copy__text",
        "clipboardCopyToggleIcon": "pf-c-clipboard-copy__toggle-icon",
        "modifiers": {
          "expanded": "pf-m-expanded",
          "inline": "pf-m-inline",
          "block": "pf-m-block",
          "code": "pf-m-code"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Popover/popover.css
  var require_24 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Popover/popover.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Popover/popover.js
  var require_popover = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Popover/popover.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_24();
      exports.default = {
        "button": "pf-c-button",
        "modifiers": {
          "noPadding": "pf-m-no-padding",
          "widthAuto": "pf-m-width-auto",
          "top": "pf-m-top",
          "topLeft": "pf-m-top-left",
          "topRight": "pf-m-top-right",
          "bottom": "pf-m-bottom",
          "bottomLeft": "pf-m-bottom-left",
          "bottomRight": "pf-m-bottom-right",
          "left": "pf-m-left",
          "leftTop": "pf-m-left-top",
          "leftBottom": "pf-m-left-bottom",
          "right": "pf-m-right",
          "rightTop": "pf-m-right-top",
          "rightBottom": "pf-m-right-bottom",
          "danger": "pf-m-danger",
          "warning": "pf-m-warning",
          "success": "pf-m-success",
          "default": "pf-m-default",
          "info": "pf-m-info",
          "icon": "pf-m-icon"
        },
        "popover": "pf-c-popover",
        "popoverArrow": "pf-c-popover__arrow",
        "popoverBody": "pf-c-popover__body",
        "popoverContent": "pf-c-popover__content",
        "popoverFooter": "pf-c-popover__footer",
        "popoverTitle": "pf-c-popover__title",
        "popoverTitleIcon": "pf-c-popover__title-icon",
        "popoverTitleText": "pf-c-popover__title-text",
        "themeDark": "pf-theme-dark",
        "title": "pf-c-title"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/DatePicker/date-picker.css
  var require_25 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/DatePicker/date-picker.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/DatePicker/date-picker.js
  var require_date_picker = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/DatePicker/date-picker.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_25();
      exports.default = {
        "datePicker": "pf-c-date-picker",
        "datePickerCalendar": "pf-c-date-picker__calendar",
        "datePickerHelperText": "pf-c-date-picker__helper-text",
        "datePickerInput": "pf-c-date-picker__input",
        "formControl": "pf-c-form-control",
        "modifiers": {
          "error": "pf-m-error",
          "alignRight": "pf-m-align-right",
          "top": "pf-m-top",
          "static": "pf-m-static"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Drawer/drawer.css
  var require_26 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Drawer/drawer.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Drawer/drawer.js
  var require_drawer = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Drawer/drawer.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_26();
      exports.default = {
        "drawer": "pf-c-drawer",
        "drawerActions": "pf-c-drawer__actions",
        "drawerBody": "pf-c-drawer__body",
        "drawerClose": "pf-c-drawer__close",
        "drawerContent": "pf-c-drawer__content",
        "drawerHead": "pf-c-drawer__head",
        "drawerMain": "pf-c-drawer__main",
        "drawerPanel": "pf-c-drawer__panel",
        "drawerPanelMain": "pf-c-drawer__panel-main",
        "drawerSection": "pf-c-drawer__section",
        "drawerSplitter": "pf-c-drawer__splitter",
        "drawerSplitterHandle": "pf-c-drawer__splitter-handle",
        "modifiers": {
          "panelBottom": "pf-m-panel-bottom",
          "inline": "pf-m-inline",
          "noBorder": "pf-m-no-border",
          "resizable": "pf-m-resizable",
          "static": "pf-m-static",
          "panelLeft": "pf-m-panel-left",
          "expanded": "pf-m-expanded",
          "resizing": "pf-m-resizing",
          "noBackground": "pf-m-no-background",
          "light_200": "pf-m-light-200",
          "noPadding": "pf-m-no-padding",
          "padding": "pf-m-padding",
          "vertical": "pf-m-vertical",
          "width_25": "pf-m-width-25",
          "width_33": "pf-m-width-33",
          "width_50": "pf-m-width-50",
          "width_66": "pf-m-width-66",
          "width_75": "pf-m-width-75",
          "width_100": "pf-m-width-100",
          "width_25OnLg": "pf-m-width-25-on-lg",
          "width_33OnLg": "pf-m-width-33-on-lg",
          "width_50OnLg": "pf-m-width-50-on-lg",
          "width_66OnLg": "pf-m-width-66-on-lg",
          "width_75OnLg": "pf-m-width-75-on-lg",
          "width_100OnLg": "pf-m-width-100-on-lg",
          "width_25OnXl": "pf-m-width-25-on-xl",
          "width_33OnXl": "pf-m-width-33-on-xl",
          "width_50OnXl": "pf-m-width-50-on-xl",
          "width_66OnXl": "pf-m-width-66-on-xl",
          "width_75OnXl": "pf-m-width-75-on-xl",
          "width_100OnXl": "pf-m-width-100-on-xl",
          "width_25On_2xl": "pf-m-width-25-on-2xl",
          "width_33On_2xl": "pf-m-width-33-on-2xl",
          "width_50On_2xl": "pf-m-width-50-on-2xl",
          "width_66On_2xl": "pf-m-width-66-on-2xl",
          "width_75On_2xl": "pf-m-width-75-on-2xl",
          "width_100On_2xl": "pf-m-width-100-on-2xl",
          "inlineOnLg": "pf-m-inline-on-lg",
          "staticOnLg": "pf-m-static-on-lg",
          "inlineOnXl": "pf-m-inline-on-xl",
          "staticOnXl": "pf-m-static-on-xl",
          "inlineOn_2xl": "pf-m-inline-on-2xl",
          "staticOn_2xl": "pf-m-static-on-2xl"
        },
        "pageMain": "pf-c-page__main",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/DualListSelector/dual-list-selector.css
  var require_27 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/DualListSelector/dual-list-selector.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/DualListSelector/dual-list-selector.js
  var require_dual_list_selector = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/DualListSelector/dual-list-selector.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_27();
      exports.default = {
        "badge": "pf-c-badge",
        "button": "pf-c-button",
        "dualListSelector": "pf-c-dual-list-selector",
        "dualListSelectorControls": "pf-c-dual-list-selector__controls",
        "dualListSelectorDraggable": "pf-c-dual-list-selector__draggable",
        "dualListSelectorHeader": "pf-c-dual-list-selector__header",
        "dualListSelectorItem": "pf-c-dual-list-selector__item",
        "dualListSelectorItemCheck": "pf-c-dual-list-selector__item-check",
        "dualListSelectorItemCount": "pf-c-dual-list-selector__item-count",
        "dualListSelectorItemMain": "pf-c-dual-list-selector__item-main",
        "dualListSelectorItemText": "pf-c-dual-list-selector__item-text",
        "dualListSelectorItemToggle": "pf-c-dual-list-selector__item-toggle",
        "dualListSelectorItemToggleIcon": "pf-c-dual-list-selector__item-toggle-icon",
        "dualListSelectorList": "pf-c-dual-list-selector__list",
        "dualListSelectorListItem": "pf-c-dual-list-selector__list-item",
        "dualListSelectorListItemRow": "pf-c-dual-list-selector__list-item-row",
        "dualListSelectorMain": "pf-c-dual-list-selector__main",
        "dualListSelectorMenu": "pf-c-dual-list-selector__menu",
        "dualListSelectorPane": "pf-c-dual-list-selector__pane",
        "dualListSelectorStatus": "pf-c-dual-list-selector__status",
        "dualListSelectorStatusText": "pf-c-dual-list-selector__status-text",
        "dualListSelectorTitleText": "pf-c-dual-list-selector__title-text",
        "dualListSelectorTools": "pf-c-dual-list-selector__tools",
        "dualListSelectorToolsActions": "pf-c-dual-list-selector__tools-actions",
        "dualListSelectorToolsFilter": "pf-c-dual-list-selector__tools-filter",
        "modifiers": {
          "chosen": "pf-m-chosen",
          "dragOver": "pf-m-drag-over",
          "expandable": "pf-m-expandable",
          "expanded": "pf-m-expanded",
          "disabled": "pf-m-disabled",
          "selected": "pf-m-selected",
          "check": "pf-m-check",
          "ghostRow": "pf-m-ghost-row",
          "read": "pf-m-read"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Panel/panel.css
  var require_28 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Panel/panel.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Panel/panel.js
  var require_panel = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Panel/panel.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_28();
      exports.default = {
        "modifiers": {
          "bordered": "pf-m-bordered",
          "raised": "pf-m-raised",
          "scrollable": "pf-m-scrollable"
        },
        "panel": "pf-c-panel",
        "panelFooter": "pf-c-panel__footer",
        "panelHeader": "pf-c-panel__header",
        "panelMain": "pf-c-panel__main",
        "panelMainBody": "pf-c-panel__main-body"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/TextInputGroup/text-input-group.css
  var require_29 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/TextInputGroup/text-input-group.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/TextInputGroup/text-input-group.js
  var require_text_input_group = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/TextInputGroup/text-input-group.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_29();
      exports.default = {
        "button": "pf-c-button",
        "chipGroupMain": "pf-c-chip-group__main",
        "modifiers": {
          "disabled": "pf-m-disabled",
          "plain": "pf-m-plain",
          "icon": "pf-m-icon",
          "hint": "pf-m-hint"
        },
        "textInputGroup": "pf-c-text-input-group",
        "textInputGroupGroup": "pf-c-text-input-group__group",
        "textInputGroupIcon": "pf-c-text-input-group__icon",
        "textInputGroupMain": "pf-c-text-input-group__main",
        "textInputGroupText": "pf-c-text-input-group__text",
        "textInputGroupTextInput": "pf-c-text-input-group__text-input",
        "textInputGroupUtilities": "pf-c-text-input-group__utilities"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/EmptyState/empty-state.css
  var require_30 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/EmptyState/empty-state.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/EmptyState/empty-state.js
  var require_empty_state = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/EmptyState/empty-state.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_30();
      exports.default = {
        "button": "pf-c-button",
        "emptyState": "pf-c-empty-state",
        "emptyStateBody": "pf-c-empty-state__body",
        "emptyStateContent": "pf-c-empty-state__content",
        "emptyStateIcon": "pf-c-empty-state__icon",
        "emptyStatePrimary": "pf-c-empty-state__primary",
        "emptyStateSecondary": "pf-c-empty-state__secondary",
        "modifiers": {
          "xs": "pf-m-xs",
          "sm": "pf-m-sm",
          "lg": "pf-m-lg",
          "xl": "pf-m-xl",
          "fullHeight": "pf-m-full-height",
          "primary": "pf-m-primary",
          "overpassFont": "pf-m-overpass-font"
        },
        "title": "pf-c-title"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ExpandableSection/expandable-section.css
  var require_31 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ExpandableSection/expandable-section.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ExpandableSection/expandable-section.js
  var require_expandable_section = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ExpandableSection/expandable-section.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_31();
      exports.default = {
        "expandableSection": "pf-c-expandable-section",
        "expandableSectionContent": "pf-c-expandable-section__content",
        "expandableSectionToggle": "pf-c-expandable-section__toggle",
        "expandableSectionToggleIcon": "pf-c-expandable-section__toggle-icon",
        "expandableSectionToggleText": "pf-c-expandable-section__toggle-text",
        "modifiers": {
          "expanded": "pf-m-expanded",
          "detached": "pf-m-detached",
          "truncate": "pf-m-truncate",
          "limitWidth": "pf-m-limit-width",
          "displayLg": "pf-m-display-lg",
          "indented": "pf-m-indented",
          "active": "pf-m-active",
          "expandTop": "pf-m-expand-top",
          "overpassFont": "pf-m-overpass-font"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/FileUpload/file-upload.css
  var require_32 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/FileUpload/file-upload.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/FileUpload/file-upload.js
  var require_file_upload = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/FileUpload/file-upload.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_32();
      exports.default = {
        "button": "pf-c-button",
        "fileUpload": "pf-c-file-upload",
        "fileUploadFileDetails": "pf-c-file-upload__file-details",
        "fileUploadFileDetailsSpinner": "pf-c-file-upload__file-details-spinner",
        "fileUploadFileSelect": "pf-c-file-upload__file-select",
        "formControl": "pf-c-form-control",
        "modifiers": {
          "dragHover": "pf-m-drag-hover",
          "loading": "pf-m-loading",
          "control": "pf-m-control"
        }
      };
    }
  });

  // node_modules/attr-accept/dist/index.js
  var require_dist = __commonJS({
    "node_modules/attr-accept/dist/index.js"(exports, module) {
      module.exports = function(t) {
        function n(e) {
          if (r[e])
            return r[e].exports;
          var o = r[e] = { i: e, l: false, exports: {} };
          return t[e].call(o.exports, o, o.exports, n), o.l = true, o.exports;
        }
        var r = {};
        return n.m = t, n.c = r, n.d = function(t2, r2, e) {
          n.o(t2, r2) || Object.defineProperty(t2, r2, { configurable: false, enumerable: true, get: e });
        }, n.n = function(t2) {
          var r2 = t2 && t2.__esModule ? function() {
            return t2.default;
          } : function() {
            return t2;
          };
          return n.d(r2, "a", r2), r2;
        }, n.o = function(t2, n2) {
          return Object.prototype.hasOwnProperty.call(t2, n2);
        }, n.p = "", n(n.s = 13);
      }([function(t, n) {
        var r = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
        "number" == typeof __g && (__g = r);
      }, function(t, n) {
        t.exports = function(t2) {
          return "object" == typeof t2 ? null !== t2 : "function" == typeof t2;
        };
      }, function(t, n) {
        var r = t.exports = { version: "2.5.0" };
        "number" == typeof __e && (__e = r);
      }, function(t, n, r) {
        t.exports = !r(4)(function() {
          return 7 != Object.defineProperty({}, "a", { get: function() {
            return 7;
          } }).a;
        });
      }, function(t, n) {
        t.exports = function(t2) {
          try {
            return !!t2();
          } catch (t3) {
            return true;
          }
        };
      }, function(t, n) {
        var r = {}.toString;
        t.exports = function(t2) {
          return r.call(t2).slice(8, -1);
        };
      }, function(t, n, r) {
        var e = r(32)("wks"), o = r(9), i = r(0).Symbol, u = "function" == typeof i;
        (t.exports = function(t2) {
          return e[t2] || (e[t2] = u && i[t2] || (u ? i : o)("Symbol." + t2));
        }).store = e;
      }, function(t, n, r) {
        var e = r(0), o = r(2), i = r(8), u = r(22), c2 = r(10), f = function(t2, n2, r2) {
          var a2, s2, p2, l, v = t2 & f.F, y2 = t2 & f.G, h = t2 & f.S, d = t2 & f.P, x2 = t2 & f.B, g = y2 ? e : h ? e[n2] || (e[n2] = {}) : (e[n2] || {}).prototype, m = y2 ? o : o[n2] || (o[n2] = {}), b = m.prototype || (m.prototype = {});
          y2 && (r2 = n2);
          for (a2 in r2)
            s2 = !v && g && void 0 !== g[a2], p2 = (s2 ? g : r2)[a2], l = x2 && s2 ? c2(p2, e) : d && "function" == typeof p2 ? c2(Function.call, p2) : p2, g && u(g, a2, p2, t2 & f.U), m[a2] != p2 && i(m, a2, l), d && b[a2] != p2 && (b[a2] = p2);
        };
        e.core = o, f.F = 1, f.G = 2, f.S = 4, f.P = 8, f.B = 16, f.W = 32, f.U = 64, f.R = 128, t.exports = f;
      }, function(t, n, r) {
        var e = r(16), o = r(21);
        t.exports = r(3) ? function(t2, n2, r2) {
          return e.f(t2, n2, o(1, r2));
        } : function(t2, n2, r2) {
          return t2[n2] = r2, t2;
        };
      }, function(t, n) {
        var r = 0, e = Math.random();
        t.exports = function(t2) {
          return "Symbol(".concat(void 0 === t2 ? "" : t2, ")_", (++r + e).toString(36));
        };
      }, function(t, n, r) {
        var e = r(24);
        t.exports = function(t2, n2, r2) {
          if (e(t2), void 0 === n2)
            return t2;
          switch (r2) {
            case 1:
              return function(r3) {
                return t2.call(n2, r3);
              };
            case 2:
              return function(r3, e3) {
                return t2.call(n2, r3, e3);
              };
            case 3:
              return function(r3, e3, o) {
                return t2.call(n2, r3, e3, o);
              };
          }
          return function() {
            return t2.apply(n2, arguments);
          };
        };
      }, function(t, n) {
        t.exports = function(t2) {
          if (void 0 == t2)
            throw TypeError("Can't call method on  " + t2);
          return t2;
        };
      }, function(t, n, r) {
        var e = r(28), o = Math.min;
        t.exports = function(t2) {
          return t2 > 0 ? o(e(t2), 9007199254740991) : 0;
        };
      }, function(t, n, r) {
        "use strict";
        n.__esModule = true, n.default = function(t2, n2) {
          if (t2 && n2) {
            var r2 = Array.isArray(n2) ? n2 : n2.split(","), e = t2.name || "", o = t2.type || "", i = o.replace(/\/.*$/, "");
            return r2.some(function(t3) {
              var n3 = t3.trim();
              return "." === n3.charAt(0) ? e.toLowerCase().endsWith(n3.toLowerCase()) : n3.endsWith("/*") ? i === n3.replace(/\/.*$/, "") : o === n3;
            });
          }
          return true;
        }, r(14), r(34);
      }, function(t, n, r) {
        r(15), t.exports = r(2).Array.some;
      }, function(t, n, r) {
        "use strict";
        var e = r(7), o = r(25)(3);
        e(e.P + e.F * !r(33)([].some, true), "Array", { some: function(t2) {
          return o(this, t2, arguments[1]);
        } });
      }, function(t, n, r) {
        var e = r(17), o = r(18), i = r(20), u = Object.defineProperty;
        n.f = r(3) ? Object.defineProperty : function(t2, n2, r2) {
          if (e(t2), n2 = i(n2, true), e(r2), o)
            try {
              return u(t2, n2, r2);
            } catch (t3) {
            }
          if ("get" in r2 || "set" in r2)
            throw TypeError("Accessors not supported!");
          return "value" in r2 && (t2[n2] = r2.value), t2;
        };
      }, function(t, n, r) {
        var e = r(1);
        t.exports = function(t2) {
          if (!e(t2))
            throw TypeError(t2 + " is not an object!");
          return t2;
        };
      }, function(t, n, r) {
        t.exports = !r(3) && !r(4)(function() {
          return 7 != Object.defineProperty(r(19)("div"), "a", { get: function() {
            return 7;
          } }).a;
        });
      }, function(t, n, r) {
        var e = r(1), o = r(0).document, i = e(o) && e(o.createElement);
        t.exports = function(t2) {
          return i ? o.createElement(t2) : {};
        };
      }, function(t, n, r) {
        var e = r(1);
        t.exports = function(t2, n2) {
          if (!e(t2))
            return t2;
          var r2, o;
          if (n2 && "function" == typeof (r2 = t2.toString) && !e(o = r2.call(t2)))
            return o;
          if ("function" == typeof (r2 = t2.valueOf) && !e(o = r2.call(t2)))
            return o;
          if (!n2 && "function" == typeof (r2 = t2.toString) && !e(o = r2.call(t2)))
            return o;
          throw TypeError("Can't convert object to primitive value");
        };
      }, function(t, n) {
        t.exports = function(t2, n2) {
          return { enumerable: !(1 & t2), configurable: !(2 & t2), writable: !(4 & t2), value: n2 };
        };
      }, function(t, n, r) {
        var e = r(0), o = r(8), i = r(23), u = r(9)("src"), c2 = Function.toString, f = ("" + c2).split("toString");
        r(2).inspectSource = function(t2) {
          return c2.call(t2);
        }, (t.exports = function(t2, n2, r2, c3) {
          var a2 = "function" == typeof r2;
          a2 && (i(r2, "name") || o(r2, "name", n2)), t2[n2] !== r2 && (a2 && (i(r2, u) || o(r2, u, t2[n2] ? "" + t2[n2] : f.join(String(n2)))), t2 === e ? t2[n2] = r2 : c3 ? t2[n2] ? t2[n2] = r2 : o(t2, n2, r2) : (delete t2[n2], o(t2, n2, r2)));
        })(Function.prototype, "toString", function() {
          return "function" == typeof this && this[u] || c2.call(this);
        });
      }, function(t, n) {
        var r = {}.hasOwnProperty;
        t.exports = function(t2, n2) {
          return r.call(t2, n2);
        };
      }, function(t, n) {
        t.exports = function(t2) {
          if ("function" != typeof t2)
            throw TypeError(t2 + " is not a function!");
          return t2;
        };
      }, function(t, n, r) {
        var e = r(10), o = r(26), i = r(27), u = r(12), c2 = r(29);
        t.exports = function(t2, n2) {
          var r2 = 1 == t2, f = 2 == t2, a2 = 3 == t2, s2 = 4 == t2, p2 = 6 == t2, l = 5 == t2 || p2, v = n2 || c2;
          return function(n3, c3, y2) {
            for (var h, d, x2 = i(n3), g = o(x2), m = e(c3, y2, 3), b = u(g.length), _ = 0, w2 = r2 ? v(n3, b) : f ? v(n3, 0) : void 0; b > _; _++)
              if ((l || _ in g) && (h = g[_], d = m(h, _, x2), t2)) {
                if (r2)
                  w2[_] = d;
                else if (d)
                  switch (t2) {
                    case 3:
                      return true;
                    case 5:
                      return h;
                    case 6:
                      return _;
                    case 2:
                      w2.push(h);
                  }
                else if (s2)
                  return false;
              }
            return p2 ? -1 : a2 || s2 ? s2 : w2;
          };
        };
      }, function(t, n, r) {
        var e = r(5);
        t.exports = Object("z").propertyIsEnumerable(0) ? Object : function(t2) {
          return "String" == e(t2) ? t2.split("") : Object(t2);
        };
      }, function(t, n, r) {
        var e = r(11);
        t.exports = function(t2) {
          return Object(e(t2));
        };
      }, function(t, n) {
        var r = Math.ceil, e = Math.floor;
        t.exports = function(t2) {
          return isNaN(t2 = +t2) ? 0 : (t2 > 0 ? e : r)(t2);
        };
      }, function(t, n, r) {
        var e = r(30);
        t.exports = function(t2, n2) {
          return new (e(t2))(n2);
        };
      }, function(t, n, r) {
        var e = r(1), o = r(31), i = r(6)("species");
        t.exports = function(t2) {
          var n2;
          return o(t2) && (n2 = t2.constructor, "function" != typeof n2 || n2 !== Array && !o(n2.prototype) || (n2 = void 0), e(n2) && null === (n2 = n2[i]) && (n2 = void 0)), void 0 === n2 ? Array : n2;
        };
      }, function(t, n, r) {
        var e = r(5);
        t.exports = Array.isArray || function(t2) {
          return "Array" == e(t2);
        };
      }, function(t, n, r) {
        var e = r(0), o = e["__core-js_shared__"] || (e["__core-js_shared__"] = {});
        t.exports = function(t2) {
          return o[t2] || (o[t2] = {});
        };
      }, function(t, n, r) {
        "use strict";
        var e = r(4);
        t.exports = function(t2, n2) {
          return !!t2 && e(function() {
            n2 ? t2.call(null, function() {
            }, 1) : t2.call(null);
          });
        };
      }, function(t, n, r) {
        r(35), t.exports = r(2).String.endsWith;
      }, function(t, n, r) {
        "use strict";
        var e = r(7), o = r(12), i = r(36), u = "".endsWith;
        e(e.P + e.F * r(38)("endsWith"), "String", { endsWith: function(t2) {
          var n2 = i(this, t2, "endsWith"), r2 = arguments.length > 1 ? arguments[1] : void 0, e3 = o(n2.length), c2 = void 0 === r2 ? e3 : Math.min(o(r2), e3), f = String(t2);
          return u ? u.call(n2, f, c2) : n2.slice(c2 - f.length, c2) === f;
        } });
      }, function(t, n, r) {
        var e = r(37), o = r(11);
        t.exports = function(t2, n2, r2) {
          if (e(n2))
            throw TypeError("String#" + r2 + " doesn't accept regex!");
          return String(o(t2));
        };
      }, function(t, n, r) {
        var e = r(1), o = r(5), i = r(6)("match");
        t.exports = function(t2) {
          var n2;
          return e(t2) && (void 0 !== (n2 = t2[i]) ? !!n2 : "RegExp" == o(t2));
        };
      }, function(t, n, r) {
        var e = r(6)("match");
        t.exports = function(t2) {
          var n2 = /./;
          try {
            "/./"[t2](n2);
          } catch (r2) {
            try {
              return n2[e] = false, !"/./"[t2](n2);
            } catch (t3) {
            }
          }
          return true;
        };
      }]);
    }
  });

  // node_modules/@patternfly/react-styles/css/components/HelperText/helper-text.css
  var require_33 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/HelperText/helper-text.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/HelperText/helper-text.js
  var require_helper_text = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/HelperText/helper-text.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_33();
      exports.default = {
        "helperText": "pf-c-helper-text",
        "helperTextItem": "pf-c-helper-text__item",
        "helperTextItemIcon": "pf-c-helper-text__item-icon",
        "helperTextItemText": "pf-c-helper-text__item-text",
        "modifiers": {
          "indeterminate": "pf-m-indeterminate",
          "warning": "pf-m-warning",
          "success": "pf-m-success",
          "error": "pf-m-error",
          "dynamic": "pf-m-dynamic"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Label/label.css
  var require_34 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Label/label.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Label/label.js
  var require_label = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Label/label.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_34();
      exports.default = {
        "button": "pf-c-button",
        "label": "pf-c-label",
        "labelContent": "pf-c-label__content",
        "labelIcon": "pf-c-label__icon",
        "labelText": "pf-c-label__text",
        "modifiers": {
          "compact": "pf-m-compact",
          "blue": "pf-m-blue",
          "green": "pf-m-green",
          "orange": "pf-m-orange",
          "red": "pf-m-red",
          "purple": "pf-m-purple",
          "cyan": "pf-m-cyan",
          "gold": "pf-m-gold",
          "outline": "pf-m-outline",
          "overflow": "pf-m-overflow",
          "add": "pf-m-add",
          "editable": "pf-m-editable",
          "editableActive": "pf-m-editable-active"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/LabelGroup/label-group.css
  var require_35 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/LabelGroup/label-group.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/LabelGroup/label-group.js
  var require_label_group = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/LabelGroup/label-group.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_35();
      exports.default = {
        "button": "pf-c-button",
        "labelGroup": "pf-c-label-group",
        "labelGroupClose": "pf-c-label-group__close",
        "labelGroupLabel": "pf-c-label-group__label",
        "labelGroupList": "pf-c-label-group__list",
        "labelGroupListItem": "pf-c-label-group__list-item",
        "labelGroupMain": "pf-c-label-group__main",
        "labelGroupTextarea": "pf-c-label-group__textarea",
        "modifiers": {
          "category": "pf-m-category",
          "vertical": "pf-m-vertical",
          "editable": "pf-m-editable",
          "textarea": "pf-m-textarea"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Menu/menu.css
  var require_36 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Menu/menu.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Menu/menu.js
  var require_menu = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Menu/menu.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_36();
      exports.default = {
        "breadcrumb": "pf-c-breadcrumb",
        "divider": "pf-c-divider",
        "menu": "pf-c-menu",
        "menuBreadcrumb": "pf-c-menu__breadcrumb",
        "menuContent": "pf-c-menu__content",
        "menuFooter": "pf-c-menu__footer",
        "menuGroup": "pf-c-menu__group",
        "menuGroupTitle": "pf-c-menu__group-title",
        "menuHeader": "pf-c-menu__header",
        "menuItem": "pf-c-menu__item",
        "menuItemAction": "pf-c-menu__item-action",
        "menuItemActionIcon": "pf-c-menu__item-action-icon",
        "menuItemCheck": "pf-c-menu__item-check",
        "menuItemDescription": "pf-c-menu__item-description",
        "menuItemExternalIcon": "pf-c-menu__item-external-icon",
        "menuItemIcon": "pf-c-menu__item-icon",
        "menuItemMain": "pf-c-menu__item-main",
        "menuItemSelectIcon": "pf-c-menu__item-select-icon",
        "menuItemText": "pf-c-menu__item-text",
        "menuItemToggleIcon": "pf-c-menu__item-toggle-icon",
        "menuList": "pf-c-menu__list",
        "menuListItem": "pf-c-menu__list-item",
        "menuSearch": "pf-c-menu__search",
        "modifiers": {
          "hidden": "pf-m-hidden",
          "hiddenOnSm": "pf-m-hidden-on-sm",
          "visibleOnSm": "pf-m-visible-on-sm",
          "hiddenOnMd": "pf-m-hidden-on-md",
          "visibleOnMd": "pf-m-visible-on-md",
          "hiddenOnLg": "pf-m-hidden-on-lg",
          "visibleOnLg": "pf-m-visible-on-lg",
          "hiddenOnXl": "pf-m-hidden-on-xl",
          "visibleOnXl": "pf-m-visible-on-xl",
          "hiddenOn_2xl": "pf-m-hidden-on-2xl",
          "visibleOn_2xl": "pf-m-visible-on-2xl",
          "flyout": "pf-m-flyout",
          "top": "pf-m-top",
          "left": "pf-m-left",
          "drilldown": "pf-m-drilldown",
          "drilledIn": "pf-m-drilled-in",
          "currentPath": "pf-m-current-path",
          "static": "pf-m-static",
          "plain": "pf-m-plain",
          "scrollable": "pf-m-scrollable",
          "nav": "pf-m-nav",
          "focus": "pf-m-focus",
          "disabled": "pf-m-disabled",
          "load": "pf-m-load",
          "loading": "pf-m-loading",
          "danger": "pf-m-danger",
          "selected": "pf-m-selected",
          "favorite": "pf-m-favorite",
          "favorited": "pf-m-favorited"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ModalBox/modal-box.css
  var require_37 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ModalBox/modal-box.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ModalBox/modal-box.js
  var require_modal_box = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ModalBox/modal-box.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_37();
      exports.default = {
        "button": "pf-c-button",
        "modalBox": "pf-c-modal-box",
        "modalBoxBody": "pf-c-modal-box__body",
        "modalBoxDescription": "pf-c-modal-box__description",
        "modalBoxFooter": "pf-c-modal-box__footer",
        "modalBoxHeader": "pf-c-modal-box__header",
        "modalBoxHeaderMain": "pf-c-modal-box__header-main",
        "modalBoxTitle": "pf-c-modal-box__title",
        "modalBoxTitleIcon": "pf-c-modal-box__title-icon",
        "modalBoxTitleText": "pf-c-modal-box__title-text",
        "modifiers": {
          "sm": "pf-m-sm",
          "md": "pf-m-md",
          "lg": "pf-m-lg",
          "alignTop": "pf-m-align-top",
          "danger": "pf-m-danger",
          "warning": "pf-m-warning",
          "success": "pf-m-success",
          "default": "pf-m-default",
          "info": "pf-m-info",
          "help": "pf-m-help",
          "icon": "pf-m-icon"
        },
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Progress/progress.css
  var require_38 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Progress/progress.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Progress/progress.js
  var require_progress = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Progress/progress.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_38();
      exports.default = {
        "modifiers": {
          "sm": "pf-m-sm",
          "lg": "pf-m-lg",
          "inside": "pf-m-inside",
          "outside": "pf-m-outside",
          "staticWidth": "pf-m-static-width",
          "singleline": "pf-m-singleline",
          "success": "pf-m-success",
          "warning": "pf-m-warning",
          "danger": "pf-m-danger",
          "truncate": "pf-m-truncate"
        },
        "progress": "pf-c-progress",
        "progressBar": "pf-c-progress__bar",
        "progressDescription": "pf-c-progress__description",
        "progressHelperText": "pf-c-progress__helper-text",
        "progressIndicator": "pf-c-progress__indicator",
        "progressMeasure": "pf-c-progress__measure",
        "progressStatus": "pf-c-progress__status",
        "progressStatusIcon": "pf-c-progress__status-icon",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Nav/nav.css
  var require_39 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Nav/nav.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Nav/nav.js
  var require_nav = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Nav/nav.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_39();
      exports.default = {
        "divider": "pf-c-divider",
        "menu": "pf-c-menu",
        "menuContent": "pf-c-menu__content",
        "menuItem": "pf-c-menu__item",
        "menuItemToggleIcon": "pf-c-menu__item-toggle-icon",
        "menuListItem": "pf-c-menu__list-item",
        "modifiers": {
          "flyout": "pf-m-flyout",
          "top": "pf-m-top",
          "left": "pf-m-left",
          "current": "pf-m-current",
          "drillUp": "pf-m-drill-up",
          "horizontal": "pf-m-horizontal",
          "tertiary": "pf-m-tertiary",
          "horizontalSubnav": "pf-m-horizontal-subnav",
          "light": "pf-m-light",
          "scrollable": "pf-m-scrollable",
          "overflowHidden": "pf-m-overflow-hidden",
          "expandable": "pf-m-expandable",
          "expanded": "pf-m-expanded",
          "drilldown": "pf-m-drilldown",
          "hover": "pf-m-hover",
          "start": "pf-m-start",
          "noTitle": "pf-m-no-title"
        },
        "nav": "pf-c-nav",
        "navItem": "pf-c-nav__item",
        "navLink": "pf-c-nav__link",
        "navList": "pf-c-nav__list",
        "navScrollButton": "pf-c-nav__scroll-button",
        "navSection": "pf-c-nav__section",
        "navSectionTitle": "pf-c-nav__section-title",
        "navSubnav": "pf-c-nav__subnav",
        "navToggle": "pf-c-nav__toggle",
        "navToggleIcon": "pf-c-nav__toggle-icon",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Page/page.css
  var require_40 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Page/page.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Page/page.js
  var require_page = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Page/page.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_40();
      exports.default = {
        "avatar": "pf-c-avatar",
        "brand": "pf-c-brand",
        "button": "pf-c-button",
        "card": "pf-c-card",
        "contextSelector": "pf-c-context-selector",
        "drawer": "pf-c-drawer",
        "masthead": "pf-c-masthead",
        "modifiers": {
          "light": "pf-m-light",
          "menu": "pf-m-menu",
          "hidden": "pf-m-hidden",
          "hiddenOnSm": "pf-m-hidden-on-sm",
          "visibleOnSm": "pf-m-visible-on-sm",
          "hiddenOnMd": "pf-m-hidden-on-md",
          "visibleOnMd": "pf-m-visible-on-md",
          "hiddenOnLg": "pf-m-hidden-on-lg",
          "visibleOnLg": "pf-m-visible-on-lg",
          "hiddenOnXl": "pf-m-hidden-on-xl",
          "visibleOnXl": "pf-m-visible-on-xl",
          "hiddenOn_2xl": "pf-m-hidden-on-2xl",
          "visibleOn_2xl": "pf-m-visible-on-2xl",
          "fullHeight": "pf-m-full-height",
          "read": "pf-m-read",
          "selected": "pf-m-selected",
          "unread": "pf-m-unread",
          "attention": "pf-m-attention",
          "expanded": "pf-m-expanded",
          "collapsed": "pf-m-collapsed",
          "limitWidth": "pf-m-limit-width",
          "alignCenter": "pf-m-align-center",
          "overflowScroll": "pf-m-overflow-scroll",
          "shadowBottom": "pf-m-shadow-bottom",
          "shadowTop": "pf-m-shadow-top",
          "stickyTop": "pf-m-sticky-top",
          "stickyBottom": "pf-m-sticky-bottom",
          "stickyTopOnSmHeight": "pf-m-sticky-top-on-sm-height",
          "stickyBottomOnSmHeight": "pf-m-sticky-bottom-on-sm-height",
          "stickyTopOnMdHeight": "pf-m-sticky-top-on-md-height",
          "stickyBottomOnMdHeight": "pf-m-sticky-bottom-on-md-height",
          "stickyTopOnLgHeight": "pf-m-sticky-top-on-lg-height",
          "stickyBottomOnLgHeight": "pf-m-sticky-bottom-on-lg-height",
          "stickyTopOnXlHeight": "pf-m-sticky-top-on-xl-height",
          "stickyBottomOnXlHeight": "pf-m-sticky-bottom-on-xl-height",
          "stickyTopOn_2xlHeight": "pf-m-sticky-top-on-2xl-height",
          "stickyBottomOn_2xlHeight": "pf-m-sticky-bottom-on-2xl-height",
          "fill": "pf-m-fill",
          "noFill": "pf-m-no-fill",
          "light_100": "pf-m-light-100",
          "dark_100": "pf-m-dark-100",
          "dark_200": "pf-m-dark-200",
          "padding": "pf-m-padding",
          "noPadding": "pf-m-no-padding",
          "paddingOnSm": "pf-m-padding-on-sm",
          "noPaddingOnSm": "pf-m-no-padding-on-sm",
          "paddingOnMd": "pf-m-padding-on-md",
          "noPaddingOnMd": "pf-m-no-padding-on-md",
          "paddingOnLg": "pf-m-padding-on-lg",
          "noPaddingOnLg": "pf-m-no-padding-on-lg",
          "paddingOnXl": "pf-m-padding-on-xl",
          "noPaddingOnXl": "pf-m-no-padding-on-xl",
          "paddingOn_2xl": "pf-m-padding-on-2xl",
          "noPaddingOn_2xl": "pf-m-no-padding-on-2xl",
          "light_200": "pf-m-light-200"
        },
        "nav": "pf-c-nav",
        "notificationBadge": "pf-c-notification-badge",
        "page": "pf-c-page",
        "pageDrawer": "pf-c-page__drawer",
        "pageHeader": "pf-c-page__header",
        "pageHeaderBrand": "pf-c-page__header-brand",
        "pageHeaderBrandLink": "pf-c-page__header-brand-link",
        "pageHeaderBrandToggle": "pf-c-page__header-brand-toggle",
        "pageHeaderNav": "pf-c-page__header-nav",
        "pageHeaderTools": "pf-c-page__header-tools",
        "pageHeaderToolsGroup": "pf-c-page__header-tools-group",
        "pageHeaderToolsItem": "pf-c-page__header-tools-item",
        "pageMain": "pf-c-page__main",
        "pageMainBody": "pf-c-page__main-body",
        "pageMainBreadcrumb": "pf-c-page__main-breadcrumb",
        "pageMainDrawer": "pf-c-page__main-drawer",
        "pageMainGroup": "pf-c-page__main-group",
        "pageMainNav": "pf-c-page__main-nav",
        "pageMainSection": "pf-c-page__main-section",
        "pageMainSubnav": "pf-c-page__main-subnav",
        "pageMainTabs": "pf-c-page__main-tabs",
        "pageMainWizard": "pf-c-page__main-wizard",
        "pageSidebar": "pf-c-page__sidebar",
        "pageSidebarBody": "pf-c-page__sidebar-body",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/OptionsMenu/options-menu.css
  var require_41 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/OptionsMenu/options-menu.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/OptionsMenu/options-menu.js
  var require_options_menu = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/OptionsMenu/options-menu.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_41();
      exports.default = {
        "divider": "pf-c-divider",
        "modifiers": {
          "plain": "pf-m-plain",
          "text": "pf-m-text",
          "active": "pf-m-active",
          "expanded": "pf-m-expanded",
          "disabled": "pf-m-disabled",
          "top": "pf-m-top",
          "alignRight": "pf-m-align-right",
          "static": "pf-m-static"
        },
        "optionsMenu": "pf-c-options-menu",
        "optionsMenuGroup": "pf-c-options-menu__group",
        "optionsMenuGroupTitle": "pf-c-options-menu__group-title",
        "optionsMenuMenu": "pf-c-options-menu__menu",
        "optionsMenuMenuItem": "pf-c-options-menu__menu-item",
        "optionsMenuMenuItemIcon": "pf-c-options-menu__menu-item-icon",
        "optionsMenuToggle": "pf-c-options-menu__toggle",
        "optionsMenuToggleButton": "pf-c-options-menu__toggle-button",
        "optionsMenuToggleButtonIcon": "pf-c-options-menu__toggle-button-icon",
        "optionsMenuToggleIcon": "pf-c-options-menu__toggle-icon",
        "optionsMenuToggleText": "pf-c-options-menu__toggle-text",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Pagination/pagination.css
  var require_42 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Pagination/pagination.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Pagination/pagination.js
  var require_pagination = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Pagination/pagination.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_42();
      exports.default = {
        "button": "pf-c-button",
        "formControl": "pf-c-form-control",
        "modifiers": {
          "bottom": "pf-m-bottom",
          "static": "pf-m-static",
          "first": "pf-m-first",
          "last": "pf-m-last",
          "sticky": "pf-m-sticky",
          "compact": "pf-m-compact",
          "pageInsets": "pf-m-page-insets",
          "displaySummary": "pf-m-display-summary",
          "displayFull": "pf-m-display-full",
          "insetNone": "pf-m-inset-none",
          "insetSm": "pf-m-inset-sm",
          "insetMd": "pf-m-inset-md",
          "insetLg": "pf-m-inset-lg",
          "insetXl": "pf-m-inset-xl",
          "inset_2xl": "pf-m-inset-2xl",
          "displaySummaryOnSm": "pf-m-display-summary-on-sm",
          "displayFullOnSm": "pf-m-display-full-on-sm",
          "insetNoneOnSm": "pf-m-inset-none-on-sm",
          "insetSmOnSm": "pf-m-inset-sm-on-sm",
          "insetMdOnSm": "pf-m-inset-md-on-sm",
          "insetLgOnSm": "pf-m-inset-lg-on-sm",
          "insetXlOnSm": "pf-m-inset-xl-on-sm",
          "inset_2xlOnSm": "pf-m-inset-2xl-on-sm",
          "displaySummaryOnMd": "pf-m-display-summary-on-md",
          "displayFullOnMd": "pf-m-display-full-on-md",
          "insetNoneOnMd": "pf-m-inset-none-on-md",
          "insetSmOnMd": "pf-m-inset-sm-on-md",
          "insetMdOnMd": "pf-m-inset-md-on-md",
          "insetLgOnMd": "pf-m-inset-lg-on-md",
          "insetXlOnMd": "pf-m-inset-xl-on-md",
          "inset_2xlOnMd": "pf-m-inset-2xl-on-md",
          "displaySummaryOnLg": "pf-m-display-summary-on-lg",
          "displayFullOnLg": "pf-m-display-full-on-lg",
          "insetNoneOnLg": "pf-m-inset-none-on-lg",
          "insetSmOnLg": "pf-m-inset-sm-on-lg",
          "insetMdOnLg": "pf-m-inset-md-on-lg",
          "insetLgOnLg": "pf-m-inset-lg-on-lg",
          "insetXlOnLg": "pf-m-inset-xl-on-lg",
          "inset_2xlOnLg": "pf-m-inset-2xl-on-lg",
          "displaySummaryOnXl": "pf-m-display-summary-on-xl",
          "displayFullOnXl": "pf-m-display-full-on-xl",
          "insetNoneOnXl": "pf-m-inset-none-on-xl",
          "insetSmOnXl": "pf-m-inset-sm-on-xl",
          "insetMdOnXl": "pf-m-inset-md-on-xl",
          "insetLgOnXl": "pf-m-inset-lg-on-xl",
          "insetXlOnXl": "pf-m-inset-xl-on-xl",
          "inset_2xlOnXl": "pf-m-inset-2xl-on-xl",
          "displaySummaryOn_2xl": "pf-m-display-summary-on-2xl",
          "displayFullOn_2xl": "pf-m-display-full-on-2xl",
          "insetNoneOn_2xl": "pf-m-inset-none-on-2xl",
          "insetSmOn_2xl": "pf-m-inset-sm-on-2xl",
          "insetMdOn_2xl": "pf-m-inset-md-on-2xl",
          "insetLgOn_2xl": "pf-m-inset-lg-on-2xl",
          "insetXlOn_2xl": "pf-m-inset-xl-on-2xl",
          "inset_2xlOn_2xl": "pf-m-inset-2xl-on-2xl"
        },
        "optionsMenu": "pf-c-options-menu",
        "optionsMenuToggle": "pf-c-options-menu__toggle",
        "pagination": "pf-c-pagination",
        "paginationNav": "pf-c-pagination__nav",
        "paginationNavControl": "pf-c-pagination__nav-control",
        "paginationNavPageSelect": "pf-c-pagination__nav-page-select",
        "paginationTotalItems": "pf-c-pagination__total-items",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Radio/radio.css
  var require_43 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Radio/radio.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Radio/radio.js
  var require_radio = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Radio/radio.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_43();
      exports.default = {
        "modifiers": {
          "standalone": "pf-m-standalone",
          "disabled": "pf-m-disabled"
        },
        "radio": "pf-c-radio",
        "radioBody": "pf-c-radio__body",
        "radioDescription": "pf-c-radio__description",
        "radioInput": "pf-c-radio__input",
        "radioLabel": "pf-c-radio__label"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/SimpleList/simple-list.css
  var require_44 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/SimpleList/simple-list.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/SimpleList/simple-list.js
  var require_simple_list = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/SimpleList/simple-list.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_44();
      exports.default = {
        "modifiers": {
          "current": "pf-m-current"
        },
        "simpleList": "pf-c-simple-list",
        "simpleListItemLink": "pf-c-simple-list__item-link",
        "simpleListSection": "pf-c-simple-list__section",
        "simpleListTitle": "pf-c-simple-list__title",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Switch/switch.css
  var require_45 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Switch/switch.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Switch/switch.js
  var require_switch = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Switch/switch.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_45();
      exports.default = {
        "modifiers": {
          "reverse": "pf-m-reverse",
          "off": "pf-m-off",
          "on": "pf-m-on"
        },
        "switch": "pf-c-switch",
        "switchInput": "pf-c-switch__input",
        "switchLabel": "pf-c-switch__label",
        "switchToggle": "pf-c-switch__toggle",
        "switchToggleIcon": "pf-c-switch__toggle-icon",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Tabs/tabs.css
  var require_46 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Tabs/tabs.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Tabs/tabs.js
  var require_tabs = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Tabs/tabs.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_46();
      exports.default = {
        "button": "pf-c-button",
        "modifiers": {
          "fill": "pf-m-fill",
          "scrollable": "pf-m-scrollable",
          "secondary": "pf-m-secondary",
          "noBorderBottom": "pf-m-no-border-bottom",
          "borderBottom": "pf-m-border-bottom",
          "box": "pf-m-box",
          "vertical": "pf-m-vertical",
          "current": "pf-m-current",
          "colorSchemeLight_300": "pf-m-color-scheme--light-300",
          "expandable": "pf-m-expandable",
          "nonExpandable": "pf-m-non-expandable",
          "expandableOnSm": "pf-m-expandable-on-sm",
          "nonExpandableOnSm": "pf-m-non-expandable-on-sm",
          "expandableOnMd": "pf-m-expandable-on-md",
          "nonExpandableOnMd": "pf-m-non-expandable-on-md",
          "expandableOnLg": "pf-m-expandable-on-lg",
          "nonExpandableOnLg": "pf-m-non-expandable-on-lg",
          "expandableOnXl": "pf-m-expandable-on-xl",
          "nonExpandableOnXl": "pf-m-non-expandable-on-xl",
          "expandableOn_2xl": "pf-m-expandable-on-2xl",
          "nonExpandableOn_2xl": "pf-m-non-expandable-on-2xl",
          "expanded": "pf-m-expanded",
          "pageInsets": "pf-m-page-insets",
          "overflow": "pf-m-overflow",
          "action": "pf-m-action",
          "active": "pf-m-active",
          "disabled": "pf-m-disabled",
          "ariaDisabled": "pf-m-aria-disabled",
          "insetNone": "pf-m-inset-none",
          "insetSm": "pf-m-inset-sm",
          "insetMd": "pf-m-inset-md",
          "insetLg": "pf-m-inset-lg",
          "insetXl": "pf-m-inset-xl",
          "inset_2xl": "pf-m-inset-2xl",
          "insetNoneOnSm": "pf-m-inset-none-on-sm",
          "insetSmOnSm": "pf-m-inset-sm-on-sm",
          "insetMdOnSm": "pf-m-inset-md-on-sm",
          "insetLgOnSm": "pf-m-inset-lg-on-sm",
          "insetXlOnSm": "pf-m-inset-xl-on-sm",
          "inset_2xlOnSm": "pf-m-inset-2xl-on-sm",
          "insetNoneOnMd": "pf-m-inset-none-on-md",
          "insetSmOnMd": "pf-m-inset-sm-on-md",
          "insetMdOnMd": "pf-m-inset-md-on-md",
          "insetLgOnMd": "pf-m-inset-lg-on-md",
          "insetXlOnMd": "pf-m-inset-xl-on-md",
          "inset_2xlOnMd": "pf-m-inset-2xl-on-md",
          "insetNoneOnLg": "pf-m-inset-none-on-lg",
          "insetSmOnLg": "pf-m-inset-sm-on-lg",
          "insetMdOnLg": "pf-m-inset-md-on-lg",
          "insetLgOnLg": "pf-m-inset-lg-on-lg",
          "insetXlOnLg": "pf-m-inset-xl-on-lg",
          "inset_2xlOnLg": "pf-m-inset-2xl-on-lg",
          "insetNoneOnXl": "pf-m-inset-none-on-xl",
          "insetSmOnXl": "pf-m-inset-sm-on-xl",
          "insetMdOnXl": "pf-m-inset-md-on-xl",
          "insetLgOnXl": "pf-m-inset-lg-on-xl",
          "insetXlOnXl": "pf-m-inset-xl-on-xl",
          "inset_2xlOnXl": "pf-m-inset-2xl-on-xl",
          "insetNoneOn_2xl": "pf-m-inset-none-on-2xl",
          "insetSmOn_2xl": "pf-m-inset-sm-on-2xl",
          "insetMdOn_2xl": "pf-m-inset-md-on-2xl",
          "insetLgOn_2xl": "pf-m-inset-lg-on-2xl",
          "insetXlOn_2xl": "pf-m-inset-xl-on-2xl",
          "inset_2xlOn_2xl": "pf-m-inset-2xl-on-2xl"
        },
        "tabs": "pf-c-tabs",
        "tabsAdd": "pf-c-tabs__add",
        "tabsItem": "pf-c-tabs__item",
        "tabsItemAction": "pf-c-tabs__item-action",
        "tabsItemActionIcon": "pf-c-tabs__item-action-icon",
        "tabsItemIcon": "pf-c-tabs__item-icon",
        "tabsItemText": "pf-c-tabs__item-text",
        "tabsLink": "pf-c-tabs__link",
        "tabsLinkToggleIcon": "pf-c-tabs__link-toggle-icon",
        "tabsList": "pf-c-tabs__list",
        "tabsScrollButton": "pf-c-tabs__scroll-button",
        "tabsToggle": "pf-c-tabs__toggle",
        "tabsToggleButton": "pf-c-tabs__toggle-button",
        "tabsToggleIcon": "pf-c-tabs__toggle-icon",
        "tabsToggleText": "pf-c-tabs__toggle-text",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/TabContent/tab-content.css
  var require_47 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/TabContent/tab-content.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/TabContent/tab-content.js
  var require_tab_content = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/TabContent/tab-content.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_47();
      exports.default = {
        "modifiers": {
          "light_300": "pf-m-light-300",
          "padding": "pf-m-padding"
        },
        "tabContent": "pf-c-tab-content",
        "tabContentBody": "pf-c-tab-content__body"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ToggleGroup/toggle-group.css
  var require_48 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ToggleGroup/toggle-group.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/ToggleGroup/toggle-group.js
  var require_toggle_group = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/ToggleGroup/toggle-group.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_48();
      exports.default = {
        "modifiers": {
          "compact": "pf-m-compact",
          "selected": "pf-m-selected",
          "disabled": "pf-m-disabled"
        },
        "themeDark": "pf-theme-dark",
        "toggleGroup": "pf-c-toggle-group",
        "toggleGroupButton": "pf-c-toggle-group__button",
        "toggleGroupIcon": "pf-c-toggle-group__icon",
        "toggleGroupItem": "pf-c-toggle-group__item",
        "toggleGroupText": "pf-c-toggle-group__text"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/NumberInput/number-input.css
  var require_49 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/NumberInput/number-input.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/NumberInput/number-input.js
  var require_number_input = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/NumberInput/number-input.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_49();
      exports.default = {
        "formControl": "pf-c-form-control",
        "inputGroup": "pf-c-input-group",
        "modifiers": {
          "status": "pf-m-status"
        },
        "numberInput": "pf-c-number-input",
        "numberInputIcon": "pf-c-number-input__icon",
        "numberInputUnit": "pf-c-number-input__unit"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/TreeView/tree-view.css
  var require_50 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/TreeView/tree-view.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/TreeView/tree-view.js
  var require_tree_view = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/TreeView/tree-view.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_50();
      exports.default = {
        "badge": "pf-c-badge",
        "modifiers": {
          "compact": "pf-m-compact",
          "guides": "pf-m-guides",
          "expanded": "pf-m-expanded",
          "noBackground": "pf-m-no-background",
          "current": "pf-m-current",
          "read": "pf-m-read",
          "selectable": "pf-m-selectable",
          "truncate": "pf-m-truncate"
        },
        "themeDark": "pf-theme-dark",
        "treeView": "pf-c-tree-view",
        "treeViewAction": "pf-c-tree-view__action",
        "treeViewContent": "pf-c-tree-view__content",
        "treeViewListItem": "pf-c-tree-view__list-item",
        "treeViewNode": "pf-c-tree-view__node",
        "treeViewNodeCheck": "pf-c-tree-view__node-check",
        "treeViewNodeContainer": "pf-c-tree-view__node-container",
        "treeViewNodeContent": "pf-c-tree-view__node-content",
        "treeViewNodeCount": "pf-c-tree-view__node-count",
        "treeViewNodeIcon": "pf-c-tree-view__node-icon",
        "treeViewNodeText": "pf-c-tree-view__node-text",
        "treeViewNodeTitle": "pf-c-tree-view__node-title",
        "treeViewNodeToggle": "pf-c-tree-view__node-toggle",
        "treeViewNodeToggleIcon": "pf-c-tree-view__node-toggle-icon",
        "treeViewSearch": "pf-c-tree-view__search"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Wizard/wizard.css
  var require_51 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Wizard/wizard.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Wizard/wizard.js
  var require_wizard = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Wizard/wizard.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_51();
      exports.default = {
        "button": "pf-c-button",
        "card": "pf-c-card",
        "drawer": "pf-c-drawer",
        "modalBox": "pf-c-modal-box",
        "modifiers": {
          "finished": "pf-m-finished",
          "expanded": "pf-m-expanded",
          "current": "pf-m-current",
          "expandable": "pf-m-expandable",
          "disabled": "pf-m-disabled",
          "noPadding": "pf-m-no-padding"
        },
        "pageMainWizard": "pf-c-page__main-wizard",
        "themeDark": "pf-theme-dark",
        "wizard": "pf-c-wizard",
        "wizardClose": "pf-c-wizard__close",
        "wizardDescription": "pf-c-wizard__description",
        "wizardFooter": "pf-c-wizard__footer",
        "wizardFooterCancel": "pf-c-wizard__footer-cancel",
        "wizardHeader": "pf-c-wizard__header",
        "wizardInnerWrap": "pf-c-wizard__inner-wrap",
        "wizardMain": "pf-c-wizard__main",
        "wizardMainBody": "pf-c-wizard__main-body",
        "wizardNav": "pf-c-wizard__nav",
        "wizardNavItem": "pf-c-wizard__nav-item",
        "wizardNavLink": "pf-c-wizard__nav-link",
        "wizardNavLinkText": "pf-c-wizard__nav-link-text",
        "wizardNavLinkToggle": "pf-c-wizard__nav-link-toggle",
        "wizardNavLinkToggleIcon": "pf-c-wizard__nav-link-toggle-icon",
        "wizardNavList": "pf-c-wizard__nav-list",
        "wizardOuterWrap": "pf-c-wizard__outer-wrap",
        "wizardTitle": "pf-c-wizard__title",
        "wizardToggle": "pf-c-wizard__toggle",
        "wizardToggleIcon": "pf-c-wizard__toggle-icon",
        "wizardToggleList": "pf-c-wizard__toggle-list",
        "wizardToggleListItem": "pf-c-wizard__toggle-list-item",
        "wizardToggleNum": "pf-c-wizard__toggle-num",
        "wizardToggleSeparator": "pf-c-wizard__toggle-separator"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/layouts/Grid/grid.css
  var require_52 = __commonJS({
    "node_modules/@patternfly/react-styles/css/layouts/Grid/grid.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/layouts/Grid/grid.js
  var require_grid = __commonJS({
    "node_modules/@patternfly/react-styles/css/layouts/Grid/grid.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_52();
      exports.default = {
        "grid": "pf-l-grid",
        "gridItem": "pf-l-grid__item",
        "modifiers": {
          "all_1Col": "pf-m-all-1-col",
          "all_2Col": "pf-m-all-2-col",
          "all_3Col": "pf-m-all-3-col",
          "all_4Col": "pf-m-all-4-col",
          "all_5Col": "pf-m-all-5-col",
          "all_6Col": "pf-m-all-6-col",
          "all_7Col": "pf-m-all-7-col",
          "all_8Col": "pf-m-all-8-col",
          "all_9Col": "pf-m-all-9-col",
          "all_10Col": "pf-m-all-10-col",
          "all_11Col": "pf-m-all-11-col",
          "all_12Col": "pf-m-all-12-col",
          "all_1ColOnSm": "pf-m-all-1-col-on-sm",
          "all_2ColOnSm": "pf-m-all-2-col-on-sm",
          "all_3ColOnSm": "pf-m-all-3-col-on-sm",
          "all_4ColOnSm": "pf-m-all-4-col-on-sm",
          "all_5ColOnSm": "pf-m-all-5-col-on-sm",
          "all_6ColOnSm": "pf-m-all-6-col-on-sm",
          "all_7ColOnSm": "pf-m-all-7-col-on-sm",
          "all_8ColOnSm": "pf-m-all-8-col-on-sm",
          "all_9ColOnSm": "pf-m-all-9-col-on-sm",
          "all_10ColOnSm": "pf-m-all-10-col-on-sm",
          "all_11ColOnSm": "pf-m-all-11-col-on-sm",
          "all_12ColOnSm": "pf-m-all-12-col-on-sm",
          "all_1ColOnMd": "pf-m-all-1-col-on-md",
          "all_2ColOnMd": "pf-m-all-2-col-on-md",
          "all_3ColOnMd": "pf-m-all-3-col-on-md",
          "all_4ColOnMd": "pf-m-all-4-col-on-md",
          "all_5ColOnMd": "pf-m-all-5-col-on-md",
          "all_6ColOnMd": "pf-m-all-6-col-on-md",
          "all_7ColOnMd": "pf-m-all-7-col-on-md",
          "all_8ColOnMd": "pf-m-all-8-col-on-md",
          "all_9ColOnMd": "pf-m-all-9-col-on-md",
          "all_10ColOnMd": "pf-m-all-10-col-on-md",
          "all_11ColOnMd": "pf-m-all-11-col-on-md",
          "all_12ColOnMd": "pf-m-all-12-col-on-md",
          "all_1ColOnLg": "pf-m-all-1-col-on-lg",
          "all_2ColOnLg": "pf-m-all-2-col-on-lg",
          "all_3ColOnLg": "pf-m-all-3-col-on-lg",
          "all_4ColOnLg": "pf-m-all-4-col-on-lg",
          "all_5ColOnLg": "pf-m-all-5-col-on-lg",
          "all_6ColOnLg": "pf-m-all-6-col-on-lg",
          "all_7ColOnLg": "pf-m-all-7-col-on-lg",
          "all_8ColOnLg": "pf-m-all-8-col-on-lg",
          "all_9ColOnLg": "pf-m-all-9-col-on-lg",
          "all_10ColOnLg": "pf-m-all-10-col-on-lg",
          "all_11ColOnLg": "pf-m-all-11-col-on-lg",
          "all_12ColOnLg": "pf-m-all-12-col-on-lg",
          "all_1ColOnXl": "pf-m-all-1-col-on-xl",
          "all_2ColOnXl": "pf-m-all-2-col-on-xl",
          "all_3ColOnXl": "pf-m-all-3-col-on-xl",
          "all_4ColOnXl": "pf-m-all-4-col-on-xl",
          "all_5ColOnXl": "pf-m-all-5-col-on-xl",
          "all_6ColOnXl": "pf-m-all-6-col-on-xl",
          "all_7ColOnXl": "pf-m-all-7-col-on-xl",
          "all_8ColOnXl": "pf-m-all-8-col-on-xl",
          "all_9ColOnXl": "pf-m-all-9-col-on-xl",
          "all_10ColOnXl": "pf-m-all-10-col-on-xl",
          "all_11ColOnXl": "pf-m-all-11-col-on-xl",
          "all_12ColOnXl": "pf-m-all-12-col-on-xl",
          "all_1ColOn_2xl": "pf-m-all-1-col-on-2xl",
          "all_2ColOn_2xl": "pf-m-all-2-col-on-2xl",
          "all_3ColOn_2xl": "pf-m-all-3-col-on-2xl",
          "all_4ColOn_2xl": "pf-m-all-4-col-on-2xl",
          "all_5ColOn_2xl": "pf-m-all-5-col-on-2xl",
          "all_6ColOn_2xl": "pf-m-all-6-col-on-2xl",
          "all_7ColOn_2xl": "pf-m-all-7-col-on-2xl",
          "all_8ColOn_2xl": "pf-m-all-8-col-on-2xl",
          "all_9ColOn_2xl": "pf-m-all-9-col-on-2xl",
          "all_10ColOn_2xl": "pf-m-all-10-col-on-2xl",
          "all_11ColOn_2xl": "pf-m-all-11-col-on-2xl",
          "all_12ColOn_2xl": "pf-m-all-12-col-on-2xl",
          "1Col": "pf-m-1-col",
          "2Col": "pf-m-2-col",
          "3Col": "pf-m-3-col",
          "4Col": "pf-m-4-col",
          "5Col": "pf-m-5-col",
          "6Col": "pf-m-6-col",
          "7Col": "pf-m-7-col",
          "8Col": "pf-m-8-col",
          "9Col": "pf-m-9-col",
          "10Col": "pf-m-10-col",
          "11Col": "pf-m-11-col",
          "12Col": "pf-m-12-col",
          "offset_1Col": "pf-m-offset-1-col",
          "offset_2Col": "pf-m-offset-2-col",
          "offset_3Col": "pf-m-offset-3-col",
          "offset_4Col": "pf-m-offset-4-col",
          "offset_5Col": "pf-m-offset-5-col",
          "offset_6Col": "pf-m-offset-6-col",
          "offset_7Col": "pf-m-offset-7-col",
          "offset_8Col": "pf-m-offset-8-col",
          "offset_9Col": "pf-m-offset-9-col",
          "offset_10Col": "pf-m-offset-10-col",
          "offset_11Col": "pf-m-offset-11-col",
          "offset_12Col": "pf-m-offset-12-col",
          "1Row": "pf-m-1-row",
          "2Row": "pf-m-2-row",
          "3Row": "pf-m-3-row",
          "4Row": "pf-m-4-row",
          "5Row": "pf-m-5-row",
          "6Row": "pf-m-6-row",
          "7Row": "pf-m-7-row",
          "8Row": "pf-m-8-row",
          "9Row": "pf-m-9-row",
          "10Row": "pf-m-10-row",
          "11Row": "pf-m-11-row",
          "12Row": "pf-m-12-row",
          "1ColOnSm": "pf-m-1-col-on-sm",
          "2ColOnSm": "pf-m-2-col-on-sm",
          "3ColOnSm": "pf-m-3-col-on-sm",
          "4ColOnSm": "pf-m-4-col-on-sm",
          "5ColOnSm": "pf-m-5-col-on-sm",
          "6ColOnSm": "pf-m-6-col-on-sm",
          "7ColOnSm": "pf-m-7-col-on-sm",
          "8ColOnSm": "pf-m-8-col-on-sm",
          "9ColOnSm": "pf-m-9-col-on-sm",
          "10ColOnSm": "pf-m-10-col-on-sm",
          "11ColOnSm": "pf-m-11-col-on-sm",
          "12ColOnSm": "pf-m-12-col-on-sm",
          "offset_1ColOnSm": "pf-m-offset-1-col-on-sm",
          "offset_2ColOnSm": "pf-m-offset-2-col-on-sm",
          "offset_3ColOnSm": "pf-m-offset-3-col-on-sm",
          "offset_4ColOnSm": "pf-m-offset-4-col-on-sm",
          "offset_5ColOnSm": "pf-m-offset-5-col-on-sm",
          "offset_6ColOnSm": "pf-m-offset-6-col-on-sm",
          "offset_7ColOnSm": "pf-m-offset-7-col-on-sm",
          "offset_8ColOnSm": "pf-m-offset-8-col-on-sm",
          "offset_9ColOnSm": "pf-m-offset-9-col-on-sm",
          "offset_10ColOnSm": "pf-m-offset-10-col-on-sm",
          "offset_11ColOnSm": "pf-m-offset-11-col-on-sm",
          "offset_12ColOnSm": "pf-m-offset-12-col-on-sm",
          "1RowOnSm": "pf-m-1-row-on-sm",
          "2RowOnSm": "pf-m-2-row-on-sm",
          "3RowOnSm": "pf-m-3-row-on-sm",
          "4RowOnSm": "pf-m-4-row-on-sm",
          "5RowOnSm": "pf-m-5-row-on-sm",
          "6RowOnSm": "pf-m-6-row-on-sm",
          "7RowOnSm": "pf-m-7-row-on-sm",
          "8RowOnSm": "pf-m-8-row-on-sm",
          "9RowOnSm": "pf-m-9-row-on-sm",
          "10RowOnSm": "pf-m-10-row-on-sm",
          "11RowOnSm": "pf-m-11-row-on-sm",
          "12RowOnSm": "pf-m-12-row-on-sm",
          "1ColOnMd": "pf-m-1-col-on-md",
          "2ColOnMd": "pf-m-2-col-on-md",
          "3ColOnMd": "pf-m-3-col-on-md",
          "4ColOnMd": "pf-m-4-col-on-md",
          "5ColOnMd": "pf-m-5-col-on-md",
          "6ColOnMd": "pf-m-6-col-on-md",
          "7ColOnMd": "pf-m-7-col-on-md",
          "8ColOnMd": "pf-m-8-col-on-md",
          "9ColOnMd": "pf-m-9-col-on-md",
          "10ColOnMd": "pf-m-10-col-on-md",
          "11ColOnMd": "pf-m-11-col-on-md",
          "12ColOnMd": "pf-m-12-col-on-md",
          "offset_1ColOnMd": "pf-m-offset-1-col-on-md",
          "offset_2ColOnMd": "pf-m-offset-2-col-on-md",
          "offset_3ColOnMd": "pf-m-offset-3-col-on-md",
          "offset_4ColOnMd": "pf-m-offset-4-col-on-md",
          "offset_5ColOnMd": "pf-m-offset-5-col-on-md",
          "offset_6ColOnMd": "pf-m-offset-6-col-on-md",
          "offset_7ColOnMd": "pf-m-offset-7-col-on-md",
          "offset_8ColOnMd": "pf-m-offset-8-col-on-md",
          "offset_9ColOnMd": "pf-m-offset-9-col-on-md",
          "offset_10ColOnMd": "pf-m-offset-10-col-on-md",
          "offset_11ColOnMd": "pf-m-offset-11-col-on-md",
          "offset_12ColOnMd": "pf-m-offset-12-col-on-md",
          "1RowOnMd": "pf-m-1-row-on-md",
          "2RowOnMd": "pf-m-2-row-on-md",
          "3RowOnMd": "pf-m-3-row-on-md",
          "4RowOnMd": "pf-m-4-row-on-md",
          "5RowOnMd": "pf-m-5-row-on-md",
          "6RowOnMd": "pf-m-6-row-on-md",
          "7RowOnMd": "pf-m-7-row-on-md",
          "8RowOnMd": "pf-m-8-row-on-md",
          "9RowOnMd": "pf-m-9-row-on-md",
          "10RowOnMd": "pf-m-10-row-on-md",
          "11RowOnMd": "pf-m-11-row-on-md",
          "12RowOnMd": "pf-m-12-row-on-md",
          "1ColOnLg": "pf-m-1-col-on-lg",
          "2ColOnLg": "pf-m-2-col-on-lg",
          "3ColOnLg": "pf-m-3-col-on-lg",
          "4ColOnLg": "pf-m-4-col-on-lg",
          "5ColOnLg": "pf-m-5-col-on-lg",
          "6ColOnLg": "pf-m-6-col-on-lg",
          "7ColOnLg": "pf-m-7-col-on-lg",
          "8ColOnLg": "pf-m-8-col-on-lg",
          "9ColOnLg": "pf-m-9-col-on-lg",
          "10ColOnLg": "pf-m-10-col-on-lg",
          "11ColOnLg": "pf-m-11-col-on-lg",
          "12ColOnLg": "pf-m-12-col-on-lg",
          "offset_1ColOnLg": "pf-m-offset-1-col-on-lg",
          "offset_2ColOnLg": "pf-m-offset-2-col-on-lg",
          "offset_3ColOnLg": "pf-m-offset-3-col-on-lg",
          "offset_4ColOnLg": "pf-m-offset-4-col-on-lg",
          "offset_5ColOnLg": "pf-m-offset-5-col-on-lg",
          "offset_6ColOnLg": "pf-m-offset-6-col-on-lg",
          "offset_7ColOnLg": "pf-m-offset-7-col-on-lg",
          "offset_8ColOnLg": "pf-m-offset-8-col-on-lg",
          "offset_9ColOnLg": "pf-m-offset-9-col-on-lg",
          "offset_10ColOnLg": "pf-m-offset-10-col-on-lg",
          "offset_11ColOnLg": "pf-m-offset-11-col-on-lg",
          "offset_12ColOnLg": "pf-m-offset-12-col-on-lg",
          "1RowOnLg": "pf-m-1-row-on-lg",
          "2RowOnLg": "pf-m-2-row-on-lg",
          "3RowOnLg": "pf-m-3-row-on-lg",
          "4RowOnLg": "pf-m-4-row-on-lg",
          "5RowOnLg": "pf-m-5-row-on-lg",
          "6RowOnLg": "pf-m-6-row-on-lg",
          "7RowOnLg": "pf-m-7-row-on-lg",
          "8RowOnLg": "pf-m-8-row-on-lg",
          "9RowOnLg": "pf-m-9-row-on-lg",
          "10RowOnLg": "pf-m-10-row-on-lg",
          "11RowOnLg": "pf-m-11-row-on-lg",
          "12RowOnLg": "pf-m-12-row-on-lg",
          "1ColOnXl": "pf-m-1-col-on-xl",
          "2ColOnXl": "pf-m-2-col-on-xl",
          "3ColOnXl": "pf-m-3-col-on-xl",
          "4ColOnXl": "pf-m-4-col-on-xl",
          "5ColOnXl": "pf-m-5-col-on-xl",
          "6ColOnXl": "pf-m-6-col-on-xl",
          "7ColOnXl": "pf-m-7-col-on-xl",
          "8ColOnXl": "pf-m-8-col-on-xl",
          "9ColOnXl": "pf-m-9-col-on-xl",
          "10ColOnXl": "pf-m-10-col-on-xl",
          "11ColOnXl": "pf-m-11-col-on-xl",
          "12ColOnXl": "pf-m-12-col-on-xl",
          "offset_1ColOnXl": "pf-m-offset-1-col-on-xl",
          "offset_2ColOnXl": "pf-m-offset-2-col-on-xl",
          "offset_3ColOnXl": "pf-m-offset-3-col-on-xl",
          "offset_4ColOnXl": "pf-m-offset-4-col-on-xl",
          "offset_5ColOnXl": "pf-m-offset-5-col-on-xl",
          "offset_6ColOnXl": "pf-m-offset-6-col-on-xl",
          "offset_7ColOnXl": "pf-m-offset-7-col-on-xl",
          "offset_8ColOnXl": "pf-m-offset-8-col-on-xl",
          "offset_9ColOnXl": "pf-m-offset-9-col-on-xl",
          "offset_10ColOnXl": "pf-m-offset-10-col-on-xl",
          "offset_11ColOnXl": "pf-m-offset-11-col-on-xl",
          "offset_12ColOnXl": "pf-m-offset-12-col-on-xl",
          "1RowOnXl": "pf-m-1-row-on-xl",
          "2RowOnXl": "pf-m-2-row-on-xl",
          "3RowOnXl": "pf-m-3-row-on-xl",
          "4RowOnXl": "pf-m-4-row-on-xl",
          "5RowOnXl": "pf-m-5-row-on-xl",
          "6RowOnXl": "pf-m-6-row-on-xl",
          "7RowOnXl": "pf-m-7-row-on-xl",
          "8RowOnXl": "pf-m-8-row-on-xl",
          "9RowOnXl": "pf-m-9-row-on-xl",
          "10RowOnXl": "pf-m-10-row-on-xl",
          "11RowOnXl": "pf-m-11-row-on-xl",
          "12RowOnXl": "pf-m-12-row-on-xl",
          "1ColOn_2xl": "pf-m-1-col-on-2xl",
          "2ColOn_2xl": "pf-m-2-col-on-2xl",
          "3ColOn_2xl": "pf-m-3-col-on-2xl",
          "4ColOn_2xl": "pf-m-4-col-on-2xl",
          "5ColOn_2xl": "pf-m-5-col-on-2xl",
          "6ColOn_2xl": "pf-m-6-col-on-2xl",
          "7ColOn_2xl": "pf-m-7-col-on-2xl",
          "8ColOn_2xl": "pf-m-8-col-on-2xl",
          "9ColOn_2xl": "pf-m-9-col-on-2xl",
          "10ColOn_2xl": "pf-m-10-col-on-2xl",
          "11ColOn_2xl": "pf-m-11-col-on-2xl",
          "12ColOn_2xl": "pf-m-12-col-on-2xl",
          "offset_1ColOn_2xl": "pf-m-offset-1-col-on-2xl",
          "offset_2ColOn_2xl": "pf-m-offset-2-col-on-2xl",
          "offset_3ColOn_2xl": "pf-m-offset-3-col-on-2xl",
          "offset_4ColOn_2xl": "pf-m-offset-4-col-on-2xl",
          "offset_5ColOn_2xl": "pf-m-offset-5-col-on-2xl",
          "offset_6ColOn_2xl": "pf-m-offset-6-col-on-2xl",
          "offset_7ColOn_2xl": "pf-m-offset-7-col-on-2xl",
          "offset_8ColOn_2xl": "pf-m-offset-8-col-on-2xl",
          "offset_9ColOn_2xl": "pf-m-offset-9-col-on-2xl",
          "offset_10ColOn_2xl": "pf-m-offset-10-col-on-2xl",
          "offset_11ColOn_2xl": "pf-m-offset-11-col-on-2xl",
          "offset_12ColOn_2xl": "pf-m-offset-12-col-on-2xl",
          "1RowOn_2xl": "pf-m-1-row-on-2xl",
          "2RowOn_2xl": "pf-m-2-row-on-2xl",
          "3RowOn_2xl": "pf-m-3-row-on-2xl",
          "4RowOn_2xl": "pf-m-4-row-on-2xl",
          "5RowOn_2xl": "pf-m-5-row-on-2xl",
          "6RowOn_2xl": "pf-m-6-row-on-2xl",
          "7RowOn_2xl": "pf-m-7-row-on-2xl",
          "8RowOn_2xl": "pf-m-8-row-on-2xl",
          "9RowOn_2xl": "pf-m-9-row-on-2xl",
          "10RowOn_2xl": "pf-m-10-row-on-2xl",
          "11RowOn_2xl": "pf-m-11-row-on-2xl",
          "12RowOn_2xl": "pf-m-12-row-on-2xl",
          "gutter": "pf-m-gutter"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/InlineEdit/inline-edit.css
  var require_53 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/InlineEdit/inline-edit.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/InlineEdit/inline-edit.js
  var require_inline_edit = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/InlineEdit/inline-edit.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_53();
      exports.default = {
        "button": "pf-c-button",
        "inlineEdit": "pf-c-inline-edit",
        "inlineEditAction": "pf-c-inline-edit__action",
        "inlineEditEditableText": "pf-c-inline-edit__editable-text",
        "inlineEditGroup": "pf-c-inline-edit__group",
        "inlineEditInput": "pf-c-inline-edit__input",
        "inlineEditLabel": "pf-c-inline-edit__label",
        "inlineEditValue": "pf-c-inline-edit__value",
        "modifiers": {
          "iconGroup": "pf-m-icon-group",
          "footer": "pf-m-footer",
          "column": "pf-m-column",
          "valid": "pf-m-valid",
          "plain": "pf-m-plain",
          "actionGroup": "pf-m-action-group",
          "enableEditable": "pf-m-enable-editable",
          "inlineEditable": "pf-m-inline-editable",
          "enable": "pf-m-enable",
          "bold": "pf-m-bold"
        }
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table.css
  var require_54 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table.js
  var require_table = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_54();
      exports.default = {
        "button": "pf-c-button",
        "modifiers": {
          "hidden": "pf-m-hidden",
          "hiddenOnSm": "pf-m-hidden-on-sm",
          "visibleOnSm": "pf-m-visible-on-sm",
          "hiddenOnMd": "pf-m-hidden-on-md",
          "visibleOnMd": "pf-m-visible-on-md",
          "hiddenOnLg": "pf-m-hidden-on-lg",
          "visibleOnLg": "pf-m-visible-on-lg",
          "hiddenOnXl": "pf-m-hidden-on-xl",
          "visibleOnXl": "pf-m-visible-on-xl",
          "hiddenOn_2xl": "pf-m-hidden-on-2xl",
          "visibleOn_2xl": "pf-m-visible-on-2xl",
          "fixed": "pf-m-fixed",
          "stickyHeader": "pf-m-sticky-header",
          "nestedColumnHeader": "pf-m-nested-column-header",
          "borderRow": "pf-m-border-row",
          "striped": "pf-m-striped",
          "expandable": "pf-m-expandable",
          "stripedEven": "pf-m-striped-even",
          "ghostRow": "pf-m-ghost-row",
          "center": "pf-m-center",
          "help": "pf-m-help",
          "favorite": "pf-m-favorite",
          "borderRight": "pf-m-border-right",
          "borderLeft": "pf-m-border-left",
          "truncate": "pf-m-truncate",
          "wrap": "pf-m-wrap",
          "nowrap": "pf-m-nowrap",
          "fitContent": "pf-m-fit-content",
          "breakWord": "pf-m-break-word",
          "noBorderRows": "pf-m-no-border-rows",
          "expanded": "pf-m-expanded",
          "hoverable": "pf-m-hoverable",
          "selected": "pf-m-selected",
          "firstCellOffsetReset": "pf-m-first-cell-offset-reset",
          "dragOver": "pf-m-drag-over",
          "favorited": "pf-m-favorited",
          "noPadding": "pf-m-no-padding",
          "compact": "pf-m-compact",
          "width_10": "pf-m-width-10",
          "width_15": "pf-m-width-15",
          "width_20": "pf-m-width-20",
          "width_25": "pf-m-width-25",
          "width_30": "pf-m-width-30",
          "width_35": "pf-m-width-35",
          "width_40": "pf-m-width-40",
          "width_45": "pf-m-width-45",
          "width_50": "pf-m-width-50",
          "width_60": "pf-m-width-60",
          "width_70": "pf-m-width-70",
          "width_80": "pf-m-width-80",
          "width_90": "pf-m-width-90",
          "width_100": "pf-m-width-100"
        },
        "table": "pf-c-table",
        "tableAction": "pf-c-table__action",
        "tableButton": "pf-c-table__button",
        "tableButtonContent": "pf-c-table__button-content",
        "tableCheck": "pf-c-table__check",
        "tableColumnHelp": "pf-c-table__column-help",
        "tableColumnHelpAction": "pf-c-table__column-help-action",
        "tableCompoundExpansionToggle": "pf-c-table__compound-expansion-toggle",
        "tableControlRow": "pf-c-table__control-row",
        "tableDraggable": "pf-c-table__draggable",
        "tableExpandableRow": "pf-c-table__expandable-row",
        "tableExpandableRowContent": "pf-c-table__expandable-row-content",
        "tableFavorite": "pf-c-table__favorite",
        "tableIcon": "pf-c-table__icon",
        "tableIconInline": "pf-c-table__icon-inline",
        "tableInlineEditAction": "pf-c-table__inline-edit-action",
        "tableSort": "pf-c-table__sort",
        "tableSortIndicator": "pf-c-table__sort-indicator",
        "tableSubhead": "pf-c-table__subhead",
        "tableText": "pf-c-table__text",
        "tableToggle": "pf-c-table__toggle",
        "tableToggleIcon": "pf-c-table__toggle-icon",
        "themeDark": "pf-theme-dark"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table-grid.css
  var require_55 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table-grid.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table-grid.js
  var require_table_grid = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table-grid.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_55();
      exports.default = {
        "button": "pf-c-button",
        "modifiers": {
          "grid": "pf-m-grid",
          "compact": "pf-m-compact",
          "expanded": "pf-m-expanded",
          "selected": "pf-m-selected",
          "noPadding": "pf-m-no-padding",
          "hoverable": "pf-m-hoverable",
          "nowrap": "pf-m-nowrap",
          "fitContent": "pf-m-fit-content",
          "truncate": "pf-m-truncate",
          "gridMd": "pf-m-grid-md",
          "gridLg": "pf-m-grid-lg",
          "gridXl": "pf-m-grid-xl",
          "grid_2xl": "pf-m-grid-2xl"
        },
        "table": "pf-c-table",
        "tableAction": "pf-c-table__action",
        "tableButton": "pf-c-table__button",
        "tableCheck": "pf-c-table__check",
        "tableCompoundExpansionToggle": "pf-c-table__compound-expansion-toggle",
        "tableExpandableRow": "pf-c-table__expandable-row",
        "tableExpandableRowContent": "pf-c-table__expandable-row-content",
        "tableFavorite": "pf-c-table__favorite",
        "tableIcon": "pf-c-table__icon",
        "tableInlineEditAction": "pf-c-table__inline-edit-action",
        "tableText": "pf-c-table__text",
        "tableToggle": "pf-c-table__toggle",
        "tableToggleIcon": "pf-c-table__toggle-icon"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table-tree-view.css
  var require_56 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table-tree-view.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table-tree-view.js
  var require_table_tree_view = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table-tree-view.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_56();
      exports.default = {
        "dropdown": "pf-c-dropdown",
        "modifiers": {
          "treeView": "pf-m-tree-view",
          "treeViewGrid": "pf-m-tree-view-grid",
          "treeViewDetailsExpanded": "pf-m-tree-view-details-expanded",
          "treeViewGridMd": "pf-m-tree-view-grid-md",
          "treeViewGridLg": "pf-m-tree-view-grid-lg",
          "treeViewGridXl": "pf-m-tree-view-grid-xl",
          "treeViewGrid_2xl": "pf-m-tree-view-grid-2xl"
        },
        "table": "pf-c-table",
        "tableAction": "pf-c-table__action",
        "tableCheck": "pf-c-table__check",
        "tableToggle": "pf-c-table__toggle",
        "tableToggleIcon": "pf-c-table__toggle-icon",
        "tableTreeViewDetailsToggle": "pf-c-table__tree-view-details-toggle",
        "tableTreeViewIcon": "pf-c-table__tree-view-icon",
        "tableTreeViewMain": "pf-c-table__tree-view-main",
        "tableTreeViewText": "pf-c-table__tree-view-text",
        "tableTreeViewTitleCell": "pf-c-table__tree-view-title-cell",
        "tableTreeViewTitleHeaderCell": "pf-c-table__tree-view-title-header-cell"
      };
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table-scrollable.css
  var require_57 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table-scrollable.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/Table/table-scrollable.js
  var require_table_scrollable = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/Table/table-scrollable.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_57();
      exports.default = {
        "modifiers": {
          "borderRight": "pf-m-border-right",
          "borderLeft": "pf-m-border-left",
          "stickyHeader": "pf-m-sticky-header"
        },
        "scrollInnerWrapper": "pf-c-scroll-inner-wrapper",
        "scrollOuterWrapper": "pf-c-scroll-outer-wrapper",
        "table": "pf-c-table",
        "tableStickyColumn": "pf-c-table__sticky-column"
      };
    }
  });

  // node_modules/lodash/_listCacheClear.js
  var require_listCacheClear = __commonJS({
    "node_modules/lodash/_listCacheClear.js"(exports, module) {
      function listCacheClear() {
        this.__data__ = [];
        this.size = 0;
      }
      module.exports = listCacheClear;
    }
  });

  // node_modules/lodash/eq.js
  var require_eq = __commonJS({
    "node_modules/lodash/eq.js"(exports, module) {
      function eq(value, other) {
        return value === other || value !== value && other !== other;
      }
      module.exports = eq;
    }
  });

  // node_modules/lodash/_assocIndexOf.js
  var require_assocIndexOf = __commonJS({
    "node_modules/lodash/_assocIndexOf.js"(exports, module) {
      var eq = require_eq();
      function assocIndexOf(array, key) {
        var length = array.length;
        while (length--) {
          if (eq(array[length][0], key)) {
            return length;
          }
        }
        return -1;
      }
      module.exports = assocIndexOf;
    }
  });

  // node_modules/lodash/_listCacheDelete.js
  var require_listCacheDelete = __commonJS({
    "node_modules/lodash/_listCacheDelete.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      var arrayProto = Array.prototype;
      var splice = arrayProto.splice;
      function listCacheDelete(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
          return false;
        }
        var lastIndex = data.length - 1;
        if (index == lastIndex) {
          data.pop();
        } else {
          splice.call(data, index, 1);
        }
        --this.size;
        return true;
      }
      module.exports = listCacheDelete;
    }
  });

  // node_modules/lodash/_listCacheGet.js
  var require_listCacheGet = __commonJS({
    "node_modules/lodash/_listCacheGet.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      function listCacheGet(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        return index < 0 ? void 0 : data[index][1];
      }
      module.exports = listCacheGet;
    }
  });

  // node_modules/lodash/_listCacheHas.js
  var require_listCacheHas = __commonJS({
    "node_modules/lodash/_listCacheHas.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      function listCacheHas(key) {
        return assocIndexOf(this.__data__, key) > -1;
      }
      module.exports = listCacheHas;
    }
  });

  // node_modules/lodash/_listCacheSet.js
  var require_listCacheSet = __commonJS({
    "node_modules/lodash/_listCacheSet.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      function listCacheSet(key, value) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
          ++this.size;
          data.push([key, value]);
        } else {
          data[index][1] = value;
        }
        return this;
      }
      module.exports = listCacheSet;
    }
  });

  // node_modules/lodash/_ListCache.js
  var require_ListCache = __commonJS({
    "node_modules/lodash/_ListCache.js"(exports, module) {
      var listCacheClear = require_listCacheClear();
      var listCacheDelete = require_listCacheDelete();
      var listCacheGet = require_listCacheGet();
      var listCacheHas = require_listCacheHas();
      var listCacheSet = require_listCacheSet();
      function ListCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      ListCache.prototype.clear = listCacheClear;
      ListCache.prototype["delete"] = listCacheDelete;
      ListCache.prototype.get = listCacheGet;
      ListCache.prototype.has = listCacheHas;
      ListCache.prototype.set = listCacheSet;
      module.exports = ListCache;
    }
  });

  // node_modules/lodash/_stackClear.js
  var require_stackClear = __commonJS({
    "node_modules/lodash/_stackClear.js"(exports, module) {
      var ListCache = require_ListCache();
      function stackClear() {
        this.__data__ = new ListCache();
        this.size = 0;
      }
      module.exports = stackClear;
    }
  });

  // node_modules/lodash/_stackDelete.js
  var require_stackDelete = __commonJS({
    "node_modules/lodash/_stackDelete.js"(exports, module) {
      function stackDelete(key) {
        var data = this.__data__, result = data["delete"](key);
        this.size = data.size;
        return result;
      }
      module.exports = stackDelete;
    }
  });

  // node_modules/lodash/_stackGet.js
  var require_stackGet = __commonJS({
    "node_modules/lodash/_stackGet.js"(exports, module) {
      function stackGet(key) {
        return this.__data__.get(key);
      }
      module.exports = stackGet;
    }
  });

  // node_modules/lodash/_stackHas.js
  var require_stackHas = __commonJS({
    "node_modules/lodash/_stackHas.js"(exports, module) {
      function stackHas(key) {
        return this.__data__.has(key);
      }
      module.exports = stackHas;
    }
  });

  // node_modules/lodash/_freeGlobal.js
  var require_freeGlobal = __commonJS({
    "node_modules/lodash/_freeGlobal.js"(exports, module) {
      var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
      module.exports = freeGlobal;
    }
  });

  // node_modules/lodash/_root.js
  var require_root = __commonJS({
    "node_modules/lodash/_root.js"(exports, module) {
      var freeGlobal = require_freeGlobal();
      var freeSelf = typeof self == "object" && self && self.Object === Object && self;
      var root = freeGlobal || freeSelf || Function("return this")();
      module.exports = root;
    }
  });

  // node_modules/lodash/_Symbol.js
  var require_Symbol = __commonJS({
    "node_modules/lodash/_Symbol.js"(exports, module) {
      var root = require_root();
      var Symbol3 = root.Symbol;
      module.exports = Symbol3;
    }
  });

  // node_modules/lodash/_getRawTag.js
  var require_getRawTag = __commonJS({
    "node_modules/lodash/_getRawTag.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var nativeObjectToString = objectProto.toString;
      var symToStringTag = Symbol3 ? Symbol3.toStringTag : void 0;
      function getRawTag(value) {
        var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
        try {
          value[symToStringTag] = void 0;
          var unmasked = true;
        } catch (e) {
        }
        var result = nativeObjectToString.call(value);
        if (unmasked) {
          if (isOwn) {
            value[symToStringTag] = tag;
          } else {
            delete value[symToStringTag];
          }
        }
        return result;
      }
      module.exports = getRawTag;
    }
  });

  // node_modules/lodash/_objectToString.js
  var require_objectToString = __commonJS({
    "node_modules/lodash/_objectToString.js"(exports, module) {
      var objectProto = Object.prototype;
      var nativeObjectToString = objectProto.toString;
      function objectToString(value) {
        return nativeObjectToString.call(value);
      }
      module.exports = objectToString;
    }
  });

  // node_modules/lodash/_baseGetTag.js
  var require_baseGetTag = __commonJS({
    "node_modules/lodash/_baseGetTag.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var getRawTag = require_getRawTag();
      var objectToString = require_objectToString();
      var nullTag = "[object Null]";
      var undefinedTag = "[object Undefined]";
      var symToStringTag = Symbol3 ? Symbol3.toStringTag : void 0;
      function baseGetTag(value) {
        if (value == null) {
          return value === void 0 ? undefinedTag : nullTag;
        }
        return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
      }
      module.exports = baseGetTag;
    }
  });

  // node_modules/lodash/isObject.js
  var require_isObject = __commonJS({
    "node_modules/lodash/isObject.js"(exports, module) {
      function isObject(value) {
        var type = typeof value;
        return value != null && (type == "object" || type == "function");
      }
      module.exports = isObject;
    }
  });

  // node_modules/lodash/isFunction.js
  var require_isFunction = __commonJS({
    "node_modules/lodash/isFunction.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObject = require_isObject();
      var asyncTag = "[object AsyncFunction]";
      var funcTag = "[object Function]";
      var genTag = "[object GeneratorFunction]";
      var proxyTag = "[object Proxy]";
      function isFunction(value) {
        if (!isObject(value)) {
          return false;
        }
        var tag = baseGetTag(value);
        return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
      }
      module.exports = isFunction;
    }
  });

  // node_modules/lodash/_coreJsData.js
  var require_coreJsData = __commonJS({
    "node_modules/lodash/_coreJsData.js"(exports, module) {
      var root = require_root();
      var coreJsData = root["__core-js_shared__"];
      module.exports = coreJsData;
    }
  });

  // node_modules/lodash/_isMasked.js
  var require_isMasked = __commonJS({
    "node_modules/lodash/_isMasked.js"(exports, module) {
      var coreJsData = require_coreJsData();
      var maskSrcKey = function() {
        var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
        return uid2 ? "Symbol(src)_1." + uid2 : "";
      }();
      function isMasked(func) {
        return !!maskSrcKey && maskSrcKey in func;
      }
      module.exports = isMasked;
    }
  });

  // node_modules/lodash/_toSource.js
  var require_toSource = __commonJS({
    "node_modules/lodash/_toSource.js"(exports, module) {
      var funcProto = Function.prototype;
      var funcToString = funcProto.toString;
      function toSource(func) {
        if (func != null) {
          try {
            return funcToString.call(func);
          } catch (e) {
          }
          try {
            return func + "";
          } catch (e) {
          }
        }
        return "";
      }
      module.exports = toSource;
    }
  });

  // node_modules/lodash/_baseIsNative.js
  var require_baseIsNative = __commonJS({
    "node_modules/lodash/_baseIsNative.js"(exports, module) {
      var isFunction = require_isFunction();
      var isMasked = require_isMasked();
      var isObject = require_isObject();
      var toSource = require_toSource();
      var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
      var reIsHostCtor = /^\[object .+?Constructor\]$/;
      var funcProto = Function.prototype;
      var objectProto = Object.prototype;
      var funcToString = funcProto.toString;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var reIsNative = RegExp(
        "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
      );
      function baseIsNative(value) {
        if (!isObject(value) || isMasked(value)) {
          return false;
        }
        var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
        return pattern.test(toSource(value));
      }
      module.exports = baseIsNative;
    }
  });

  // node_modules/lodash/_getValue.js
  var require_getValue = __commonJS({
    "node_modules/lodash/_getValue.js"(exports, module) {
      function getValue2(object, key) {
        return object == null ? void 0 : object[key];
      }
      module.exports = getValue2;
    }
  });

  // node_modules/lodash/_getNative.js
  var require_getNative = __commonJS({
    "node_modules/lodash/_getNative.js"(exports, module) {
      var baseIsNative = require_baseIsNative();
      var getValue2 = require_getValue();
      function getNative(object, key) {
        var value = getValue2(object, key);
        return baseIsNative(value) ? value : void 0;
      }
      module.exports = getNative;
    }
  });

  // node_modules/lodash/_Map.js
  var require_Map = __commonJS({
    "node_modules/lodash/_Map.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var Map2 = getNative(root, "Map");
      module.exports = Map2;
    }
  });

  // node_modules/lodash/_nativeCreate.js
  var require_nativeCreate = __commonJS({
    "node_modules/lodash/_nativeCreate.js"(exports, module) {
      var getNative = require_getNative();
      var nativeCreate = getNative(Object, "create");
      module.exports = nativeCreate;
    }
  });

  // node_modules/lodash/_hashClear.js
  var require_hashClear = __commonJS({
    "node_modules/lodash/_hashClear.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      function hashClear() {
        this.__data__ = nativeCreate ? nativeCreate(null) : {};
        this.size = 0;
      }
      module.exports = hashClear;
    }
  });

  // node_modules/lodash/_hashDelete.js
  var require_hashDelete = __commonJS({
    "node_modules/lodash/_hashDelete.js"(exports, module) {
      function hashDelete(key) {
        var result = this.has(key) && delete this.__data__[key];
        this.size -= result ? 1 : 0;
        return result;
      }
      module.exports = hashDelete;
    }
  });

  // node_modules/lodash/_hashGet.js
  var require_hashGet = __commonJS({
    "node_modules/lodash/_hashGet.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function hashGet(key) {
        var data = this.__data__;
        if (nativeCreate) {
          var result = data[key];
          return result === HASH_UNDEFINED ? void 0 : result;
        }
        return hasOwnProperty.call(data, key) ? data[key] : void 0;
      }
      module.exports = hashGet;
    }
  });

  // node_modules/lodash/_hashHas.js
  var require_hashHas = __commonJS({
    "node_modules/lodash/_hashHas.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function hashHas(key) {
        var data = this.__data__;
        return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
      }
      module.exports = hashHas;
    }
  });

  // node_modules/lodash/_hashSet.js
  var require_hashSet = __commonJS({
    "node_modules/lodash/_hashSet.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      function hashSet(key, value) {
        var data = this.__data__;
        this.size += this.has(key) ? 0 : 1;
        data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
        return this;
      }
      module.exports = hashSet;
    }
  });

  // node_modules/lodash/_Hash.js
  var require_Hash = __commonJS({
    "node_modules/lodash/_Hash.js"(exports, module) {
      var hashClear = require_hashClear();
      var hashDelete = require_hashDelete();
      var hashGet = require_hashGet();
      var hashHas = require_hashHas();
      var hashSet = require_hashSet();
      function Hash(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      Hash.prototype.clear = hashClear;
      Hash.prototype["delete"] = hashDelete;
      Hash.prototype.get = hashGet;
      Hash.prototype.has = hashHas;
      Hash.prototype.set = hashSet;
      module.exports = Hash;
    }
  });

  // node_modules/lodash/_mapCacheClear.js
  var require_mapCacheClear = __commonJS({
    "node_modules/lodash/_mapCacheClear.js"(exports, module) {
      var Hash = require_Hash();
      var ListCache = require_ListCache();
      var Map2 = require_Map();
      function mapCacheClear() {
        this.size = 0;
        this.__data__ = {
          "hash": new Hash(),
          "map": new (Map2 || ListCache)(),
          "string": new Hash()
        };
      }
      module.exports = mapCacheClear;
    }
  });

  // node_modules/lodash/_isKeyable.js
  var require_isKeyable = __commonJS({
    "node_modules/lodash/_isKeyable.js"(exports, module) {
      function isKeyable(value) {
        var type = typeof value;
        return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
      }
      module.exports = isKeyable;
    }
  });

  // node_modules/lodash/_getMapData.js
  var require_getMapData = __commonJS({
    "node_modules/lodash/_getMapData.js"(exports, module) {
      var isKeyable = require_isKeyable();
      function getMapData(map2, key) {
        var data = map2.__data__;
        return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
      }
      module.exports = getMapData;
    }
  });

  // node_modules/lodash/_mapCacheDelete.js
  var require_mapCacheDelete = __commonJS({
    "node_modules/lodash/_mapCacheDelete.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheDelete(key) {
        var result = getMapData(this, key)["delete"](key);
        this.size -= result ? 1 : 0;
        return result;
      }
      module.exports = mapCacheDelete;
    }
  });

  // node_modules/lodash/_mapCacheGet.js
  var require_mapCacheGet = __commonJS({
    "node_modules/lodash/_mapCacheGet.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheGet(key) {
        return getMapData(this, key).get(key);
      }
      module.exports = mapCacheGet;
    }
  });

  // node_modules/lodash/_mapCacheHas.js
  var require_mapCacheHas = __commonJS({
    "node_modules/lodash/_mapCacheHas.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheHas(key) {
        return getMapData(this, key).has(key);
      }
      module.exports = mapCacheHas;
    }
  });

  // node_modules/lodash/_mapCacheSet.js
  var require_mapCacheSet = __commonJS({
    "node_modules/lodash/_mapCacheSet.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheSet(key, value) {
        var data = getMapData(this, key), size = data.size;
        data.set(key, value);
        this.size += data.size == size ? 0 : 1;
        return this;
      }
      module.exports = mapCacheSet;
    }
  });

  // node_modules/lodash/_MapCache.js
  var require_MapCache = __commonJS({
    "node_modules/lodash/_MapCache.js"(exports, module) {
      var mapCacheClear = require_mapCacheClear();
      var mapCacheDelete = require_mapCacheDelete();
      var mapCacheGet = require_mapCacheGet();
      var mapCacheHas = require_mapCacheHas();
      var mapCacheSet = require_mapCacheSet();
      function MapCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      MapCache.prototype.clear = mapCacheClear;
      MapCache.prototype["delete"] = mapCacheDelete;
      MapCache.prototype.get = mapCacheGet;
      MapCache.prototype.has = mapCacheHas;
      MapCache.prototype.set = mapCacheSet;
      module.exports = MapCache;
    }
  });

  // node_modules/lodash/_stackSet.js
  var require_stackSet = __commonJS({
    "node_modules/lodash/_stackSet.js"(exports, module) {
      var ListCache = require_ListCache();
      var Map2 = require_Map();
      var MapCache = require_MapCache();
      var LARGE_ARRAY_SIZE = 200;
      function stackSet(key, value) {
        var data = this.__data__;
        if (data instanceof ListCache) {
          var pairs = data.__data__;
          if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
            pairs.push([key, value]);
            this.size = ++data.size;
            return this;
          }
          data = this.__data__ = new MapCache(pairs);
        }
        data.set(key, value);
        this.size = data.size;
        return this;
      }
      module.exports = stackSet;
    }
  });

  // node_modules/lodash/_Stack.js
  var require_Stack = __commonJS({
    "node_modules/lodash/_Stack.js"(exports, module) {
      var ListCache = require_ListCache();
      var stackClear = require_stackClear();
      var stackDelete = require_stackDelete();
      var stackGet = require_stackGet();
      var stackHas = require_stackHas();
      var stackSet = require_stackSet();
      function Stack(entries) {
        var data = this.__data__ = new ListCache(entries);
        this.size = data.size;
      }
      Stack.prototype.clear = stackClear;
      Stack.prototype["delete"] = stackDelete;
      Stack.prototype.get = stackGet;
      Stack.prototype.has = stackHas;
      Stack.prototype.set = stackSet;
      module.exports = Stack;
    }
  });

  // node_modules/lodash/_defineProperty.js
  var require_defineProperty = __commonJS({
    "node_modules/lodash/_defineProperty.js"(exports, module) {
      var getNative = require_getNative();
      var defineProperty = function() {
        try {
          var func = getNative(Object, "defineProperty");
          func({}, "", {});
          return func;
        } catch (e) {
        }
      }();
      module.exports = defineProperty;
    }
  });

  // node_modules/lodash/_baseAssignValue.js
  var require_baseAssignValue = __commonJS({
    "node_modules/lodash/_baseAssignValue.js"(exports, module) {
      var defineProperty = require_defineProperty();
      function baseAssignValue(object, key, value) {
        if (key == "__proto__" && defineProperty) {
          defineProperty(object, key, {
            "configurable": true,
            "enumerable": true,
            "value": value,
            "writable": true
          });
        } else {
          object[key] = value;
        }
      }
      module.exports = baseAssignValue;
    }
  });

  // node_modules/lodash/_assignMergeValue.js
  var require_assignMergeValue = __commonJS({
    "node_modules/lodash/_assignMergeValue.js"(exports, module) {
      var baseAssignValue = require_baseAssignValue();
      var eq = require_eq();
      function assignMergeValue(object, key, value) {
        if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
          baseAssignValue(object, key, value);
        }
      }
      module.exports = assignMergeValue;
    }
  });

  // node_modules/lodash/_createBaseFor.js
  var require_createBaseFor = __commonJS({
    "node_modules/lodash/_createBaseFor.js"(exports, module) {
      function createBaseFor(fromRight) {
        return function(object, iteratee, keysFunc) {
          var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
          while (length--) {
            var key = props[fromRight ? length : ++index];
            if (iteratee(iterable[key], key, iterable) === false) {
              break;
            }
          }
          return object;
        };
      }
      module.exports = createBaseFor;
    }
  });

  // node_modules/lodash/_baseFor.js
  var require_baseFor = __commonJS({
    "node_modules/lodash/_baseFor.js"(exports, module) {
      var createBaseFor = require_createBaseFor();
      var baseFor = createBaseFor();
      module.exports = baseFor;
    }
  });

  // node_modules/lodash/_cloneBuffer.js
  var require_cloneBuffer = __commonJS({
    "node_modules/lodash/_cloneBuffer.js"(exports, module) {
      var root = require_root();
      var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var Buffer2 = moduleExports ? root.Buffer : void 0;
      var allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
      function cloneBuffer(buffer, isDeep) {
        if (isDeep) {
          return buffer.slice();
        }
        var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
        buffer.copy(result);
        return result;
      }
      module.exports = cloneBuffer;
    }
  });

  // node_modules/lodash/_Uint8Array.js
  var require_Uint8Array = __commonJS({
    "node_modules/lodash/_Uint8Array.js"(exports, module) {
      var root = require_root();
      var Uint8Array2 = root.Uint8Array;
      module.exports = Uint8Array2;
    }
  });

  // node_modules/lodash/_cloneArrayBuffer.js
  var require_cloneArrayBuffer = __commonJS({
    "node_modules/lodash/_cloneArrayBuffer.js"(exports, module) {
      var Uint8Array2 = require_Uint8Array();
      function cloneArrayBuffer(arrayBuffer) {
        var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
        new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
        return result;
      }
      module.exports = cloneArrayBuffer;
    }
  });

  // node_modules/lodash/_cloneTypedArray.js
  var require_cloneTypedArray = __commonJS({
    "node_modules/lodash/_cloneTypedArray.js"(exports, module) {
      var cloneArrayBuffer = require_cloneArrayBuffer();
      function cloneTypedArray(typedArray, isDeep) {
        var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
        return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
      }
      module.exports = cloneTypedArray;
    }
  });

  // node_modules/lodash/_copyArray.js
  var require_copyArray = __commonJS({
    "node_modules/lodash/_copyArray.js"(exports, module) {
      function copyArray(source, array) {
        var index = -1, length = source.length;
        array || (array = Array(length));
        while (++index < length) {
          array[index] = source[index];
        }
        return array;
      }
      module.exports = copyArray;
    }
  });

  // node_modules/lodash/_baseCreate.js
  var require_baseCreate = __commonJS({
    "node_modules/lodash/_baseCreate.js"(exports, module) {
      var isObject = require_isObject();
      var objectCreate = Object.create;
      var baseCreate = function() {
        function object() {
        }
        return function(proto) {
          if (!isObject(proto)) {
            return {};
          }
          if (objectCreate) {
            return objectCreate(proto);
          }
          object.prototype = proto;
          var result = new object();
          object.prototype = void 0;
          return result;
        };
      }();
      module.exports = baseCreate;
    }
  });

  // node_modules/lodash/_overArg.js
  var require_overArg = __commonJS({
    "node_modules/lodash/_overArg.js"(exports, module) {
      function overArg(func, transform2) {
        return function(arg) {
          return func(transform2(arg));
        };
      }
      module.exports = overArg;
    }
  });

  // node_modules/lodash/_getPrototype.js
  var require_getPrototype = __commonJS({
    "node_modules/lodash/_getPrototype.js"(exports, module) {
      var overArg = require_overArg();
      var getPrototype = overArg(Object.getPrototypeOf, Object);
      module.exports = getPrototype;
    }
  });

  // node_modules/lodash/_isPrototype.js
  var require_isPrototype = __commonJS({
    "node_modules/lodash/_isPrototype.js"(exports, module) {
      var objectProto = Object.prototype;
      function isPrototype(value) {
        var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
        return value === proto;
      }
      module.exports = isPrototype;
    }
  });

  // node_modules/lodash/_initCloneObject.js
  var require_initCloneObject = __commonJS({
    "node_modules/lodash/_initCloneObject.js"(exports, module) {
      var baseCreate = require_baseCreate();
      var getPrototype = require_getPrototype();
      var isPrototype = require_isPrototype();
      function initCloneObject(object) {
        return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
      }
      module.exports = initCloneObject;
    }
  });

  // node_modules/lodash/isObjectLike.js
  var require_isObjectLike = __commonJS({
    "node_modules/lodash/isObjectLike.js"(exports, module) {
      function isObjectLike(value) {
        return value != null && typeof value == "object";
      }
      module.exports = isObjectLike;
    }
  });

  // node_modules/lodash/_baseIsArguments.js
  var require_baseIsArguments = __commonJS({
    "node_modules/lodash/_baseIsArguments.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var argsTag = "[object Arguments]";
      function baseIsArguments(value) {
        return isObjectLike(value) && baseGetTag(value) == argsTag;
      }
      module.exports = baseIsArguments;
    }
  });

  // node_modules/lodash/isArguments.js
  var require_isArguments = __commonJS({
    "node_modules/lodash/isArguments.js"(exports, module) {
      var baseIsArguments = require_baseIsArguments();
      var isObjectLike = require_isObjectLike();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var propertyIsEnumerable = objectProto.propertyIsEnumerable;
      var isArguments = baseIsArguments(function() {
        return arguments;
      }()) ? baseIsArguments : function(value) {
        return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
      };
      module.exports = isArguments;
    }
  });

  // node_modules/lodash/isArray.js
  var require_isArray = __commonJS({
    "node_modules/lodash/isArray.js"(exports, module) {
      var isArray = Array.isArray;
      module.exports = isArray;
    }
  });

  // node_modules/lodash/isLength.js
  var require_isLength = __commonJS({
    "node_modules/lodash/isLength.js"(exports, module) {
      var MAX_SAFE_INTEGER = 9007199254740991;
      function isLength(value) {
        return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
      }
      module.exports = isLength;
    }
  });

  // node_modules/lodash/isArrayLike.js
  var require_isArrayLike = __commonJS({
    "node_modules/lodash/isArrayLike.js"(exports, module) {
      var isFunction = require_isFunction();
      var isLength = require_isLength();
      function isArrayLike(value) {
        return value != null && isLength(value.length) && !isFunction(value);
      }
      module.exports = isArrayLike;
    }
  });

  // node_modules/lodash/isArrayLikeObject.js
  var require_isArrayLikeObject = __commonJS({
    "node_modules/lodash/isArrayLikeObject.js"(exports, module) {
      var isArrayLike = require_isArrayLike();
      var isObjectLike = require_isObjectLike();
      function isArrayLikeObject(value) {
        return isObjectLike(value) && isArrayLike(value);
      }
      module.exports = isArrayLikeObject;
    }
  });

  // node_modules/lodash/stubFalse.js
  var require_stubFalse = __commonJS({
    "node_modules/lodash/stubFalse.js"(exports, module) {
      function stubFalse() {
        return false;
      }
      module.exports = stubFalse;
    }
  });

  // node_modules/lodash/isBuffer.js
  var require_isBuffer = __commonJS({
    "node_modules/lodash/isBuffer.js"(exports, module) {
      var root = require_root();
      var stubFalse = require_stubFalse();
      var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var Buffer2 = moduleExports ? root.Buffer : void 0;
      var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
      var isBuffer = nativeIsBuffer || stubFalse;
      module.exports = isBuffer;
    }
  });

  // node_modules/lodash/isPlainObject.js
  var require_isPlainObject = __commonJS({
    "node_modules/lodash/isPlainObject.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var getPrototype = require_getPrototype();
      var isObjectLike = require_isObjectLike();
      var objectTag = "[object Object]";
      var funcProto = Function.prototype;
      var objectProto = Object.prototype;
      var funcToString = funcProto.toString;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var objectCtorString = funcToString.call(Object);
      function isPlainObject(value) {
        if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
          return false;
        }
        var proto = getPrototype(value);
        if (proto === null) {
          return true;
        }
        var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
        return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
      }
      module.exports = isPlainObject;
    }
  });

  // node_modules/lodash/_baseIsTypedArray.js
  var require_baseIsTypedArray = __commonJS({
    "node_modules/lodash/_baseIsTypedArray.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isLength = require_isLength();
      var isObjectLike = require_isObjectLike();
      var argsTag = "[object Arguments]";
      var arrayTag = "[object Array]";
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var errorTag = "[object Error]";
      var funcTag = "[object Function]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var objectTag = "[object Object]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var weakMapTag = "[object WeakMap]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var float32Tag = "[object Float32Array]";
      var float64Tag = "[object Float64Array]";
      var int8Tag = "[object Int8Array]";
      var int16Tag = "[object Int16Array]";
      var int32Tag = "[object Int32Array]";
      var uint8Tag = "[object Uint8Array]";
      var uint8ClampedTag = "[object Uint8ClampedArray]";
      var uint16Tag = "[object Uint16Array]";
      var uint32Tag = "[object Uint32Array]";
      var typedArrayTags = {};
      typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
      typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
      function baseIsTypedArray(value) {
        return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
      }
      module.exports = baseIsTypedArray;
    }
  });

  // node_modules/lodash/_baseUnary.js
  var require_baseUnary = __commonJS({
    "node_modules/lodash/_baseUnary.js"(exports, module) {
      function baseUnary(func) {
        return function(value) {
          return func(value);
        };
      }
      module.exports = baseUnary;
    }
  });

  // node_modules/lodash/_nodeUtil.js
  var require_nodeUtil = __commonJS({
    "node_modules/lodash/_nodeUtil.js"(exports, module) {
      var freeGlobal = require_freeGlobal();
      var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var freeProcess = moduleExports && freeGlobal.process;
      var nodeUtil = function() {
        try {
          var types = freeModule && freeModule.require && freeModule.require("util").types;
          if (types) {
            return types;
          }
          return freeProcess && freeProcess.binding && freeProcess.binding("util");
        } catch (e) {
        }
      }();
      module.exports = nodeUtil;
    }
  });

  // node_modules/lodash/isTypedArray.js
  var require_isTypedArray = __commonJS({
    "node_modules/lodash/isTypedArray.js"(exports, module) {
      var baseIsTypedArray = require_baseIsTypedArray();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
      var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
      module.exports = isTypedArray;
    }
  });

  // node_modules/lodash/_safeGet.js
  var require_safeGet = __commonJS({
    "node_modules/lodash/_safeGet.js"(exports, module) {
      function safeGet(object, key) {
        if (key === "constructor" && typeof object[key] === "function") {
          return;
        }
        if (key == "__proto__") {
          return;
        }
        return object[key];
      }
      module.exports = safeGet;
    }
  });

  // node_modules/lodash/_assignValue.js
  var require_assignValue = __commonJS({
    "node_modules/lodash/_assignValue.js"(exports, module) {
      var baseAssignValue = require_baseAssignValue();
      var eq = require_eq();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function assignValue(object, key, value) {
        var objValue = object[key];
        if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
          baseAssignValue(object, key, value);
        }
      }
      module.exports = assignValue;
    }
  });

  // node_modules/lodash/_copyObject.js
  var require_copyObject = __commonJS({
    "node_modules/lodash/_copyObject.js"(exports, module) {
      var assignValue = require_assignValue();
      var baseAssignValue = require_baseAssignValue();
      function copyObject(source, props, object, customizer) {
        var isNew = !object;
        object || (object = {});
        var index = -1, length = props.length;
        while (++index < length) {
          var key = props[index];
          var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
          if (newValue === void 0) {
            newValue = source[key];
          }
          if (isNew) {
            baseAssignValue(object, key, newValue);
          } else {
            assignValue(object, key, newValue);
          }
        }
        return object;
      }
      module.exports = copyObject;
    }
  });

  // node_modules/lodash/_baseTimes.js
  var require_baseTimes = __commonJS({
    "node_modules/lodash/_baseTimes.js"(exports, module) {
      function baseTimes(n, iteratee) {
        var index = -1, result = Array(n);
        while (++index < n) {
          result[index] = iteratee(index);
        }
        return result;
      }
      module.exports = baseTimes;
    }
  });

  // node_modules/lodash/_isIndex.js
  var require_isIndex = __commonJS({
    "node_modules/lodash/_isIndex.js"(exports, module) {
      var MAX_SAFE_INTEGER = 9007199254740991;
      var reIsUint = /^(?:0|[1-9]\d*)$/;
      function isIndex(value, length) {
        var type = typeof value;
        length = length == null ? MAX_SAFE_INTEGER : length;
        return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
      }
      module.exports = isIndex;
    }
  });

  // node_modules/lodash/_arrayLikeKeys.js
  var require_arrayLikeKeys = __commonJS({
    "node_modules/lodash/_arrayLikeKeys.js"(exports, module) {
      var baseTimes = require_baseTimes();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isBuffer = require_isBuffer();
      var isIndex = require_isIndex();
      var isTypedArray = require_isTypedArray();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function arrayLikeKeys(value, inherited) {
        var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
        for (var key in value) {
          if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
          (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
          isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
          isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
          isIndex(key, length)))) {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = arrayLikeKeys;
    }
  });

  // node_modules/lodash/_nativeKeysIn.js
  var require_nativeKeysIn = __commonJS({
    "node_modules/lodash/_nativeKeysIn.js"(exports, module) {
      function nativeKeysIn(object) {
        var result = [];
        if (object != null) {
          for (var key in Object(object)) {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = nativeKeysIn;
    }
  });

  // node_modules/lodash/_baseKeysIn.js
  var require_baseKeysIn = __commonJS({
    "node_modules/lodash/_baseKeysIn.js"(exports, module) {
      var isObject = require_isObject();
      var isPrototype = require_isPrototype();
      var nativeKeysIn = require_nativeKeysIn();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function baseKeysIn(object) {
        if (!isObject(object)) {
          return nativeKeysIn(object);
        }
        var isProto = isPrototype(object), result = [];
        for (var key in object) {
          if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = baseKeysIn;
    }
  });

  // node_modules/lodash/keysIn.js
  var require_keysIn = __commonJS({
    "node_modules/lodash/keysIn.js"(exports, module) {
      var arrayLikeKeys = require_arrayLikeKeys();
      var baseKeysIn = require_baseKeysIn();
      var isArrayLike = require_isArrayLike();
      function keysIn(object) {
        return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
      }
      module.exports = keysIn;
    }
  });

  // node_modules/lodash/toPlainObject.js
  var require_toPlainObject = __commonJS({
    "node_modules/lodash/toPlainObject.js"(exports, module) {
      var copyObject = require_copyObject();
      var keysIn = require_keysIn();
      function toPlainObject(value) {
        return copyObject(value, keysIn(value));
      }
      module.exports = toPlainObject;
    }
  });

  // node_modules/lodash/_baseMergeDeep.js
  var require_baseMergeDeep = __commonJS({
    "node_modules/lodash/_baseMergeDeep.js"(exports, module) {
      var assignMergeValue = require_assignMergeValue();
      var cloneBuffer = require_cloneBuffer();
      var cloneTypedArray = require_cloneTypedArray();
      var copyArray = require_copyArray();
      var initCloneObject = require_initCloneObject();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isArrayLikeObject = require_isArrayLikeObject();
      var isBuffer = require_isBuffer();
      var isFunction = require_isFunction();
      var isObject = require_isObject();
      var isPlainObject = require_isPlainObject();
      var isTypedArray = require_isTypedArray();
      var safeGet = require_safeGet();
      var toPlainObject = require_toPlainObject();
      function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
        var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
        if (stacked) {
          assignMergeValue(object, key, stacked);
          return;
        }
        var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
        var isCommon = newValue === void 0;
        if (isCommon) {
          var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
          newValue = srcValue;
          if (isArr || isBuff || isTyped) {
            if (isArray(objValue)) {
              newValue = objValue;
            } else if (isArrayLikeObject(objValue)) {
              newValue = copyArray(objValue);
            } else if (isBuff) {
              isCommon = false;
              newValue = cloneBuffer(srcValue, true);
            } else if (isTyped) {
              isCommon = false;
              newValue = cloneTypedArray(srcValue, true);
            } else {
              newValue = [];
            }
          } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
            newValue = objValue;
            if (isArguments(objValue)) {
              newValue = toPlainObject(objValue);
            } else if (!isObject(objValue) || isFunction(objValue)) {
              newValue = initCloneObject(srcValue);
            }
          } else {
            isCommon = false;
          }
        }
        if (isCommon) {
          stack.set(srcValue, newValue);
          mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
          stack["delete"](srcValue);
        }
        assignMergeValue(object, key, newValue);
      }
      module.exports = baseMergeDeep;
    }
  });

  // node_modules/lodash/_baseMerge.js
  var require_baseMerge = __commonJS({
    "node_modules/lodash/_baseMerge.js"(exports, module) {
      var Stack = require_Stack();
      var assignMergeValue = require_assignMergeValue();
      var baseFor = require_baseFor();
      var baseMergeDeep = require_baseMergeDeep();
      var isObject = require_isObject();
      var keysIn = require_keysIn();
      var safeGet = require_safeGet();
      function baseMerge(object, source, srcIndex, customizer, stack) {
        if (object === source) {
          return;
        }
        baseFor(source, function(srcValue, key) {
          stack || (stack = new Stack());
          if (isObject(srcValue)) {
            baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
          } else {
            var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
            if (newValue === void 0) {
              newValue = srcValue;
            }
            assignMergeValue(object, key, newValue);
          }
        }, keysIn);
      }
      module.exports = baseMerge;
    }
  });

  // node_modules/lodash/identity.js
  var require_identity = __commonJS({
    "node_modules/lodash/identity.js"(exports, module) {
      function identity3(value) {
        return value;
      }
      module.exports = identity3;
    }
  });

  // node_modules/lodash/_apply.js
  var require_apply = __commonJS({
    "node_modules/lodash/_apply.js"(exports, module) {
      function apply(func, thisArg, args) {
        switch (args.length) {
          case 0:
            return func.call(thisArg);
          case 1:
            return func.call(thisArg, args[0]);
          case 2:
            return func.call(thisArg, args[0], args[1]);
          case 3:
            return func.call(thisArg, args[0], args[1], args[2]);
        }
        return func.apply(thisArg, args);
      }
      module.exports = apply;
    }
  });

  // node_modules/lodash/_overRest.js
  var require_overRest = __commonJS({
    "node_modules/lodash/_overRest.js"(exports, module) {
      var apply = require_apply();
      var nativeMax = Math.max;
      function overRest(func, start2, transform2) {
        start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
        return function() {
          var args = arguments, index = -1, length = nativeMax(args.length - start2, 0), array = Array(length);
          while (++index < length) {
            array[index] = args[start2 + index];
          }
          index = -1;
          var otherArgs = Array(start2 + 1);
          while (++index < start2) {
            otherArgs[index] = args[index];
          }
          otherArgs[start2] = transform2(array);
          return apply(func, this, otherArgs);
        };
      }
      module.exports = overRest;
    }
  });

  // node_modules/lodash/constant.js
  var require_constant = __commonJS({
    "node_modules/lodash/constant.js"(exports, module) {
      function constant(value) {
        return function() {
          return value;
        };
      }
      module.exports = constant;
    }
  });

  // node_modules/lodash/_baseSetToString.js
  var require_baseSetToString = __commonJS({
    "node_modules/lodash/_baseSetToString.js"(exports, module) {
      var constant = require_constant();
      var defineProperty = require_defineProperty();
      var identity3 = require_identity();
      var baseSetToString = !defineProperty ? identity3 : function(func, string) {
        return defineProperty(func, "toString", {
          "configurable": true,
          "enumerable": false,
          "value": constant(string),
          "writable": true
        });
      };
      module.exports = baseSetToString;
    }
  });

  // node_modules/lodash/_shortOut.js
  var require_shortOut = __commonJS({
    "node_modules/lodash/_shortOut.js"(exports, module) {
      var HOT_COUNT = 800;
      var HOT_SPAN = 16;
      var nativeNow = Date.now;
      function shortOut(func) {
        var count = 0, lastCalled = 0;
        return function() {
          var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
          lastCalled = stamp;
          if (remaining > 0) {
            if (++count >= HOT_COUNT) {
              return arguments[0];
            }
          } else {
            count = 0;
          }
          return func.apply(void 0, arguments);
        };
      }
      module.exports = shortOut;
    }
  });

  // node_modules/lodash/_setToString.js
  var require_setToString = __commonJS({
    "node_modules/lodash/_setToString.js"(exports, module) {
      var baseSetToString = require_baseSetToString();
      var shortOut = require_shortOut();
      var setToString = shortOut(baseSetToString);
      module.exports = setToString;
    }
  });

  // node_modules/lodash/_baseRest.js
  var require_baseRest = __commonJS({
    "node_modules/lodash/_baseRest.js"(exports, module) {
      var identity3 = require_identity();
      var overRest = require_overRest();
      var setToString = require_setToString();
      function baseRest(func, start2) {
        return setToString(overRest(func, start2, identity3), func + "");
      }
      module.exports = baseRest;
    }
  });

  // node_modules/lodash/_isIterateeCall.js
  var require_isIterateeCall = __commonJS({
    "node_modules/lodash/_isIterateeCall.js"(exports, module) {
      var eq = require_eq();
      var isArrayLike = require_isArrayLike();
      var isIndex = require_isIndex();
      var isObject = require_isObject();
      function isIterateeCall(value, index, object) {
        if (!isObject(object)) {
          return false;
        }
        var type = typeof index;
        if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
          return eq(object[index], value);
        }
        return false;
      }
      module.exports = isIterateeCall;
    }
  });

  // node_modules/lodash/_createAssigner.js
  var require_createAssigner = __commonJS({
    "node_modules/lodash/_createAssigner.js"(exports, module) {
      var baseRest = require_baseRest();
      var isIterateeCall = require_isIterateeCall();
      function createAssigner(assigner) {
        return baseRest(function(object, sources) {
          var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
          customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
          if (guard && isIterateeCall(sources[0], sources[1], guard)) {
            customizer = length < 3 ? void 0 : customizer;
            length = 1;
          }
          object = Object(object);
          while (++index < length) {
            var source = sources[index];
            if (source) {
              assigner(object, source, index, customizer);
            }
          }
          return object;
        });
      }
      module.exports = createAssigner;
    }
  });

  // node_modules/lodash/mergeWith.js
  var require_mergeWith = __commonJS({
    "node_modules/lodash/mergeWith.js"(exports, module) {
      var baseMerge = require_baseMerge();
      var createAssigner = require_createAssigner();
      var mergeWith2 = createAssigner(function(object, source, srcIndex, customizer) {
        baseMerge(object, source, srcIndex, customizer);
      });
      module.exports = mergeWith2;
    }
  });

  // node_modules/lodash/_setCacheAdd.js
  var require_setCacheAdd = __commonJS({
    "node_modules/lodash/_setCacheAdd.js"(exports, module) {
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      function setCacheAdd(value) {
        this.__data__.set(value, HASH_UNDEFINED);
        return this;
      }
      module.exports = setCacheAdd;
    }
  });

  // node_modules/lodash/_setCacheHas.js
  var require_setCacheHas = __commonJS({
    "node_modules/lodash/_setCacheHas.js"(exports, module) {
      function setCacheHas(value) {
        return this.__data__.has(value);
      }
      module.exports = setCacheHas;
    }
  });

  // node_modules/lodash/_SetCache.js
  var require_SetCache = __commonJS({
    "node_modules/lodash/_SetCache.js"(exports, module) {
      var MapCache = require_MapCache();
      var setCacheAdd = require_setCacheAdd();
      var setCacheHas = require_setCacheHas();
      function SetCache(values) {
        var index = -1, length = values == null ? 0 : values.length;
        this.__data__ = new MapCache();
        while (++index < length) {
          this.add(values[index]);
        }
      }
      SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
      SetCache.prototype.has = setCacheHas;
      module.exports = SetCache;
    }
  });

  // node_modules/lodash/_arraySome.js
  var require_arraySome = __commonJS({
    "node_modules/lodash/_arraySome.js"(exports, module) {
      function arraySome(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          if (predicate(array[index], index, array)) {
            return true;
          }
        }
        return false;
      }
      module.exports = arraySome;
    }
  });

  // node_modules/lodash/_cacheHas.js
  var require_cacheHas = __commonJS({
    "node_modules/lodash/_cacheHas.js"(exports, module) {
      function cacheHas(cache, key) {
        return cache.has(key);
      }
      module.exports = cacheHas;
    }
  });

  // node_modules/lodash/_equalArrays.js
  var require_equalArrays = __commonJS({
    "node_modules/lodash/_equalArrays.js"(exports, module) {
      var SetCache = require_SetCache();
      var arraySome = require_arraySome();
      var cacheHas = require_cacheHas();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
        if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
          return false;
        }
        var arrStacked = stack.get(array);
        var othStacked = stack.get(other);
        if (arrStacked && othStacked) {
          return arrStacked == other && othStacked == array;
        }
        var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
        stack.set(array, other);
        stack.set(other, array);
        while (++index < arrLength) {
          var arrValue = array[index], othValue = other[index];
          if (customizer) {
            var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
          }
          if (compared !== void 0) {
            if (compared) {
              continue;
            }
            result = false;
            break;
          }
          if (seen) {
            if (!arraySome(other, function(othValue2, othIndex) {
              if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
                return seen.push(othIndex);
              }
            })) {
              result = false;
              break;
            }
          } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
            result = false;
            break;
          }
        }
        stack["delete"](array);
        stack["delete"](other);
        return result;
      }
      module.exports = equalArrays;
    }
  });

  // node_modules/lodash/_mapToArray.js
  var require_mapToArray = __commonJS({
    "node_modules/lodash/_mapToArray.js"(exports, module) {
      function mapToArray(map2) {
        var index = -1, result = Array(map2.size);
        map2.forEach(function(value, key) {
          result[++index] = [key, value];
        });
        return result;
      }
      module.exports = mapToArray;
    }
  });

  // node_modules/lodash/_setToArray.js
  var require_setToArray = __commonJS({
    "node_modules/lodash/_setToArray.js"(exports, module) {
      function setToArray(set) {
        var index = -1, result = Array(set.size);
        set.forEach(function(value) {
          result[++index] = value;
        });
        return result;
      }
      module.exports = setToArray;
    }
  });

  // node_modules/lodash/_equalByTag.js
  var require_equalByTag = __commonJS({
    "node_modules/lodash/_equalByTag.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var Uint8Array2 = require_Uint8Array();
      var eq = require_eq();
      var equalArrays = require_equalArrays();
      var mapToArray = require_mapToArray();
      var setToArray = require_setToArray();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var errorTag = "[object Error]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var symbolTag = "[object Symbol]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
      var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
      function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
        switch (tag) {
          case dataViewTag:
            if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
              return false;
            }
            object = object.buffer;
            other = other.buffer;
          case arrayBufferTag:
            if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
              return false;
            }
            return true;
          case boolTag:
          case dateTag:
          case numberTag:
            return eq(+object, +other);
          case errorTag:
            return object.name == other.name && object.message == other.message;
          case regexpTag:
          case stringTag:
            return object == other + "";
          case mapTag:
            var convert2 = mapToArray;
          case setTag:
            var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
            convert2 || (convert2 = setToArray);
            if (object.size != other.size && !isPartial) {
              return false;
            }
            var stacked = stack.get(object);
            if (stacked) {
              return stacked == other;
            }
            bitmask |= COMPARE_UNORDERED_FLAG;
            stack.set(object, other);
            var result = equalArrays(convert2(object), convert2(other), bitmask, customizer, equalFunc, stack);
            stack["delete"](object);
            return result;
          case symbolTag:
            if (symbolValueOf) {
              return symbolValueOf.call(object) == symbolValueOf.call(other);
            }
        }
        return false;
      }
      module.exports = equalByTag;
    }
  });

  // node_modules/lodash/_arrayPush.js
  var require_arrayPush = __commonJS({
    "node_modules/lodash/_arrayPush.js"(exports, module) {
      function arrayPush(array, values) {
        var index = -1, length = values.length, offset2 = array.length;
        while (++index < length) {
          array[offset2 + index] = values[index];
        }
        return array;
      }
      module.exports = arrayPush;
    }
  });

  // node_modules/lodash/_baseGetAllKeys.js
  var require_baseGetAllKeys = __commonJS({
    "node_modules/lodash/_baseGetAllKeys.js"(exports, module) {
      var arrayPush = require_arrayPush();
      var isArray = require_isArray();
      function baseGetAllKeys(object, keysFunc, symbolsFunc) {
        var result = keysFunc(object);
        return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
      }
      module.exports = baseGetAllKeys;
    }
  });

  // node_modules/lodash/_arrayFilter.js
  var require_arrayFilter = __commonJS({
    "node_modules/lodash/_arrayFilter.js"(exports, module) {
      function arrayFilter(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
        while (++index < length) {
          var value = array[index];
          if (predicate(value, index, array)) {
            result[resIndex++] = value;
          }
        }
        return result;
      }
      module.exports = arrayFilter;
    }
  });

  // node_modules/lodash/stubArray.js
  var require_stubArray = __commonJS({
    "node_modules/lodash/stubArray.js"(exports, module) {
      function stubArray() {
        return [];
      }
      module.exports = stubArray;
    }
  });

  // node_modules/lodash/_getSymbols.js
  var require_getSymbols = __commonJS({
    "node_modules/lodash/_getSymbols.js"(exports, module) {
      var arrayFilter = require_arrayFilter();
      var stubArray = require_stubArray();
      var objectProto = Object.prototype;
      var propertyIsEnumerable = objectProto.propertyIsEnumerable;
      var nativeGetSymbols = Object.getOwnPropertySymbols;
      var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
        if (object == null) {
          return [];
        }
        object = Object(object);
        return arrayFilter(nativeGetSymbols(object), function(symbol) {
          return propertyIsEnumerable.call(object, symbol);
        });
      };
      module.exports = getSymbols;
    }
  });

  // node_modules/lodash/_nativeKeys.js
  var require_nativeKeys = __commonJS({
    "node_modules/lodash/_nativeKeys.js"(exports, module) {
      var overArg = require_overArg();
      var nativeKeys = overArg(Object.keys, Object);
      module.exports = nativeKeys;
    }
  });

  // node_modules/lodash/_baseKeys.js
  var require_baseKeys = __commonJS({
    "node_modules/lodash/_baseKeys.js"(exports, module) {
      var isPrototype = require_isPrototype();
      var nativeKeys = require_nativeKeys();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function baseKeys(object) {
        if (!isPrototype(object)) {
          return nativeKeys(object);
        }
        var result = [];
        for (var key in Object(object)) {
          if (hasOwnProperty.call(object, key) && key != "constructor") {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = baseKeys;
    }
  });

  // node_modules/lodash/keys.js
  var require_keys = __commonJS({
    "node_modules/lodash/keys.js"(exports, module) {
      var arrayLikeKeys = require_arrayLikeKeys();
      var baseKeys = require_baseKeys();
      var isArrayLike = require_isArrayLike();
      function keys(object) {
        return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
      }
      module.exports = keys;
    }
  });

  // node_modules/lodash/_getAllKeys.js
  var require_getAllKeys = __commonJS({
    "node_modules/lodash/_getAllKeys.js"(exports, module) {
      var baseGetAllKeys = require_baseGetAllKeys();
      var getSymbols = require_getSymbols();
      var keys = require_keys();
      function getAllKeys(object) {
        return baseGetAllKeys(object, keys, getSymbols);
      }
      module.exports = getAllKeys;
    }
  });

  // node_modules/lodash/_equalObjects.js
  var require_equalObjects = __commonJS({
    "node_modules/lodash/_equalObjects.js"(exports, module) {
      var getAllKeys = require_getAllKeys();
      var COMPARE_PARTIAL_FLAG = 1;
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
        if (objLength != othLength && !isPartial) {
          return false;
        }
        var index = objLength;
        while (index--) {
          var key = objProps[index];
          if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
            return false;
          }
        }
        var objStacked = stack.get(object);
        var othStacked = stack.get(other);
        if (objStacked && othStacked) {
          return objStacked == other && othStacked == object;
        }
        var result = true;
        stack.set(object, other);
        stack.set(other, object);
        var skipCtor = isPartial;
        while (++index < objLength) {
          key = objProps[index];
          var objValue = object[key], othValue = other[key];
          if (customizer) {
            var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
          }
          if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
            result = false;
            break;
          }
          skipCtor || (skipCtor = key == "constructor");
        }
        if (result && !skipCtor) {
          var objCtor = object.constructor, othCtor = other.constructor;
          if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
            result = false;
          }
        }
        stack["delete"](object);
        stack["delete"](other);
        return result;
      }
      module.exports = equalObjects;
    }
  });

  // node_modules/lodash/_DataView.js
  var require_DataView = __commonJS({
    "node_modules/lodash/_DataView.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var DataView2 = getNative(root, "DataView");
      module.exports = DataView2;
    }
  });

  // node_modules/lodash/_Promise.js
  var require_Promise = __commonJS({
    "node_modules/lodash/_Promise.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var Promise2 = getNative(root, "Promise");
      module.exports = Promise2;
    }
  });

  // node_modules/lodash/_Set.js
  var require_Set = __commonJS({
    "node_modules/lodash/_Set.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var Set2 = getNative(root, "Set");
      module.exports = Set2;
    }
  });

  // node_modules/lodash/_WeakMap.js
  var require_WeakMap = __commonJS({
    "node_modules/lodash/_WeakMap.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var WeakMap2 = getNative(root, "WeakMap");
      module.exports = WeakMap2;
    }
  });

  // node_modules/lodash/_getTag.js
  var require_getTag = __commonJS({
    "node_modules/lodash/_getTag.js"(exports, module) {
      var DataView2 = require_DataView();
      var Map2 = require_Map();
      var Promise2 = require_Promise();
      var Set2 = require_Set();
      var WeakMap2 = require_WeakMap();
      var baseGetTag = require_baseGetTag();
      var toSource = require_toSource();
      var mapTag = "[object Map]";
      var objectTag = "[object Object]";
      var promiseTag = "[object Promise]";
      var setTag = "[object Set]";
      var weakMapTag = "[object WeakMap]";
      var dataViewTag = "[object DataView]";
      var dataViewCtorString = toSource(DataView2);
      var mapCtorString = toSource(Map2);
      var promiseCtorString = toSource(Promise2);
      var setCtorString = toSource(Set2);
      var weakMapCtorString = toSource(WeakMap2);
      var getTag = baseGetTag;
      if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
        getTag = function(value) {
          var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
          if (ctorString) {
            switch (ctorString) {
              case dataViewCtorString:
                return dataViewTag;
              case mapCtorString:
                return mapTag;
              case promiseCtorString:
                return promiseTag;
              case setCtorString:
                return setTag;
              case weakMapCtorString:
                return weakMapTag;
            }
          }
          return result;
        };
      }
      module.exports = getTag;
    }
  });

  // node_modules/lodash/_baseIsEqualDeep.js
  var require_baseIsEqualDeep = __commonJS({
    "node_modules/lodash/_baseIsEqualDeep.js"(exports, module) {
      var Stack = require_Stack();
      var equalArrays = require_equalArrays();
      var equalByTag = require_equalByTag();
      var equalObjects = require_equalObjects();
      var getTag = require_getTag();
      var isArray = require_isArray();
      var isBuffer = require_isBuffer();
      var isTypedArray = require_isTypedArray();
      var COMPARE_PARTIAL_FLAG = 1;
      var argsTag = "[object Arguments]";
      var arrayTag = "[object Array]";
      var objectTag = "[object Object]";
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
        var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
        objTag = objTag == argsTag ? objectTag : objTag;
        othTag = othTag == argsTag ? objectTag : othTag;
        var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
        if (isSameTag && isBuffer(object)) {
          if (!isBuffer(other)) {
            return false;
          }
          objIsArr = true;
          objIsObj = false;
        }
        if (isSameTag && !objIsObj) {
          stack || (stack = new Stack());
          return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
        }
        if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
          var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
          if (objIsWrapped || othIsWrapped) {
            var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
            stack || (stack = new Stack());
            return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
          }
        }
        if (!isSameTag) {
          return false;
        }
        stack || (stack = new Stack());
        return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
      }
      module.exports = baseIsEqualDeep;
    }
  });

  // node_modules/lodash/_baseIsEqual.js
  var require_baseIsEqual = __commonJS({
    "node_modules/lodash/_baseIsEqual.js"(exports, module) {
      var baseIsEqualDeep = require_baseIsEqualDeep();
      var isObjectLike = require_isObjectLike();
      function baseIsEqual(value, other, bitmask, customizer, stack) {
        if (value === other) {
          return true;
        }
        if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
          return value !== value && other !== other;
        }
        return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
      }
      module.exports = baseIsEqual;
    }
  });

  // node_modules/lodash/isEqual.js
  var require_isEqual = __commonJS({
    "node_modules/lodash/isEqual.js"(exports, module) {
      var baseIsEqual = require_baseIsEqual();
      function isEqual12(value, other) {
        return baseIsEqual(value, other);
      }
      module.exports = isEqual12;
    }
  });

  // node_modules/lodash/isEqualWith.js
  var require_isEqualWith = __commonJS({
    "node_modules/lodash/isEqualWith.js"(exports, module) {
      var baseIsEqual = require_baseIsEqual();
      function isEqualWith2(value, other, customizer) {
        customizer = typeof customizer == "function" ? customizer : void 0;
        var result = customizer ? customizer(value, other) : void 0;
        return result === void 0 ? baseIsEqual(value, other, void 0, customizer) : !!result;
      }
      module.exports = isEqualWith2;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/createIcon.js
  var require_createIcon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/createIcon.js"(exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", { value: true });
      exports.createIcon = exports.getSize = exports.IconSize = void 0;
      var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
      var React395 = tslib_1.__importStar(require_react());
      var IconSize2;
      (function(IconSize3) {
        IconSize3["sm"] = "sm";
        IconSize3["md"] = "md";
        IconSize3["lg"] = "lg";
        IconSize3["xl"] = "xl";
      })(IconSize2 = exports.IconSize || (exports.IconSize = {}));
      var getSize2 = (size) => {
        switch (size) {
          case IconSize2.sm:
            return "1em";
          case IconSize2.md:
            return "1.5em";
          case IconSize2.lg:
            return "2em";
          case IconSize2.xl:
            return "3em";
          default:
            return "1em";
        }
      };
      exports.getSize = getSize2;
      var currentId4 = 0;
      function createIcon2({ name: name2, xOffset = 0, yOffset = 0, width, height, svgPath }) {
        var _a;
        return _a = class SVGIcon extends React395.Component {
          constructor() {
            super(...arguments);
            this.id = `icon-title-${currentId4++}`;
          }
          render() {
            const _a2 = this.props, { size, color: color2, title, noVerticalAlign } = _a2, props = tslib_1.__rest(_a2, ["size", "color", "title", "noVerticalAlign"]);
            const hasTitle = Boolean(title);
            const heightWidth = (0, exports.getSize)(size);
            const baseAlign = -0.125 * Number.parseFloat(heightWidth);
            const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
            const viewBox = [xOffset, yOffset, width, height].join(" ");
            return React395.createElement(
              "svg",
              Object.assign({ style, fill: color2, height: heightWidth, width: heightWidth, viewBox, "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img" }, props),
              hasTitle && React395.createElement("title", { id: this.id }, title),
              React395.createElement("path", { d: svgPath })
            );
          }
        }, _a.displayName = name2, _a.defaultProps = {
          color: "currentColor",
          size: IconSize2.sm,
          noVerticalAlign: false
        }, _a;
      }
      exports.createIcon = createIcon2;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/outlined-question-circle-icon.js
  var require_outlined_question_circle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/outlined-question-circle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.OutlinedQuestionCircleIconConfig = {
        name: "OutlinedQuestionCircleIcon",
        height: 512,
        width: 512,
        svgPath: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z",
        yOffset: 0,
        xOffset: 0
      };
      exports.OutlinedQuestionCircleIcon = require_createIcon().createIcon(exports.OutlinedQuestionCircleIconConfig);
      exports["default"] = exports.OutlinedQuestionCircleIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/trash-alt-icon.js
  var require_trash_alt_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/trash-alt-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.TrashAltIconConfig = {
        name: "TrashAltIcon",
        height: 512,
        width: 448,
        svgPath: "M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",
        yOffset: 0,
        xOffset: 0
      };
      exports.TrashAltIcon = require_createIcon().createIcon(exports.TrashAltIconConfig);
      exports["default"] = exports.TrashAltIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/arrow-right-icon.js
  var require_arrow_right_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/arrow-right-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.ArrowRightIconConfig = {
        name: "ArrowRightIcon",
        height: 512,
        width: 448,
        svgPath: "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z",
        yOffset: 0,
        xOffset: 0
      };
      exports.ArrowRightIcon = require_createIcon().createIcon(exports.ArrowRightIconConfig);
      exports["default"] = exports.ArrowRightIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/exclamation-circle-icon.js
  var require_exclamation_circle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/exclamation-circle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.ExclamationCircleIconConfig = {
        name: "ExclamationCircleIcon",
        height: 512,
        width: 512,
        svgPath: "M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
        yOffset: 0,
        xOffset: 0
      };
      exports.ExclamationCircleIcon = require_createIcon().createIcon(exports.ExclamationCircleIconConfig);
      exports["default"] = exports.ExclamationCircleIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/plus-icon.js
  var require_plus_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/plus-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.PlusIconConfig = {
        name: "PlusIcon",
        height: 512,
        width: 448,
        svgPath: "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",
        yOffset: 0,
        xOffset: 0
      };
      exports.PlusIcon = require_createIcon().createIcon(exports.PlusIconConfig);
      exports["default"] = exports.PlusIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon.js
  var require_exclamation_triangle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.ExclamationTriangleIconConfig = {
        name: "ExclamationTriangleIcon",
        height: 512,
        width: 576,
        svgPath: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
        yOffset: 0,
        xOffset: 0
      };
      exports.ExclamationTriangleIcon = require_createIcon().createIcon(exports.ExclamationTriangleIconConfig);
      exports["default"] = exports.ExclamationTriangleIcon;
    }
  });

  // node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
  var require_hoist_non_react_statics_cjs = __commonJS({
    "node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) {
      "use strict";
      var reactIs = require_react_is();
      var REACT_STATICS = {
        childContextTypes: true,
        contextType: true,
        contextTypes: true,
        defaultProps: true,
        displayName: true,
        getDefaultProps: true,
        getDerivedStateFromError: true,
        getDerivedStateFromProps: true,
        mixins: true,
        propTypes: true,
        type: true
      };
      var KNOWN_STATICS = {
        name: true,
        length: true,
        prototype: true,
        caller: true,
        callee: true,
        arguments: true,
        arity: true
      };
      var FORWARD_REF_STATICS = {
        "$$typeof": true,
        render: true,
        defaultProps: true,
        displayName: true,
        propTypes: true
      };
      var MEMO_STATICS = {
        "$$typeof": true,
        compare: true,
        defaultProps: true,
        displayName: true,
        propTypes: true,
        type: true
      };
      var TYPE_STATICS = {};
      TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
      TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
      function getStatics(component) {
        if (reactIs.isMemo(component)) {
          return MEMO_STATICS;
        }
        return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
      }
      var defineProperty = Object.defineProperty;
      var getOwnPropertyNames = Object.getOwnPropertyNames;
      var getOwnPropertySymbols = Object.getOwnPropertySymbols;
      var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      var getPrototypeOf = Object.getPrototypeOf;
      var objectPrototype = Object.prototype;
      function hoistNonReactStatics10(targetComponent, sourceComponent, blacklist) {
        if (typeof sourceComponent !== "string") {
          if (objectPrototype) {
            var inheritedComponent = getPrototypeOf(sourceComponent);
            if (inheritedComponent && inheritedComponent !== objectPrototype) {
              hoistNonReactStatics10(targetComponent, inheritedComponent, blacklist);
            }
          }
          var keys = getOwnPropertyNames(sourceComponent);
          if (getOwnPropertySymbols) {
            keys = keys.concat(getOwnPropertySymbols(sourceComponent));
          }
          var targetStatics = getStatics(targetComponent);
          var sourceStatics = getStatics(sourceComponent);
          for (var i = 0; i < keys.length; ++i) {
            var key = keys[i];
            if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
              var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
              try {
                defineProperty(targetComponent, key, descriptor);
              } catch (e) {
              }
            }
          }
        }
        return targetComponent;
      }
      module.exports = hoistNonReactStatics10;
    }
  });

  // node_modules/lodash/isEmpty.js
  var require_isEmpty = __commonJS({
    "node_modules/lodash/isEmpty.js"(exports, module) {
      var baseKeys = require_baseKeys();
      var getTag = require_getTag();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isArrayLike = require_isArrayLike();
      var isBuffer = require_isBuffer();
      var isPrototype = require_isPrototype();
      var isTypedArray = require_isTypedArray();
      var mapTag = "[object Map]";
      var setTag = "[object Set]";
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function isEmpty(value) {
        if (value == null) {
          return true;
        }
        if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
          return !value.length;
        }
        var tag = getTag(value);
        if (tag == mapTag || tag == setTag) {
          return !value.size;
        }
        if (isPrototype(value)) {
          return !baseKeys(value).length;
        }
        for (var key in value) {
          if (hasOwnProperty.call(value, key)) {
            return false;
          }
        }
        return true;
      }
      module.exports = isEmpty;
    }
  });

  // node_modules/lodash/assign.js
  var require_assign = __commonJS({
    "node_modules/lodash/assign.js"(exports, module) {
      var assignValue = require_assignValue();
      var copyObject = require_copyObject();
      var createAssigner = require_createAssigner();
      var isArrayLike = require_isArrayLike();
      var isPrototype = require_isPrototype();
      var keys = require_keys();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var assign = createAssigner(function(object, source) {
        if (isPrototype(source) || isArrayLike(source)) {
          copyObject(source, keys(source), object);
          return;
        }
        for (var key in source) {
          if (hasOwnProperty.call(source, key)) {
            assignValue(object, key, source[key]);
          }
        }
      });
      module.exports = assign;
    }
  });

  // node_modules/lodash/defaults.js
  var require_defaults = __commonJS({
    "node_modules/lodash/defaults.js"(exports, module) {
      var baseRest = require_baseRest();
      var eq = require_eq();
      var isIterateeCall = require_isIterateeCall();
      var keysIn = require_keysIn();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var defaults3 = baseRest(function(object, sources) {
        object = Object(object);
        var index = -1;
        var length = sources.length;
        var guard = length > 2 ? sources[2] : void 0;
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          length = 1;
        }
        while (++index < length) {
          var source = sources[index];
          var props = keysIn(source);
          var propsIndex = -1;
          var propsLength = props.length;
          while (++propsIndex < propsLength) {
            var key = props[propsIndex];
            var value = object[key];
            if (value === void 0 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
              object[key] = source[key];
            }
          }
        }
        return object;
      });
      module.exports = defaults3;
    }
  });

  // node_modules/lodash/_arrayMap.js
  var require_arrayMap = __commonJS({
    "node_modules/lodash/_arrayMap.js"(exports, module) {
      function arrayMap(array, iteratee) {
        var index = -1, length = array == null ? 0 : array.length, result = Array(length);
        while (++index < length) {
          result[index] = iteratee(array[index], index, array);
        }
        return result;
      }
      module.exports = arrayMap;
    }
  });

  // node_modules/lodash/isSymbol.js
  var require_isSymbol = __commonJS({
    "node_modules/lodash/isSymbol.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var symbolTag = "[object Symbol]";
      function isSymbol(value) {
        return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
      }
      module.exports = isSymbol;
    }
  });

  // node_modules/lodash/_isKey.js
  var require_isKey = __commonJS({
    "node_modules/lodash/_isKey.js"(exports, module) {
      var isArray = require_isArray();
      var isSymbol = require_isSymbol();
      var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
      var reIsPlainProp = /^\w*$/;
      function isKey(value, object) {
        if (isArray(value)) {
          return false;
        }
        var type = typeof value;
        if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
          return true;
        }
        return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
      }
      module.exports = isKey;
    }
  });

  // node_modules/lodash/memoize.js
  var require_memoize = __commonJS({
    "node_modules/lodash/memoize.js"(exports, module) {
      var MapCache = require_MapCache();
      var FUNC_ERROR_TEXT = "Expected a function";
      function memoize(func, resolver) {
        if (typeof func != "function" || resolver != null && typeof resolver != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        var memoized = function() {
          var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
          if (cache.has(key)) {
            return cache.get(key);
          }
          var result = func.apply(this, args);
          memoized.cache = cache.set(key, result) || cache;
          return result;
        };
        memoized.cache = new (memoize.Cache || MapCache)();
        return memoized;
      }
      memoize.Cache = MapCache;
      module.exports = memoize;
    }
  });

  // node_modules/lodash/_memoizeCapped.js
  var require_memoizeCapped = __commonJS({
    "node_modules/lodash/_memoizeCapped.js"(exports, module) {
      var memoize = require_memoize();
      var MAX_MEMOIZE_SIZE = 500;
      function memoizeCapped(func) {
        var result = memoize(func, function(key) {
          if (cache.size === MAX_MEMOIZE_SIZE) {
            cache.clear();
          }
          return key;
        });
        var cache = result.cache;
        return result;
      }
      module.exports = memoizeCapped;
    }
  });

  // node_modules/lodash/_stringToPath.js
  var require_stringToPath = __commonJS({
    "node_modules/lodash/_stringToPath.js"(exports, module) {
      var memoizeCapped = require_memoizeCapped();
      var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
      var reEscapeChar = /\\(\\)?/g;
      var stringToPath = memoizeCapped(function(string) {
        var result = [];
        if (string.charCodeAt(0) === 46) {
          result.push("");
        }
        string.replace(rePropName, function(match, number4, quote, subString) {
          result.push(quote ? subString.replace(reEscapeChar, "$1") : number4 || match);
        });
        return result;
      });
      module.exports = stringToPath;
    }
  });

  // node_modules/lodash/_baseToString.js
  var require_baseToString = __commonJS({
    "node_modules/lodash/_baseToString.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var arrayMap = require_arrayMap();
      var isArray = require_isArray();
      var isSymbol = require_isSymbol();
      var INFINITY = 1 / 0;
      var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
      var symbolToString = symbolProto ? symbolProto.toString : void 0;
      function baseToString(value) {
        if (typeof value == "string") {
          return value;
        }
        if (isArray(value)) {
          return arrayMap(value, baseToString) + "";
        }
        if (isSymbol(value)) {
          return symbolToString ? symbolToString.call(value) : "";
        }
        var result = value + "";
        return result == "0" && 1 / value == -INFINITY ? "-0" : result;
      }
      module.exports = baseToString;
    }
  });

  // node_modules/lodash/toString.js
  var require_toString = __commonJS({
    "node_modules/lodash/toString.js"(exports, module) {
      var baseToString = require_baseToString();
      function toString(value) {
        return value == null ? "" : baseToString(value);
      }
      module.exports = toString;
    }
  });

  // node_modules/lodash/_castPath.js
  var require_castPath = __commonJS({
    "node_modules/lodash/_castPath.js"(exports, module) {
      var isArray = require_isArray();
      var isKey = require_isKey();
      var stringToPath = require_stringToPath();
      var toString = require_toString();
      function castPath(value, object) {
        if (isArray(value)) {
          return value;
        }
        return isKey(value, object) ? [value] : stringToPath(toString(value));
      }
      module.exports = castPath;
    }
  });

  // node_modules/lodash/_toKey.js
  var require_toKey = __commonJS({
    "node_modules/lodash/_toKey.js"(exports, module) {
      var isSymbol = require_isSymbol();
      var INFINITY = 1 / 0;
      function toKey(value) {
        if (typeof value == "string" || isSymbol(value)) {
          return value;
        }
        var result = value + "";
        return result == "0" && 1 / value == -INFINITY ? "-0" : result;
      }
      module.exports = toKey;
    }
  });

  // node_modules/lodash/_baseGet.js
  var require_baseGet = __commonJS({
    "node_modules/lodash/_baseGet.js"(exports, module) {
      var castPath = require_castPath();
      var toKey = require_toKey();
      function baseGet(object, path2) {
        path2 = castPath(path2, object);
        var index = 0, length = path2.length;
        while (object != null && index < length) {
          object = object[toKey(path2[index++])];
        }
        return index && index == length ? object : void 0;
      }
      module.exports = baseGet;
    }
  });

  // node_modules/lodash/_baseIsMatch.js
  var require_baseIsMatch = __commonJS({
    "node_modules/lodash/_baseIsMatch.js"(exports, module) {
      var Stack = require_Stack();
      var baseIsEqual = require_baseIsEqual();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      function baseIsMatch(object, source, matchData, customizer) {
        var index = matchData.length, length = index, noCustomizer = !customizer;
        if (object == null) {
          return !length;
        }
        object = Object(object);
        while (index--) {
          var data = matchData[index];
          if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
            return false;
          }
        }
        while (++index < length) {
          data = matchData[index];
          var key = data[0], objValue = object[key], srcValue = data[1];
          if (noCustomizer && data[2]) {
            if (objValue === void 0 && !(key in object)) {
              return false;
            }
          } else {
            var stack = new Stack();
            if (customizer) {
              var result = customizer(objValue, srcValue, key, object, source, stack);
            }
            if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
              return false;
            }
          }
        }
        return true;
      }
      module.exports = baseIsMatch;
    }
  });

  // node_modules/lodash/_isStrictComparable.js
  var require_isStrictComparable = __commonJS({
    "node_modules/lodash/_isStrictComparable.js"(exports, module) {
      var isObject = require_isObject();
      function isStrictComparable(value) {
        return value === value && !isObject(value);
      }
      module.exports = isStrictComparable;
    }
  });

  // node_modules/lodash/_getMatchData.js
  var require_getMatchData = __commonJS({
    "node_modules/lodash/_getMatchData.js"(exports, module) {
      var isStrictComparable = require_isStrictComparable();
      var keys = require_keys();
      function getMatchData(object) {
        var result = keys(object), length = result.length;
        while (length--) {
          var key = result[length], value = object[key];
          result[length] = [key, value, isStrictComparable(value)];
        }
        return result;
      }
      module.exports = getMatchData;
    }
  });

  // node_modules/lodash/_matchesStrictComparable.js
  var require_matchesStrictComparable = __commonJS({
    "node_modules/lodash/_matchesStrictComparable.js"(exports, module) {
      function matchesStrictComparable(key, srcValue) {
        return function(object) {
          if (object == null) {
            return false;
          }
          return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
        };
      }
      module.exports = matchesStrictComparable;
    }
  });

  // node_modules/lodash/_baseMatches.js
  var require_baseMatches = __commonJS({
    "node_modules/lodash/_baseMatches.js"(exports, module) {
      var baseIsMatch = require_baseIsMatch();
      var getMatchData = require_getMatchData();
      var matchesStrictComparable = require_matchesStrictComparable();
      function baseMatches(source) {
        var matchData = getMatchData(source);
        if (matchData.length == 1 && matchData[0][2]) {
          return matchesStrictComparable(matchData[0][0], matchData[0][1]);
        }
        return function(object) {
          return object === source || baseIsMatch(object, source, matchData);
        };
      }
      module.exports = baseMatches;
    }
  });

  // node_modules/lodash/get.js
  var require_get = __commonJS({
    "node_modules/lodash/get.js"(exports, module) {
      var baseGet = require_baseGet();
      function get(object, path2, defaultValue) {
        var result = object == null ? void 0 : baseGet(object, path2);
        return result === void 0 ? defaultValue : result;
      }
      module.exports = get;
    }
  });

  // node_modules/lodash/_baseHasIn.js
  var require_baseHasIn = __commonJS({
    "node_modules/lodash/_baseHasIn.js"(exports, module) {
      function baseHasIn(object, key) {
        return object != null && key in Object(object);
      }
      module.exports = baseHasIn;
    }
  });

  // node_modules/lodash/_hasPath.js
  var require_hasPath = __commonJS({
    "node_modules/lodash/_hasPath.js"(exports, module) {
      var castPath = require_castPath();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isIndex = require_isIndex();
      var isLength = require_isLength();
      var toKey = require_toKey();
      function hasPath(object, path2, hasFunc) {
        path2 = castPath(path2, object);
        var index = -1, length = path2.length, result = false;
        while (++index < length) {
          var key = toKey(path2[index]);
          if (!(result = object != null && hasFunc(object, key))) {
            break;
          }
          object = object[key];
        }
        if (result || ++index != length) {
          return result;
        }
        length = object == null ? 0 : object.length;
        return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
      }
      module.exports = hasPath;
    }
  });

  // node_modules/lodash/hasIn.js
  var require_hasIn = __commonJS({
    "node_modules/lodash/hasIn.js"(exports, module) {
      var baseHasIn = require_baseHasIn();
      var hasPath = require_hasPath();
      function hasIn(object, path2) {
        return object != null && hasPath(object, path2, baseHasIn);
      }
      module.exports = hasIn;
    }
  });

  // node_modules/lodash/_baseMatchesProperty.js
  var require_baseMatchesProperty = __commonJS({
    "node_modules/lodash/_baseMatchesProperty.js"(exports, module) {
      var baseIsEqual = require_baseIsEqual();
      var get = require_get();
      var hasIn = require_hasIn();
      var isKey = require_isKey();
      var isStrictComparable = require_isStrictComparable();
      var matchesStrictComparable = require_matchesStrictComparable();
      var toKey = require_toKey();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      function baseMatchesProperty(path2, srcValue) {
        if (isKey(path2) && isStrictComparable(srcValue)) {
          return matchesStrictComparable(toKey(path2), srcValue);
        }
        return function(object) {
          var objValue = get(object, path2);
          return objValue === void 0 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
        };
      }
      module.exports = baseMatchesProperty;
    }
  });

  // node_modules/lodash/_baseProperty.js
  var require_baseProperty = __commonJS({
    "node_modules/lodash/_baseProperty.js"(exports, module) {
      function baseProperty(key) {
        return function(object) {
          return object == null ? void 0 : object[key];
        };
      }
      module.exports = baseProperty;
    }
  });

  // node_modules/lodash/_basePropertyDeep.js
  var require_basePropertyDeep = __commonJS({
    "node_modules/lodash/_basePropertyDeep.js"(exports, module) {
      var baseGet = require_baseGet();
      function basePropertyDeep(path2) {
        return function(object) {
          return baseGet(object, path2);
        };
      }
      module.exports = basePropertyDeep;
    }
  });

  // node_modules/lodash/property.js
  var require_property = __commonJS({
    "node_modules/lodash/property.js"(exports, module) {
      var baseProperty = require_baseProperty();
      var basePropertyDeep = require_basePropertyDeep();
      var isKey = require_isKey();
      var toKey = require_toKey();
      function property(path2) {
        return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2);
      }
      module.exports = property;
    }
  });

  // node_modules/lodash/_baseIteratee.js
  var require_baseIteratee = __commonJS({
    "node_modules/lodash/_baseIteratee.js"(exports, module) {
      var baseMatches = require_baseMatches();
      var baseMatchesProperty = require_baseMatchesProperty();
      var identity3 = require_identity();
      var isArray = require_isArray();
      var property = require_property();
      function baseIteratee(value) {
        if (typeof value == "function") {
          return value;
        }
        if (value == null) {
          return identity3;
        }
        if (typeof value == "object") {
          return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
        }
        return property(value);
      }
      module.exports = baseIteratee;
    }
  });

  // node_modules/lodash/_baseForOwn.js
  var require_baseForOwn = __commonJS({
    "node_modules/lodash/_baseForOwn.js"(exports, module) {
      var baseFor = require_baseFor();
      var keys = require_keys();
      function baseForOwn(object, iteratee) {
        return object && baseFor(object, iteratee, keys);
      }
      module.exports = baseForOwn;
    }
  });

  // node_modules/lodash/_createBaseEach.js
  var require_createBaseEach = __commonJS({
    "node_modules/lodash/_createBaseEach.js"(exports, module) {
      var isArrayLike = require_isArrayLike();
      function createBaseEach(eachFunc, fromRight) {
        return function(collection, iteratee) {
          if (collection == null) {
            return collection;
          }
          if (!isArrayLike(collection)) {
            return eachFunc(collection, iteratee);
          }
          var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
          while (fromRight ? index-- : ++index < length) {
            if (iteratee(iterable[index], index, iterable) === false) {
              break;
            }
          }
          return collection;
        };
      }
      module.exports = createBaseEach;
    }
  });

  // node_modules/lodash/_baseEach.js
  var require_baseEach = __commonJS({
    "node_modules/lodash/_baseEach.js"(exports, module) {
      var baseForOwn = require_baseForOwn();
      var createBaseEach = require_createBaseEach();
      var baseEach = createBaseEach(baseForOwn);
      module.exports = baseEach;
    }
  });

  // node_modules/lodash/_baseMap.js
  var require_baseMap = __commonJS({
    "node_modules/lodash/_baseMap.js"(exports, module) {
      var baseEach = require_baseEach();
      var isArrayLike = require_isArrayLike();
      function baseMap(collection, iteratee) {
        var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
        baseEach(collection, function(value, key, collection2) {
          result[++index] = iteratee(value, key, collection2);
        });
        return result;
      }
      module.exports = baseMap;
    }
  });

  // node_modules/lodash/_baseSortBy.js
  var require_baseSortBy = __commonJS({
    "node_modules/lodash/_baseSortBy.js"(exports, module) {
      function baseSortBy(array, comparer) {
        var length = array.length;
        array.sort(comparer);
        while (length--) {
          array[length] = array[length].value;
        }
        return array;
      }
      module.exports = baseSortBy;
    }
  });

  // node_modules/lodash/_compareAscending.js
  var require_compareAscending = __commonJS({
    "node_modules/lodash/_compareAscending.js"(exports, module) {
      var isSymbol = require_isSymbol();
      function compareAscending(value, other) {
        if (value !== other) {
          var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
          var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
          if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
            return 1;
          }
          if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
            return -1;
          }
        }
        return 0;
      }
      module.exports = compareAscending;
    }
  });

  // node_modules/lodash/_compareMultiple.js
  var require_compareMultiple = __commonJS({
    "node_modules/lodash/_compareMultiple.js"(exports, module) {
      var compareAscending = require_compareAscending();
      function compareMultiple(object, other, orders) {
        var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
        while (++index < length) {
          var result = compareAscending(objCriteria[index], othCriteria[index]);
          if (result) {
            if (index >= ordersLength) {
              return result;
            }
            var order2 = orders[index];
            return result * (order2 == "desc" ? -1 : 1);
          }
        }
        return object.index - other.index;
      }
      module.exports = compareMultiple;
    }
  });

  // node_modules/lodash/_baseOrderBy.js
  var require_baseOrderBy = __commonJS({
    "node_modules/lodash/_baseOrderBy.js"(exports, module) {
      var arrayMap = require_arrayMap();
      var baseGet = require_baseGet();
      var baseIteratee = require_baseIteratee();
      var baseMap = require_baseMap();
      var baseSortBy = require_baseSortBy();
      var baseUnary = require_baseUnary();
      var compareMultiple = require_compareMultiple();
      var identity3 = require_identity();
      var isArray = require_isArray();
      function baseOrderBy(collection, iteratees, orders) {
        if (iteratees.length) {
          iteratees = arrayMap(iteratees, function(iteratee) {
            if (isArray(iteratee)) {
              return function(value) {
                return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
              };
            }
            return iteratee;
          });
        } else {
          iteratees = [identity3];
        }
        var index = -1;
        iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
        var result = baseMap(collection, function(value, key, collection2) {
          var criteria = arrayMap(iteratees, function(iteratee) {
            return iteratee(value);
          });
          return { "criteria": criteria, "index": ++index, "value": value };
        });
        return baseSortBy(result, function(object, other) {
          return compareMultiple(object, other, orders);
        });
      }
      module.exports = baseOrderBy;
    }
  });

  // node_modules/lodash/orderBy.js
  var require_orderBy = __commonJS({
    "node_modules/lodash/orderBy.js"(exports, module) {
      var baseOrderBy = require_baseOrderBy();
      var isArray = require_isArray();
      function orderBy(collection, iteratees, orders, guard) {
        if (collection == null) {
          return [];
        }
        if (!isArray(iteratees)) {
          iteratees = iteratees == null ? [] : [iteratees];
        }
        orders = guard ? void 0 : orders;
        if (!isArray(orders)) {
          orders = orders == null ? [] : [orders];
        }
        return baseOrderBy(collection, iteratees, orders);
      }
      module.exports = orderBy;
    }
  });

  // node_modules/react-fast-compare/index.js
  var require_react_fast_compare = __commonJS({
    "node_modules/react-fast-compare/index.js"(exports, module) {
      var hasElementType = typeof Element !== "undefined";
      var hasMap = typeof Map === "function";
      var hasSet = typeof Set === "function";
      var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
      function equal(a2, b) {
        if (a2 === b)
          return true;
        if (a2 && b && typeof a2 == "object" && typeof b == "object") {
          if (a2.constructor !== b.constructor)
            return false;
          var length, i, keys;
          if (Array.isArray(a2)) {
            length = a2.length;
            if (length != b.length)
              return false;
            for (i = length; i-- !== 0; )
              if (!equal(a2[i], b[i]))
                return false;
            return true;
          }
          var it;
          if (hasMap && a2 instanceof Map && b instanceof Map) {
            if (a2.size !== b.size)
              return false;
            it = a2.entries();
            while (!(i = it.next()).done)
              if (!b.has(i.value[0]))
                return false;
            it = a2.entries();
            while (!(i = it.next()).done)
              if (!equal(i.value[1], b.get(i.value[0])))
                return false;
            return true;
          }
          if (hasSet && a2 instanceof Set && b instanceof Set) {
            if (a2.size !== b.size)
              return false;
            it = a2.entries();
            while (!(i = it.next()).done)
              if (!b.has(i.value[0]))
                return false;
            return true;
          }
          if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b)) {
            length = a2.length;
            if (length != b.length)
              return false;
            for (i = length; i-- !== 0; )
              if (a2[i] !== b[i])
                return false;
            return true;
          }
          if (a2.constructor === RegExp)
            return a2.source === b.source && a2.flags === b.flags;
          if (a2.valueOf !== Object.prototype.valueOf && typeof a2.valueOf === "function" && typeof b.valueOf === "function")
            return a2.valueOf() === b.valueOf();
          if (a2.toString !== Object.prototype.toString && typeof a2.toString === "function" && typeof b.toString === "function")
            return a2.toString() === b.toString();
          keys = Object.keys(a2);
          length = keys.length;
          if (length !== Object.keys(b).length)
            return false;
          for (i = length; i-- !== 0; )
            if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
              return false;
          if (hasElementType && a2 instanceof Element)
            return false;
          for (i = length; i-- !== 0; ) {
            if ((keys[i] === "_owner" || keys[i] === "__v" || keys[i] === "__o") && a2.$$typeof) {
              continue;
            }
            if (!equal(a2[keys[i]], b[keys[i]]))
              return false;
          }
          return true;
        }
        return a2 !== a2 && b !== b;
      }
      module.exports = function isEqual12(a2, b) {
        try {
          return equal(a2, b);
        } catch (error) {
          if ((error.message || "").match(/stack|recursion/i)) {
            console.warn("react-fast-compare cannot handle circular refs");
            return false;
          }
          throw error;
        }
      };
    }
  });

  // node_modules/lodash/uniqueId.js
  var require_uniqueId = __commonJS({
    "node_modules/lodash/uniqueId.js"(exports, module) {
      var toString = require_toString();
      var idCounter = 0;
      function uniqueId2(prefix) {
        var id = ++idCounter;
        return toString(prefix) + id;
      }
      module.exports = uniqueId2;
    }
  });

  // node_modules/lodash/_baseIsRegExp.js
  var require_baseIsRegExp = __commonJS({
    "node_modules/lodash/_baseIsRegExp.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var regexpTag = "[object RegExp]";
      function baseIsRegExp(value) {
        return isObjectLike(value) && baseGetTag(value) == regexpTag;
      }
      module.exports = baseIsRegExp;
    }
  });

  // node_modules/lodash/isRegExp.js
  var require_isRegExp = __commonJS({
    "node_modules/lodash/isRegExp.js"(exports, module) {
      var baseIsRegExp = require_baseIsRegExp();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
      var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
      module.exports = isRegExp;
    }
  });

  // node_modules/lodash/_createFind.js
  var require_createFind = __commonJS({
    "node_modules/lodash/_createFind.js"(exports, module) {
      var baseIteratee = require_baseIteratee();
      var isArrayLike = require_isArrayLike();
      var keys = require_keys();
      function createFind(findIndexFunc) {
        return function(collection, predicate, fromIndex) {
          var iterable = Object(collection);
          if (!isArrayLike(collection)) {
            var iteratee = baseIteratee(predicate, 3);
            collection = keys(collection);
            predicate = function(key) {
              return iteratee(iterable[key], key, iterable);
            };
          }
          var index = findIndexFunc(collection, predicate, fromIndex);
          return index > -1 ? iterable[iteratee ? collection[index] : index] : void 0;
        };
      }
      module.exports = createFind;
    }
  });

  // node_modules/lodash/_baseFindIndex.js
  var require_baseFindIndex = __commonJS({
    "node_modules/lodash/_baseFindIndex.js"(exports, module) {
      function baseFindIndex(array, predicate, fromIndex, fromRight) {
        var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
        while (fromRight ? index-- : ++index < length) {
          if (predicate(array[index], index, array)) {
            return index;
          }
        }
        return -1;
      }
      module.exports = baseFindIndex;
    }
  });

  // node_modules/lodash/_trimmedEndIndex.js
  var require_trimmedEndIndex = __commonJS({
    "node_modules/lodash/_trimmedEndIndex.js"(exports, module) {
      var reWhitespace = /\s/;
      function trimmedEndIndex(string) {
        var index = string.length;
        while (index-- && reWhitespace.test(string.charAt(index))) {
        }
        return index;
      }
      module.exports = trimmedEndIndex;
    }
  });

  // node_modules/lodash/_baseTrim.js
  var require_baseTrim = __commonJS({
    "node_modules/lodash/_baseTrim.js"(exports, module) {
      var trimmedEndIndex = require_trimmedEndIndex();
      var reTrimStart = /^\s+/;
      function baseTrim(string) {
        return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
      }
      module.exports = baseTrim;
    }
  });

  // node_modules/lodash/toNumber.js
  var require_toNumber = __commonJS({
    "node_modules/lodash/toNumber.js"(exports, module) {
      var baseTrim = require_baseTrim();
      var isObject = require_isObject();
      var isSymbol = require_isSymbol();
      var NAN = 0 / 0;
      var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
      var reIsBinary = /^0b[01]+$/i;
      var reIsOctal = /^0o[0-7]+$/i;
      var freeParseInt = parseInt;
      function toNumber(value) {
        if (typeof value == "number") {
          return value;
        }
        if (isSymbol(value)) {
          return NAN;
        }
        if (isObject(value)) {
          var other = typeof value.valueOf == "function" ? value.valueOf() : value;
          value = isObject(other) ? other + "" : other;
        }
        if (typeof value != "string") {
          return value === 0 ? value : +value;
        }
        value = baseTrim(value);
        var isBinary = reIsBinary.test(value);
        return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
      }
      module.exports = toNumber;
    }
  });

  // node_modules/lodash/toFinite.js
  var require_toFinite = __commonJS({
    "node_modules/lodash/toFinite.js"(exports, module) {
      var toNumber = require_toNumber();
      var INFINITY = 1 / 0;
      var MAX_INTEGER = 17976931348623157e292;
      function toFinite(value) {
        if (!value) {
          return value === 0 ? value : 0;
        }
        value = toNumber(value);
        if (value === INFINITY || value === -INFINITY) {
          var sign2 = value < 0 ? -1 : 1;
          return sign2 * MAX_INTEGER;
        }
        return value === value ? value : 0;
      }
      module.exports = toFinite;
    }
  });

  // node_modules/lodash/toInteger.js
  var require_toInteger = __commonJS({
    "node_modules/lodash/toInteger.js"(exports, module) {
      var toFinite = require_toFinite();
      function toInteger(value) {
        var result = toFinite(value), remainder = result % 1;
        return result === result ? remainder ? result - remainder : result : 0;
      }
      module.exports = toInteger;
    }
  });

  // node_modules/lodash/findIndex.js
  var require_findIndex = __commonJS({
    "node_modules/lodash/findIndex.js"(exports, module) {
      var baseFindIndex = require_baseFindIndex();
      var baseIteratee = require_baseIteratee();
      var toInteger = require_toInteger();
      var nativeMax = Math.max;
      function findIndex3(array, predicate, fromIndex) {
        var length = array == null ? 0 : array.length;
        if (!length) {
          return -1;
        }
        var index = fromIndex == null ? 0 : toInteger(fromIndex);
        if (index < 0) {
          index = nativeMax(length + index, 0);
        }
        return baseFindIndex(array, baseIteratee(predicate, 3), index);
      }
      module.exports = findIndex3;
    }
  });

  // node_modules/lodash/find.js
  var require_find = __commonJS({
    "node_modules/lodash/find.js"(exports, module) {
      var createFind = require_createFind();
      var findIndex3 = require_findIndex();
      var find = createFind(findIndex3);
      module.exports = find;
    }
  });

  // node_modules/lodash/_baseIsNaN.js
  var require_baseIsNaN = __commonJS({
    "node_modules/lodash/_baseIsNaN.js"(exports, module) {
      function baseIsNaN(value) {
        return value !== value;
      }
      module.exports = baseIsNaN;
    }
  });

  // node_modules/lodash/_strictIndexOf.js
  var require_strictIndexOf = __commonJS({
    "node_modules/lodash/_strictIndexOf.js"(exports, module) {
      function strictIndexOf(array, value, fromIndex) {
        var index = fromIndex - 1, length = array.length;
        while (++index < length) {
          if (array[index] === value) {
            return index;
          }
        }
        return -1;
      }
      module.exports = strictIndexOf;
    }
  });

  // node_modules/lodash/_baseIndexOf.js
  var require_baseIndexOf = __commonJS({
    "node_modules/lodash/_baseIndexOf.js"(exports, module) {
      var baseFindIndex = require_baseFindIndex();
      var baseIsNaN = require_baseIsNaN();
      var strictIndexOf = require_strictIndexOf();
      function baseIndexOf(array, value, fromIndex) {
        return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
      }
      module.exports = baseIndexOf;
    }
  });

  // node_modules/lodash/isString.js
  var require_isString = __commonJS({
    "node_modules/lodash/isString.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isArray = require_isArray();
      var isObjectLike = require_isObjectLike();
      var stringTag = "[object String]";
      function isString(value) {
        return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
      }
      module.exports = isString;
    }
  });

  // node_modules/lodash/_baseValues.js
  var require_baseValues = __commonJS({
    "node_modules/lodash/_baseValues.js"(exports, module) {
      var arrayMap = require_arrayMap();
      function baseValues(object, props) {
        return arrayMap(props, function(key) {
          return object[key];
        });
      }
      module.exports = baseValues;
    }
  });

  // node_modules/lodash/values.js
  var require_values = __commonJS({
    "node_modules/lodash/values.js"(exports, module) {
      var baseValues = require_baseValues();
      var keys = require_keys();
      function values(object) {
        return object == null ? [] : baseValues(object, keys(object));
      }
      module.exports = values;
    }
  });

  // node_modules/lodash/includes.js
  var require_includes = __commonJS({
    "node_modules/lodash/includes.js"(exports, module) {
      var baseIndexOf = require_baseIndexOf();
      var isArrayLike = require_isArrayLike();
      var isString = require_isString();
      var toInteger = require_toInteger();
      var values = require_values();
      var nativeMax = Math.max;
      function includes(collection, value, fromIndex, guard) {
        collection = isArrayLike(collection) ? collection : values(collection);
        fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
        var length = collection.length;
        if (fromIndex < 0) {
          fromIndex = nativeMax(length + fromIndex, 0);
        }
        return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
      }
      module.exports = includes;
    }
  });

  // node_modules/lodash/_baseSet.js
  var require_baseSet = __commonJS({
    "node_modules/lodash/_baseSet.js"(exports, module) {
      var assignValue = require_assignValue();
      var castPath = require_castPath();
      var isIndex = require_isIndex();
      var isObject = require_isObject();
      var toKey = require_toKey();
      function baseSet(object, path2, value, customizer) {
        if (!isObject(object)) {
          return object;
        }
        path2 = castPath(path2, object);
        var index = -1, length = path2.length, lastIndex = length - 1, nested = object;
        while (nested != null && ++index < length) {
          var key = toKey(path2[index]), newValue = value;
          if (key === "__proto__" || key === "constructor" || key === "prototype") {
            return object;
          }
          if (index != lastIndex) {
            var objValue = nested[key];
            newValue = customizer ? customizer(objValue, key, nested) : void 0;
            if (newValue === void 0) {
              newValue = isObject(objValue) ? objValue : isIndex(path2[index + 1]) ? [] : {};
            }
          }
          assignValue(nested, key, newValue);
          nested = nested[key];
        }
        return object;
      }
      module.exports = baseSet;
    }
  });

  // node_modules/lodash/_basePickBy.js
  var require_basePickBy = __commonJS({
    "node_modules/lodash/_basePickBy.js"(exports, module) {
      var baseGet = require_baseGet();
      var baseSet = require_baseSet();
      var castPath = require_castPath();
      function basePickBy(object, paths, predicate) {
        var index = -1, length = paths.length, result = {};
        while (++index < length) {
          var path2 = paths[index], value = baseGet(object, path2);
          if (predicate(value, path2)) {
            baseSet(result, castPath(path2, object), value);
          }
        }
        return result;
      }
      module.exports = basePickBy;
    }
  });

  // node_modules/lodash/_basePick.js
  var require_basePick = __commonJS({
    "node_modules/lodash/_basePick.js"(exports, module) {
      var basePickBy = require_basePickBy();
      var hasIn = require_hasIn();
      function basePick(object, paths) {
        return basePickBy(object, paths, function(value, path2) {
          return hasIn(object, path2);
        });
      }
      module.exports = basePick;
    }
  });

  // node_modules/lodash/_isFlattenable.js
  var require_isFlattenable = __commonJS({
    "node_modules/lodash/_isFlattenable.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var spreadableSymbol = Symbol3 ? Symbol3.isConcatSpreadable : void 0;
      function isFlattenable(value) {
        return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
      }
      module.exports = isFlattenable;
    }
  });

  // node_modules/lodash/_baseFlatten.js
  var require_baseFlatten = __commonJS({
    "node_modules/lodash/_baseFlatten.js"(exports, module) {
      var arrayPush = require_arrayPush();
      var isFlattenable = require_isFlattenable();
      function baseFlatten(array, depth, predicate, isStrict, result) {
        var index = -1, length = array.length;
        predicate || (predicate = isFlattenable);
        result || (result = []);
        while (++index < length) {
          var value = array[index];
          if (depth > 0 && predicate(value)) {
            if (depth > 1) {
              baseFlatten(value, depth - 1, predicate, isStrict, result);
            } else {
              arrayPush(result, value);
            }
          } else if (!isStrict) {
            result[result.length] = value;
          }
        }
        return result;
      }
      module.exports = baseFlatten;
    }
  });

  // node_modules/lodash/flatten.js
  var require_flatten = __commonJS({
    "node_modules/lodash/flatten.js"(exports, module) {
      var baseFlatten = require_baseFlatten();
      function flatten2(array) {
        var length = array == null ? 0 : array.length;
        return length ? baseFlatten(array, 1) : [];
      }
      module.exports = flatten2;
    }
  });

  // node_modules/lodash/_flatRest.js
  var require_flatRest = __commonJS({
    "node_modules/lodash/_flatRest.js"(exports, module) {
      var flatten2 = require_flatten();
      var overRest = require_overRest();
      var setToString = require_setToString();
      function flatRest(func) {
        return setToString(overRest(func, void 0, flatten2), func + "");
      }
      module.exports = flatRest;
    }
  });

  // node_modules/lodash/pick.js
  var require_pick = __commonJS({
    "node_modules/lodash/pick.js"(exports, module) {
      var basePick = require_basePick();
      var flatRest = require_flatRest();
      var pick = flatRest(function(object, paths) {
        return object == null ? {} : basePick(object, paths);
      });
      module.exports = pick;
    }
  });

  // node_modules/lodash/_baseRange.js
  var require_baseRange = __commonJS({
    "node_modules/lodash/_baseRange.js"(exports, module) {
      var nativeCeil = Math.ceil;
      var nativeMax = Math.max;
      function baseRange(start2, end2, step, fromRight) {
        var index = -1, length = nativeMax(nativeCeil((end2 - start2) / (step || 1)), 0), result = Array(length);
        while (length--) {
          result[fromRight ? length : ++index] = start2;
          start2 += step;
        }
        return result;
      }
      module.exports = baseRange;
    }
  });

  // node_modules/lodash/_createRange.js
  var require_createRange = __commonJS({
    "node_modules/lodash/_createRange.js"(exports, module) {
      var baseRange = require_baseRange();
      var isIterateeCall = require_isIterateeCall();
      var toFinite = require_toFinite();
      function createRange(fromRight) {
        return function(start2, end2, step) {
          if (step && typeof step != "number" && isIterateeCall(start2, end2, step)) {
            end2 = step = void 0;
          }
          start2 = toFinite(start2);
          if (end2 === void 0) {
            end2 = start2;
            start2 = 0;
          } else {
            end2 = toFinite(end2);
          }
          step = step === void 0 ? start2 < end2 ? 1 : -1 : toFinite(step);
          return baseRange(start2, end2, step, fromRight);
        };
      }
      module.exports = createRange;
    }
  });

  // node_modules/lodash/range.js
  var require_range = __commonJS({
    "node_modules/lodash/range.js"(exports, module) {
      var createRange = require_createRange();
      var range2 = createRange();
      module.exports = range2;
    }
  });

  // node_modules/lodash/_arrayIncludes.js
  var require_arrayIncludes = __commonJS({
    "node_modules/lodash/_arrayIncludes.js"(exports, module) {
      var baseIndexOf = require_baseIndexOf();
      function arrayIncludes(array, value) {
        var length = array == null ? 0 : array.length;
        return !!length && baseIndexOf(array, value, 0) > -1;
      }
      module.exports = arrayIncludes;
    }
  });

  // node_modules/lodash/_arrayIncludesWith.js
  var require_arrayIncludesWith = __commonJS({
    "node_modules/lodash/_arrayIncludesWith.js"(exports, module) {
      function arrayIncludesWith(array, value, comparator) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          if (comparator(value, array[index])) {
            return true;
          }
        }
        return false;
      }
      module.exports = arrayIncludesWith;
    }
  });

  // node_modules/lodash/_baseDifference.js
  var require_baseDifference = __commonJS({
    "node_modules/lodash/_baseDifference.js"(exports, module) {
      var SetCache = require_SetCache();
      var arrayIncludes = require_arrayIncludes();
      var arrayIncludesWith = require_arrayIncludesWith();
      var arrayMap = require_arrayMap();
      var baseUnary = require_baseUnary();
      var cacheHas = require_cacheHas();
      var LARGE_ARRAY_SIZE = 200;
      function baseDifference(array, values, iteratee, comparator) {
        var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length;
        if (!length) {
          return result;
        }
        if (iteratee) {
          values = arrayMap(values, baseUnary(iteratee));
        }
        if (comparator) {
          includes = arrayIncludesWith;
          isCommon = false;
        } else if (values.length >= LARGE_ARRAY_SIZE) {
          includes = cacheHas;
          isCommon = false;
          values = new SetCache(values);
        }
        outer:
          while (++index < length) {
            var value = array[index], computed = iteratee == null ? value : iteratee(value);
            value = comparator || value !== 0 ? value : 0;
            if (isCommon && computed === computed) {
              var valuesIndex = valuesLength;
              while (valuesIndex--) {
                if (values[valuesIndex] === computed) {
                  continue outer;
                }
              }
              result.push(value);
            } else if (!includes(values, computed, comparator)) {
              result.push(value);
            }
          }
        return result;
      }
      module.exports = baseDifference;
    }
  });

  // node_modules/lodash/without.js
  var require_without = __commonJS({
    "node_modules/lodash/without.js"(exports, module) {
      var baseDifference = require_baseDifference();
      var baseRest = require_baseRest();
      var isArrayLikeObject = require_isArrayLikeObject();
      var without = baseRest(function(array, values) {
        return isArrayLikeObject(array) ? baseDifference(array, values) : [];
      });
      module.exports = without;
    }
  });

  // node_modules/lodash/isNil.js
  var require_isNil = __commonJS({
    "node_modules/lodash/isNil.js"(exports, module) {
      function isNil(value) {
        return value == null;
      }
      module.exports = isNil;
    }
  });

  // node_modules/lodash/difference.js
  var require_difference = __commonJS({
    "node_modules/lodash/difference.js"(exports, module) {
      var baseDifference = require_baseDifference();
      var baseFlatten = require_baseFlatten();
      var baseRest = require_baseRest();
      var isArrayLikeObject = require_isArrayLikeObject();
      var difference = baseRest(function(array, values) {
        return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
      });
      module.exports = difference;
    }
  });

  // node_modules/lodash/noop.js
  var require_noop = __commonJS({
    "node_modules/lodash/noop.js"(exports, module) {
      function noop4() {
      }
      module.exports = noop4;
    }
  });

  // node_modules/lodash/_createSet.js
  var require_createSet = __commonJS({
    "node_modules/lodash/_createSet.js"(exports, module) {
      var Set2 = require_Set();
      var noop4 = require_noop();
      var setToArray = require_setToArray();
      var INFINITY = 1 / 0;
      var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop4 : function(values) {
        return new Set2(values);
      };
      module.exports = createSet;
    }
  });

  // node_modules/lodash/_baseUniq.js
  var require_baseUniq = __commonJS({
    "node_modules/lodash/_baseUniq.js"(exports, module) {
      var SetCache = require_SetCache();
      var arrayIncludes = require_arrayIncludes();
      var arrayIncludesWith = require_arrayIncludesWith();
      var cacheHas = require_cacheHas();
      var createSet = require_createSet();
      var setToArray = require_setToArray();
      var LARGE_ARRAY_SIZE = 200;
      function baseUniq(array, iteratee, comparator) {
        var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
        if (comparator) {
          isCommon = false;
          includes = arrayIncludesWith;
        } else if (length >= LARGE_ARRAY_SIZE) {
          var set = iteratee ? null : createSet(array);
          if (set) {
            return setToArray(set);
          }
          isCommon = false;
          includes = cacheHas;
          seen = new SetCache();
        } else {
          seen = iteratee ? [] : result;
        }
        outer:
          while (++index < length) {
            var value = array[index], computed = iteratee ? iteratee(value) : value;
            value = comparator || value !== 0 ? value : 0;
            if (isCommon && computed === computed) {
              var seenIndex = seen.length;
              while (seenIndex--) {
                if (seen[seenIndex] === computed) {
                  continue outer;
                }
              }
              if (iteratee) {
                seen.push(computed);
              }
              result.push(value);
            } else if (!includes(seen, computed, comparator)) {
              if (seen !== result) {
                seen.push(computed);
              }
              result.push(value);
            }
          }
        return result;
      }
      module.exports = baseUniq;
    }
  });

  // node_modules/lodash/uniq.js
  var require_uniq = __commonJS({
    "node_modules/lodash/uniq.js"(exports, module) {
      var baseUniq = require_baseUniq();
      function uniq(array) {
        return array && array.length ? baseUniq(array) : [];
      }
      module.exports = uniq;
    }
  });

  // node_modules/lodash/negate.js
  var require_negate = __commonJS({
    "node_modules/lodash/negate.js"(exports, module) {
      var FUNC_ERROR_TEXT = "Expected a function";
      function negate(predicate) {
        if (typeof predicate != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        return function() {
          var args = arguments;
          switch (args.length) {
            case 0:
              return !predicate.call(this);
            case 1:
              return !predicate.call(this, args[0]);
            case 2:
              return !predicate.call(this, args[0], args[1]);
            case 3:
              return !predicate.call(this, args[0], args[1], args[2]);
          }
          return !predicate.apply(this, args);
        };
      }
      module.exports = negate;
    }
  });

  // node_modules/lodash/_getSymbolsIn.js
  var require_getSymbolsIn = __commonJS({
    "node_modules/lodash/_getSymbolsIn.js"(exports, module) {
      var arrayPush = require_arrayPush();
      var getPrototype = require_getPrototype();
      var getSymbols = require_getSymbols();
      var stubArray = require_stubArray();
      var nativeGetSymbols = Object.getOwnPropertySymbols;
      var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
        var result = [];
        while (object) {
          arrayPush(result, getSymbols(object));
          object = getPrototype(object);
        }
        return result;
      };
      module.exports = getSymbolsIn;
    }
  });

  // node_modules/lodash/_getAllKeysIn.js
  var require_getAllKeysIn = __commonJS({
    "node_modules/lodash/_getAllKeysIn.js"(exports, module) {
      var baseGetAllKeys = require_baseGetAllKeys();
      var getSymbolsIn = require_getSymbolsIn();
      var keysIn = require_keysIn();
      function getAllKeysIn(object) {
        return baseGetAllKeys(object, keysIn, getSymbolsIn);
      }
      module.exports = getAllKeysIn;
    }
  });

  // node_modules/lodash/pickBy.js
  var require_pickBy = __commonJS({
    "node_modules/lodash/pickBy.js"(exports, module) {
      var arrayMap = require_arrayMap();
      var baseIteratee = require_baseIteratee();
      var basePickBy = require_basePickBy();
      var getAllKeysIn = require_getAllKeysIn();
      function pickBy(object, predicate) {
        if (object == null) {
          return {};
        }
        var props = arrayMap(getAllKeysIn(object), function(prop) {
          return [prop];
        });
        predicate = baseIteratee(predicate);
        return basePickBy(object, props, function(value, path2) {
          return predicate(value, path2[0]);
        });
      }
      module.exports = pickBy;
    }
  });

  // node_modules/lodash/omitBy.js
  var require_omitBy = __commonJS({
    "node_modules/lodash/omitBy.js"(exports, module) {
      var baseIteratee = require_baseIteratee();
      var negate = require_negate();
      var pickBy = require_pickBy();
      function omitBy(object, predicate) {
        return pickBy(object, negate(baseIteratee(predicate)));
      }
      module.exports = omitBy;
    }
  });

  // node_modules/lodash/_baseInverter.js
  var require_baseInverter = __commonJS({
    "node_modules/lodash/_baseInverter.js"(exports, module) {
      var baseForOwn = require_baseForOwn();
      function baseInverter(object, setter, iteratee, accumulator) {
        baseForOwn(object, function(value, key, object2) {
          setter(accumulator, iteratee(value), key, object2);
        });
        return accumulator;
      }
      module.exports = baseInverter;
    }
  });

  // node_modules/lodash/_createInverter.js
  var require_createInverter = __commonJS({
    "node_modules/lodash/_createInverter.js"(exports, module) {
      var baseInverter = require_baseInverter();
      function createInverter(setter, toIteratee) {
        return function(object, iteratee) {
          return baseInverter(object, setter, toIteratee(iteratee), {});
        };
      }
      module.exports = createInverter;
    }
  });

  // node_modules/lodash/invert.js
  var require_invert = __commonJS({
    "node_modules/lodash/invert.js"(exports, module) {
      var constant = require_constant();
      var createInverter = require_createInverter();
      var identity3 = require_identity();
      var objectProto = Object.prototype;
      var nativeObjectToString = objectProto.toString;
      var invert = createInverter(function(result, value, key) {
        if (value != null && typeof value.toString != "function") {
          value = nativeObjectToString.call(value);
        }
        result[value] = key;
      }, constant(identity3));
      module.exports = invert;
    }
  });

  // node_modules/lodash/_baseIsDate.js
  var require_baseIsDate = __commonJS({
    "node_modules/lodash/_baseIsDate.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var dateTag = "[object Date]";
      function baseIsDate(value) {
        return isObjectLike(value) && baseGetTag(value) == dateTag;
      }
      module.exports = baseIsDate;
    }
  });

  // node_modules/lodash/isDate.js
  var require_isDate = __commonJS({
    "node_modules/lodash/isDate.js"(exports, module) {
      var baseIsDate = require_baseIsDate();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsDate = nodeUtil && nodeUtil.isDate;
      var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
      module.exports = isDate;
    }
  });

  // node_modules/lodash/_baseSortedUniq.js
  var require_baseSortedUniq = __commonJS({
    "node_modules/lodash/_baseSortedUniq.js"(exports, module) {
      var eq = require_eq();
      function baseSortedUniq(array, iteratee) {
        var index = -1, length = array.length, resIndex = 0, result = [];
        while (++index < length) {
          var value = array[index], computed = iteratee ? iteratee(value) : value;
          if (!index || !eq(computed, seen)) {
            var seen = computed;
            result[resIndex++] = value === 0 ? 0 : value;
          }
        }
        return result;
      }
      module.exports = baseSortedUniq;
    }
  });

  // node_modules/lodash/sortedUniq.js
  var require_sortedUniq = __commonJS({
    "node_modules/lodash/sortedUniq.js"(exports, module) {
      var baseSortedUniq = require_baseSortedUniq();
      function sortedUniq(array) {
        return array && array.length ? baseSortedUniq(array) : [];
      }
      module.exports = sortedUniq;
    }
  });

  // node_modules/lodash/isUndefined.js
  var require_isUndefined = __commonJS({
    "node_modules/lodash/isUndefined.js"(exports, module) {
      function isUndefined(value) {
        return value === void 0;
      }
      module.exports = isUndefined;
    }
  });

  // node_modules/lodash/last.js
  var require_last = __commonJS({
    "node_modules/lodash/last.js"(exports, module) {
      function last(array) {
        var length = array == null ? 0 : array.length;
        return length ? array[length - 1] : void 0;
      }
      module.exports = last;
    }
  });

  // node_modules/lodash/_baseSome.js
  var require_baseSome = __commonJS({
    "node_modules/lodash/_baseSome.js"(exports, module) {
      var baseEach = require_baseEach();
      function baseSome(collection, predicate) {
        var result;
        baseEach(collection, function(value, index, collection2) {
          result = predicate(value, index, collection2);
          return !result;
        });
        return !!result;
      }
      module.exports = baseSome;
    }
  });

  // node_modules/lodash/some.js
  var require_some = __commonJS({
    "node_modules/lodash/some.js"(exports, module) {
      var arraySome = require_arraySome();
      var baseIteratee = require_baseIteratee();
      var baseSome = require_baseSome();
      var isArray = require_isArray();
      var isIterateeCall = require_isIterateeCall();
      function some(collection, predicate, guard) {
        var func = isArray(collection) ? arraySome : baseSome;
        if (guard && isIterateeCall(collection, predicate, guard)) {
          predicate = void 0;
        }
        return func(collection, baseIteratee(predicate, 3));
      }
      module.exports = some;
    }
  });

  // node_modules/lodash/uniqBy.js
  var require_uniqBy = __commonJS({
    "node_modules/lodash/uniqBy.js"(exports, module) {
      var baseIteratee = require_baseIteratee();
      var baseUniq = require_baseUniq();
      function uniqBy(array, iteratee) {
        return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
      }
      module.exports = uniqBy;
    }
  });

  // node_modules/lodash/_arrayAggregator.js
  var require_arrayAggregator = __commonJS({
    "node_modules/lodash/_arrayAggregator.js"(exports, module) {
      function arrayAggregator(array, setter, iteratee, accumulator) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          var value = array[index];
          setter(accumulator, value, iteratee(value), array);
        }
        return accumulator;
      }
      module.exports = arrayAggregator;
    }
  });

  // node_modules/lodash/_baseAggregator.js
  var require_baseAggregator = __commonJS({
    "node_modules/lodash/_baseAggregator.js"(exports, module) {
      var baseEach = require_baseEach();
      function baseAggregator(collection, setter, iteratee, accumulator) {
        baseEach(collection, function(value, key, collection2) {
          setter(accumulator, value, iteratee(value), collection2);
        });
        return accumulator;
      }
      module.exports = baseAggregator;
    }
  });

  // node_modules/lodash/_createAggregator.js
  var require_createAggregator = __commonJS({
    "node_modules/lodash/_createAggregator.js"(exports, module) {
      var arrayAggregator = require_arrayAggregator();
      var baseAggregator = require_baseAggregator();
      var baseIteratee = require_baseIteratee();
      var isArray = require_isArray();
      function createAggregator(setter, initializer) {
        return function(collection, iteratee) {
          var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
          return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
        };
      }
      module.exports = createAggregator;
    }
  });

  // node_modules/lodash/groupBy.js
  var require_groupBy = __commonJS({
    "node_modules/lodash/groupBy.js"(exports, module) {
      var baseAssignValue = require_baseAssignValue();
      var createAggregator = require_createAggregator();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var groupBy = createAggregator(function(result, value, key) {
        if (hasOwnProperty.call(result, key)) {
          result[key].push(value);
        } else {
          baseAssignValue(result, key, [value]);
        }
      });
      module.exports = groupBy;
    }
  });

  // node_modules/lodash/fromPairs.js
  var require_fromPairs = __commonJS({
    "node_modules/lodash/fromPairs.js"(exports, module) {
      function fromPairs(pairs) {
        var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
        while (++index < length) {
          var pair = pairs[index];
          result[pair[0]] = pair[1];
        }
        return result;
      }
      module.exports = fromPairs;
    }
  });

  // node_modules/json-stringify-safe/stringify.js
  var require_stringify = __commonJS({
    "node_modules/json-stringify-safe/stringify.js"(exports, module) {
      exports = module.exports = stringify2;
      exports.getSerialize = serializer;
      function stringify2(obj, replacer, spaces, cycleReplacer) {
        return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
      }
      function serializer(replacer, cycleReplacer) {
        var stack = [], keys = [];
        if (cycleReplacer == null)
          cycleReplacer = function(key, value) {
            if (stack[0] === value)
              return "[Circular ~]";
            return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
          };
        return function(key, value) {
          if (stack.length > 0) {
            var thisPos = stack.indexOf(this);
            ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
            ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
            if (~stack.indexOf(value))
              value = cycleReplacer.call(this, key, value);
          } else
            stack.push(value);
          return replacer == null ? value : replacer.call(this, key, value);
        };
      }
    }
  });

  // node_modules/lodash/now.js
  var require_now = __commonJS({
    "node_modules/lodash/now.js"(exports, module) {
      var root = require_root();
      var now2 = function() {
        return root.Date.now();
      };
      module.exports = now2;
    }
  });

  // node_modules/lodash/debounce.js
  var require_debounce = __commonJS({
    "node_modules/lodash/debounce.js"(exports, module) {
      var isObject = require_isObject();
      var now2 = require_now();
      var toNumber = require_toNumber();
      var FUNC_ERROR_TEXT = "Expected a function";
      var nativeMax = Math.max;
      var nativeMin = Math.min;
      function debounce3(func, wait, options4) {
        var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
        if (typeof func != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        wait = toNumber(wait) || 0;
        if (isObject(options4)) {
          leading = !!options4.leading;
          maxing = "maxWait" in options4;
          maxWait = maxing ? nativeMax(toNumber(options4.maxWait) || 0, wait) : maxWait;
          trailing = "trailing" in options4 ? !!options4.trailing : trailing;
        }
        function invokeFunc(time2) {
          var args = lastArgs, thisArg = lastThis;
          lastArgs = lastThis = void 0;
          lastInvokeTime = time2;
          result = func.apply(thisArg, args);
          return result;
        }
        function leadingEdge(time2) {
          lastInvokeTime = time2;
          timerId = setTimeout(timerExpired, wait);
          return leading ? invokeFunc(time2) : result;
        }
        function remainingWait(time2) {
          var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
          return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
        }
        function shouldInvoke(time2) {
          var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
          return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
        }
        function timerExpired() {
          var time2 = now2();
          if (shouldInvoke(time2)) {
            return trailingEdge(time2);
          }
          timerId = setTimeout(timerExpired, remainingWait(time2));
        }
        function trailingEdge(time2) {
          timerId = void 0;
          if (trailing && lastArgs) {
            return invokeFunc(time2);
          }
          lastArgs = lastThis = void 0;
          return result;
        }
        function cancel() {
          if (timerId !== void 0) {
            clearTimeout(timerId);
          }
          lastInvokeTime = 0;
          lastArgs = lastCallTime = lastThis = timerId = void 0;
        }
        function flush() {
          return timerId === void 0 ? result : trailingEdge(now2());
        }
        function debounced() {
          var time2 = now2(), isInvoking = shouldInvoke(time2);
          lastArgs = arguments;
          lastThis = this;
          lastCallTime = time2;
          if (isInvoking) {
            if (timerId === void 0) {
              return leadingEdge(lastCallTime);
            }
            if (maxing) {
              clearTimeout(timerId);
              timerId = setTimeout(timerExpired, wait);
              return invokeFunc(lastCallTime);
            }
          }
          if (timerId === void 0) {
            timerId = setTimeout(timerExpired, wait);
          }
          return result;
        }
        debounced.cancel = cancel;
        debounced.flush = flush;
        return debounced;
      }
      module.exports = debounce3;
    }
  });

  // node_modules/lodash/throttle.js
  var require_throttle = __commonJS({
    "node_modules/lodash/throttle.js"(exports, module) {
      var debounce3 = require_debounce();
      var isObject = require_isObject();
      var FUNC_ERROR_TEXT = "Expected a function";
      function throttle(func, wait, options4) {
        var leading = true, trailing = true;
        if (typeof func != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        if (isObject(options4)) {
          leading = "leading" in options4 ? !!options4.leading : leading;
          trailing = "trailing" in options4 ? !!options4.trailing : trailing;
        }
        return debounce3(func, wait, {
          "leading": leading,
          "maxWait": wait,
          "trailing": trailing
        });
      }
      module.exports = throttle;
    }
  });

  // node_modules/delaunator/delaunator.js
  var require_delaunator = __commonJS({
    "node_modules/delaunator/delaunator.js"(exports, module) {
      (function(global2, factory2) {
        typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory2() : typeof define === "function" && define.amd ? define(factory2) : (global2 = global2 || self, global2.Delaunator = factory2());
      })(exports, function() {
        "use strict";
        var EPSILON = Math.pow(2, -52);
        var EDGE_STACK = new Uint32Array(512);
        var Delaunator = function Delaunator2(coords) {
          var n = coords.length >> 1;
          if (n > 0 && typeof coords[0] !== "number") {
            throw new Error("Expected coords to contain numbers.");
          }
          this.coords = coords;
          var maxTriangles = Math.max(2 * n - 5, 0);
          this._triangles = new Uint32Array(maxTriangles * 3);
          this._halfedges = new Int32Array(maxTriangles * 3);
          this._hashSize = Math.ceil(Math.sqrt(n));
          this._hullPrev = new Uint32Array(n);
          this._hullNext = new Uint32Array(n);
          this._hullTri = new Uint32Array(n);
          this._hullHash = new Int32Array(this._hashSize).fill(-1);
          this._ids = new Uint32Array(n);
          this._dists = new Float64Array(n);
          this.update();
        };
        Delaunator.from = function from(points, getX, getY) {
          if (getX === void 0)
            getX = defaultGetX;
          if (getY === void 0)
            getY = defaultGetY;
          var n = points.length;
          var coords = new Float64Array(n * 2);
          for (var i = 0; i < n; i++) {
            var p2 = points[i];
            coords[2 * i] = getX(p2);
            coords[2 * i + 1] = getY(p2);
          }
          return new Delaunator(coords);
        };
        Delaunator.prototype.update = function update() {
          var ref = this;
          var coords = ref.coords;
          var hullPrev = ref._hullPrev;
          var hullNext = ref._hullNext;
          var hullTri = ref._hullTri;
          var hullHash = ref._hullHash;
          var n = coords.length >> 1;
          var minX = Infinity;
          var minY = Infinity;
          var maxX = -Infinity;
          var maxY = -Infinity;
          for (var i = 0; i < n; i++) {
            var x2 = coords[2 * i];
            var y2 = coords[2 * i + 1];
            if (x2 < minX) {
              minX = x2;
            }
            if (y2 < minY) {
              minY = y2;
            }
            if (x2 > maxX) {
              maxX = x2;
            }
            if (y2 > maxY) {
              maxY = y2;
            }
            this._ids[i] = i;
          }
          var cx = (minX + maxX) / 2;
          var cy = (minY + maxY) / 2;
          var minDist = Infinity;
          var i0, i1, i2;
          for (var i$1 = 0; i$1 < n; i$1++) {
            var d = dist(cx, cy, coords[2 * i$1], coords[2 * i$1 + 1]);
            if (d < minDist) {
              i0 = i$1;
              minDist = d;
            }
          }
          var i0x = coords[2 * i0];
          var i0y = coords[2 * i0 + 1];
          minDist = Infinity;
          for (var i$2 = 0; i$2 < n; i$2++) {
            if (i$2 === i0) {
              continue;
            }
            var d$1 = dist(i0x, i0y, coords[2 * i$2], coords[2 * i$2 + 1]);
            if (d$1 < minDist && d$1 > 0) {
              i1 = i$2;
              minDist = d$1;
            }
          }
          var i1x = coords[2 * i1];
          var i1y = coords[2 * i1 + 1];
          var minRadius = Infinity;
          for (var i$3 = 0; i$3 < n; i$3++) {
            if (i$3 === i0 || i$3 === i1) {
              continue;
            }
            var r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i$3], coords[2 * i$3 + 1]);
            if (r < minRadius) {
              i2 = i$3;
              minRadius = r;
            }
          }
          var i2x = coords[2 * i2];
          var i2y = coords[2 * i2 + 1];
          if (minRadius === Infinity) {
            for (var i$4 = 0; i$4 < n; i$4++) {
              this._dists[i$4] = coords[2 * i$4] - coords[0] || coords[2 * i$4 + 1] - coords[1];
            }
            quicksort(this._ids, this._dists, 0, n - 1);
            var hull = new Uint32Array(n);
            var j = 0;
            for (var i$5 = 0, d0 = -Infinity; i$5 < n; i$5++) {
              var id = this._ids[i$5];
              if (this._dists[id] > d0) {
                hull[j++] = id;
                d0 = this._dists[id];
              }
            }
            this.hull = hull.subarray(0, j);
            this.triangles = new Uint32Array(0);
            this.halfedges = new Uint32Array(0);
            return;
          }
          if (orient(i0x, i0y, i1x, i1y, i2x, i2y)) {
            var i$6 = i1;
            var x$1 = i1x;
            var y$1 = i1y;
            i1 = i2;
            i1x = i2x;
            i1y = i2y;
            i2 = i$6;
            i2x = x$1;
            i2y = y$1;
          }
          var center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);
          this._cx = center.x;
          this._cy = center.y;
          for (var i$7 = 0; i$7 < n; i$7++) {
            this._dists[i$7] = dist(coords[2 * i$7], coords[2 * i$7 + 1], center.x, center.y);
          }
          quicksort(this._ids, this._dists, 0, n - 1);
          this._hullStart = i0;
          var hullSize = 3;
          hullNext[i0] = hullPrev[i2] = i1;
          hullNext[i1] = hullPrev[i0] = i2;
          hullNext[i2] = hullPrev[i1] = i0;
          hullTri[i0] = 0;
          hullTri[i1] = 1;
          hullTri[i2] = 2;
          hullHash.fill(-1);
          hullHash[this._hashKey(i0x, i0y)] = i0;
          hullHash[this._hashKey(i1x, i1y)] = i1;
          hullHash[this._hashKey(i2x, i2y)] = i2;
          this.trianglesLen = 0;
          this._addTriangle(i0, i1, i2, -1, -1, -1);
          for (var k2 = 0, xp = void 0, yp = void 0; k2 < this._ids.length; k2++) {
            var i$8 = this._ids[k2];
            var x$2 = coords[2 * i$8];
            var y$2 = coords[2 * i$8 + 1];
            if (k2 > 0 && Math.abs(x$2 - xp) <= EPSILON && Math.abs(y$2 - yp) <= EPSILON) {
              continue;
            }
            xp = x$2;
            yp = y$2;
            if (i$8 === i0 || i$8 === i1 || i$8 === i2) {
              continue;
            }
            var start2 = 0;
            for (var j$1 = 0, key = this._hashKey(x$2, y$2); j$1 < this._hashSize; j$1++) {
              start2 = hullHash[(key + j$1) % this._hashSize];
              if (start2 !== -1 && start2 !== hullNext[start2]) {
                break;
              }
            }
            start2 = hullPrev[start2];
            var e = start2, q = void 0;
            while (q = hullNext[e], !orient(x$2, y$2, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1])) {
              e = q;
              if (e === start2) {
                e = -1;
                break;
              }
            }
            if (e === -1) {
              continue;
            }
            var t = this._addTriangle(e, i$8, hullNext[e], -1, -1, hullTri[e]);
            hullTri[i$8] = this._legalize(t + 2);
            hullTri[e] = t;
            hullSize++;
            var n$1 = hullNext[e];
            while (q = hullNext[n$1], orient(x$2, y$2, coords[2 * n$1], coords[2 * n$1 + 1], coords[2 * q], coords[2 * q + 1])) {
              t = this._addTriangle(n$1, i$8, q, hullTri[i$8], -1, hullTri[n$1]);
              hullTri[i$8] = this._legalize(t + 2);
              hullNext[n$1] = n$1;
              hullSize--;
              n$1 = q;
            }
            if (e === start2) {
              while (q = hullPrev[e], orient(x$2, y$2, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1])) {
                t = this._addTriangle(q, i$8, e, -1, hullTri[e], hullTri[q]);
                this._legalize(t + 2);
                hullTri[q] = t;
                hullNext[e] = e;
                hullSize--;
                e = q;
              }
            }
            this._hullStart = hullPrev[i$8] = e;
            hullNext[e] = hullPrev[n$1] = i$8;
            hullNext[i$8] = n$1;
            hullHash[this._hashKey(x$2, y$2)] = i$8;
            hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;
          }
          this.hull = new Uint32Array(hullSize);
          for (var i$9 = 0, e$1 = this._hullStart; i$9 < hullSize; i$9++) {
            this.hull[i$9] = e$1;
            e$1 = hullNext[e$1];
          }
          this.triangles = this._triangles.subarray(0, this.trianglesLen);
          this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
        };
        Delaunator.prototype._hashKey = function _hashKey(x2, y2) {
          return Math.floor(pseudoAngle(x2 - this._cx, y2 - this._cy) * this._hashSize) % this._hashSize;
        };
        Delaunator.prototype._legalize = function _legalize(a2) {
          var ref = this;
          var triangles = ref._triangles;
          var halfedges = ref._halfedges;
          var coords = ref.coords;
          var i = 0;
          var ar = 0;
          while (true) {
            var b = halfedges[a2];
            var a0 = a2 - a2 % 3;
            ar = a0 + (a2 + 2) % 3;
            if (b === -1) {
              if (i === 0) {
                break;
              }
              a2 = EDGE_STACK[--i];
              continue;
            }
            var b02 = b - b % 3;
            var al = a0 + (a2 + 1) % 3;
            var bl = b02 + (b + 2) % 3;
            var p0 = triangles[ar];
            var pr = triangles[a2];
            var pl = triangles[al];
            var p1 = triangles[bl];
            var illegal = inCircle(
              coords[2 * p0],
              coords[2 * p0 + 1],
              coords[2 * pr],
              coords[2 * pr + 1],
              coords[2 * pl],
              coords[2 * pl + 1],
              coords[2 * p1],
              coords[2 * p1 + 1]
            );
            if (illegal) {
              triangles[a2] = p1;
              triangles[b] = p0;
              var hbl = halfedges[bl];
              if (hbl === -1) {
                var e = this._hullStart;
                do {
                  if (this._hullTri[e] === bl) {
                    this._hullTri[e] = a2;
                    break;
                  }
                  e = this._hullPrev[e];
                } while (e !== this._hullStart);
              }
              this._link(a2, hbl);
              this._link(b, halfedges[ar]);
              this._link(ar, bl);
              var br = b02 + (b + 1) % 3;
              if (i < EDGE_STACK.length) {
                EDGE_STACK[i++] = br;
              }
            } else {
              if (i === 0) {
                break;
              }
              a2 = EDGE_STACK[--i];
            }
          }
          return ar;
        };
        Delaunator.prototype._link = function _link(a2, b) {
          this._halfedges[a2] = b;
          if (b !== -1) {
            this._halfedges[b] = a2;
          }
        };
        Delaunator.prototype._addTriangle = function _addTriangle(i0, i1, i2, a2, b, c2) {
          var t = this.trianglesLen;
          this._triangles[t] = i0;
          this._triangles[t + 1] = i1;
          this._triangles[t + 2] = i2;
          this._link(t, a2);
          this._link(t + 1, b);
          this._link(t + 2, c2);
          this.trianglesLen += 3;
          return t;
        };
        function pseudoAngle(dx, dy) {
          var p2 = dx / (Math.abs(dx) + Math.abs(dy));
          return (dy > 0 ? 3 - p2 : 1 + p2) / 4;
        }
        function dist(ax, ay, bx, by) {
          var dx = ax - bx;
          var dy = ay - by;
          return dx * dx + dy * dy;
        }
        function orientIfSure(px, py, rx, ry, qx, qy) {
          var l = (ry - py) * (qx - px);
          var r = (rx - px) * (qy - py);
          return Math.abs(l - r) >= 33306690738754716e-32 * Math.abs(l + r) ? l - r : 0;
        }
        function orient(rx, ry, qx, qy, px, py) {
          var sign2 = orientIfSure(px, py, rx, ry, qx, qy) || orientIfSure(rx, ry, qx, qy, px, py) || orientIfSure(qx, qy, px, py, rx, ry);
          return sign2 < 0;
        }
        function inCircle(ax, ay, bx, by, cx, cy, px, py) {
          var dx = ax - px;
          var dy = ay - py;
          var ex = bx - px;
          var ey = by - py;
          var fx = cx - px;
          var fy = cy - py;
          var ap = dx * dx + dy * dy;
          var bp = ex * ex + ey * ey;
          var cp = fx * fx + fy * fy;
          return dx * (ey * cp - bp * fy) - dy * (ex * cp - bp * fx) + ap * (ex * fy - ey * fx) < 0;
        }
        function circumradius(ax, ay, bx, by, cx, cy) {
          var dx = bx - ax;
          var dy = by - ay;
          var ex = cx - ax;
          var ey = cy - ay;
          var bl = dx * dx + dy * dy;
          var cl = ex * ex + ey * ey;
          var d = 0.5 / (dx * ey - dy * ex);
          var x2 = (ey * bl - dy * cl) * d;
          var y2 = (dx * cl - ex * bl) * d;
          return x2 * x2 + y2 * y2;
        }
        function circumcenter(ax, ay, bx, by, cx, cy) {
          var dx = bx - ax;
          var dy = by - ay;
          var ex = cx - ax;
          var ey = cy - ay;
          var bl = dx * dx + dy * dy;
          var cl = ex * ex + ey * ey;
          var d = 0.5 / (dx * ey - dy * ex);
          var x2 = ax + (ey * bl - dy * cl) * d;
          var y2 = ay + (dx * cl - ex * bl) * d;
          return { x: x2, y: y2 };
        }
        function quicksort(ids, dists, left2, right2) {
          if (right2 - left2 <= 20) {
            for (var i = left2 + 1; i <= right2; i++) {
              var temp = ids[i];
              var tempDist = dists[temp];
              var j = i - 1;
              while (j >= left2 && dists[ids[j]] > tempDist) {
                ids[j + 1] = ids[j--];
              }
              ids[j + 1] = temp;
            }
          } else {
            var median = left2 + right2 >> 1;
            var i$1 = left2 + 1;
            var j$1 = right2;
            swap2(ids, median, i$1);
            if (dists[ids[left2]] > dists[ids[right2]]) {
              swap2(ids, left2, right2);
            }
            if (dists[ids[i$1]] > dists[ids[right2]]) {
              swap2(ids, i$1, right2);
            }
            if (dists[ids[left2]] > dists[ids[i$1]]) {
              swap2(ids, left2, i$1);
            }
            var temp$1 = ids[i$1];
            var tempDist$1 = dists[temp$1];
            while (true) {
              do {
                i$1++;
              } while (dists[ids[i$1]] < tempDist$1);
              do {
                j$1--;
              } while (dists[ids[j$1]] > tempDist$1);
              if (j$1 < i$1) {
                break;
              }
              swap2(ids, i$1, j$1);
            }
            ids[left2 + 1] = ids[j$1];
            ids[j$1] = temp$1;
            if (right2 - i$1 + 1 >= j$1 - left2) {
              quicksort(ids, dists, i$1, right2);
              quicksort(ids, dists, left2, j$1 - 1);
            } else {
              quicksort(ids, dists, left2, j$1 - 1);
              quicksort(ids, dists, i$1, right2);
            }
          }
        }
        function swap2(arr, i, j) {
          var tmp = arr[i];
          arr[i] = arr[j];
          arr[j] = tmp;
        }
        function defaultGetX(p2) {
          return p2[0];
        }
        function defaultGetY(p2) {
          return p2[1];
        }
        return Delaunator;
      });
    }
  });

  // node_modules/delaunay-find/lib/index.js
  var require_lib = __commonJS({
    "node_modules/delaunay-find/lib/index.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports["default"] = void 0;
      var _delaunator = _interopRequireDefault(require_delaunator());
      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { "default": obj };
      }
      function pointX(p2) {
        return p2[0];
      }
      function pointY(p2) {
        return p2[1];
      }
      function collinear(d) {
        var triangles = d.triangles, coords = d.coords;
        for (var i = 0; i < triangles.length; i += 3) {
          var a2 = 2 * triangles[i];
          var b = 2 * triangles[i + 1];
          var c2 = 2 * triangles[i + 2];
          var cross2 = (coords[c2] - coords[a2]) * (coords[b + 1] - coords[a2 + 1]) - (coords[b] - coords[a2]) * (coords[c2 + 1] - coords[a2 + 1]);
          if (cross2 > 1e-10) {
            return false;
          }
        }
        return true;
      }
      function jitter(x2, y2, r) {
        return [x2 + Math.sin(x2 + y2) * r, y2 + Math.cos(x2 - y2) * r];
      }
      function flatArray(points, fx, fy, that) {
        var n = points.length;
        var array = new Float64Array(n * 2);
        for (var i = 0; i < n; ++i) {
          var p2 = points[i];
          array[i * 2] = fx.call(that, p2, i, points);
          array[i * 2 + 1] = fy.call(that, p2, i, points);
        }
        return array;
      }
      var Delaunay2 = /* @__PURE__ */ function() {
        function Delaunay3(points) {
          var delaunator = new _delaunator["default"](points);
          this.inedges = new Int32Array(points.length / 2);
          this._hullIndex = new Int32Array(points.length / 2);
          this.points = delaunator.coords;
          this._init(delaunator);
        }
        var _proto = Delaunay3.prototype;
        _proto._init = function _init(delaunator) {
          var d = delaunator;
          var points = this.points;
          if (d.hull && d.hull.length > 2 && collinear(d)) {
            this.collinear = Int32Array.from({
              length: points.length / 2
            }, function(_, i2) {
              return i2;
            }).sort(function(i2, j) {
              return points[2 * i2] - points[2 * j] || points[2 * i2 + 1] - points[2 * j + 1];
            });
            var e = this.collinear[0];
            var f = this.collinear[this.collinear.length - 1];
            var bounds = [points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1]];
            var r = 1e-8 * // eslint-disable-line no-magic-numbers
            Math.sqrt(Math.pow(bounds[3] - bounds[1], 2) + Math.pow(bounds[2] - bounds[0], 2));
            for (var i = 0, n = points.length / 2; i < n; ++i) {
              var p2 = jitter(points[2 * i], points[2 * i + 1], r);
              points[2 * i] = p2[0];
              points[2 * i + 1] = p2[1];
            }
            delaunator = new _delaunator["default"](points);
          }
          var halfedges = this.halfedges = delaunator.halfedges;
          var hull = this.hull = delaunator.hull;
          var triangles = this.triangles = delaunator.triangles;
          var inedges = this.inedges.fill(-1);
          var hullIndex = this._hullIndex.fill(-1);
          for (var _e = 0, _n = halfedges.length; _e < _n; ++_e) {
            var _p = triangles[_e % 3 === 2 ? _e - 2 : _e + 1];
            if (halfedges[_e] === -1 || inedges[_p] === -1)
              inedges[_p] = _e;
          }
          for (var _i = 0, _n2 = hull.length; _i < _n2; ++_i) {
            hullIndex[hull[_i]] = _i;
          }
          if (hull.length <= 2 && hull.length > 0) {
            this.triangles = new Int32Array(3).fill(-1);
            this.halfedges = new Int32Array(3).fill(-1);
            this.triangles[0] = hull[0];
            this.triangles[1] = hull[1];
            this.triangles[2] = hull[1];
            inedges[hull[0]] = 1;
            if (hull.length === 2)
              inedges[hull[1]] = 0;
          }
        };
        _proto.neighbors = function neighbors(i) {
          var results = [];
          var inedges = this.inedges, hull = this.hull, _hullIndex = this._hullIndex, halfedges = this.halfedges, triangles = this.triangles;
          var e0 = inedges[i];
          if (e0 === -1)
            return results;
          var e = e0;
          var p0 = -1;
          do {
            p0 = triangles[e];
            results.push(p0);
            e = e % 3 === 2 ? e - 2 : e + 1;
            if (triangles[e] !== i)
              break;
            e = halfedges[e];
            if (e === -1) {
              var p2 = hull[(_hullIndex[i] + 1) % hull.length];
              if (p2 !== p0)
                results.push(p2);
              break;
            }
          } while (e !== e0);
          return results;
        };
        _proto.find = function find(x2, y2, i) {
          if (i === void 0) {
            i = 0;
          }
          if ((x2 = +x2, x2 !== x2) || (y2 = +y2, y2 !== y2))
            return -1;
          var i0 = i;
          var c2;
          while ((c2 = this._step(i, x2, y2)) >= 0 && c2 !== i && c2 !== i0) {
            i = c2;
          }
          return c2;
        };
        _proto._step = function _step(i, x2, y2) {
          var inedges = this.inedges, points = this.points;
          if (inedges[i] === -1 || !points.length)
            return (i + 1) % (points.length >> 1);
          var c2 = i;
          var dc = Math.pow(x2 - points[i * 2], 2) + Math.pow(y2 - points[i * 2 + 1], 2);
          for (var _iterator = this.neighbors(i), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) {
            var _ref2;
            if (_isArray) {
              if (_i2 >= _iterator.length)
                break;
              _ref2 = _iterator[_i2++];
            } else {
              _i2 = _iterator.next();
              if (_i2.done)
                break;
              _ref2 = _i2.value;
            }
            var t = _ref2;
            var dt = Math.pow(x2 - points[t * 2], 2) + Math.pow(y2 - points[t * 2 + 1], 2);
            if (dt < dc) {
              dc = dt;
              c2 = t;
            }
          }
          return c2;
        };
        return Delaunay3;
      }();
      exports["default"] = Delaunay2;
      Delaunay2.from = function(points, fx, fy, that) {
        if (fx === void 0) {
          fx = pointX;
        }
        if (fy === void 0) {
          fy = pointY;
        }
        return new Delaunay2(flatArray(points, fx, fy, that));
      };
    }
  });

  // node_modules/lodash/_baseSum.js
  var require_baseSum = __commonJS({
    "node_modules/lodash/_baseSum.js"(exports, module) {
      function baseSum(array, iteratee) {
        var result, index = -1, length = array.length;
        while (++index < length) {
          var current = iteratee(array[index]);
          if (current !== void 0) {
            result = result === void 0 ? current : result + current;
          }
        }
        return result;
      }
      module.exports = baseSum;
    }
  });

  // node_modules/lodash/sum.js
  var require_sum = __commonJS({
    "node_modules/lodash/sum.js"(exports, module) {
      var baseSum = require_baseSum();
      var identity3 = require_identity();
      function sum2(array) {
        return array && array.length ? baseSum(array, identity3) : 0;
      }
      module.exports = sum2;
    }
  });

  // node_modules/lodash/_arrayEach.js
  var require_arrayEach = __commonJS({
    "node_modules/lodash/_arrayEach.js"(exports, module) {
      function arrayEach(array, iteratee) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          if (iteratee(array[index], index, array) === false) {
            break;
          }
        }
        return array;
      }
      module.exports = arrayEach;
    }
  });

  // node_modules/lodash/_baseAssign.js
  var require_baseAssign = __commonJS({
    "node_modules/lodash/_baseAssign.js"(exports, module) {
      var copyObject = require_copyObject();
      var keys = require_keys();
      function baseAssign(object, source) {
        return object && copyObject(source, keys(source), object);
      }
      module.exports = baseAssign;
    }
  });

  // node_modules/lodash/_baseAssignIn.js
  var require_baseAssignIn = __commonJS({
    "node_modules/lodash/_baseAssignIn.js"(exports, module) {
      var copyObject = require_copyObject();
      var keysIn = require_keysIn();
      function baseAssignIn(object, source) {
        return object && copyObject(source, keysIn(source), object);
      }
      module.exports = baseAssignIn;
    }
  });

  // node_modules/lodash/_copySymbols.js
  var require_copySymbols = __commonJS({
    "node_modules/lodash/_copySymbols.js"(exports, module) {
      var copyObject = require_copyObject();
      var getSymbols = require_getSymbols();
      function copySymbols(source, object) {
        return copyObject(source, getSymbols(source), object);
      }
      module.exports = copySymbols;
    }
  });

  // node_modules/lodash/_copySymbolsIn.js
  var require_copySymbolsIn = __commonJS({
    "node_modules/lodash/_copySymbolsIn.js"(exports, module) {
      var copyObject = require_copyObject();
      var getSymbolsIn = require_getSymbolsIn();
      function copySymbolsIn(source, object) {
        return copyObject(source, getSymbolsIn(source), object);
      }
      module.exports = copySymbolsIn;
    }
  });

  // node_modules/lodash/_initCloneArray.js
  var require_initCloneArray = __commonJS({
    "node_modules/lodash/_initCloneArray.js"(exports, module) {
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function initCloneArray(array) {
        var length = array.length, result = new array.constructor(length);
        if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
          result.index = array.index;
          result.input = array.input;
        }
        return result;
      }
      module.exports = initCloneArray;
    }
  });

  // node_modules/lodash/_cloneDataView.js
  var require_cloneDataView = __commonJS({
    "node_modules/lodash/_cloneDataView.js"(exports, module) {
      var cloneArrayBuffer = require_cloneArrayBuffer();
      function cloneDataView(dataView, isDeep) {
        var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
        return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
      }
      module.exports = cloneDataView;
    }
  });

  // node_modules/lodash/_cloneRegExp.js
  var require_cloneRegExp = __commonJS({
    "node_modules/lodash/_cloneRegExp.js"(exports, module) {
      var reFlags = /\w*$/;
      function cloneRegExp(regexp) {
        var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
        result.lastIndex = regexp.lastIndex;
        return result;
      }
      module.exports = cloneRegExp;
    }
  });

  // node_modules/lodash/_cloneSymbol.js
  var require_cloneSymbol = __commonJS({
    "node_modules/lodash/_cloneSymbol.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
      var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
      function cloneSymbol(symbol) {
        return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
      }
      module.exports = cloneSymbol;
    }
  });

  // node_modules/lodash/_initCloneByTag.js
  var require_initCloneByTag = __commonJS({
    "node_modules/lodash/_initCloneByTag.js"(exports, module) {
      var cloneArrayBuffer = require_cloneArrayBuffer();
      var cloneDataView = require_cloneDataView();
      var cloneRegExp = require_cloneRegExp();
      var cloneSymbol = require_cloneSymbol();
      var cloneTypedArray = require_cloneTypedArray();
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var symbolTag = "[object Symbol]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var float32Tag = "[object Float32Array]";
      var float64Tag = "[object Float64Array]";
      var int8Tag = "[object Int8Array]";
      var int16Tag = "[object Int16Array]";
      var int32Tag = "[object Int32Array]";
      var uint8Tag = "[object Uint8Array]";
      var uint8ClampedTag = "[object Uint8ClampedArray]";
      var uint16Tag = "[object Uint16Array]";
      var uint32Tag = "[object Uint32Array]";
      function initCloneByTag(object, tag, isDeep) {
        var Ctor = object.constructor;
        switch (tag) {
          case arrayBufferTag:
            return cloneArrayBuffer(object);
          case boolTag:
          case dateTag:
            return new Ctor(+object);
          case dataViewTag:
            return cloneDataView(object, isDeep);
          case float32Tag:
          case float64Tag:
          case int8Tag:
          case int16Tag:
          case int32Tag:
          case uint8Tag:
          case uint8ClampedTag:
          case uint16Tag:
          case uint32Tag:
            return cloneTypedArray(object, isDeep);
          case mapTag:
            return new Ctor();
          case numberTag:
          case stringTag:
            return new Ctor(object);
          case regexpTag:
            return cloneRegExp(object);
          case setTag:
            return new Ctor();
          case symbolTag:
            return cloneSymbol(object);
        }
      }
      module.exports = initCloneByTag;
    }
  });

  // node_modules/lodash/_baseIsMap.js
  var require_baseIsMap = __commonJS({
    "node_modules/lodash/_baseIsMap.js"(exports, module) {
      var getTag = require_getTag();
      var isObjectLike = require_isObjectLike();
      var mapTag = "[object Map]";
      function baseIsMap(value) {
        return isObjectLike(value) && getTag(value) == mapTag;
      }
      module.exports = baseIsMap;
    }
  });

  // node_modules/lodash/isMap.js
  var require_isMap = __commonJS({
    "node_modules/lodash/isMap.js"(exports, module) {
      var baseIsMap = require_baseIsMap();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsMap = nodeUtil && nodeUtil.isMap;
      var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
      module.exports = isMap;
    }
  });

  // node_modules/lodash/_baseIsSet.js
  var require_baseIsSet = __commonJS({
    "node_modules/lodash/_baseIsSet.js"(exports, module) {
      var getTag = require_getTag();
      var isObjectLike = require_isObjectLike();
      var setTag = "[object Set]";
      function baseIsSet(value) {
        return isObjectLike(value) && getTag(value) == setTag;
      }
      module.exports = baseIsSet;
    }
  });

  // node_modules/lodash/isSet.js
  var require_isSet = __commonJS({
    "node_modules/lodash/isSet.js"(exports, module) {
      var baseIsSet = require_baseIsSet();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsSet = nodeUtil && nodeUtil.isSet;
      var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
      module.exports = isSet;
    }
  });

  // node_modules/lodash/_baseClone.js
  var require_baseClone = __commonJS({
    "node_modules/lodash/_baseClone.js"(exports, module) {
      var Stack = require_Stack();
      var arrayEach = require_arrayEach();
      var assignValue = require_assignValue();
      var baseAssign = require_baseAssign();
      var baseAssignIn = require_baseAssignIn();
      var cloneBuffer = require_cloneBuffer();
      var copyArray = require_copyArray();
      var copySymbols = require_copySymbols();
      var copySymbolsIn = require_copySymbolsIn();
      var getAllKeys = require_getAllKeys();
      var getAllKeysIn = require_getAllKeysIn();
      var getTag = require_getTag();
      var initCloneArray = require_initCloneArray();
      var initCloneByTag = require_initCloneByTag();
      var initCloneObject = require_initCloneObject();
      var isArray = require_isArray();
      var isBuffer = require_isBuffer();
      var isMap = require_isMap();
      var isObject = require_isObject();
      var isSet = require_isSet();
      var keys = require_keys();
      var keysIn = require_keysIn();
      var CLONE_DEEP_FLAG = 1;
      var CLONE_FLAT_FLAG = 2;
      var CLONE_SYMBOLS_FLAG = 4;
      var argsTag = "[object Arguments]";
      var arrayTag = "[object Array]";
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var errorTag = "[object Error]";
      var funcTag = "[object Function]";
      var genTag = "[object GeneratorFunction]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var objectTag = "[object Object]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var symbolTag = "[object Symbol]";
      var weakMapTag = "[object WeakMap]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var float32Tag = "[object Float32Array]";
      var float64Tag = "[object Float64Array]";
      var int8Tag = "[object Int8Array]";
      var int16Tag = "[object Int16Array]";
      var int32Tag = "[object Int32Array]";
      var uint8Tag = "[object Uint8Array]";
      var uint8ClampedTag = "[object Uint8ClampedArray]";
      var uint16Tag = "[object Uint16Array]";
      var uint32Tag = "[object Uint32Array]";
      var cloneableTags = {};
      cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
      cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
      function baseClone(value, bitmask, customizer, key, object, stack) {
        var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
        if (customizer) {
          result = object ? customizer(value, key, object, stack) : customizer(value);
        }
        if (result !== void 0) {
          return result;
        }
        if (!isObject(value)) {
          return value;
        }
        var isArr = isArray(value);
        if (isArr) {
          result = initCloneArray(value);
          if (!isDeep) {
            return copyArray(value, result);
          }
        } else {
          var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
          if (isBuffer(value)) {
            return cloneBuffer(value, isDeep);
          }
          if (tag == objectTag || tag == argsTag || isFunc && !object) {
            result = isFlat || isFunc ? {} : initCloneObject(value);
            if (!isDeep) {
              return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
            }
          } else {
            if (!cloneableTags[tag]) {
              return object ? value : {};
            }
            result = initCloneByTag(value, tag, isDeep);
          }
        }
        stack || (stack = new Stack());
        var stacked = stack.get(value);
        if (stacked) {
          return stacked;
        }
        stack.set(value, result);
        if (isSet(value)) {
          value.forEach(function(subValue) {
            result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
          });
        } else if (isMap(value)) {
          value.forEach(function(subValue, key2) {
            result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
          });
        }
        var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
        var props = isArr ? void 0 : keysFunc(value);
        arrayEach(props || value, function(subValue, key2) {
          if (props) {
            key2 = subValue;
            subValue = value[key2];
          }
          assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
        });
        return result;
      }
      module.exports = baseClone;
    }
  });

  // node_modules/lodash/cloneDeep.js
  var require_cloneDeep = __commonJS({
    "node_modules/lodash/cloneDeep.js"(exports, module) {
      var baseClone = require_baseClone();
      var CLONE_DEEP_FLAG = 1;
      var CLONE_SYMBOLS_FLAG = 4;
      function cloneDeep2(value) {
        return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
      }
      module.exports = cloneDeep2;
    }
  });

  // node_modules/lodash/merge.js
  var require_merge = __commonJS({
    "node_modules/lodash/merge.js"(exports, module) {
      var baseMerge = require_baseMerge();
      var createAssigner = require_createAssigner();
      var merge2 = createAssigner(function(object, source, srcIndex) {
        baseMerge(object, source, srcIndex);
      });
      module.exports = merge2;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/info-circle-icon.js
  var require_info_circle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/info-circle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.InfoCircleIconConfig = {
        name: "InfoCircleIcon",
        height: 512,
        width: 512,
        svgPath: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z",
        yOffset: 0,
        xOffset: 0
      };
      exports.InfoCircleIcon = require_createIcon().createIcon(exports.InfoCircleIconConfig);
      exports["default"] = exports.InfoCircleIcon;
    }
  });

  // pkg/lib/cockpit-dark-theme.js
  function debug() {
    if (window.debugging == "all" || window.debugging?.includes("style")) {
      console.debug([`cockpit-dark-theme: ${document.documentElement.id}:`, ...arguments].join(" "));
    }
  }
  function changeDarkThemeClass(documentElement, dark_mode) {
    debug(`Setting cockpit theme to ${dark_mode ? "dark" : "light"}`);
    if (dark_mode) {
      documentElement.classList.add("pf-v5-theme-dark");
    } else {
      documentElement.classList.remove("pf-v5-theme-dark");
    }
  }
  function _setDarkMode(_style) {
    const style = _style || localStorage.getItem("shell:style") || "auto";
    let dark_mode;
    if (window.matchMedia?.("(prefers-color-scheme: dark)").matches && style === "auto" || style === "dark") {
      dark_mode = true;
    } else {
      dark_mode = false;
    }
    changeDarkThemeClass(document.documentElement, dark_mode);
  }
  window.addEventListener("storage", (event) => {
    if (event.key === "shell:style") {
      debug(`Storage element 'shell:style' changed from  ${event.oldValue} to ${event.newValue}`);
      _setDarkMode();
    }
  });
  window.addEventListener("cockpit-style", (event) => {
    const style = event.detail.style;
    debug(`Event received from shell with 'cockpit-style'  ${style}`);
    _setDarkMode(style);
  });
  window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
    debug(`Operating system theme preference changed to ${window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"}`);
    _setDarkMode();
  });
  _setDarkMode();

  // src/index.js
  var import_react159 = __toESM(require_react(), 1);
  var import_react_dom = __toESM(require_react_dom(), 1);

  // pkg/lib/cockpit.js
  var url_root;
  var meta_url_root = document.head.querySelector("meta[name='url-root']");
  if (meta_url_root) {
    url_root = meta_url_root.content.replace(/^\/+|\/+$/g, "");
  } else {
    try {
      url_root = window.localStorage.getItem("url-root");
    } catch (e) {
    }
  }
  var cockpit = {};
  event_mixin(cockpit, {});
  if (typeof window.debugging === "undefined") {
    try {
      Object.defineProperty(window, "debugging", {
        get: function() {
          return window.sessionStorage.debugging || window.localStorage.debugging;
        },
        set: function(x2) {
          window.sessionStorage.debugging = x2;
        }
      });
    } catch (e) {
    }
  }
  function in_array(array, val) {
    const length = array.length;
    for (let i = 0; i < length; i++) {
      if (val === array[i])
        return true;
    }
    return false;
  }
  function is_function(x2) {
    return typeof x2 === "function";
  }
  function is_object(x2) {
    return x2 !== null && typeof x2 === "object";
  }
  function is_plain_object(x2) {
    return is_object(x2) && Object.prototype.toString.call(x2) === "[object Object]";
  }
  function is_negative(n) {
    return ((n = +n) || 1 / n) < 0;
  }
  function invoke_functions(functions2, self2, args) {
    const length = functions2?.length ?? 0;
    for (let i = 0; i < length; i++) {
      if (functions2[i])
        functions2[i].apply(self2, args);
    }
  }
  function iterate_data(data, callback, batch) {
    let binary = false;
    let len = 0;
    if (!batch)
      batch = 64 * 1024;
    if (data) {
      if (data.byteLength) {
        len = data.byteLength;
        binary = true;
      } else if (data.length) {
        len = data.length;
      }
    }
    for (let i = 0; i < len; i += batch) {
      const n = Math.min(len - i, batch);
      if (binary)
        callback(new window.Uint8Array(data.buffer, i, n));
      else
        callback(data.substr(i, n));
    }
  }
  var default_transport = null;
  var public_transport = null;
  var reload_after_disconnect = false;
  var expect_disconnect = false;
  var init_callback = null;
  var default_host = null;
  var process_hints = null;
  var incoming_filters = null;
  var outgoing_filters = null;
  var transport_origin = window.location.origin;
  if (!transport_origin) {
    transport_origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
  }
  function array_from_raw_string(str, constructor) {
    const length = str.length;
    const data = new (constructor || Array)(length);
    for (let i = 0; i < length; i++)
      data[i] = str.charCodeAt(i) & 255;
    return data;
  }
  function array_to_raw_string(data) {
    const length = data.length;
    let str = "";
    for (let i = 0; i < length; i++)
      str += String.fromCharCode(data[i]);
    return str;
  }
  function uint6_to_b64(x2) {
    return x2 < 26 ? x2 + 65 : x2 < 52 ? x2 + 71 : x2 < 62 ? x2 - 4 : x2 === 62 ? 43 : x2 === 63 ? 47 : 65;
  }
  function base64_encode(data) {
    if (typeof data === "string")
      return window.btoa(data);
    if (data instanceof window.ArrayBuffer)
      data = new window.Uint8Array(data);
    const length = data.length;
    let mod3 = 2;
    let str = "";
    for (let uint24 = 0, i = 0; i < length; i++) {
      mod3 = i % 3;
      uint24 |= data[i] << (16 >>> mod3 & 24);
      if (mod3 === 2 || length - i === 1) {
        str += String.fromCharCode(
          uint6_to_b64(uint24 >>> 18 & 63),
          uint6_to_b64(uint24 >>> 12 & 63),
          uint6_to_b64(uint24 >>> 6 & 63),
          uint6_to_b64(uint24 & 63)
        );
        uint24 = 0;
      }
    }
    return str.substr(0, str.length - 2 + mod3) + (mod3 === 2 ? "" : mod3 === 1 ? "=" : "==");
  }
  function b64_to_uint6(x2) {
    return x2 > 64 && x2 < 91 ? x2 - 65 : x2 > 96 && x2 < 123 ? x2 - 71 : x2 > 47 && x2 < 58 ? x2 + 4 : x2 === 43 ? 62 : x2 === 47 ? 63 : 0;
  }
  function base64_decode(str, constructor) {
    if (constructor === String)
      return window.atob(str);
    const ilen = str.length;
    let eq;
    for (eq = 0; eq < 3; eq++) {
      if (str[ilen - (eq + 1)] != "=")
        break;
    }
    const olen = (ilen * 3 + 1 >> 2) - eq;
    const data = new (constructor || Array)(olen);
    for (let mod3, mod4, uint24 = 0, oi = 0, ii = 0; ii < ilen; ii++) {
      mod4 = ii & 3;
      uint24 |= b64_to_uint6(str.charCodeAt(ii)) << 18 - 6 * mod4;
      if (mod4 === 3 || ilen - ii === 1) {
        for (mod3 = 0; mod3 < 3 && oi < olen; mod3++, oi++)
          data[oi] = uint24 >>> (16 >>> mod3 & 24) & 255;
        uint24 = 0;
      }
    }
    return data;
  }
  window.addEventListener("beforeunload", function() {
    expect_disconnect = true;
  }, false);
  function transport_debug() {
    if (window.debugging == "all" || window.debugging?.includes("channel"))
      console.debug.apply(console, arguments);
  }
  function event_mixin(obj, handlers) {
    Object.defineProperties(obj, {
      addEventListener: {
        enumerable: false,
        value: function addEventListener(type, handler) {
          if (handlers[type] === void 0)
            handlers[type] = [];
          handlers[type].push(handler);
        }
      },
      removeEventListener: {
        enumerable: false,
        value: function removeEventListener(type, handler) {
          const length = handlers[type] ? handlers[type].length : 0;
          for (let i = 0; i < length; i++) {
            if (handlers[type][i] === handler) {
              handlers[type][i] = null;
              break;
            }
          }
        }
      },
      dispatchEvent: {
        enumerable: false,
        value: function dispatchEvent(event) {
          let type, args;
          if (typeof event === "string") {
            type = event;
            args = Array.prototype.slice.call(arguments, 1);
            let detail = null;
            if (arguments.length == 2)
              detail = arguments[1];
            else if (arguments.length > 2)
              detail = args;
            event = new CustomEvent(type, {
              bubbles: false,
              cancelable: false,
              detail
            });
            args.unshift(event);
          } else {
            type = event.type;
            args = arguments;
          }
          if (is_function(obj["on" + type]))
            obj["on" + type].apply(obj, args);
          invoke_functions(handlers[type], obj, args);
        }
      }
    });
  }
  function calculate_application() {
    let path2 = window.location.pathname || "/";
    let _url_root = url_root;
    if (window.mock?.pathname)
      path2 = window.mock.pathname;
    if (window.mock?.url_root)
      _url_root = window.mock.url_root;
    if (_url_root && path2.indexOf("/" + _url_root) === 0)
      path2 = path2.replace("/" + _url_root, "") || "/";
    if (path2.indexOf("/cockpit/") !== 0 && path2.indexOf("/cockpit+") !== 0) {
      if (path2.indexOf("/=") === 0)
        path2 = "/cockpit+" + path2.split("/")[1];
      else
        path2 = "/cockpit";
    }
    return path2.split("/")[1];
  }
  function calculate_url(suffix) {
    if (!suffix)
      suffix = "socket";
    const window_loc = window.location.toString();
    const meta_websocket_root = document.head.querySelector("meta[name='websocket-root']");
    let _url_root = meta_websocket_root ? meta_websocket_root.content.replace(/^\/+|\/+$/g, "") : url_root;
    if (window.mock?.url)
      return window.mock.url;
    if (window.mock?.url_root)
      _url_root = window.mock.url_root;
    let prefix = calculate_application();
    if (_url_root)
      prefix = _url_root + "/" + prefix;
    if (window_loc.indexOf("http:") === 0) {
      return "ws://" + window.location.host + "/" + prefix + "/" + suffix;
    } else if (window_loc.indexOf("https:") === 0) {
      return "wss://" + window.location.host + "/" + prefix + "/" + suffix;
    } else {
      transport_debug("Cockpit must be used over http or https");
      return null;
    }
  }
  function join_data(buffers, binary) {
    if (!binary)
      return buffers.join("");
    let total = 0;
    const length = buffers.length;
    for (let i = 0; i < length; i++)
      total += buffers[i].length;
    const data = window.Uint8Array ? new window.Uint8Array(total) : new Array(total);
    if (data.set) {
      for (let j = 0, i = 0; i < length; i++) {
        data.set(buffers[i], j);
        j += buffers[i].length;
      }
    } else {
      for (let j = 0, i = 0; i < length; i++) {
        for (let k2 = 0; k2 < buffers[i].length; k2++)
          data[i + j] = buffers[i][k2];
        j += buffers[i].length;
      }
    }
    return data;
  }
  function ParentWebSocket(parent) {
    const self2 = this;
    self2.readyState = 0;
    window.addEventListener("message", function receive(event) {
      if (event.origin !== transport_origin || event.source !== parent)
        return;
      const data = event.data;
      if (data === void 0 || data.length === void 0 && data.byteLength === void 0)
        return;
      if (data.length === 0) {
        self2.readyState = 3;
        self2.onclose();
      } else {
        self2.onmessage(event);
      }
    }, false);
    self2.send = function send(message) {
      parent.postMessage(message, transport_origin);
    };
    self2.close = function close() {
      self2.readyState = 3;
      parent.postMessage("", transport_origin);
      self2.onclose();
    };
    window.setTimeout(function() {
      self2.readyState = 1;
      self2.onopen();
    }, 0);
  }
  function parse_channel(data) {
    let channel;
    if (data instanceof window.ArrayBuffer) {
      const binary = new window.Uint8Array(data);
      const length = binary.length;
      let pos;
      for (pos = 0; pos < length; pos++) {
        if (binary[pos] == 10)
          break;
      }
      if (pos === length) {
        console.warn("binary message without channel");
        return null;
      } else if (pos === 0) {
        console.warn("binary control message");
        return null;
      } else {
        channel = String.fromCharCode.apply(null, binary.subarray(0, pos));
      }
    } else {
      const pos = data.indexOf("\n");
      if (pos === -1) {
        console.warn("text message without channel");
        return null;
      }
      channel = data.substring(0, pos);
    }
    return channel;
  }
  function Transport() {
    const self2 = this;
    self2.application = calculate_application();
    event_mixin(self2, {});
    let last_channel = 0;
    let channel_seed = "";
    if (window.mock)
      window.mock.last_transport = self2;
    let ws;
    let ignore_health_check = false;
    let got_message = false;
    if (window.parent !== window && window.name.indexOf("cockpit1:") === 0)
      ws = new ParentWebSocket(window.parent);
    let check_health_timer;
    try {
      if (!ws && window.parent !== window && window.parent.options && window.parent.options.protocol == "cockpit1") {
        ws = new ParentWebSocket(window.parent);
      }
    } catch (ex) {
    }
    if (!ws) {
      const ws_loc = calculate_url();
      transport_debug("connecting to " + ws_loc);
      if (ws_loc) {
        if ("WebSocket" in window) {
          ws = new window.WebSocket(ws_loc, "cockpit1");
        } else {
          console.error("WebSocket not supported, application will not work!");
        }
      }
      check_health_timer = window.setInterval(function() {
        if (self2.ready)
          ws.send('\n{ "command": "ping" }');
        if (!got_message) {
          if (ignore_health_check) {
            console.log("health check failure ignored");
          } else {
            console.log("health check failed");
            self2.close({ problem: "timeout" });
          }
        }
        got_message = false;
      }, 3e4);
    }
    if (!ws) {
      ws = { close: function() {
      } };
      window.setTimeout(function() {
        self2.close({ problem: "no-cockpit" });
      }, 50);
    }
    const control_cbs = {};
    const message_cbs = {};
    let waiting_for_init = true;
    self2.ready = false;
    function ready_for_channels() {
      if (!self2.ready) {
        self2.ready = true;
        self2.dispatchEvent("ready");
      }
    }
    ws.onopen = function() {
      if (ws) {
        if (typeof ws.binaryType !== "undefined")
          ws.binaryType = "arraybuffer";
        ws.send('\n{ "command": "init", "version": 1 }');
      }
    };
    ws.onclose = function() {
      transport_debug("WebSocket onclose");
      ws = null;
      if (reload_after_disconnect) {
        expect_disconnect = true;
        window.location.reload(true);
      }
      self2.close();
    };
    ws.onmessage = self2.dispatch_data = function(arg) {
      got_message = true;
      const message = arg.data;
      const channel = parse_channel(message);
      if (channel === null)
        return false;
      const payload = message instanceof window.ArrayBuffer ? new window.Uint8Array(message, channel.length + 1) : message.substring(channel.length + 1);
      let control;
      if (!channel) {
        transport_debug("recv control:", payload);
        control = JSON.parse(payload);
      } else {
        transport_debug("recv " + channel + ":", payload);
      }
      const length = incoming_filters ? incoming_filters.length : 0;
      for (let i = 0; i < length; i++) {
        if (incoming_filters[i](message, channel, control) === false)
          return false;
      }
      if (!channel)
        process_control(control);
      else
        process_message(channel, payload);
      return true;
    };
    self2.close = function close(options4) {
      if (!options4)
        options4 = { problem: "disconnected" };
      options4.command = "close";
      window.clearInterval(check_health_timer);
      const ows = ws;
      ws = null;
      if (ows)
        ows.close();
      if (expect_disconnect)
        return;
      ready_for_channels();
      for (const chan in control_cbs)
        control_cbs[chan].apply(null, [options4]);
    };
    self2.next_channel = function next_channel() {
      last_channel++;
      return channel_seed + String(last_channel);
    };
    function process_init(options4) {
      if (options4.problem) {
        self2.close({ problem: options4.problem });
        return;
      }
      if (options4.version !== 1) {
        console.error("received unsupported version in init message: " + options4.version);
        self2.close({ problem: "not-supported" });
        return;
      }
      if (options4["channel-seed"])
        channel_seed = String(options4["channel-seed"]);
      if (options4.host)
        default_host = options4.host;
      if (public_transport) {
        public_transport.options = options4;
        public_transport.csrf_token = options4["csrf-token"];
        public_transport.host = default_host;
      }
      if (init_callback)
        init_callback(options4);
      if (waiting_for_init) {
        waiting_for_init = false;
        ready_for_channels();
      }
    }
    function process_control(data) {
      const channel = data.channel;
      if (data.command == "init") {
        process_init(data);
      } else if (waiting_for_init) {
        waiting_for_init = false;
        if (data.command != "close" || channel) {
          console.error("received message before init: ", data.command);
          data = { problem: "protocol-error" };
        }
        self2.close(data);
      } else if (data.command == "ping") {
        data.command = "pong";
        self2.send_control(data);
      } else if (data.command == "pong") {
      } else if (data.command == "hint") {
        if (process_hints)
          process_hints(data);
      } else if (channel !== void 0) {
        const func = control_cbs[channel];
        if (func)
          func(data);
      }
    }
    function process_message(channel, payload) {
      const func = message_cbs[channel];
      if (func)
        func(payload);
    }
    self2.send_data = function send_data(data, channel, control) {
      if (!ws) {
        return false;
      }
      const length = outgoing_filters ? outgoing_filters.length : 0;
      for (let i = 0; i < length; i++) {
        if (channel === void 0)
          channel = parse_channel(data);
        if (!channel && control === void 0)
          control = JSON.parse(data);
        if (outgoing_filters[i](data, channel, control) === false)
          return false;
      }
      ws.send(data);
      return true;
    };
    self2.send_message = function send_message(payload, channel, control) {
      if (channel)
        transport_debug("send " + channel, payload);
      else
        transport_debug("send control:", payload);
      if (payload.byteLength || Array.isArray(payload)) {
        if (payload instanceof window.ArrayBuffer)
          payload = new window.Uint8Array(payload);
        const output = join_data([array_from_raw_string(channel), [10], payload], true);
        return self2.send_data(output.buffer, channel, control);
      } else {
        return self2.send_data(channel.toString() + "\n" + payload, channel, control);
      }
    };
    self2.send_control = function send_control(data) {
      if (!ws && (data.command == "close" || data.command == "kill"))
        return;
      if (check_health_timer && data.command == "hint" && data.hint == "ignore_transport_health_check") {
        ignore_health_check = data.data;
        return;
      }
      return self2.send_message(JSON.stringify(data), "", data);
    };
    self2.register = function register(channel, control_cb, message_cb) {
      control_cbs[channel] = control_cb;
      message_cbs[channel] = message_cb;
    };
    self2.unregister = function unregister(channel) {
      delete control_cbs[channel];
      delete message_cbs[channel];
    };
  }
  function ensure_transport(callback) {
    if (!default_transport)
      default_transport = new Transport();
    const transport = default_transport;
    if (transport.ready) {
      callback(transport);
    } else {
      transport.addEventListener("ready", function() {
        callback(transport);
      });
    }
  }
  window.addEventListener("unload", function() {
    if (default_transport)
      default_transport.close();
  });
  function Channel(options4) {
    const self2 = this;
    event_mixin(self2, {});
    let transport;
    let ready = null;
    let closed = null;
    let waiting = null;
    let received_done = false;
    let sent_done = false;
    let id = null;
    const binary = options4.binary === true;
    const queue = [];
    self2.valid = true;
    self2.options = options4;
    self2.binary = binary;
    self2.id = id;
    function on_message(payload) {
      if (received_done) {
        console.warn("received message after done");
        self2.close("protocol-error");
      } else {
        self2.dispatchEvent("message", payload);
      }
    }
    function on_close(data) {
      closed = data;
      self2.valid = false;
      if (transport && id)
        transport.unregister(id);
      if (closed.message && !options4.err)
        console.warn(closed.message);
      self2.dispatchEvent("close", closed);
      if (waiting)
        waiting.resolve(closed);
    }
    function on_ready(data) {
      ready = data;
      self2.dispatchEvent("ready", ready);
    }
    function on_control(data) {
      if (data.command == "close") {
        on_close(data);
        return;
      } else if (data.command == "ready") {
        on_ready(data);
      }
      const done = data.command === "done";
      if (done && received_done) {
        console.warn("received two done commands on channel");
        self2.close("protocol-error");
      } else {
        if (done)
          received_done = true;
        self2.dispatchEvent("control", data);
      }
    }
    function send_payload(payload) {
      if (!binary) {
        if (typeof payload !== "string")
          payload = String(payload);
      }
      transport.send_message(payload, id);
    }
    ensure_transport(function(trans) {
      transport = trans;
      if (closed)
        return;
      id = transport.next_channel();
      self2.id = id;
      transport.register(id, on_control, on_message);
      const command = {};
      for (const i in options4)
        command[i] = options4[i];
      command.command = "open";
      command.channel = id;
      if (!command.host) {
        if (default_host)
          command.host = default_host;
      }
      if (binary)
        command.binary = "raw";
      else
        delete command.binary;
      command["flow-control"] = true;
      transport.send_control(command);
      while (queue.length > 0) {
        const item = queue.shift();
        if (item[0]) {
          item[1].channel = id;
          transport.send_control(item[1]);
        } else {
          send_payload(item[1]);
        }
      }
    });
    self2.send = function send(message) {
      if (closed)
        console.warn("sending message on closed channel");
      else if (sent_done)
        console.warn("sending message after done");
      else if (!transport)
        queue.push([false, message]);
      else
        send_payload(message);
    };
    self2.control = function control(options5) {
      options5 = options5 || {};
      if (!options5.command)
        options5.command = "options";
      if (options5.command === "done")
        sent_done = true;
      options5.channel = id;
      if (!transport)
        queue.push([true, options5]);
      else
        transport.send_control(options5);
    };
    self2.wait = function wait(callback) {
      if (!waiting) {
        waiting = cockpit.defer();
        if (closed) {
          waiting.reject(closed);
        } else if (ready) {
          waiting.resolve(ready);
        } else {
          self2.addEventListener("ready", function(event, data) {
            waiting.resolve(data);
          });
          self2.addEventListener("close", function(event, data) {
            waiting.reject(data);
          });
        }
      }
      const promise = waiting.promise;
      if (callback)
        promise.then(callback, callback);
      return promise;
    };
    self2.close = function close(options5) {
      if (closed)
        return;
      if (!options5)
        options5 = {};
      else if (typeof options5 == "string")
        options5 = { problem: options5 };
      options5.command = "close";
      options5.channel = id;
      if (!transport)
        queue.push([true, options5]);
      else
        transport.send_control(options5);
      on_close(options5);
    };
    self2.buffer = function buffer(callback) {
      const buffers = [];
      buffers.callback = callback;
      buffers.squash = function squash() {
        return join_data(buffers, binary);
      };
      function on_message2(event, data) {
        buffers.push(data);
        if (buffers.callback) {
          const block = join_data(buffers, binary);
          if (block.length > 0) {
            const consumed = buffers.callback.call(self2, block);
            if (typeof consumed !== "number" || consumed === block.length) {
              buffers.length = 0;
            } else if (consumed === 0) {
              buffers.length = 1;
              buffers[0] = block;
            } else if (consumed !== 0) {
              buffers.length = 1;
              if (block.subarray)
                buffers[0] = block.subarray(consumed);
              else if (block.substring)
                buffers[0] = block.substring(consumed);
              else
                buffers[0] = block.slice(consumed);
            }
          }
        }
      }
      function on_close2() {
        self2.removeEventListener("message", on_message2);
        self2.removeEventListener("close", on_close2);
      }
      self2.addEventListener("message", on_message2);
      self2.addEventListener("close", on_close2);
      return buffers;
    };
    self2.toString = function toString() {
      const host = options4.host || "localhost";
      return "[Channel " + (self2.valid ? id : "<invalid>") + " -> " + host + "]";
    };
  }
  function resolve_path_dots(parts) {
    const out = [];
    const length = parts.length;
    for (let i = 0; i < length; i++) {
      const part = parts[i];
      if (part === "" || part == ".") {
        continue;
      } else if (part == "..") {
        if (out.length === 0)
          return null;
        out.pop();
      } else {
        out.push(part);
      }
    }
    return out;
  }
  function factory() {
    cockpit.channel = function channel(options4) {
      return new Channel(options4);
    };
    cockpit.event_target = function event_target(obj) {
      event_mixin(obj, {});
      return obj;
    };
    cockpit.extend = Object.assign;
    cockpit.manifests = {};
    function Utf8TextEncoder(constructor) {
      const self2 = this;
      self2.encoding = "utf-8";
      self2.encode = function encode(string, options4) {
        const data = window.unescape(encodeURIComponent(string));
        if (constructor === String)
          return data;
        return array_from_raw_string(data, constructor);
      };
    }
    function Utf8TextDecoder(fatal) {
      const self2 = this;
      let buffer = null;
      self2.encoding = "utf-8";
      self2.decode = function decode(data, options4) {
        const stream = options4?.stream;
        if (data === null || data === void 0)
          data = "";
        if (typeof data !== "string")
          data = array_to_raw_string(data);
        if (buffer) {
          data = buffer + data;
          buffer = null;
        }
        const len = data.length;
        let beg = 0;
        let i = 0;
        let str = "";
        while (i < len) {
          const p2 = data.charCodeAt(i);
          const x2 = p2 == 255 ? 0 : p2 > 251 && p2 < 254 ? 6 : p2 > 247 && p2 < 252 ? 5 : p2 > 239 && p2 < 248 ? 4 : p2 > 223 && p2 < 240 ? 3 : p2 > 191 && p2 < 224 ? 2 : p2 < 128 ? 1 : 0;
          let ok = i + x2 <= len;
          if (!ok && stream) {
            buffer = data.substring(i);
            break;
          }
          if (x2 === 0)
            ok = false;
          for (let j = 1; ok && j < x2; j++)
            ok = (data.charCodeAt(i + j) & 128) !== 0;
          if (!ok) {
            if (fatal) {
              i = len;
              break;
            }
            str += decodeURIComponent(window.escape(data.substring(beg, i)));
            str += "\uFFFD";
            i++;
            beg = i;
          } else {
            i += x2;
          }
        }
        str += decodeURIComponent(window.escape(data.substring(beg, i)));
        return str;
      };
    }
    cockpit.utf8_encoder = function utf8_encoder(constructor) {
      return new Utf8TextEncoder(constructor);
    };
    cockpit.utf8_decoder = function utf8_decoder(fatal) {
      return new Utf8TextDecoder(!!fatal);
    };
    cockpit.base64_encode = base64_encode;
    cockpit.base64_decode = base64_decode;
    cockpit.kill = function kill(host, group) {
      const options4 = {};
      if (host)
        options4.host = host;
      if (group)
        options4.group = group;
      cockpit.transport.control("kill", options4);
    };
    cockpit.hint = function hint(name2, options4) {
      if (!default_transport)
        return;
      if (!options4)
        options4 = default_host;
      if (typeof options4 == "string")
        options4 = { host: options4 };
      options4.hint = name2;
      cockpit.transport.control("hint", options4);
    };
    cockpit.transport = public_transport = {
      wait: ensure_transport,
      inject: function inject(message, out) {
        if (!default_transport)
          return false;
        if (out === void 0 || out)
          return default_transport.send_data(message);
        else
          return default_transport.dispatch_data({ data: message });
      },
      filter: function filter(callback, out) {
        if (out) {
          if (!outgoing_filters)
            outgoing_filters = [];
          outgoing_filters.push(callback);
        } else {
          if (!incoming_filters)
            incoming_filters = [];
          incoming_filters.push(callback);
        }
      },
      close: function close(problem) {
        if (default_transport)
          default_transport.close(problem ? { problem } : void 0);
        default_transport = null;
        this.options = {};
      },
      origin: transport_origin,
      options: {},
      uri: calculate_url,
      control: function(command, options4) {
        options4 = { ...options4, command };
        ensure_transport(function(transport) {
          transport.send_control(options4);
        });
      },
      application: function() {
        if (!default_transport || window.mock)
          return calculate_application();
        return default_transport.application;
      }
    };
    let later_queue = [];
    let later_timeout = null;
    function later_drain() {
      const queue = later_queue;
      later_timeout = null;
      later_queue = [];
      for (; ; ) {
        const func = queue.shift();
        if (!func)
          break;
        func();
      }
    }
    function later_invoke(func) {
      if (func)
        later_queue.push(func);
      if (later_timeout === null)
        later_timeout = window.setTimeout(later_drain, 0);
    }
    function promise_then(state, fulfilled, rejected, updated) {
      if (fulfilled === void 0 && rejected === void 0 && updated === void 0)
        return null;
      const result = new Deferred();
      state.pending = state.pending || [];
      state.pending.push([result, fulfilled, rejected, updated]);
      if (state.status > 0)
        schedule_process_queue(state);
      return result.promise;
    }
    function create_promise(state) {
      const self2 = function Promise2(target) {
        if (target) {
          Object.assign(target, self2);
          return target;
        }
        return self2;
      };
      state.status = 0;
      self2.then = function then2(fulfilled, rejected, updated) {
        return promise_then(state, fulfilled, rejected, updated) || self2;
      };
      self2.catch = function catch_(callback) {
        return promise_then(state, null, callback) || self2;
      };
      self2.finally = function finally_(callback, updated) {
        return promise_then(state, function() {
          return handle_callback(arguments, true, callback);
        }, function() {
          return handle_callback(arguments, false, callback);
        }, updated) || self2;
      };
      self2.done = function done(fulfilled) {
        promise_then(state, fulfilled);
        return self2;
      };
      self2.fail = function fail(rejected) {
        promise_then(state, null, rejected);
        return self2;
      };
      self2.always = function always(callback) {
        promise_then(state, callback, callback);
        return self2;
      };
      self2.progress = function progress(updated) {
        promise_then(state, null, null, updated);
        return self2;
      };
      self2.state = function state_() {
        if (state.status == 1)
          return "resolved";
        if (state.status == 2)
          return "rejected";
        return "pending";
      };
      self2.promise = self2;
      return self2;
    }
    function process_queue(state) {
      const pending = state.pending;
      state.process_scheduled = false;
      state.pending = void 0;
      for (let i = 0, ii = pending.length; i < ii; ++i) {
        state.pur = true;
        const deferred = pending[i][0];
        const fn = pending[i][state.status];
        if (is_function(fn)) {
          deferred.resolve(fn.apply(state.promise, state.values));
        } else if (state.status === 1) {
          deferred.resolve.apply(deferred.resolve, state.values);
        } else {
          deferred.reject.apply(deferred.reject, state.values);
        }
      }
    }
    function schedule_process_queue(state) {
      if (state.process_scheduled || !state.pending)
        return;
      state.process_scheduled = true;
      later_invoke(function() {
        process_queue(state);
      });
    }
    function deferred_resolve(state, values) {
      let then2;
      let done = false;
      if (is_object(values[0]) || is_function(values[0]))
        then2 = values[0]?.then;
      if (is_function(then2)) {
        state.status = -1;
        then2.call(values[0], function() {
          if (done)
            return;
          done = true;
          deferred_resolve(state, arguments);
        }, function() {
          if (done)
            return;
          done = true;
          deferred_reject(state, arguments);
        }, function() {
          deferred_notify(state, arguments);
        });
      } else {
        state.values = values;
        state.status = 1;
        schedule_process_queue(state);
      }
    }
    function deferred_reject(state, values) {
      state.values = values;
      state.status = 2;
      schedule_process_queue(state);
    }
    function deferred_notify(state, values) {
      const callbacks = state.pending;
      if (state.status <= 0 && callbacks?.length) {
        later_invoke(function() {
          for (let i = 0, ii = callbacks.length; i < ii; i++) {
            const result = callbacks[i][0];
            const callback = callbacks[i][3];
            if (is_function(callback))
              result.notify(callback.apply(state.promise, values));
            else
              result.notify.apply(result, values);
          }
        });
      }
    }
    function Deferred() {
      const self2 = this;
      const state = {};
      self2.promise = state.promise = create_promise(state);
      self2.resolve = function resolve2() {
        if (arguments[0] === state.promise)
          throw new Error("Expected promise to be resolved with other value than itself");
        if (!state.status)
          deferred_resolve(state, arguments);
        return self2;
      };
      self2.reject = function reject2() {
        if (state.status)
          return;
        deferred_reject(state, arguments);
        return self2;
      };
      self2.notify = function notify() {
        deferred_notify(state, arguments);
        return self2;
      };
    }
    function prep_promise(values, resolved) {
      const result = cockpit.defer();
      if (resolved)
        result.resolve.apply(result, values);
      else
        result.reject.apply(result, values);
      return result.promise;
    }
    function handle_callback(values, is_resolved, callback) {
      let callback_output = null;
      if (is_function(callback))
        callback_output = callback();
      if (callback_output && is_function(callback_output.then)) {
        return callback_output.then(function() {
          return prep_promise(values, is_resolved);
        }, function() {
          return prep_promise(arguments, false);
        });
      } else {
        return prep_promise(values, is_resolved);
      }
    }
    cockpit.when = function when(value, fulfilled, rejected, updated) {
      const result = cockpit.defer();
      result.resolve(value);
      return result.promise.then(fulfilled, rejected, updated);
    };
    cockpit.resolve = function resolve2(result) {
      return cockpit.defer().resolve(result).promise;
    };
    cockpit.reject = function reject2(ex) {
      return cockpit.defer().reject(ex).promise;
    };
    cockpit.defer = function() {
      return new Deferred();
    };
    const fmt_re = /\$\{([^}]+)\}|\$([a-zA-Z0-9_]+)/g;
    cockpit.format = function format2(fmt, args) {
      if (arguments.length != 2 || !is_object(args) || args === null)
        args = Array.prototype.slice.call(arguments, 1);
      function replace(m, x2, y2) {
        const value = args[x2 || y2];
        if (value === 0)
          return "0";
        return value || "";
      }
      return fmt.replace(fmt_re, replace);
    };
    cockpit.format_number = function format_number(number4, precision) {
      if (precision === void 0)
        precision = 3;
      const lang = cockpit.language === void 0 ? void 0 : cockpit.language.replace("_", "-");
      const smallestValue = 10 ** -precision;
      if (!number4 && number4 !== 0)
        return "";
      else if (number4 % 1 === 0)
        return number4.toString();
      else if (number4 > 0 && number4 <= smallestValue)
        return smallestValue.toLocaleString(lang);
      else if (number4 < 0 && number4 >= -smallestValue)
        return (-smallestValue).toLocaleString(lang);
      else if (number4 > 999 || number4 < -999)
        return number4.toFixed(0);
      else
        return number4.toLocaleString(lang, {
          maximumSignificantDigits: precision,
          minimumSignificantDigits: precision
        });
    };
    function format_units(number4, suffixes, factor, options4) {
      if (!is_object(options4))
        options4 = { separate: options4 };
      let suffix = null;
      if (!number4 && number4 !== 0) {
        suffix = null;
      } else if (typeof factor === "string") {
        const keys = [];
        for (const key in suffixes)
          keys.push(key);
        keys.sort().reverse();
        for (let y2 = 0; y2 < keys.length; y2++) {
          for (let x2 = 0; x2 < suffixes[keys[y2]].length; x2++) {
            if (factor == suffixes[keys[y2]][x2]) {
              number4 = number4 / Math.pow(keys[y2], x2);
              suffix = factor;
              break;
            }
          }
          if (suffix)
            break;
        }
      } else if (factor in suffixes) {
        let divisor = 1;
        for (let i = 0; i < suffixes[factor].length; i++) {
          const quotient = number4 / divisor;
          if (quotient < factor) {
            number4 = quotient;
            suffix = suffixes[factor][i];
            break;
          }
          divisor *= factor;
        }
      }
      const string_representation = cockpit.format_number(number4, options4.precision);
      let ret;
      if (string_representation && suffix)
        ret = [string_representation, suffix];
      else
        ret = [string_representation];
      if (!options4.separate)
        ret = ret.join(" ");
      return ret;
    }
    const byte_suffixes = {
      1e3: [null, "KB", "MB", "GB", "TB", "PB", "EB", "ZB"],
      1024: [null, "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB"]
    };
    cockpit.format_bytes = function format_bytes(number4, factor, options4) {
      if (factor === void 0)
        factor = 1e3;
      return format_units(number4, byte_suffixes, factor, options4);
    };
    cockpit.get_byte_units = function get_byte_units(guide_value, factor) {
      if (factor === void 0 || !(factor in byte_suffixes))
        factor = 1e3;
      function unit2(index) {
        return {
          name: byte_suffixes[factor][index],
          factor: Math.pow(factor, index)
        };
      }
      const units = [unit2(2), unit2(3), unit2(4)];
      for (let i = units.length - 1; i >= 0; i--) {
        if (i === 0 || guide_value / units[i].factor >= 10) {
          units[i].selected = true;
          break;
        }
      }
      return units;
    };
    const byte_sec_suffixes = {
      1e3: ["B/s", "kB/s", "MB/s", "GB/s", "TB/s", "PB/s", "EB/s", "ZB/s"],
      1024: ["B/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s", "PiB/s", "EiB/s", "ZiB/s"]
    };
    cockpit.format_bytes_per_sec = function format_bytes_per_sec(number4, factor, options4) {
      if (factor === void 0)
        factor = 1e3;
      return format_units(number4, byte_sec_suffixes, factor, options4);
    };
    const bit_suffixes = {
      1e3: ["bps", "Kbps", "Mbps", "Gbps", "Tbps", "Pbps", "Ebps", "Zbps"]
    };
    cockpit.format_bits_per_sec = function format_bits_per_sec(number4, factor, options4) {
      if (factor === void 0)
        factor = 1e3;
      return format_units(number4, bit_suffixes, factor, options4);
    };
    function StorageHelper(storageName) {
      const self2 = this;
      let storage;
      try {
        storage = window[storageName];
      } catch (e) {
      }
      self2.prefixedKey = function(key) {
        return cockpit.transport.application() + ":" + key;
      };
      self2.getItem = function(key, both) {
        let value = storage.getItem(self2.prefixedKey(key));
        if (!value && both)
          value = storage.getItem(key);
        return value;
      };
      self2.setItem = function(key, value, both) {
        storage.setItem(self2.prefixedKey(key), value);
        if (both)
          storage.setItem(key, value);
      };
      self2.removeItem = function(key, both) {
        storage.removeItem(self2.prefixedKey(key));
        if (both)
          storage.removeItem(key);
      };
      self2.clear = function(full) {
        let i = 0;
        while (i < storage.length) {
          const k2 = storage.key(i);
          if (full && k2.indexOf("cockpit") !== 0)
            storage.removeItem(k2);
          else if (k2.indexOf(cockpit.transport.application()) === 0)
            storage.removeItem(k2);
          else
            i++;
        }
      };
    }
    cockpit.localStorage = new StorageHelper("localStorage");
    cockpit.sessionStorage = new StorageHelper("sessionStorage");
    function lookup_storage(win) {
      let storage;
      if (win.parent && win.parent !== win)
        storage = lookup_storage(win.parent);
      if (!storage) {
        try {
          storage = win["cv1-storage"];
          if (!storage)
            win["cv1-storage"] = storage = {};
        } catch (ex) {
        }
      }
      return storage;
    }
    function StorageCache(org_key, provider, consumer) {
      const self2 = this;
      const key = cockpit.transport.application() + ":" + org_key;
      const trigger = window.sessionStorage;
      let last;
      const storage = lookup_storage(window);
      let claimed = false;
      let source;
      function callback() {
        if (storage[key] !== void 0) {
          const value = storage[key];
          window.setTimeout(function() {
            if (consumer(value, org_key) === false)
              self2.close();
          });
        }
      }
      function result(value) {
        if (source && !claimed)
          claimed = true;
        if (!claimed)
          return;
        const version = Math.floor(Math.random() * 1e7) + 1;
        const ev = document.createEvent("StorageEvent");
        ev.initStorageEvent(
          "storage",
          false,
          false,
          key,
          null,
          version,
          window.location,
          trigger
        );
        storage[key] = value;
        trigger.setItem(key, version);
        ev.self = self2;
        window.dispatchEvent(ev);
      }
      self2.claim = function claim() {
        if (source)
          return;
        const claiming = { close: function() {
        } };
        source = claiming;
        const changed2 = provider(result, org_key);
        if (source === claiming)
          source = changed2;
        else
          changed2.close();
      };
      function unclaim() {
        if (source?.close)
          source.close();
        source = null;
        if (!claimed)
          return;
        claimed = false;
        let current_value = trigger.getItem(key);
        if (current_value)
          current_value = parseInt(current_value, 10);
        else
          current_value = null;
        if (last && last === current_value) {
          const ev = document.createEvent("StorageEvent");
          const version = trigger[key];
          ev.initStorageEvent(
            "storage",
            false,
            false,
            key,
            version,
            null,
            window.location,
            trigger
          );
          delete storage[key];
          trigger.removeItem(key);
          ev.self = self2;
          window.dispatchEvent(ev);
        }
      }
      function changed(event) {
        if (event.key !== key)
          return;
        if (event.self !== self2) {
          if (!event.newValue && !claimed) {
            self2.claim();
            return;
          }
        } else if (claimed && !event.oldValue && event.newValue !== trigger.getItem(key)) {
          unclaim();
        }
        let new_value = null;
        if (event.newValue)
          new_value = parseInt(event.newValue, 10);
        if (last !== new_value) {
          last = new_value;
          callback();
        }
      }
      self2.close = function() {
        window.removeEventListener("storage", changed, true);
        unclaim();
      };
      window.addEventListener("storage", changed, true);
      window.addEventListener("beforeunload", function() {
        self2.close();
      });
      window.addEventListener("unload", function() {
        self2.close();
      });
      if (trigger.getItem(key))
        callback();
      else
        self2.claim();
    }
    cockpit.cache = function cache(key, provider, consumer) {
      return new StorageCache(key, provider, consumer);
    };
    function SeriesSink(interval2, identifier, fetch_callback) {
      const self2 = this;
      self2.interval = interval2;
      self2.limit = identifier ? 64 * 1024 : 1024;
      const index = setup_index(identifier);
      let count = 0;
      let head = null;
      let tail = null;
      function setup_index(id) {
        if (!id)
          return [];
        const storage = lookup_storage(window);
        let index2 = storage[id];
        if (!index2)
          storage[id] = index2 = [];
        return index2;
      }
      function search(idx, beg) {
        let low = 0;
        let high = idx.length - 1;
        while (low <= high) {
          const mid = (low + high) / 2 | 0;
          const val = idx[mid].beg;
          if (val < beg)
            low = mid + 1;
          else if (val > beg)
            high = mid - 1;
          else
            return mid;
        }
        return low;
      }
      function fetch(beg, end2, for_walking) {
        if (fetch_callback) {
          if (!for_walking) {
            stash(beg, new Array(end2 - beg), {});
          }
          fetch_callback(beg, end2, for_walking);
        }
      }
      self2.load = function load(beg, end2, for_walking) {
        if (end2 <= beg)
          return;
        const at = search(index, beg);
        const len = index.length;
        let last = beg;
        const fetches = [];
        for (let i = at > 0 ? at - 1 : at; i < len; i++) {
          const entry = index[i];
          const en = entry.items.length;
          if (!en)
            continue;
          const eb = entry.beg;
          const b = Math.max(eb, beg);
          const e = Math.min(eb + en, end2);
          if (b < e) {
            if (b > last)
              fetches.push([last, b]);
            process2(b, entry.items.slice(b - eb, e - eb), entry.mapping);
            last = e;
          } else if (i >= at) {
            break;
          }
        }
        for (let i = 0; i < fetches.length; i++)
          fetch(fetches[i][0], fetches[i][1], for_walking);
        if (last != end2)
          fetch(last, end2, for_walking);
      };
      function stash(beg, items, mapping) {
        if (!items.length)
          return;
        let at = search(index, beg);
        const end2 = beg + items.length;
        const len = index.length;
        let i;
        for (i = at > 0 ? at - 1 : at; i < len; i++) {
          const entry2 = index[i];
          const en = entry2.items.length;
          if (!en)
            continue;
          const eb = entry2.beg;
          const b = Math.max(eb, beg);
          const e = Math.min(eb + en, end2);
          if (b < e) {
            const num = e - b;
            entry2.items.splice(b - eb, num);
            count -= num;
            if (b - eb === 0)
              entry2.beg += e - eb;
          } else if (i >= at) {
            break;
          }
        }
        const entry = { beg, items, mapping };
        if (!head)
          head = entry;
        if (tail)
          tail.next = entry;
        tail = entry;
        count += items.length;
        index.splice(at, 0, entry);
        for (at--; at <= i; at++) {
          const entry2 = index[at];
          if (entry2 && !entry2.items.length) {
            index.splice(at, 1);
            at--;
          }
        }
        while (head && count > self2.limit) {
          count -= head.items.length;
          head.items = [];
          head.mapping = null;
          head = head.next || null;
        }
        const newlen = index.length;
        for (i = 0; i < newlen; i++) {
          if (index[i].items.length > 0)
            break;
        }
        index.splice(0, i);
      }
      const registered = {};
      self2._register = function _register(grid, id) {
        if (grid.interval != interval2)
          throw Error("mismatched metric interval between grid and sink");
        let gdata = registered[id];
        if (!gdata) {
          gdata = registered[id] = { grid, links: [] };
          gdata.links.remove = function remove() {
            delete registered[id];
          };
        }
        return gdata.links;
      };
      function process2(beg, items, mapping) {
        const end2 = beg + items.length;
        for (const id in registered) {
          const gdata = registered[id];
          const grid = gdata.grid;
          const b = Math.max(beg, grid.beg);
          const e = Math.min(end2, grid.end);
          if (b < e) {
            const f = b - beg;
            const t = b - grid.beg;
            const n = e - b;
            for (let i = 0; i < n; i++) {
              const klen = gdata.links.length;
              for (let k2 = 0; k2 < klen; k2++) {
                const path2 = gdata.links[k2][0];
                const row = gdata.links[k2][1];
                let data = items[f + i];
                let map2 = mapping;
                const jlen = path2.length;
                for (let j = 0; data !== void 0 && j < jlen; j++) {
                  if (!data) {
                    data = void 0;
                  } else if (map2 !== void 0 && map2 !== null) {
                    map2 = map2[path2[j]];
                    if (map2)
                      data = data[map2[""]];
                    else
                      data = data[path2[j]];
                  } else {
                    data = data[path2[j]];
                  }
                }
                row[t + i] = data;
              }
            }
            grid.notify(t, n);
          }
        }
      }
      self2.input = function input(beg, items, mapping) {
        process2(beg, items, mapping);
        stash(beg, items, mapping);
      };
      self2.close = function() {
        for (const id in registered) {
          const grid = registered[id];
          if (grid?.grid)
            grid.grid.remove_sink(self2);
        }
      };
    }
    cockpit.series = function series(interval2, cache, fetch) {
      return new SeriesSink(interval2, cache, fetch);
    };
    let unique = 1;
    function SeriesGrid(interval2, beg, end2) {
      const self2 = this;
      event_mixin(self2, {});
      const rows = [];
      self2.interval = interval2;
      self2.beg = 0;
      self2.end = 0;
      const callbacks = [];
      const sinks = [];
      let suppress = 0;
      const id = "g1-" + unique;
      unique += 1;
      let walking = null;
      let offset2 = null;
      self2.notify = function notify(x2, n) {
        if (suppress)
          return;
        if (x2 + n > self2.end - self2.beg)
          n = self2.end - self2.beg - x2;
        if (n <= 0)
          return;
        const jlen = callbacks.length;
        for (let j = 0; j < jlen; j++) {
          const callback = callbacks[j][0];
          const row = callbacks[j][1];
          callback.call(self2, row, x2, n);
        }
        self2.dispatchEvent("notify", x2, n);
      };
      self2.add = function add() {
        const row = [];
        rows.push(row);
        if (is_object(arguments[0])) {
          const sink = arguments[0].series || arguments[0];
          let path2 = arguments[1];
          if (!path2)
            path2 = [];
          else if (typeof path2 === "string")
            path2 = path2.split(".");
          const links = sink._register(self2, id);
          if (!links.length)
            sinks.push({ sink, links });
          links.push([path2, row]);
        } else if (is_function(arguments[0])) {
          const cb = [arguments[0], row];
          if (arguments[1] === true)
            callbacks.unshift(cb);
          else
            callbacks.push(cb);
        } else if (arguments.length !== 0) {
          throw Error("invalid args to grid.add()");
        }
        return row;
      };
      self2.remove = function remove(row) {
        let ilen = sinks.length;
        for (let i = 0; i < ilen; i++) {
          const jlen = sinks[i].links.length;
          for (let j = 0; j < jlen; j++) {
            if (sinks[i].links[j][1] === row) {
              sinks[i].links.splice(j, 1);
              break;
            }
          }
        }
        ilen = rows.length;
        for (let i = 0; i < ilen; i++) {
          if (rows[i] === row) {
            rows.splice(i, 1);
            break;
          }
        }
      };
      self2.remove_sink = function remove_sink(sink) {
        const len = sinks.length;
        for (let i = 0; i < len; i++) {
          if (sinks[i].sink === sink) {
            sinks[i].links.remove();
            sinks.splice(i, 1);
            break;
          }
        }
      };
      self2.sync = function sync(for_walking) {
        suppress++;
        const len = sinks.length;
        for (let i = 0; i < len; i++) {
          const sink = sinks[i].sink;
          sink.load(self2.beg, self2.end, for_walking);
        }
        suppress--;
        self2.notify(0, self2.end - self2.beg);
      };
      function move_internal(beg2, end3, for_walking) {
        if (end3 === void 0)
          end3 = beg2 + (self2.end - self2.beg);
        if (end3 < beg2)
          beg2 = end3;
        self2.beg = beg2;
        self2.end = end3;
        if (!rows.length)
          return;
        rows.forEach(function(row) {
          row.length = 0;
        });
        self2.sync(for_walking);
      }
      function stop_walking() {
        window.clearInterval(walking);
        walking = null;
        offset2 = null;
      }
      self2.move = function move(beg2, end3) {
        stop_walking();
        let now2 = null;
        if (beg2 === void 0) {
          beg2 = 0;
        } else if (is_negative(beg2)) {
          now2 = Date.now();
          beg2 = Math.floor(now2 / self2.interval) + beg2;
        }
        if (end3 !== void 0 && is_negative(end3)) {
          if (now2 === null)
            now2 = Date.now();
          end3 = Math.floor(now2 / self2.interval) + end3;
        }
        move_internal(beg2, end3, false);
      };
      self2.walk = function walk() {
        const start2 = Date.now();
        if (self2.interval > 2e9)
          return;
        stop_walking();
        offset2 = start2 - self2.beg * self2.interval;
        walking = window.setInterval(function() {
          const now2 = Date.now();
          move_internal(Math.floor((now2 - offset2) / self2.interval), void 0, true);
        }, self2.interval);
      };
      self2.close = function close() {
        stop_walking();
        while (sinks.length)
          sinks.pop().links.remove();
      };
      self2.move(beg, end2);
    }
    cockpit.grid = function grid(interval2, beg, end2) {
      return new SeriesGrid(interval2, beg, end2);
    };
    function BasicError(problem, message) {
      this.problem = problem;
      this.message = message || cockpit.message(problem);
      this.toString = function() {
        return this.message;
      };
    }
    cockpit.logout = function logout(reload, reason) {
      cockpit.sessionStorage.clear(true);
      cockpit.localStorage.removeItem("login-data", true);
      cockpit.localStorage.clear(false);
      if (reload !== false)
        reload_after_disconnect = true;
      ensure_transport(function(transport) {
        if (!transport.send_control({ command: "logout", disconnect: true }))
          window.location.reload(reload_after_disconnect);
      });
      window.sessionStorage.setItem("logout-intent", "explicit");
      if (reason)
        window.sessionStorage.setItem("logout-reason", reason);
    };
    cockpit.drop_privileges = function drop_privileges() {
      ensure_transport(function(transport) {
        transport.send_control({ command: "logout", disconnect: false });
      });
    };
    cockpit.info = {};
    event_mixin(cockpit.info, {});
    init_callback = function(options4) {
      if (options4.system)
        Object.assign(cockpit.info, options4.system);
      if (options4.system)
        cockpit.info.dispatchEvent("changed");
    };
    let the_user = null;
    cockpit.user = function() {
      const dfd = cockpit.defer();
      if (!the_user) {
        const dbus = cockpit.dbus(null, { bus: "internal" });
        dbus.call(
          "/user",
          "org.freedesktop.DBus.Properties",
          "GetAll",
          ["cockpit.User"],
          { type: "s" }
        ).then(([user]) => {
          the_user = {
            id: user.Id.v,
            name: user.Name.v,
            full_name: user.Full.v,
            groups: user.Groups.v,
            home: user.Home.v,
            shell: user.Shell.v
          };
          dfd.resolve(the_user);
        }).catch((ex) => dfd.reject(ex)).finally(() => dbus.close());
      } else {
        dfd.resolve(the_user);
      }
      return dfd.promise;
    };
    document.addEventListener("click", function(ev) {
      if (ev.target.classList && in_array(ev.target.classList, "disabled"))
        ev.stopPropagation();
    }, true);
    let last_loc = null;
    function get_window_location_hash() {
      return window.location.href.split("#")[1] || "";
    }
    function Location() {
      const self2 = this;
      const application = cockpit.transport.application();
      self2.url_root = url_root || "";
      if (window.mock?.url_root)
        self2.url_root = window.mock.url_root;
      if (application.indexOf("cockpit+=") === 0) {
        if (self2.url_root)
          self2.url_root += "/";
        self2.url_root = self2.url_root + application.replace("cockpit+", "");
      }
      const href = get_window_location_hash();
      const options4 = {};
      self2.path = decode(href, options4);
      function decode_path(input) {
        const parts = input.split("/").map(decodeURIComponent);
        let result, i;
        let pre_parts = [];
        if (self2.url_root)
          pre_parts = self2.url_root.split("/").map(decodeURIComponent);
        if (input && input[0] !== "/") {
          result = [].concat(self2.path);
          result.pop();
          result = result.concat(parts);
        } else {
          result = parts;
        }
        result = resolve_path_dots(result);
        for (i = 0; i < pre_parts.length; i++) {
          if (pre_parts[i] !== result[i])
            break;
        }
        if (i == pre_parts.length)
          result.splice(0, pre_parts.length);
        return result;
      }
      function encode(path2, options5, with_root) {
        if (typeof path2 == "string")
          path2 = decode_path(path2);
        let href2 = "/" + path2.map(encodeURIComponent).join("/");
        if (with_root && self2.url_root && href2.indexOf("/" + self2.url_root + "/") !== 0)
          href2 = "/" + self2.url_root + href2;
        href2 = href2.replaceAll("%40", "@");
        href2 = href2.replaceAll("%3D", "=");
        href2 = href2.replaceAll("%2B", "+");
        href2 = href2.replaceAll("%23", "#");
        let opt;
        const query = [];
        function push_option(v) {
          query.push(encodeURIComponent(opt) + "=" + encodeURIComponent(v));
        }
        if (options5) {
          for (opt in options5) {
            let value = options5[opt];
            if (!Array.isArray(value))
              value = [value];
            value.forEach(push_option);
          }
          if (query.length > 0)
            href2 += "?" + query.join("&");
        }
        return href2;
      }
      function decode(href2, options5) {
        if (href2[0] == "#")
          href2 = href2.substr(1);
        const pos = href2.indexOf("?");
        const first = pos === -1 ? href2 : href2.substr(0, pos);
        const path2 = decode_path(first);
        if (pos !== -1 && options5) {
          href2.substring(pos + 1).split("&").forEach(function(opt) {
            const parts = opt.split("=");
            const name2 = decodeURIComponent(parts[0]);
            const value = decodeURIComponent(parts[1]);
            if (options5[name2]) {
              let last = options5[name2];
              if (!Array.isArray(value))
                last = options5[name2] = [last];
              last.push(value);
            } else {
              options5[name2] = value;
            }
          });
        }
        return path2;
      }
      function href_for_go_or_replace() {
        let href2;
        if (arguments.length == 1 && arguments[0] instanceof Location) {
          href2 = String(arguments[0]);
        } else if (typeof arguments[0] == "string") {
          const options5 = arguments[1] || {};
          href2 = encode(decode(arguments[0], options5), options5);
        } else {
          href2 = encode.apply(self2, arguments);
        }
        return href2;
      }
      function replace() {
        if (self2 !== last_loc)
          return;
        const href2 = href_for_go_or_replace.apply(self2, arguments);
        window.location.replace(window.location.pathname + "#" + href2);
      }
      function go() {
        if (self2 !== last_loc)
          return;
        const href2 = href_for_go_or_replace.apply(self2, arguments);
        window.location.hash = "#" + href2;
      }
      Object.defineProperties(self2, {
        path: {
          enumerable: true,
          writable: false,
          value: self2.path
        },
        options: {
          enumerable: true,
          writable: false,
          value: options4
        },
        href: {
          enumerable: true,
          value: href
        },
        go: { value: go },
        replace: { value: replace },
        encode: { value: encode },
        decode: { value: decode },
        toString: { value: function() {
          return href;
        } }
      });
    }
    Object.defineProperty(cockpit, "location", {
      enumerable: true,
      get: function() {
        if (!last_loc || last_loc.href !== get_window_location_hash())
          last_loc = new Location();
        return last_loc;
      },
      set: function(v) {
        cockpit.location.go(v);
      }
    });
    window.addEventListener("hashchange", function() {
      last_loc = null;
      let hash4 = window.location.hash;
      if (hash4.indexOf("#") === 0)
        hash4 = hash4.substring(1);
      cockpit.hint("location", { hash: hash4 });
      cockpit.dispatchEvent("locationchanged");
    });
    cockpit.jump = function jump(path2, host) {
      if (Array.isArray(path2))
        path2 = "/" + path2.map(encodeURIComponent).join("/").replaceAll("%40", "@").replaceAll("%3D", "=").replaceAll("%2B", "+");
      else
        path2 = "" + path2;
      if (host === void 0)
        host = cockpit.transport.host;
      const options4 = { command: "jump", location: path2, host };
      cockpit.transport.inject("\n" + JSON.stringify(options4));
    };
    (function() {
      let hiddenProp;
      let hiddenHint = false;
      function visibility_change() {
        let value = document[hiddenProp];
        if (!hiddenProp || typeof value === "undefined")
          value = false;
        if (value === false)
          value = hiddenHint;
        if (cockpit.hidden !== value) {
          cockpit.hidden = value;
          cockpit.dispatchEvent("visibilitychange");
        }
      }
      if (typeof document.hidden !== "undefined") {
        hiddenProp = "hidden";
        document.addEventListener("visibilitychange", visibility_change);
      } else if (typeof document.mozHidden !== "undefined") {
        hiddenProp = "mozHidden";
        document.addEventListener("mozvisibilitychange", visibility_change);
      } else if (typeof document.msHidden !== "undefined") {
        hiddenProp = "msHidden";
        document.addEventListener("msvisibilitychange", visibility_change);
      } else if (typeof document.webkitHidden !== "undefined") {
        hiddenProp = "webkitHidden";
        document.addEventListener("webkitvisibilitychange", visibility_change);
      }
      process_hints = function(data) {
        if ("hidden" in data) {
          hiddenHint = data.hidden;
          visibility_change();
        }
      };
      visibility_change();
    })();
    function ProcessError(options4, name2) {
      this.problem = options4.problem || null;
      this.exit_status = options4["exit-status"];
      if (this.exit_status === void 0)
        this.exit_status = null;
      this.exit_signal = options4["exit-signal"];
      if (this.exit_signal === void 0)
        this.exit_signal = null;
      this.message = options4.message;
      if (this.message === void 0) {
        if (this.problem)
          this.message = cockpit.message(options4.problem);
        else if (this.exit_signal !== null)
          this.message = cockpit.format(_("$0 killed with signal $1"), name2, this.exit_signal);
        else if (this.exit_status !== void 0)
          this.message = cockpit.format(_("$0 exited with code $1"), name2, this.exit_status);
        else
          this.message = cockpit.format(_("$0 failed"), name2);
      } else {
        this.message = this.message.trim();
      }
      this.toString = function() {
        return this.message;
      };
    }
    function spawn_debug() {
      if (window.debugging == "all" || window.debugging?.includes("spawn"))
        console.debug.apply(console, arguments);
    }
    cockpit.spawn = function(command, options4) {
      const dfd = cockpit.defer();
      const args = { payload: "stream", spawn: [] };
      if (command instanceof Array) {
        for (let i = 0; i < command.length; i++)
          args.spawn.push(String(command[i]));
      } else {
        args.spawn.push(String(command));
      }
      if (options4 !== void 0)
        Object.assign(args, options4);
      const name2 = args.spawn[0] || "process";
      const channel = cockpit.channel(args);
      const buffer = channel.buffer(null);
      channel.addEventListener("close", function(event, options5) {
        const data = buffer.squash();
        spawn_debug("process closed:", JSON.stringify(options5));
        if (data)
          spawn_debug("process output:", data);
        if (options5.message !== void 0)
          spawn_debug("process error:", options5.message);
        if (options5.problem)
          dfd.reject(new ProcessError(options5, name2));
        else if (options5["exit-status"] || options5["exit-signal"])
          dfd.reject(new ProcessError(options5, name2), data);
        else if (options5.message !== void 0)
          dfd.resolve(data, options5.message);
        else
          dfd.resolve(data);
      });
      const ret = dfd.promise;
      ret.stream = function(callback) {
        buffer.callback = callback.bind(ret);
        return this;
      };
      ret.input = function(message, stream) {
        if (message !== null && message !== void 0) {
          spawn_debug("process input:", message);
          iterate_data(message, function(data) {
            channel.send(data);
          });
        }
        if (!stream)
          channel.control({ command: "done" });
        return this;
      };
      ret.close = function(problem) {
        spawn_debug("process closing:", problem);
        if (channel.valid)
          channel.close(problem);
        return this;
      };
      return ret;
    };
    cockpit.script = function(script, args, options4) {
      if (!options4 && is_plain_object(args)) {
        options4 = args;
        args = [];
      }
      const command = ["/bin/sh", "-c", script, "--"];
      command.push.apply(command, args);
      return cockpit.spawn(command, options4);
    };
    function dbus_debug() {
      if (window.debugging == "all" || window.debugging?.includes("dbus"))
        console.debug.apply(console, arguments);
    }
    function DBusError(arg, arg1) {
      if (typeof arg == "string") {
        this.problem = arg;
        this.name = null;
        this.message = arg1 || cockpit.message(arg);
      } else {
        this.problem = null;
        this.name = arg[0];
        this.message = arg[1][0] || arg[0];
      }
      this.toString = function() {
        return this.message;
      };
    }
    function DBusCache() {
      const self2 = this;
      let callbacks = [];
      self2.data = {};
      self2.meta = {};
      self2.connect = function connect(path2, iface, callback, first) {
        const cb = [path2, iface, callback];
        if (first)
          callbacks.unshift(cb);
        else
          callbacks.push(cb);
        return {
          remove: function remove() {
            const length = callbacks.length;
            for (let i = 0; i < length; i++) {
              const cb2 = callbacks[i];
              if (cb2[0] === path2 && cb2[1] === iface && cb2[2] === callback) {
                delete cb2[i];
                break;
              }
            }
          }
        };
      };
      function emit(path2, iface, props) {
        const copy3 = callbacks.slice();
        const length = copy3.length;
        for (let i = 0; i < length; i++) {
          const cb = copy3[i];
          if ((!cb[0] || cb[0] === path2) && (!cb[1] || cb[1] === iface)) {
            cb[2](props, path2);
          }
        }
      }
      self2.update = function update(path2, iface, props) {
        if (!self2.data[path2])
          self2.data[path2] = {};
        if (!self2.data[path2][iface])
          self2.data[path2][iface] = props;
        else
          props = Object.assign(self2.data[path2][iface], props);
        emit(path2, iface, props);
      };
      self2.remove = function remove(path2, iface) {
        if (self2.data[path2]) {
          delete self2.data[path2][iface];
          emit(path2, iface, null);
        }
      };
      self2.lookup = function lookup(path2, iface) {
        if (self2.data[path2])
          return self2.data[path2][iface];
        return void 0;
      };
      self2.each = function each(iface, callback) {
        for (const path2 in self2.data) {
          for (const ifa in self2.data[path2]) {
            if (ifa == iface)
              callback(self2.data[path2][iface], path2);
          }
        }
      };
      self2.close = function close() {
        self2.data = {};
        const copy3 = callbacks;
        callbacks = [];
        const length = copy3.length;
        for (let i = 0; i < length; i++)
          copy3[i].callback();
      };
    }
    function DBusProxy(client, cache, iface, path2, options4) {
      const self2 = this;
      event_mixin(self2, {});
      let valid = false;
      let defined3 = false;
      const waits = cockpit.defer();
      Object.defineProperties(self2, {
        client: { value: client, enumerable: false, writable: false },
        path: { value: path2, enumerable: false, writable: false },
        iface: { value: iface, enumerable: false, writable: false },
        valid: { get: function() {
          return valid;
        }, enumerable: false },
        wait: {
          enumerable: false,
          writable: false,
          value: function(func) {
            if (func)
              waits.promise.always(func);
            return waits.promise;
          }
        },
        call: {
          value: function(name2, args, options5) {
            return client.call(path2, iface, name2, args, options5);
          },
          enumerable: false,
          writable: false
        },
        data: { value: {}, enumerable: false }
      });
      if (!options4)
        options4 = {};
      function define2() {
        if (!cache.meta[iface])
          return;
        const meta = cache.meta[iface];
        defined3 = true;
        Object.keys(meta.methods || {}).forEach(function(name2) {
          if (name2[0].toLowerCase() == name2[0])
            return;
          Object.defineProperty(self2, name2, {
            enumerable: false,
            value: function() {
              const dfd = cockpit.defer();
              client.call(path2, iface, name2, Array.prototype.slice.call(arguments)).done(function(reply) {
                dfd.resolve.apply(dfd, reply);
              }).fail(function(ex) {
                dfd.reject(ex);
              });
              return dfd.promise;
            }
          });
        });
        Object.keys(meta.properties || {}).forEach(function(name2) {
          if (name2[0].toLowerCase() == name2[0])
            return;
          const config2 = {
            enumerable: true,
            get: function() {
              return self2.data[name2];
            },
            set: function(v) {
              throw Error(name2 + "is not writable");
            }
          };
          const prop = meta.properties[name2];
          if (prop.flags && prop.flags.indexOf("w") !== -1) {
            config2.set = function(v) {
              client.call(
                path2,
                "org.freedesktop.DBus.Properties",
                "Set",
                [iface, name2, cockpit.variant(prop.type, v)]
              ).fail(function(ex) {
                console.log("Couldn't set " + iface + " " + name2 + " at " + path2 + ": " + ex);
              });
            };
          }
          Object.defineProperty(self2, name2, config2);
        });
      }
      function update(props) {
        if (props) {
          Object.assign(self2.data, props);
          if (!defined3)
            define2();
          valid = true;
        } else {
          valid = false;
        }
        self2.dispatchEvent("changed", props);
      }
      cache.connect(path2, iface, update, true);
      update(cache.lookup(path2, iface));
      function signal(path3, iface2, name2, args) {
        self2.dispatchEvent("signal", name2, args);
        if (name2[0].toLowerCase() != name2[0]) {
          args = args.slice();
          args.unshift(name2);
          self2.dispatchEvent.apply(self2, args);
        }
      }
      client.subscribe({ path: path2, interface: iface }, signal, options4.subscribe !== false);
      function waited(ex) {
        if (valid)
          waits.resolve();
        else
          waits.reject(ex);
      }
      if (options4.watch !== false)
        client.watch({ path: path2, interface: iface }).always(waited);
      else
        waited();
    }
    function DBusProxies(client, cache, iface, path_namespace, options4) {
      const self2 = this;
      event_mixin(self2, {});
      let waits;
      Object.defineProperties(self2, {
        client: { value: client, enumerable: false, writable: false },
        iface: { value: iface, enumerable: false, writable: false },
        path_namespace: { value: path_namespace, enumerable: false, writable: false },
        wait: {
          enumerable: false,
          writable: false,
          value: function(func) {
            if (func)
              waits.always(func);
            return waits;
          }
        }
      });
      const match = { interface: iface, path_namespace };
      client.subscribe(match);
      if (options4.watch !== false) {
        waits = client.watch(match);
      } else {
        waits = cockpit.defer().resolve().promise;
      }
      options4 = { watch: false, subscribe: false, ...options4 };
      function update(props, path2) {
        let proxy = self2[path2];
        if (path2) {
          if (!props && proxy) {
            delete self2[path2];
            self2.dispatchEvent("removed", proxy);
          } else if (props) {
            if (!proxy) {
              proxy = self2[path2] = client.proxy(iface, path2, options4);
              self2.dispatchEvent("added", proxy);
            }
            self2.dispatchEvent("changed", proxy);
          }
        }
      }
      cache.connect(null, iface, update, false);
      cache.each(iface, update);
    }
    function DBusClient(name2, options4) {
      const self2 = this;
      event_mixin(self2, {});
      const args = {};
      let track = false;
      let owner = null;
      if (options4) {
        if (options4.track)
          track = true;
        delete options4.track;
        Object.assign(args, options4);
      }
      args.payload = "dbus-json3";
      if (name2)
        args.name = name2;
      self2.options = options4;
      self2.unique_name = null;
      dbus_debug("dbus open: ", args);
      let channel = cockpit.channel(args);
      const subscribers = {};
      let calls = {};
      let cache;
      let closed;
      self2.constructors = { "*": DBusProxy };
      self2.wait = channel.wait;
      function ensure_cache() {
        if (!cache)
          cache = new DBusCache();
      }
      function send(payload) {
        if (channel?.valid) {
          dbus_debug("dbus:", payload);
          channel.send(payload);
          return true;
        }
        return false;
      }
      function matches2(signal, match) {
        if (match.path && signal[0] !== match.path)
          return false;
        if (match.path_namespace && signal[0].indexOf(match.path_namespace) !== 0)
          return false;
        if (match.interface && signal[1] !== match.interface)
          return false;
        if (match.member && signal[2] !== match.member)
          return false;
        if (match.arg0 && (!signal[3] || signal[3][0] !== match.arg0))
          return false;
        return true;
      }
      function on_message(event, payload) {
        dbus_debug("dbus:", payload);
        let msg;
        try {
          msg = JSON.parse(payload);
        } catch (ex) {
          console.warn("received invalid dbus json message:", ex);
        }
        if (msg === void 0) {
          channel.close({ problem: "protocol-error" });
          return;
        }
        const dfd = msg.id !== void 0 ? calls[msg.id] : void 0;
        if (msg.reply) {
          if (dfd) {
            const options5 = {};
            if (msg.type)
              options5.type = msg.type;
            if (msg.flags)
              options5.flags = msg.flags;
            dfd.resolve(msg.reply[0] || [], options5);
            delete calls[msg.id];
          }
          return;
        } else if (msg.error) {
          if (dfd) {
            dfd.reject(new DBusError(msg.error));
            delete calls[msg.id];
          }
          return;
        }
        later_invoke(function() {
          if (msg.signal) {
            for (const id in subscribers) {
              const subscription = subscribers[id];
              if (subscription.callback) {
                if (matches2(msg.signal, subscription.match))
                  subscription.callback.apply(self2, msg.signal);
              }
            }
          } else if (msg.notify) {
            notify(msg.notify);
          } else if (msg.meta) {
            meta(msg.meta);
          } else if (msg.owner !== void 0) {
            self2.dispatchEvent("owner", msg.owner);
            if (track && owner)
              self2.close();
            owner = msg.owner;
          } else {
            dbus_debug("received unexpected dbus json message:", payload);
          }
        });
      }
      function meta(data) {
        ensure_cache();
        Object.assign(cache.meta, data);
        self2.dispatchEvent("meta", data);
      }
      function notify(data) {
        ensure_cache();
        for (const path2 in data) {
          for (const iface in data[path2]) {
            const props = data[path2][iface];
            if (!props)
              cache.remove(path2, iface);
            else
              cache.update(path2, iface, props);
          }
        }
        self2.dispatchEvent("notify", data);
      }
      this.notify = notify;
      function close_perform(options5) {
        closed = options5.problem || "disconnected";
        const outstanding = calls;
        calls = {};
        for (const id in outstanding) {
          outstanding[id].reject(new DBusError(closed, options5.message));
        }
        self2.dispatchEvent("close", options5);
      }
      this.close = function close(options5) {
        if (typeof options5 == "string")
          options5 = { problem: options5 };
        if (!options5)
          options5 = {};
        if (channel)
          channel.close(options5);
        else
          close_perform(options5);
      };
      function on_ready(event, message) {
        dbus_debug("dbus ready:", options4);
        self2.unique_name = message["unique-name"];
      }
      function on_close(event, options5) {
        dbus_debug("dbus close:", options5);
        channel.removeEventListener("ready", on_ready);
        channel.removeEventListener("message", on_message);
        channel.removeEventListener("close", on_close);
        channel = null;
        close_perform(options5);
      }
      channel.addEventListener("ready", on_ready);
      channel.addEventListener("message", on_message);
      channel.addEventListener("close", on_close);
      let last_cookie = 1;
      this.call = function call(path2, iface, method, args2, options5) {
        const dfd = cockpit.defer();
        const id = String(last_cookie);
        last_cookie++;
        const method_call = {
          ...options5,
          call: [path2, iface, method, args2 || []],
          id
        };
        const msg = JSON.stringify(method_call);
        if (send(msg))
          calls[id] = dfd;
        else
          dfd.reject(new DBusError(closed));
        return dfd.promise;
      };
      self2.signal = function signal(path2, iface, member, args2, options5) {
        if (!channel || !channel.valid)
          return;
        const message = { ...options5, signal: [path2, iface, member, args2 || []] };
        send(JSON.stringify(message));
      };
      this.subscribe = function subscribe(match, callback, rule) {
        const subscription = {
          match: { ...match },
          callback
        };
        if (rule !== false)
          send(JSON.stringify({ "add-match": subscription.match }));
        let id;
        if (callback) {
          id = String(last_cookie);
          last_cookie++;
          subscribers[id] = subscription;
        }
        return {
          remove: function() {
            let prev;
            if (id) {
              prev = subscribers[id];
              if (prev)
                delete subscribers[id];
            }
            if (rule !== false && prev)
              send(JSON.stringify({ "remove-match": prev.match }));
          }
        };
      };
      self2.watch = function watch(path2) {
        const match = is_plain_object(path2) ? { ...path2 } : { path: String(path2) };
        const id = String(last_cookie);
        last_cookie++;
        const dfd = cockpit.defer();
        const msg = JSON.stringify({ watch: match, id });
        if (send(msg))
          calls[id] = dfd;
        else
          dfd.reject(new DBusError(closed));
        const ret = dfd.promise;
        ret.remove = function remove() {
          if (id in calls) {
            dfd.reject(new DBusError("cancelled"));
            delete calls[id];
          }
          send(JSON.stringify({ unwatch: match }));
        };
        return ret;
      };
      self2.proxy = function proxy(iface, path2, options5) {
        if (!iface)
          iface = name2;
        iface = String(iface);
        if (!path2)
          path2 = "/" + iface.replaceAll(".", "/");
        let Constructor = self2.constructors[iface];
        if (!Constructor)
          Constructor = self2.constructors["*"];
        if (!options5)
          options5 = {};
        ensure_cache();
        return new Constructor(self2, cache, iface, String(path2), options5);
      };
      self2.proxies = function proxies(iface, path_namespace, options5) {
        if (!iface)
          iface = name2;
        if (!path_namespace)
          path_namespace = "/";
        if (!options5)
          options5 = {};
        ensure_cache();
        return new DBusProxies(self2, cache, String(iface), String(path_namespace), options5);
      };
    }
    const shared_dbus = {
      internal: null,
      session: null,
      system: null
    };
    cockpit.dbus = function dbus(name2, options4) {
      if (!options4)
        options4 = { bus: "system" };
      const keys = Object.keys(options4);
      const bus = options4.bus;
      const shared = !name2 && keys.length == 1 && bus in shared_dbus;
      if (shared && shared_dbus[bus])
        return shared_dbus[bus];
      const client = new DBusClient(name2, options4);
      if (shared) {
        const old_close = client.close;
        client.close = function() {
          if (arguments.length > 0)
            old_close.apply(client, arguments);
        };
        client.addEventListener("close", function() {
          if (shared_dbus[bus] == client)
            shared_dbus[bus] = null;
        });
        shared_dbus[bus] = client;
      }
      return client;
    };
    cockpit.variant = function variant(type, value) {
      return { v: value, t: type };
    };
    cockpit.byte_array = function byte_array(string) {
      return window.btoa(string);
    };
    cockpit.file = function file(path2, options4) {
      options4 = options4 || {};
      const binary = options4.binary;
      const self2 = {
        path: path2,
        read: read2,
        replace,
        modify,
        watch,
        close
      };
      const base_channel_options = { ...options4 };
      delete base_channel_options.syntax;
      function parse2(str) {
        if (options4.syntax?.parse)
          return options4.syntax.parse(str);
        else
          return str;
      }
      function stringify2(obj) {
        if (options4.syntax?.stringify)
          return options4.syntax.stringify(obj);
        else
          return obj;
      }
      let read_promise = null;
      let read_channel;
      function read2() {
        if (read_promise)
          return read_promise;
        const dfd = cockpit.defer();
        const opts = {
          ...base_channel_options,
          payload: "fsread1",
          path: path2
        };
        function try_read() {
          read_channel = cockpit.channel(opts);
          const content_parts = [];
          read_channel.addEventListener("message", function(event, message) {
            content_parts.push(message);
          });
          read_channel.addEventListener("close", function(event, message) {
            read_channel = null;
            if (message.problem == "change-conflict") {
              try_read();
              return;
            }
            read_promise = null;
            if (message.problem) {
              const error = new BasicError(message.problem, message.message);
              fire_watch_callbacks(null, null, error);
              dfd.reject(error);
              return;
            }
            let content;
            if (message.tag == "-")
              content = null;
            else {
              try {
                content = parse2(join_data(content_parts, binary));
              } catch (e) {
                fire_watch_callbacks(null, null, e);
                dfd.reject(e);
                return;
              }
            }
            fire_watch_callbacks(content, message.tag);
            dfd.resolve(content, message.tag);
          });
        }
        try_read();
        read_promise = dfd.promise;
        return read_promise;
      }
      let replace_channel = null;
      function replace(new_content, expected_tag) {
        const dfd = cockpit.defer();
        let file_content;
        try {
          file_content = new_content === null ? null : stringify2(new_content);
        } catch (e) {
          dfd.reject(e);
          return dfd.promise;
        }
        if (replace_channel)
          replace_channel.close("abort");
        const opts = {
          ...base_channel_options,
          payload: "fsreplace1",
          path: path2,
          tag: expected_tag
        };
        replace_channel = cockpit.channel(opts);
        replace_channel.addEventListener("close", function(event, message) {
          replace_channel = null;
          if (message.problem) {
            dfd.reject(new BasicError(message.problem, message.message));
          } else {
            fire_watch_callbacks(new_content, message.tag);
            dfd.resolve(message.tag);
          }
        });
        iterate_data(file_content, function(data) {
          replace_channel.send(data);
        });
        replace_channel.control({ command: "done" });
        return dfd.promise;
      }
      function modify(callback, initial_content, initial_tag) {
        const dfd = cockpit.defer();
        function update(content, tag) {
          let new_content = callback(content);
          if (new_content === void 0)
            new_content = content;
          replace(new_content, tag).done(function(new_tag) {
            dfd.resolve(new_content, new_tag);
          }).fail(function(error) {
            if (error.problem == "change-conflict")
              read_then_update();
            else
              dfd.reject(error);
          });
        }
        function read_then_update() {
          read2().done(update).fail(function(error) {
            dfd.reject(error);
          });
        }
        if (initial_content === void 0)
          read_then_update();
        else
          update(initial_content, initial_tag);
        return dfd.promise;
      }
      const watch_callbacks = [];
      let n_watch_callbacks = 0;
      let watch_channel = null;
      let watch_tag;
      function ensure_watch_channel(options5) {
        if (n_watch_callbacks > 0) {
          if (watch_channel)
            return;
          const opts = {
            payload: "fswatch1",
            path: path2,
            superuser: base_channel_options.superuser
          };
          watch_channel = cockpit.channel(opts);
          watch_channel.addEventListener("message", function(event, message_string) {
            let message;
            try {
              message = JSON.parse(message_string);
            } catch (e) {
              message = null;
            }
            if (message && message.path == path2 && message.tag && message.tag != watch_tag) {
              if (options5 && options5.read !== void 0 && !options5.read)
                fire_watch_callbacks(null, message.tag);
              else
                read2();
            }
          });
        } else {
          if (watch_channel) {
            watch_channel.close();
            watch_channel = null;
          }
        }
      }
      function fire_watch_callbacks() {
        watch_tag = arguments[1] || null;
        invoke_functions(watch_callbacks, self2, arguments);
      }
      function watch(callback, options5) {
        if (callback)
          watch_callbacks.push(callback);
        n_watch_callbacks += 1;
        ensure_watch_channel(options5);
        watch_tag = null;
        read2();
        return {
          remove: function() {
            if (callback) {
              const index = watch_callbacks.indexOf(callback);
              if (index > -1)
                watch_callbacks[index] = null;
            }
            n_watch_callbacks -= 1;
            ensure_watch_channel(options5);
          }
        };
      }
      function close() {
        if (read_channel)
          read_channel.close("cancelled");
        if (replace_channel)
          replace_channel.close("cancelled");
        if (watch_channel)
          watch_channel.close("cancelled");
      }
      return self2;
    };
    let po_data = {};
    let po_plural;
    cockpit.language = "en";
    cockpit.language_direction = "ltr";
    cockpit.locale = function locale3(po) {
      let lang = cockpit.language;
      let lang_dir = cockpit.language_direction;
      let header;
      if (po) {
        Object.assign(po_data, po);
        header = po[""];
      } else if (po === null) {
        po_data = {};
      }
      if (header) {
        if (header["plural-forms"])
          po_plural = header["plural-forms"];
        if (header.language)
          lang = header.language;
        if (header["language-direction"])
          lang_dir = header["language-direction"];
      }
      cockpit.language = lang;
      cockpit.language_direction = lang_dir;
    };
    cockpit.translate = function translate() {
      let what;
      if (arguments.length === 0)
        what = [document];
      else if (arguments.length === 1 && arguments[0].length)
        what = arguments[0];
      else
        what = arguments;
      const wlen = what.length;
      for (let w2 = 0; w2 < wlen; w2++) {
        let list = null;
        if (what[w2].querySelectorAll)
          list = what[w2].querySelectorAll("[translatable], [translate]");
        if (!list)
          continue;
        for (let i = 0; i < list.length; i++) {
          const el = list[i];
          let val = el.getAttribute("translate") || el.getAttribute("translatable") || "yes";
          if (val == "no")
            continue;
          const tasks = val.split(" ");
          val = el.getAttribute("translate-context") || el.getAttribute("context");
          for (let t = 0; t < tasks.length; t++) {
            if (tasks[t] == "yes" || tasks[t] == "translate")
              el.textContent = cockpit.gettext(val, el.textContent);
            else if (tasks[t])
              el.setAttribute(tasks[t], cockpit.gettext(val, el.getAttribute(tasks[t]) || ""));
          }
          el.removeAttribute("translatable");
          el.removeAttribute("translate");
        }
      }
    };
    cockpit.gettext = function gettext(context, string) {
      if (arguments.length == 1) {
        string = context;
        context = void 0;
      }
      const key = context ? context + "" + string : string;
      if (po_data) {
        const translated = po_data[key];
        if (translated?.[1])
          return translated[1];
      }
      return string;
    };
    function imply(val) {
      return val === true ? 1 : val || 0;
    }
    cockpit.ngettext = function ngettext(context, string1, stringN, num) {
      if (arguments.length == 3) {
        num = stringN;
        stringN = string1;
        string1 = context;
        context = void 0;
      }
      const key = context ? context + "" + string1 : string1;
      if (po_data && po_plural) {
        const translated = po_data[key];
        if (translated) {
          const i = imply(po_plural(num)) + 1;
          if (translated[i])
            return translated[i];
        }
      }
      if (num == 1)
        return string1;
      return stringN;
    };
    cockpit.noop = function noop4(arg0, arg1) {
      return arguments[arguments.length - 1];
    };
    const _ = cockpit.gettext;
    cockpit.message = function message(arg) {
      if (arg.message)
        return arg.message;
      let problem = null;
      if (arg.problem)
        problem = arg.problem;
      else
        problem = arg + "";
      if (problem == "terminated")
        return _("Your session has been terminated.");
      else if (problem == "no-session")
        return _("Your session has expired. Please log in again.");
      else if (problem == "access-denied")
        return _("Not permitted to perform this action.");
      else if (problem == "authentication-failed")
        return _("Login failed");
      else if (problem == "authentication-not-supported")
        return _("The server refused to authenticate using any supported methods.");
      else if (problem == "unknown-hostkey")
        return _("Untrusted host");
      else if (problem == "unknown-host")
        return _("Untrusted host");
      else if (problem == "invalid-hostkey")
        return _("Host key is incorrect");
      else if (problem == "internal-error")
        return _("Internal error");
      else if (problem == "timeout")
        return _("Connection has timed out.");
      else if (problem == "no-cockpit")
        return _("Cockpit is not installed on the system.");
      else if (problem == "no-forwarding")
        return _("Cannot forward login credentials");
      else if (problem == "disconnected")
        return _("Server has closed the connection.");
      else if (problem == "not-supported")
        return _("Cockpit is not compatible with the software on the system.");
      else if (problem == "no-host")
        return _("Cockpit could not contact the given host.");
      else if (problem == "too-large")
        return _("Too much data");
      else
        return problem;
    };
    function HttpError(arg0, arg1, message) {
      this.status = parseInt(arg0, 10);
      this.reason = arg1;
      this.message = message || arg1;
      this.problem = null;
      this.valueOf = function() {
        return this.status;
      };
      this.toString = function() {
        return this.status + " " + this.message;
      };
    }
    function http_debug() {
      if (window.debugging == "all" || window.debugging?.includes("http"))
        console.debug.apply(console, arguments);
    }
    function find_header(headers, name2) {
      if (!headers)
        return void 0;
      name2 = name2.toLowerCase();
      for (const head in headers) {
        if (head.toLowerCase() == name2)
          return headers[head];
      }
      return void 0;
    }
    function HttpClient(endpoint, options4) {
      const self2 = this;
      self2.options = options4;
      options4.payload = "http-stream2";
      const active_requests = [];
      if (endpoint !== void 0) {
        if (endpoint.indexOf && endpoint.indexOf("/") === 0) {
          options4.unix = endpoint;
        } else {
          const port = parseInt(endpoint, 10);
          if (!isNaN(port))
            options4.port = port;
          else
            throw Error("The endpoint must be either a unix path or port number");
        }
      }
      if (options4.address) {
        if (!options4.capabilities)
          options4.capabilities = [];
        options4.capabilities.push("address");
      }
      function param(obj) {
        return Object.keys(obj).map(function(k2) {
          return encodeURIComponent(k2) + "=" + encodeURIComponent(obj[k2]);
        }).join("&").split("%20").join("+");
      }
      self2.request = function request(req) {
        const dfd = cockpit.defer();
        const ret = dfd.promise;
        if (!req.path)
          req.path = "/";
        if (!req.method)
          req.method = "GET";
        if (req.params) {
          if (req.path.indexOf("?") === -1)
            req.path += "?" + param(req.params);
          else
            req.path += "&" + param(req.params);
        }
        delete req.params;
        const input = req.body;
        delete req.body;
        const headers = req.headers;
        delete req.headers;
        Object.assign(req, options4);
        if (options4.headers && headers)
          req.headers = { ...options4.headers, ...headers };
        else if (options4.headers)
          req.headers = options4.headers;
        else
          req.headers = headers;
        http_debug("http request:", JSON.stringify(req));
        const channel = cockpit.channel(req);
        if (input !== void 0) {
          if (input !== "") {
            http_debug("http input:", input);
            iterate_data(input, function(data) {
              channel.send(data);
            });
          }
          http_debug("http done");
          channel.control({ command: "done" });
        }
        let streamer = null;
        let responsers = null;
        let resp = null;
        const buffer = channel.buffer(function(data) {
          if (resp && resp.status >= 200 && resp.status <= 299 && streamer)
            return streamer.call(ret, data);
          return 0;
        });
        function on_control(event, options5) {
          if (options5.command == "response") {
            resp = options5;
            if (responsers) {
              resp.headers = resp.headers || {};
              invoke_functions(responsers, ret, [resp.status, resp.headers]);
            }
          }
        }
        function on_close(event, options5) {
          const pos = active_requests.indexOf(ret);
          if (pos >= 0)
            active_requests.splice(pos, 1);
          if (options5.problem) {
            http_debug("http problem: ", options5.problem);
            dfd.reject(new BasicError(options5.problem));
          } else {
            const body = buffer.squash();
            if (resp && (resp.status < 200 || resp.status > 299)) {
              let message;
              const type = find_header(resp.headers, "Content-Type");
              if (type && !channel.binary) {
                if (type.indexOf("text/plain") === 0)
                  message = body;
              }
              http_debug("http status: ", resp.status);
              dfd.reject(new HttpError(resp.status, resp.reason, message), body);
            } else {
              http_debug("http done");
              dfd.resolve(body);
            }
          }
          channel.removeEventListener("control", on_control);
          channel.removeEventListener("close", on_close);
        }
        channel.addEventListener("control", on_control);
        channel.addEventListener("close", on_close);
        ret.stream = function(callback) {
          streamer = callback;
          return ret;
        };
        ret.response = function(callback) {
          if (responsers === null)
            responsers = [];
          responsers.push(callback);
          return ret;
        };
        ret.input = function(message, stream) {
          if (message !== null && message !== void 0) {
            http_debug("http input:", message);
            iterate_data(message, function(data) {
              channel.send(data);
            });
          }
          if (!stream) {
            http_debug("http done");
            channel.control({ command: "done" });
          }
          return ret;
        };
        ret.close = function(problem) {
          http_debug("http closing:", problem);
          channel.close(problem);
          return ret;
        };
        active_requests.push(ret);
        return ret;
      };
      self2.get = function get(path2, params, headers) {
        return self2.request({
          method: "GET",
          params,
          path: path2,
          body: "",
          headers
        });
      };
      self2.post = function post(path2, body, headers) {
        headers = headers || {};
        if (is_plain_object(body) || Array.isArray(body)) {
          body = JSON.stringify(body);
          if (find_header(headers, "Content-Type") === void 0)
            headers["Content-Type"] = "application/json";
        } else if (body === void 0 || body === null) {
          body = "";
        } else if (typeof body !== "string") {
          body = String(body);
        }
        return self2.request({
          method: "POST",
          path: path2,
          body,
          headers
        });
      };
      self2.close = function close(problem) {
        const reqs = active_requests.slice();
        for (let i = 0; i < reqs.length; i++)
          reqs[i].close(problem);
      };
    }
    cockpit.http = function(endpoint, options4) {
      if (is_plain_object(endpoint) && options4 === void 0) {
        options4 = endpoint;
        endpoint = void 0;
      }
      return new HttpClient(endpoint, options4 || {});
    };
    function check_superuser() {
      return new Promise((resolve2, reject2) => {
        const ch = cockpit.channel({ payload: "null", superuser: "require" });
        ch.wait().then(() => resolve2(true)).catch(() => resolve2(false)).always(() => ch.close());
      });
    }
    function Permission(options4) {
      const self2 = this;
      event_mixin(self2, {});
      const api = cockpit.dbus(null, { bus: "internal" }).proxy("cockpit.Superuser", "/superuser");
      api.addEventListener("changed", maybe_reload);
      function maybe_reload() {
        if (api.valid && self2.allowed !== null) {
          if (self2.allowed != (api.Current != "none"))
            window.location.reload(true);
        }
      }
      self2.allowed = null;
      self2.user = options4 ? options4.user : null;
      self2.is_superuser = options4 ? options4._is_superuser : null;
      let group = null;
      let admin = false;
      if (options4)
        group = options4.group;
      if (options4?.admin)
        admin = true;
      function decide(user) {
        if (user.id === 0)
          return true;
        if (group)
          return !!(user.groups || []).includes(group);
        if (admin)
          return self2.is_superuser;
        if (user.id === void 0)
          return null;
        return false;
      }
      if (self2.user && self2.is_superuser !== null) {
        self2.allowed = decide(self2.user);
      } else {
        Promise.all([cockpit.user(), check_superuser()]).then(([user, is_superuser]) => {
          self2.user = user;
          self2.is_superuser = is_superuser;
          const allowed = decide(user);
          if (self2.allowed !== allowed) {
            self2.allowed = allowed;
            maybe_reload();
            self2.dispatchEvent("changed");
          }
        });
      }
      self2.close = function close() {
      };
    }
    cockpit.permission = function permission(arg) {
      return new Permission(arg);
    };
    function MetricsChannel(interval2, options_list, cache) {
      const self2 = this;
      event_mixin(self2, {});
      if (options_list.length === void 0)
        options_list = [options_list];
      const channels = [];
      let following = false;
      self2.series = cockpit.series(interval2, cache, fetch_for_series);
      self2.archives = null;
      self2.meta = null;
      function fetch_for_series(beg, end2, for_walking) {
        if (!for_walking)
          self2.fetch(beg, end2);
        else
          self2.follow();
      }
      function transfer(options_list2, callback, is_archive) {
        if (options_list2.length === 0)
          return;
        if (!is_archive) {
          if (following)
            return;
          following = true;
        }
        const options4 = {
          payload: "metrics1",
          interval: interval2,
          source: "internal",
          ...options_list2[0]
        };
        delete options4.archive_source;
        const channel = cockpit.channel(options4);
        channels.push(channel);
        let meta = null;
        let last = null;
        let beg;
        channel.addEventListener("close", function(ev, close_options) {
          if (!is_archive)
            following = false;
          if (options_list2.length > 1 && (close_options.problem == "not-supported" || close_options.problem == "not-found")) {
            transfer(options_list2.slice(1), callback);
          } else if (close_options.problem) {
            if (close_options.problem != "terminated" && close_options.problem != "disconnected" && close_options.problem != "authentication-failed" && (close_options.problem != "not-found" || !is_archive) && (close_options.problem != "not-supported" || !is_archive)) {
              console.warn("metrics channel failed: " + close_options.problem);
            }
          } else if (is_archive) {
            if (!self2.archives) {
              self2.archives = true;
              self2.dispatchEvent("changed");
            }
          }
        });
        channel.addEventListener("message", function(ev, payload) {
          const message = JSON.parse(payload);
          const message_len = message.length;
          if (message_len === void 0) {
            meta = message;
            let timestamp = 0;
            if (meta.now && meta.timestamp)
              timestamp = meta.timestamp + (Date.now() - meta.now);
            beg = Math.floor(timestamp / interval2);
            callback(beg, meta, null, options_list2[0]);
            self2.meta = meta;
            self2.dispatchEvent("changed");
          } else if (meta) {
            for (let i = 0; i < message_len; i++) {
              const data = message[i];
              if (last) {
                for (let j = 0; j < last.length; j++) {
                  const dataj = data[j];
                  if (dataj === null || dataj === void 0) {
                    data[j] = last[j];
                  } else {
                    const dataj_len = dataj.length;
                    if (dataj_len !== void 0) {
                      const lastj = last[j];
                      const lastj_len = last[j].length;
                      let k2;
                      for (k2 = 0; k2 < dataj_len; k2++) {
                        if (dataj[k2] === null)
                          dataj[k2] = lastj[k2];
                      }
                      for (; k2 < lastj_len; k2++)
                        dataj[k2] = lastj[k2];
                    }
                  }
                }
              }
              last = data;
            }
            callback(beg, meta, message, options_list2[0]);
            beg += message_len;
            meta.timestamp += interval2 * message_len;
          }
        });
      }
      function drain(beg, meta, message, options4) {
        let mapping = meta.mapping;
        if (!mapping) {
          mapping = {};
          meta.metrics.forEach(function(metric, i) {
            const map2 = { "": i };
            const name2 = options4.metrics_path_names?.[i] ?? metric.name;
            mapping[name2] = map2;
            if (metric.instances) {
              metric.instances.forEach(function(instance, i2) {
                if (instance === "")
                  instance = "/";
                map2[instance] = { "": i2 };
              });
            }
          });
          meta.mapping = mapping;
        }
        if (message)
          self2.series.input(beg, message, mapping);
      }
      self2.fetch = function fetch(beg, end2) {
        const timestamp = beg * interval2 - Date.now();
        const limit = end2 - beg;
        const archive_options_list = [];
        for (let i = 0; i < options_list.length; i++) {
          if (options_list[i].archive_source) {
            archive_options_list.push({
              ...options_list[i],
              source: options_list[i].archive_source,
              timestamp,
              limit
            });
          }
        }
        transfer(archive_options_list, drain, true);
      };
      self2.follow = function follow() {
        transfer(options_list, drain);
      };
      self2.close = function close(options4) {
        const len = channels.length;
        if (self2.series)
          self2.series.close();
        for (let i = 0; i < len; i++)
          channels[i].close(options4);
      };
    }
    cockpit.metrics = function metrics(interval2, options4) {
      return new MetricsChannel(interval2, options4);
    };
    cockpit.oops = function oops() {
      if (window.parent !== window && window.name.indexOf("cockpit1:") === 0)
        window.parent.postMessage('\n{ "command": "oops" }', transport_origin);
    };
    const old_onerror = window.onerror;
    window.onerror = function(msg, url, line) {
      if (url != "")
        cockpit.oops();
      if (old_onerror)
        return old_onerror(msg, url, line);
      return false;
    };
    return cockpit;
  }
  window.cockpit = factory();
  var cockpit_default = window.cockpit;

  // src/ds.jsx
  var import_react158 = __toESM(require_react(), 1);

  // src/plugins.jsx
  var import_react24 = __toESM(require_react(), 1);
  var import_prop_types19 = __toESM(require_prop_types(), 1);

  // src/lib/tools.jsx
  function searchFilter(searchFilterValue, columnsToSearch, rows) {
    if (searchFilterValue && rows && rows.length) {
      const filteredRows = [];
      rows.forEach((row) => {
        let rowToSearch = [];
        if (columnsToSearch && columnsToSearch.length) {
          columnsToSearch.forEach((column) => {
            if (column in row) {
              if (row[column] != null) {
                rowToSearch.push(row[column]);
              }
            }
          });
        } else {
          rowToSearch = row;
        }
        const match = Object.values(rowToSearch).some(
          (value) => value.join().toLowerCase().includes(searchFilterValue.toLowerCase())
        );
        if (match) {
          filteredRows.push(row);
        }
      });
      return filteredRows;
    }
    return rows;
  }
  function log_cmd(js_func, desc, cmd_array) {
    if (console) {
      const pw_args = ["--passwd", "--bind-pw", "--nsslapd-rootpw"];
      const cmd_list = [];
      let converted_pw = false;
      for (const idx in cmd_array) {
        const cmd = cmd_array[idx].toString();
        converted_pw = false;
        for (const arg_idx in pw_args) {
          if (cmd.startsWith(pw_args[arg_idx])) {
            const arg_len = cmd.indexOf("=");
            const arg = cmd.substring(0, arg_len);
            if (cmd.length !== arg_len + 1) {
              cmd_list.push(arg + "=**********");
              converted_pw = true;
            }
            break;
          }
        }
        if (!converted_pw) {
          cmd_list.push(cmd);
        }
      }
      console.log("CMD: " + js_func + ": " + desc + " ==> " + cmd_list.join(" "));
    }
  }
  function get_date_string(timestamp) {
    const year = timestamp.substr(0, 4);
    const month = timestamp.substr(4, 2);
    const day = timestamp.substr(6, 2);
    const hour = timestamp.substr(8, 2);
    const minute = timestamp.substr(10, 2);
    const sec = timestamp.substr(12, 2);
    const date2 = new Date(
      parseInt(year),
      parseInt(month) - 1,
      parseInt(day),
      parseInt(hour),
      parseInt(minute),
      parseInt(sec)
    );
    return date2.toLocaleString("en-ZA");
  }
  function get_date_diff(start2, end2) {
    let year = start2.substr(0, 4);
    let month = start2.substr(4, 2);
    let day = start2.substr(6, 2);
    let hour = start2.substr(8, 2);
    let minute = start2.substr(10, 2);
    let sec = start2.substr(12, 2);
    const startDate = new Date(
      parseInt(year),
      parseInt(month),
      parseInt(day),
      parseInt(hour),
      parseInt(minute),
      parseInt(sec)
    );
    year = end2.substr(0, 4);
    month = end2.substr(4, 2);
    day = end2.substr(6, 2);
    hour = end2.substr(8, 2);
    minute = end2.substr(10, 2);
    sec = end2.substr(12, 2);
    const currDate = new Date(
      parseInt(year),
      parseInt(month),
      parseInt(day),
      parseInt(hour),
      parseInt(minute),
      parseInt(sec)
    );
    let seconds2 = Math.floor((currDate - startDate) / 1e3);
    let minutes = Math.floor(seconds2 / 60);
    let hours = Math.floor(minutes / 60);
    const days = Math.floor(hours / 24);
    hours = hours - days * 24;
    minutes = minutes - days * 24 * 60 - hours * 60;
    seconds2 = seconds2 - days * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60;
    if (days === "1") {
      day = "day";
    } else {
      day = "days";
    }
    if (hours === "1") {
      hour = "hour";
    } else {
      hour = "hours";
    }
    if (minutes === "1") {
      minute = "minute";
    } else {
      minute = "minutes";
    }
    if (seconds2 === "1") {
      sec = "second";
    } else {
      sec = "seconds";
    }
    return `${days} ${day}, ${hours} ${hour}, ${minutes} ${minute}, and ${seconds2} ${sec}`;
  }
  function bad_file_name(file_name) {
    if (file_name.includes("/")) {
      return true;
    }
    return false;
  }
  function file_is_path(file_name) {
    if (file_name.length >= 2 && file_name.startsWith("/") && !file_name.endsWith("/")) {
      return true;
    } else {
      return false;
    }
  }
  function valid_port(val) {
    let result = !isNaN(val);
    if (result) {
      if (val < 1 || val > 65535) {
        result = false;
      }
    }
    return result;
  }
  function valid_dn(dn) {
    if (dn === "" || dn.endsWith(",")) {
      return false;
    }
    const dn_regex = /^([A-Za-z])+=\S.*/;
    const result = dn_regex.test(dn);
    return result;
  }
  function valid_filter(filter) {
    if (filter.startsWith("(") && filter.endsWith(")")) {
      return true;
    }
    return false;
  }
  function numToCommas(num) {
    return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  }
  function displayBytes(bytes) {
    if (bytes === 0 || isNaN(bytes)) {
      return "0 Bytes";
    }
    const k2 = 1024;
    const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
    const i = Math.floor(Math.log(bytes) / Math.log(k2));
    return parseFloat((bytes / Math.pow(k2, i)).toFixed(2)) + " " + sizes[i];
  }
  function displayKBytes(kbytes) {
    if (kbytes === 0 || isNaN(kbytes)) {
      return "0 KB";
    }
    const k2 = 1024;
    const sizes = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
    const i = Math.floor(Math.log(kbytes) / Math.log(k2));
    return parseFloat((kbytes / Math.pow(k2, i)).toFixed(2)) + " " + sizes[i];
  }
  function listsEqual(list1, list2) {
    if (Array.isArray(list1) && Array.isArray(list2)) {
      const list1_sorted = [...list1].sort();
      const list2_sorted = [...list2].sort();
      if (list1_sorted.length !== list2_sorted.length) {
        return false;
      }
      for (let i = list1_sorted.length; i--; ) {
        if (list1_sorted[i].toLowerCase() !== list2_sorted[i].toLowerCase()) {
          return false;
        }
      }
      return true;
    } else if (list1 === void 0 && list2 === void 0) {
      return true;
    } else {
      return false;
    }
  }
  function validHostname(hostname) {
    const reHostname = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/;
    return reHostname.exec(hostname);
  }
  function callCmdStreamPassword(config2) {
    const cmd = [...config2.cmd];
    if (config2.passwd !== "" && config2.promptArg !== "") {
      cmd.push(config2.promptArg);
    }
    let buffer = "";
    const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
    proc.done((data) => {
      config2.addNotification("success", config2.success_msg);
      config2.state_callback();
      if (config2.reload_func) {
        config2.reload_func(config2.reload_arg);
      }
      if (config2.ext_func) {
        config2.ext_func(config2.ext_arg);
      }
    }).fail((_) => {
      config2.addNotification("error", config2.error_msg + ": " + buffer);
      config2.state_callback();
      if (config2.reload_func) {
        config2.reload_func(config2.reload_arg);
      }
      if (config2.ext_func) {
        config2.ext_func(config2.ext_arg);
      }
    }).stream((data) => {
      buffer += data;
      proc.input(config2.passwd + "\n", true);
    });
  }

  // src/lib/notifications.jsx
  var import_react7 = __toESM(require_react(), 1);
  var import_prop_types2 = __toESM(require_prop_types(), 1);

  // node_modules/@patternfly/react-styles/dist/esm/index.js
  function css(...args) {
    const classes = [];
    const hasOwn = {}.hasOwnProperty;
    args.filter(Boolean).forEach((arg) => {
      const argType = typeof arg;
      if (argType === "string" || argType === "number") {
        classes.push(arg);
      } else if (Array.isArray(arg) && arg.length) {
        const inner = css(...arg);
        if (inner) {
          classes.push(inner);
        }
      } else if (argType === "object") {
        for (const key in arg) {
          if (hasOwn.call(arg, key) && arg[key]) {
            classes.push(key);
          }
        }
      }
    });
    return classes.join(" ");
  }

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_sm.js
  var global_breakpoint_sm = {
    "name": "--pf-global--breakpoint--sm",
    "value": "576px",
    "var": "var(--pf-global--breakpoint--sm)"
  };
  var global_breakpoint_sm_default = global_breakpoint_sm;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_md.js
  var global_breakpoint_md = {
    "name": "--pf-global--breakpoint--md",
    "value": "768px",
    "var": "var(--pf-global--breakpoint--md)"
  };
  var global_breakpoint_md_default = global_breakpoint_md;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_lg.js
  var global_breakpoint_lg = {
    "name": "--pf-global--breakpoint--lg",
    "value": "992px",
    "var": "var(--pf-global--breakpoint--lg)"
  };
  var global_breakpoint_lg_default = global_breakpoint_lg;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_xl.js
  var global_breakpoint_xl = {
    "name": "--pf-global--breakpoint--xl",
    "value": "1200px",
    "var": "var(--pf-global--breakpoint--xl)"
  };
  var global_breakpoint_xl_default = global_breakpoint_xl;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_2xl.js
  var global_breakpoint_2xl = {
    "name": "--pf-global--breakpoint--2xl",
    "value": "1450px",
    "var": "var(--pf-global--breakpoint--2xl)"
  };
  var global_breakpoint_2xl_default = global_breakpoint_2xl;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_sm.js
  var global_height_breakpoint_sm = {
    "name": "--pf-global--height-breakpoint--sm",
    "value": "0",
    "var": "var(--pf-global--height-breakpoint--sm)"
  };
  var global_height_breakpoint_sm_default = global_height_breakpoint_sm;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_md.js
  var global_height_breakpoint_md = {
    "name": "--pf-global--height-breakpoint--md",
    "value": "40rem",
    "var": "var(--pf-global--height-breakpoint--md)"
  };
  var global_height_breakpoint_md_default = global_height_breakpoint_md;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_lg.js
  var global_height_breakpoint_lg = {
    "name": "--pf-global--height-breakpoint--lg",
    "value": "48rem",
    "var": "var(--pf-global--height-breakpoint--lg)"
  };
  var global_height_breakpoint_lg_default = global_height_breakpoint_lg;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_xl.js
  var global_height_breakpoint_xl = {
    "name": "--pf-global--height-breakpoint--xl",
    "value": "60rem",
    "var": "var(--pf-global--height-breakpoint--xl)"
  };
  var global_height_breakpoint_xl_default = global_height_breakpoint_xl;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_2xl.js
  var global_height_breakpoint_2xl = {
    "name": "--pf-global--height-breakpoint--2xl",
    "value": "80rem",
    "var": "var(--pf-global--height-breakpoint--2xl)"
  };
  var global_height_breakpoint_2xl_default = global_height_breakpoint_2xl;

  // node_modules/@patternfly/react-core/dist/esm/helpers/constants.js
  var KEYHANDLER_DIRECTION = { UP: "up", DOWN: "down", RIGHT: "right", LEFT: "left" };
  var ValidatedOptions;
  (function(ValidatedOptions2) {
    ValidatedOptions2["success"] = "success";
    ValidatedOptions2["error"] = "error";
    ValidatedOptions2["warning"] = "warning";
    ValidatedOptions2["default"] = "default";
  })(ValidatedOptions || (ValidatedOptions = {}));
  var KeyTypes = {
    Tab: "Tab",
    Space: " ",
    Escape: "Escape",
    Enter: "Enter",
    ArrowUp: "ArrowUp",
    ArrowDown: "ArrowDown",
    ArrowLeft: "ArrowLeft",
    ArrowRight: "ArrowRight"
  };
  var globalWidthBreakpoints = {
    sm: parseInt(global_breakpoint_sm_default.value),
    md: parseInt(global_breakpoint_md_default.value),
    lg: parseInt(global_breakpoint_lg_default.value),
    xl: parseInt(global_breakpoint_xl_default.value),
    "2xl": parseInt(global_breakpoint_2xl_default.value)
  };
  var globalHeightBreakpoints = {
    sm: parseInt(global_height_breakpoint_sm_default.value),
    md: parseInt(global_height_breakpoint_md_default.value),
    lg: parseInt(global_height_breakpoint_lg_default.value),
    xl: parseInt(global_height_breakpoint_xl_default.value),
    "2xl": parseInt(global_height_breakpoint_2xl_default.value)
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/FocusTrap/FocusTrap.js
  init_tslib_es6();
  var React = __toESM(require_react());

  // node_modules/tabbable/dist/index.esm.js
  var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"];
  var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
  var NoElement = typeof Element === "undefined";
  var matches = NoElement ? function() {
  } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) {
    return element.getRootNode();
  } : function(element) {
    return element.ownerDocument;
  };
  var getCandidates = function getCandidates2(el, includeContainer, filter) {
    var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
    if (includeContainer && matches.call(el, candidateSelector)) {
      candidates.unshift(el);
    }
    candidates = candidates.filter(filter);
    return candidates;
  };
  var getCandidatesIteratively = function getCandidatesIteratively2(elements, includeContainer, options4) {
    var candidates = [];
    var elementsToCheck = Array.from(elements);
    while (elementsToCheck.length) {
      var element = elementsToCheck.shift();
      if (element.tagName === "SLOT") {
        var assigned = element.assignedElements();
        var content = assigned.length ? assigned : element.children;
        var nestedCandidates = getCandidatesIteratively2(content, true, options4);
        if (options4.flatten) {
          candidates.push.apply(candidates, nestedCandidates);
        } else {
          candidates.push({
            scope: element,
            candidates: nestedCandidates
          });
        }
      } else {
        var validCandidate = matches.call(element, candidateSelector);
        if (validCandidate && options4.filter(element) && (includeContainer || !elements.includes(element))) {
          candidates.push(element);
        }
        var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
        typeof options4.getShadowRoot === "function" && options4.getShadowRoot(element);
        var validShadowRoot = !options4.shadowRootFilter || options4.shadowRootFilter(element);
        if (shadowRoot && validShadowRoot) {
          var _nestedCandidates = getCandidatesIteratively2(shadowRoot === true ? element.children : shadowRoot.children, true, options4);
          if (options4.flatten) {
            candidates.push.apply(candidates, _nestedCandidates);
          } else {
            candidates.push({
              scope: element,
              candidates: _nestedCandidates
            });
          }
        } else {
          elementsToCheck.unshift.apply(elementsToCheck, element.children);
        }
      }
    }
    return candidates;
  };
  var getTabindex = function getTabindex2(node, isScope) {
    if (node.tabIndex < 0) {
      if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) {
        return 0;
      }
    }
    return node.tabIndex;
  };
  var sortOrderedTabbables = function sortOrderedTabbables2(a2, b) {
    return a2.tabIndex === b.tabIndex ? a2.documentOrder - b.documentOrder : a2.tabIndex - b.tabIndex;
  };
  var isInput = function isInput2(node) {
    return node.tagName === "INPUT";
  };
  var isHiddenInput = function isHiddenInput2(node) {
    return isInput(node) && node.type === "hidden";
  };
  var isDetailsWithSummary = function isDetailsWithSummary2(node) {
    var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
      return child.tagName === "SUMMARY";
    });
    return r;
  };
  var getCheckedRadio = function getCheckedRadio2(nodes, form) {
    for (var i = 0; i < nodes.length; i++) {
      if (nodes[i].checked && nodes[i].form === form) {
        return nodes[i];
      }
    }
  };
  var isTabbableRadio = function isTabbableRadio2(node) {
    if (!node.name) {
      return true;
    }
    var radioScope = node.form || getRootNode(node);
    var queryRadios = function queryRadios2(name2) {
      return radioScope.querySelectorAll('input[type="radio"][name="' + name2 + '"]');
    };
    var radioSet;
    if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
      radioSet = queryRadios(window.CSS.escape(node.name));
    } else {
      try {
        radioSet = queryRadios(node.name);
      } catch (err) {
        console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
        return false;
      }
    }
    var checked = getCheckedRadio(radioSet, node.form);
    return !checked || checked === node;
  };
  var isRadio = function isRadio2(node) {
    return isInput(node) && node.type === "radio";
  };
  var isNonTabbableRadio = function isNonTabbableRadio2(node) {
    return isRadio(node) && !isTabbableRadio(node);
  };
  var isZeroArea = function isZeroArea2(node) {
    var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
    return width === 0 && height === 0;
  };
  var isHidden = function isHidden2(node, _ref2) {
    var displayCheck = _ref2.displayCheck, getShadowRoot = _ref2.getShadowRoot;
    if (getComputedStyle(node).visibility === "hidden") {
      return true;
    }
    var isDirectSummary = matches.call(node, "details>summary:first-of-type");
    var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
    if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
      return true;
    }
    var nodeRootHost = getRootNode(node).host;
    var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node);
    if (!displayCheck || displayCheck === "full") {
      if (typeof getShadowRoot === "function") {
        var originalNode = node;
        while (node) {
          var parentElement = node.parentElement;
          var rootNode = getRootNode(node);
          if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) {
            return isZeroArea(node);
          } else if (node.assignedSlot) {
            node = node.assignedSlot;
          } else if (!parentElement && rootNode !== node.ownerDocument) {
            node = rootNode.host;
          } else {
            node = parentElement;
          }
        }
        node = originalNode;
      }
      if (nodeIsAttached) {
        return !node.getClientRects().length;
      }
    } else if (displayCheck === "non-zero-area") {
      return isZeroArea(node);
    }
    return false;
  };
  var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
    if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
      var parentNode = node.parentElement;
      while (parentNode) {
        if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
          for (var i = 0; i < parentNode.children.length; i++) {
            var child = parentNode.children.item(i);
            if (child.tagName === "LEGEND") {
              return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node);
            }
          }
          return true;
        }
        parentNode = parentNode.parentElement;
      }
    }
    return false;
  };
  var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options4, node) {
    if (node.disabled || isHiddenInput(node) || isHidden(node, options4) || // For a details element with a summary, the summary element gets the focus
    isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
      return false;
    }
    return true;
  };
  var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options4, node) {
    if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options4, node)) {
      return false;
    }
    return true;
  };
  var isValidShadowRootTabbable = function isValidShadowRootTabbable2(shadowHostNode) {
    var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10);
    if (isNaN(tabIndex) || tabIndex >= 0) {
      return true;
    }
    return false;
  };
  var sortByOrder = function sortByOrder2(candidates) {
    var regularTabbables = [];
    var orderedTabbables = [];
    candidates.forEach(function(item, i) {
      var isScope = !!item.scope;
      var element = isScope ? item.scope : item;
      var candidateTabindex = getTabindex(element, isScope);
      var elements = isScope ? sortByOrder2(item.candidates) : element;
      if (candidateTabindex === 0) {
        isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
      } else {
        orderedTabbables.push({
          documentOrder: i,
          tabIndex: candidateTabindex,
          item,
          isScope,
          content: elements
        });
      }
    });
    return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable2) {
      sortable2.isScope ? acc.push.apply(acc, sortable2.content) : acc.push(sortable2.content);
      return acc;
    }, []).concat(regularTabbables);
  };
  var tabbable = function tabbable2(el, options4) {
    options4 = options4 || {};
    var candidates;
    if (options4.getShadowRoot) {
      candidates = getCandidatesIteratively([el], options4.includeContainer, {
        filter: isNodeMatchingSelectorTabbable.bind(null, options4),
        flatten: false,
        getShadowRoot: options4.getShadowRoot,
        shadowRootFilter: isValidShadowRootTabbable
      });
    } else {
      candidates = getCandidates(el, options4.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options4));
    }
    return sortByOrder(candidates);
  };
  var focusable = function focusable2(el, options4) {
    options4 = options4 || {};
    var candidates;
    if (options4.getShadowRoot) {
      candidates = getCandidatesIteratively([el], options4.includeContainer, {
        filter: isNodeMatchingSelectorFocusable.bind(null, options4),
        flatten: true,
        getShadowRoot: options4.getShadowRoot
      });
    } else {
      candidates = getCandidates(el, options4.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options4));
    }
    return candidates;
  };
  var isTabbable = function isTabbable2(node, options4) {
    options4 = options4 || {};
    if (!node) {
      throw new Error("No node provided");
    }
    if (matches.call(node, candidateSelector) === false) {
      return false;
    }
    return isNodeMatchingSelectorTabbable(options4, node);
  };
  var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(",");
  var isFocusable = function isFocusable2(node, options4) {
    options4 = options4 || {};
    if (!node) {
      throw new Error("No node provided");
    }
    if (matches.call(node, focusableCandidateSelector) === false) {
      return false;
    }
    return isNodeMatchingSelectorFocusable(options4, node);
  };

  // node_modules/focus-trap/dist/focus-trap.esm.js
  function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
        _defineProperty(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var activeFocusTraps = function() {
    var trapQueue = [];
    return {
      activateTrap: function activateTrap(trap) {
        if (trapQueue.length > 0) {
          var activeTrap = trapQueue[trapQueue.length - 1];
          if (activeTrap !== trap) {
            activeTrap.pause();
          }
        }
        var trapIndex = trapQueue.indexOf(trap);
        if (trapIndex === -1) {
          trapQueue.push(trap);
        } else {
          trapQueue.splice(trapIndex, 1);
          trapQueue.push(trap);
        }
      },
      deactivateTrap: function deactivateTrap(trap) {
        var trapIndex = trapQueue.indexOf(trap);
        if (trapIndex !== -1) {
          trapQueue.splice(trapIndex, 1);
        }
        if (trapQueue.length > 0) {
          trapQueue[trapQueue.length - 1].unpause();
        }
      }
    };
  }();
  var isSelectableInput = function isSelectableInput2(node) {
    return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
  };
  var isEscapeEvent = function isEscapeEvent2(e) {
    return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
  };
  var isTabEvent = function isTabEvent2(e) {
    return e.key === "Tab" || e.keyCode === 9;
  };
  var delay = function delay2(fn) {
    return setTimeout(fn, 0);
  };
  var findIndex = function findIndex2(arr, fn) {
    var idx = -1;
    arr.every(function(value, i) {
      if (fn(value)) {
        idx = i;
        return false;
      }
      return true;
    });
    return idx;
  };
  var valueOrHandler = function valueOrHandler2(value) {
    for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      params[_key - 1] = arguments[_key];
    }
    return typeof value === "function" ? value.apply(void 0, params) : value;
  };
  var getActualTarget = function getActualTarget2(event) {
    return event.target.shadowRoot && typeof event.composedPath === "function" ? event.composedPath()[0] : event.target;
  };
  var createFocusTrap = function createFocusTrap2(elements, userOptions) {
    var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
    var config2 = _objectSpread2({
      returnFocusOnDeactivate: true,
      escapeDeactivates: true,
      delayInitialFocus: true
    }, userOptions);
    var state = {
      // containers given to createFocusTrap()
      // @type {Array<HTMLElement>}
      containers: [],
      // list of objects identifying tabbable nodes in `containers` in the trap
      // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
      //  is active, but the trap should never get to a state where there isn't at least one group
      //  with at least one tabbable node in it (that would lead to an error condition that would
      //  result in an error being thrown)
      // @type {Array<{
      //   container: HTMLElement,
      //   tabbableNodes: Array<HTMLElement>, // empty if none
      //   focusableNodes: Array<HTMLElement>, // empty if none
      //   firstTabbableNode: HTMLElement|null,
      //   lastTabbableNode: HTMLElement|null,
      //   nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
      // }>}
      containerGroups: [],
      // same order/length as `containers` list
      // references to objects in `containerGroups`, but only those that actually have
      //  tabbable nodes in them
      // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
      //  the same length
      tabbableGroups: [],
      nodeFocusedBeforeActivation: null,
      mostRecentlyFocusedNode: null,
      active: false,
      paused: false,
      // timer ID for when delayInitialFocus is true and initial focus in this trap
      //  has been delayed during activation
      delayInitialFocusTimer: void 0
    };
    var trap;
    var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) {
      return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config2[configOptionName || optionName];
    };
    var findContainerIndex = function findContainerIndex2(element) {
      return state.containerGroups.findIndex(function(_ref2) {
        var container = _ref2.container, tabbableNodes = _ref2.tabbableNodes;
        return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
        //  web components if the `tabbableOptions.getShadowRoot` option was used for
        //  the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
        //  look inside web components even if open)
        tabbableNodes.find(function(node) {
          return node === element;
        });
      });
    };
    var getNodeForOption = function getNodeForOption2(optionName) {
      var optionValue = config2[optionName];
      if (typeof optionValue === "function") {
        for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
          params[_key2 - 1] = arguments[_key2];
        }
        optionValue = optionValue.apply(void 0, params);
      }
      if (optionValue === true) {
        optionValue = void 0;
      }
      if (!optionValue) {
        if (optionValue === void 0 || optionValue === false) {
          return optionValue;
        }
        throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
      }
      var node = optionValue;
      if (typeof optionValue === "string") {
        node = doc.querySelector(optionValue);
        if (!node) {
          throw new Error("`".concat(optionName, "` as selector refers to no known node"));
        }
      }
      return node;
    };
    var getInitialFocusNode = function getInitialFocusNode2() {
      var node = getNodeForOption("initialFocus");
      if (node === false) {
        return false;
      }
      if (node === void 0) {
        if (findContainerIndex(doc.activeElement) >= 0) {
          node = doc.activeElement;
        } else {
          var firstTabbableGroup = state.tabbableGroups[0];
          var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
          node = firstTabbableNode || getNodeForOption("fallbackFocus");
        }
      }
      if (!node) {
        throw new Error("Your focus-trap needs to have at least one focusable element");
      }
      return node;
    };
    var updateTabbableNodes = function updateTabbableNodes2() {
      state.containerGroups = state.containers.map(function(container) {
        var tabbableNodes = tabbable(container, config2.tabbableOptions);
        var focusableNodes = focusable(container, config2.tabbableOptions);
        return {
          container,
          tabbableNodes,
          focusableNodes,
          firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
          lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
          /**
           * Finds the __tabbable__ node that follows the given node in the specified direction,
           *  in this container, if any.
           * @param {HTMLElement} node
           * @param {boolean} [forward] True if going in forward tab order; false if going
           *  in reverse.
           * @returns {HTMLElement|undefined} The next tabbable node, if any.
           */
          nextTabbableNode: function nextTabbableNode(node) {
            var forward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
            var nodeIdx = focusableNodes.findIndex(function(n) {
              return n === node;
            });
            if (nodeIdx < 0) {
              return void 0;
            }
            if (forward) {
              return focusableNodes.slice(nodeIdx + 1).find(function(n) {
                return isTabbable(n, config2.tabbableOptions);
              });
            }
            return focusableNodes.slice(0, nodeIdx).reverse().find(function(n) {
              return isTabbable(n, config2.tabbableOptions);
            });
          }
        };
      });
      state.tabbableGroups = state.containerGroups.filter(function(group) {
        return group.tabbableNodes.length > 0;
      });
      if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) {
        throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
      }
    };
    var tryFocus = function tryFocus2(node) {
      if (node === false) {
        return;
      }
      if (node === doc.activeElement) {
        return;
      }
      if (!node || !node.focus) {
        tryFocus2(getInitialFocusNode());
        return;
      }
      node.focus({
        preventScroll: !!config2.preventScroll
      });
      state.mostRecentlyFocusedNode = node;
      if (isSelectableInput(node)) {
        node.select();
      }
    };
    var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) {
      var node = getNodeForOption("setReturnFocus", previousActiveElement);
      return node ? node : node === false ? false : previousActiveElement;
    };
    var checkPointerDown = function checkPointerDown2(e) {
      var target = getActualTarget(e);
      if (findContainerIndex(target) >= 0) {
        return;
      }
      if (valueOrHandler(config2.clickOutsideDeactivates, e)) {
        trap.deactivate({
          // if, on deactivation, we should return focus to the node originally-focused
          //  when the trap was activated (or the configured `setReturnFocus` node),
          //  then assume it's also OK to return focus to the outside node that was
          //  just clicked, causing deactivation, as long as that node is focusable;
          //  if it isn't focusable, then return focus to the original node focused
          //  on activation (or the configured `setReturnFocus` node)
          // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
          //  which will result in the outside click setting focus to the node
          //  that was clicked, whether it's focusable or not; by setting
          //  `returnFocus: true`, we'll attempt to re-focus the node originally-focused
          //  on activation (or the configured `setReturnFocus` node)
          returnFocus: config2.returnFocusOnDeactivate && !isFocusable(target, config2.tabbableOptions)
        });
        return;
      }
      if (valueOrHandler(config2.allowOutsideClick, e)) {
        return;
      }
      e.preventDefault();
    };
    var checkFocusIn = function checkFocusIn2(e) {
      var target = getActualTarget(e);
      var targetContained = findContainerIndex(target) >= 0;
      if (targetContained || target instanceof Document) {
        if (targetContained) {
          state.mostRecentlyFocusedNode = target;
        }
      } else {
        e.stopImmediatePropagation();
        tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
      }
    };
    var checkTab = function checkTab2(e) {
      var target = getActualTarget(e);
      updateTabbableNodes();
      var destinationNode = null;
      if (state.tabbableGroups.length > 0) {
        var containerIndex = findContainerIndex(target);
        var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : void 0;
        if (containerIndex < 0) {
          if (e.shiftKey) {
            destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
          } else {
            destinationNode = state.tabbableGroups[0].firstTabbableNode;
          }
        } else if (e.shiftKey) {
          var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref2) {
            var firstTabbableNode = _ref2.firstTabbableNode;
            return target === firstTabbableNode;
          });
          if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config2.tabbableOptions) && !isTabbable(target, config2.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
            startOfGroupIndex = containerIndex;
          }
          if (startOfGroupIndex >= 0) {
            var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
            var destinationGroup = state.tabbableGroups[destinationGroupIndex];
            destinationNode = destinationGroup.lastTabbableNode;
          }
        } else {
          var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) {
            var lastTabbableNode = _ref3.lastTabbableNode;
            return target === lastTabbableNode;
          });
          if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config2.tabbableOptions) && !isTabbable(target, config2.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
            lastOfGroupIndex = containerIndex;
          }
          if (lastOfGroupIndex >= 0) {
            var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
            var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
            destinationNode = _destinationGroup.firstTabbableNode;
          }
        }
      } else {
        destinationNode = getNodeForOption("fallbackFocus");
      }
      if (destinationNode) {
        e.preventDefault();
        tryFocus(destinationNode);
      }
    };
    var checkKey = function checkKey2(e) {
      if (isEscapeEvent(e) && valueOrHandler(config2.escapeDeactivates, e) !== false) {
        e.preventDefault();
        trap.deactivate();
        return;
      }
      if (isTabEvent(e)) {
        checkTab(e);
        return;
      }
    };
    var checkClick = function checkClick2(e) {
      var target = getActualTarget(e);
      if (findContainerIndex(target) >= 0) {
        return;
      }
      if (valueOrHandler(config2.clickOutsideDeactivates, e)) {
        return;
      }
      if (valueOrHandler(config2.allowOutsideClick, e)) {
        return;
      }
      e.preventDefault();
      e.stopImmediatePropagation();
    };
    var addListeners = function addListeners2() {
      if (!state.active) {
        return;
      }
      activeFocusTraps.activateTrap(trap);
      state.delayInitialFocusTimer = config2.delayInitialFocus ? delay(function() {
        tryFocus(getInitialFocusNode());
      }) : tryFocus(getInitialFocusNode());
      doc.addEventListener("focusin", checkFocusIn, true);
      doc.addEventListener("mousedown", checkPointerDown, {
        capture: true,
        passive: false
      });
      doc.addEventListener("touchstart", checkPointerDown, {
        capture: true,
        passive: false
      });
      doc.addEventListener("click", checkClick, {
        capture: true,
        passive: false
      });
      doc.addEventListener("keydown", checkKey, {
        capture: true,
        passive: false
      });
      return trap;
    };
    var removeListeners = function removeListeners2() {
      if (!state.active) {
        return;
      }
      doc.removeEventListener("focusin", checkFocusIn, true);
      doc.removeEventListener("mousedown", checkPointerDown, true);
      doc.removeEventListener("touchstart", checkPointerDown, true);
      doc.removeEventListener("click", checkClick, true);
      doc.removeEventListener("keydown", checkKey, true);
      return trap;
    };
    trap = {
      get active() {
        return state.active;
      },
      get paused() {
        return state.paused;
      },
      activate: function activate(activateOptions) {
        if (state.active) {
          return this;
        }
        var onActivate = getOption(activateOptions, "onActivate");
        var onPostActivate = getOption(activateOptions, "onPostActivate");
        var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap");
        if (!checkCanFocusTrap) {
          updateTabbableNodes();
        }
        state.active = true;
        state.paused = false;
        state.nodeFocusedBeforeActivation = doc.activeElement;
        if (onActivate) {
          onActivate();
        }
        var finishActivation = function finishActivation2() {
          if (checkCanFocusTrap) {
            updateTabbableNodes();
          }
          addListeners();
          if (onPostActivate) {
            onPostActivate();
          }
        };
        if (checkCanFocusTrap) {
          checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
          return this;
        }
        finishActivation();
        return this;
      },
      deactivate: function deactivate(deactivateOptions) {
        if (!state.active) {
          return this;
        }
        var options4 = _objectSpread2({
          onDeactivate: config2.onDeactivate,
          onPostDeactivate: config2.onPostDeactivate,
          checkCanReturnFocus: config2.checkCanReturnFocus
        }, deactivateOptions);
        clearTimeout(state.delayInitialFocusTimer);
        state.delayInitialFocusTimer = void 0;
        removeListeners();
        state.active = false;
        state.paused = false;
        activeFocusTraps.deactivateTrap(trap);
        var onDeactivate = getOption(options4, "onDeactivate");
        var onPostDeactivate = getOption(options4, "onPostDeactivate");
        var checkCanReturnFocus = getOption(options4, "checkCanReturnFocus");
        var returnFocus = getOption(options4, "returnFocus", "returnFocusOnDeactivate");
        if (onDeactivate) {
          onDeactivate();
        }
        var finishDeactivation = function finishDeactivation2() {
          delay(function() {
            if (returnFocus) {
              tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
            }
            if (onPostDeactivate) {
              onPostDeactivate();
            }
          });
        };
        if (returnFocus && checkCanReturnFocus) {
          checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
          return this;
        }
        finishDeactivation();
        return this;
      },
      pause: function pause() {
        if (state.paused || !state.active) {
          return this;
        }
        state.paused = true;
        removeListeners();
        return this;
      },
      unpause: function unpause() {
        if (!state.paused || !state.active) {
          return this;
        }
        state.paused = false;
        updateTabbableNodes();
        addListeners();
        return this;
      },
      updateContainerElements: function updateContainerElements(containerElements) {
        var elementsAsArray = [].concat(containerElements).filter(Boolean);
        state.containers = elementsAsArray.map(function(element) {
          return typeof element === "string" ? doc.querySelector(element) : element;
        });
        if (state.active) {
          updateTabbableNodes();
        }
        return this;
      }
    };
    trap.updateContainerElements(elements);
    return trap;
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/FocusTrap/FocusTrap.js
  var FocusTrapBase = class extends React.Component {
    constructor(props) {
      super(props);
      this.divRef = this.props.innerRef || React.createRef();
      if (typeof document !== "undefined") {
        this.previouslyFocusedElement = document.activeElement;
      }
    }
    componentDidMount() {
      this.focusTrap = createFocusTrap(this.divRef.current, Object.assign(Object.assign({}, this.props.focusTrapOptions), { returnFocusOnDeactivate: false }));
      if (this.props.active) {
        this.focusTrap.activate();
      }
      if (this.props.paused) {
        this.focusTrap.pause();
      }
    }
    componentDidUpdate(prevProps) {
      if (prevProps.active && !this.props.active) {
        this.focusTrap.deactivate();
      } else if (!prevProps.active && this.props.active) {
        this.focusTrap.activate();
      }
      if (prevProps.paused && !this.props.paused) {
        this.focusTrap.unpause();
      } else if (!prevProps.paused && this.props.paused) {
        this.focusTrap.pause();
      }
    }
    componentWillUnmount() {
      this.focusTrap.deactivate();
      if (this.props.focusTrapOptions.returnFocusOnDeactivate !== false && this.previouslyFocusedElement && this.previouslyFocusedElement.focus) {
        this.previouslyFocusedElement.focus({ preventScroll: this.props.preventScrollOnDeactivate });
      }
    }
    render() {
      const _a = this.props, {
        children,
        className,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        focusTrapOptions,
        active,
        paused,
        preventScrollOnDeactivate,
        innerRef
      } = _a, rest = __rest(_a, ["children", "className", "focusTrapOptions", "active", "paused", "preventScrollOnDeactivate", "innerRef"]);
      return React.createElement("div", Object.assign({ ref: this.divRef, className }, rest), children);
    }
  };
  FocusTrapBase.displayName = "FocusTrap";
  FocusTrapBase.defaultProps = {
    active: true,
    paused: false,
    focusTrapOptions: {},
    preventScrollOnDeactivate: false
  };
  var FocusTrap = React.forwardRef((props, ref) => React.createElement(FocusTrapBase, Object.assign({ innerRef: ref }, props)));

  // node_modules/@patternfly/react-core/dist/esm/helpers/GenerateId/GenerateId.js
  var React2 = __toESM(require_react());
  var currentId = 0;
  var GenerateId = class extends React2.Component {
    constructor() {
      super(...arguments);
      this.id = `${this.props.prefix}${currentId++}`;
    }
    render() {
      return this.props.children(this.id);
    }
  };
  GenerateId.displayName = "GenerateId";
  GenerateId.defaultProps = {
    prefix: "pf-random-id-"
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/htmlConstants.js
  var ASTERISK = "*";

  // node_modules/@patternfly/react-core/dist/esm/helpers/OUIA/ouia.js
  var import_react = __toESM(require_react());
  var uid = 0;
  var ouiaPrefix = "OUIA-Generated-";
  var ouiaIdByRoute = {};
  function getOUIAProps(componentType, id, ouiaSafe = true) {
    return {
      "data-ouia-component-type": `PF4/${componentType}`,
      "data-ouia-safe": ouiaSafe,
      "data-ouia-component-id": id
    };
  }
  var useOUIAProps = (componentType, id, ouiaSafe = true, variant) => ({
    "data-ouia-component-type": `PF4/${componentType}`,
    "data-ouia-safe": ouiaSafe,
    "data-ouia-component-id": useOUIAId(componentType, id, variant)
  });
  var useOUIAId = (componentType, id, variant) => {
    const defaultOUIAId = (0, import_react.useMemo)(() => getDefaultOUIAId(componentType, variant), [componentType, variant]);
    return id !== null && id !== void 0 ? id : defaultOUIAId;
  };
  function getDefaultOUIAId(componentType, variant) {
    try {
      let key;
      if (typeof window !== "undefined") {
        key = `${window.location.href}-${componentType}-${variant || ""}`;
      } else {
        key = `${componentType}-${variant || ""}`;
      }
      if (!ouiaIdByRoute[key]) {
        ouiaIdByRoute[key] = 0;
      }
      return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ""}${++ouiaIdByRoute[key]}`;
    } catch (exception) {
      return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ""}${++uid}`;
    }
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/util.js
  var ReactDOM = __toESM(require_react_dom());
  function capitalize(input) {
    return input[0].toUpperCase() + input.substring(1);
  }
  function getUniqueId(prefix = "pf") {
    const uid2 = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(2);
    return `${prefix}-${uid2}`;
  }
  function debounce(func, wait) {
    let timeout2;
    return (...args) => {
      clearTimeout(timeout2);
      timeout2 = setTimeout(() => func.apply(this, args), wait);
    };
  }
  function isElementInView(container, element, partial, strict = false) {
    if (!container || !element) {
      return false;
    }
    const containerBounds = container.getBoundingClientRect();
    const elementBounds = element.getBoundingClientRect();
    const containerBoundsLeft = Math.ceil(containerBounds.left);
    const containerBoundsRight = Math.floor(containerBounds.right);
    const elementBoundsLeft = Math.ceil(elementBounds.left);
    const elementBoundsRight = Math.floor(elementBounds.right);
    const isTotallyInView = elementBoundsLeft >= containerBoundsLeft && elementBoundsRight <= containerBoundsRight;
    const isPartiallyInView = (partial || !strict && containerBounds.width < elementBounds.width) && (elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft || elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight);
    return isTotallyInView || isPartiallyInView;
  }
  function fillTemplate(templateString, templateVars) {
    return templateString.replace(/\${(.*?)}/g, (_, match) => templateVars[match] || "");
  }
  function keyHandler(index, innerIndex, position, refsCollection, kids, custom17 = false) {
    if (!Array.isArray(kids)) {
      return;
    }
    const isMultiDimensional = refsCollection.filter((ref) => ref)[0].constructor === Array;
    let nextIndex = index;
    let nextInnerIndex = innerIndex;
    if (position === "up") {
      if (index === 0) {
        nextIndex = kids.length - 1;
      } else {
        nextIndex = index - 1;
      }
    } else if (position === "down") {
      if (index === kids.length - 1) {
        nextIndex = 0;
      } else {
        nextIndex = index + 1;
      }
    } else if (position === "left") {
      if (innerIndex === 0) {
        nextInnerIndex = refsCollection[index].length - 1;
      } else {
        nextInnerIndex = innerIndex - 1;
      }
    } else if (position === "right") {
      if (innerIndex === refsCollection[index].length - 1) {
        nextInnerIndex = 0;
      } else {
        nextInnerIndex = innerIndex + 1;
      }
    }
    if (refsCollection[nextIndex] === null || refsCollection[nextIndex] === void 0 || isMultiDimensional && (refsCollection[nextIndex][nextInnerIndex] === null || refsCollection[nextIndex][nextInnerIndex] === void 0)) {
      keyHandler(nextIndex, nextInnerIndex, position, refsCollection, kids, custom17);
    } else if (custom17) {
      if (refsCollection[nextIndex].focus) {
        refsCollection[nextIndex].focus();
      }
      const element = ReactDOM.findDOMNode(refsCollection[nextIndex]);
      element.focus();
    } else if (position !== "tab") {
      if (isMultiDimensional) {
        refsCollection[nextIndex][nextInnerIndex].focus();
      } else {
        refsCollection[nextIndex].focus();
      }
    }
  }
  function findTabbableElements(containerRef, tababbleSelectors) {
    const tabbable3 = containerRef.current.querySelectorAll(tababbleSelectors);
    const list = Array.prototype.filter.call(tabbable3, function(item) {
      return item.tabIndex >= "0";
    });
    return list;
  }
  function getNextIndex(index, position, collection) {
    let nextIndex;
    if (position === "up") {
      if (index === 0) {
        nextIndex = collection.length - 1;
      } else {
        nextIndex = index - 1;
      }
    } else if (index === collection.length - 1) {
      nextIndex = 0;
    } else {
      nextIndex = index + 1;
    }
    if (collection[nextIndex] === void 0 || collection[nextIndex][0] === null) {
      return getNextIndex(nextIndex, position, collection);
    } else {
      return nextIndex;
    }
  }
  function pluralize(i, singular, plural) {
    if (!plural) {
      plural = `${singular}s`;
    }
    return `${i || 0} ${i === 1 ? singular : plural}`;
  }
  var setBreakpointCssVars = (mods, cssVar) => Object.entries(mods || {}).reduce((acc, [breakpoint, value]) => breakpoint === "default" ? Object.assign(Object.assign({}, acc), { [cssVar]: value }) : Object.assign(Object.assign({}, acc), { [`${cssVar}-on-${breakpoint}`]: value }), {});
  var formatBreakpointMods = (mods, styles164, stylePrefix = "", breakpoint, vertical) => {
    if (!mods) {
      return "";
    }
    if (breakpoint && !vertical) {
      if (breakpoint in mods) {
        return styles164.modifiers[toCamel(`${stylePrefix}${mods[breakpoint]}`)];
      }
      const breakpointsOrder = ["2xl", "xl", "lg", "md", "sm", "default"];
      const breakpointsIndex = breakpointsOrder.indexOf(breakpoint);
      for (let i = breakpointsIndex; i < breakpointsOrder.length; i++) {
        if (breakpointsOrder[i] in mods) {
          return styles164.modifiers[toCamel(`${stylePrefix}${mods[breakpointsOrder[i]]}`)];
        }
      }
      return "";
    }
    return Object.entries(mods || {}).map(([breakpoint2, mod]) => `${stylePrefix}${mod}${breakpoint2 !== "default" ? `-on-${breakpoint2}` : ""}${vertical && breakpoint2 !== "default" ? "-height" : ""}`).map(toCamel).map((mod) => mod.replace(/-?(\dxl)/gi, (_res, group) => `_${group}`)).map((modifierKey) => styles164.modifiers[modifierKey]).filter(Boolean).join(" ");
  };
  var getVerticalBreakpoint = (height) => {
    if (height === null) {
      return null;
    }
    if (height >= globalHeightBreakpoints["2xl"]) {
      return "2xl";
    }
    if (height >= globalHeightBreakpoints.xl) {
      return "xl";
    }
    if (height >= globalHeightBreakpoints.lg) {
      return "lg";
    }
    if (height >= globalHeightBreakpoints.md) {
      return "md";
    }
    if (height >= globalHeightBreakpoints.sm) {
      return "sm";
    }
    return "default";
  };
  var getBreakpoint = (width) => {
    if (width === null) {
      return null;
    }
    if (width >= globalWidthBreakpoints["2xl"]) {
      return "2xl";
    }
    if (width >= globalWidthBreakpoints.xl) {
      return "xl";
    }
    if (width >= globalWidthBreakpoints.lg) {
      return "lg";
    }
    if (width >= globalWidthBreakpoints.md) {
      return "md";
    }
    if (width >= globalWidthBreakpoints.sm) {
      return "sm";
    }
    return "default";
  };
  var camelize = (s2) => s2.toUpperCase().replace("-", "").replace("_", "");
  var toCamel = (s2) => s2.replace(/([-_][a-z])/gi, camelize);
  var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
  var getTextWidth = (text, node) => {
    const computedStyle = getComputedStyle(node);
    const getFontFromComputedStyle = () => {
      let computedFont = "";
      const fontStretchLookupTable = {
        "50%": "ultra-condensed",
        "62.5%": "extra-condensed",
        "75%": "condensed",
        "87.5%": "semi-condensed",
        "100%": "normal",
        "112.5%": "semi-expanded",
        "125%": "expanded",
        "150%": "extra-expanded",
        "200%": "ultra-expanded"
      };
      let fontStretch;
      if (computedStyle.fontStretch in fontStretchLookupTable) {
        fontStretch = fontStretchLookupTable[computedStyle.fontStretch];
      } else {
        fontStretch = "normal";
      }
      computedFont = computedStyle.fontStyle + " " + computedStyle.fontVariant + " " + computedStyle.fontWeight + " " + fontStretch + " " + computedStyle.fontSize + "/" + computedStyle.lineHeight + " " + computedStyle.fontFamily;
      return computedFont;
    };
    const canvas = document.createElement("canvas");
    const context = canvas.getContext("2d");
    context.font = computedStyle.font || getFontFromComputedStyle();
    return context.measureText(text).width;
  };
  var innerDimensions = (node) => {
    const computedStyle = getComputedStyle(node);
    let width = node.clientWidth;
    let height = node.clientHeight;
    height -= parseFloat(computedStyle.paddingTop) + parseFloat(computedStyle.paddingBottom);
    width -= parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight);
    return { height, width };
  };
  var trimLeft = (node, value) => {
    const availableWidth = innerDimensions(node).width;
    let newValue = value;
    if (getTextWidth(value, node) > availableWidth) {
      while (getTextWidth(`...${newValue}`, node) > availableWidth) {
        newValue = newValue.substring(1);
      }
      if (node.value) {
        node.value = `...${newValue}`;
      } else {
        node.innerText = `...${newValue}`;
      }
    } else {
      if (node.value) {
        node.value = value;
      } else {
        node.innerText = value;
      }
    }
  };
  var preventedEvents = (events) => events.reduce((handlers, eventToPrevent) => Object.assign(Object.assign({}, handlers), { [eventToPrevent]: (event) => {
    event.preventDefault();
  } }), {});

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/Popper.js
  var React6 = __toESM(require_react());
  var ReactDOM3 = __toESM(require_react_dom());

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/react-popper/usePopper.js
  var React4 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getBoundingClientRect.js
  function getBoundingClientRect(element) {
    const rect = element.getBoundingClientRect();
    return {
      width: rect.width,
      height: rect.height,
      top: rect.top,
      right: rect.right,
      bottom: rect.bottom,
      left: rect.left,
      x: rect.left,
      y: rect.top
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getWindow.js
  function getWindow(node) {
    if (node.toString() !== "[object Window]") {
      const ownerDocument = node.ownerDocument;
      return ownerDocument ? ownerDocument.defaultView : window;
    }
    return node;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getWindowScroll.js
  function getWindowScroll(node) {
    const win = getWindow(node);
    const scrollLeft = win.pageXOffset;
    const scrollTop = win.pageYOffset;
    return {
      scrollLeft,
      scrollTop
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/instanceOf.js
  function isElement(node) {
    const OwnElement = getWindow(node).Element;
    return node instanceof OwnElement || node instanceof Element;
  }
  function isHTMLElement(node) {
    const OwnElement = getWindow(node).HTMLElement;
    return node instanceof OwnElement || node instanceof HTMLElement;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getHTMLElementScroll.js
  function getHTMLElementScroll(element) {
    return {
      scrollLeft: element.scrollLeft,
      scrollTop: element.scrollTop
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getNodeScroll.js
  function getNodeScroll(node) {
    if (node === getWindow(node) || !isHTMLElement(node)) {
      return getWindowScroll(node);
    } else {
      return getHTMLElementScroll(node);
    }
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getNodeName.js
  function getNodeName(element) {
    return element ? (element.nodeName || "").toLowerCase() : null;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getDocumentElement.js
  function getDocumentElement(element) {
    return (isElement(element) ? element.ownerDocument : element.document).documentElement;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getWindowScrollBarX.js
  function getWindowScrollBarX(element) {
    return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getComputedStyle.js
  function getComputedStyle2(element) {
    return getWindow(element).getComputedStyle(element);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/isScrollParent.js
  function isScrollParent(element) {
    const { overflow, overflowX, overflowY } = getComputedStyle2(element);
    return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getCompositeRect.js
  function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed = false) {
    const documentElement = getDocumentElement(offsetParent);
    const rect = getBoundingClientRect(elementOrVirtualElement);
    const isOffsetParentAnElement = isHTMLElement(offsetParent);
    let scroll = { scrollLeft: 0, scrollTop: 0 };
    let offsets = { x: 0, y: 0 };
    if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
      if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
      isScrollParent(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
      if (isHTMLElement(offsetParent)) {
        offsets = getBoundingClientRect(offsetParent);
        offsets.x += offsetParent.clientLeft;
        offsets.y += offsetParent.clientTop;
      } else if (documentElement) {
        offsets.x = getWindowScrollBarX(documentElement);
      }
    }
    return {
      x: rect.left + scroll.scrollLeft - offsets.x,
      y: rect.top + scroll.scrollTop - offsets.y,
      width: rect.width,
      height: rect.height
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getLayoutRect.js
  function getLayoutRect(element) {
    return {
      x: element.offsetLeft,
      y: element.offsetTop,
      width: element.offsetWidth,
      height: element.offsetHeight
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getParentNode.js
  function getParentNode(element) {
    if (getNodeName(element) === "html") {
      return element;
    }
    return (
      // $FlowFixMe: this is a quicker (but less type safe) way to save quite some bytes from the bundle
      element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
      element.parentNode || // DOM Element detected
      // $FlowFixMe: need a better way to handle this...
      element.host || // ShadowRoot detected
      // $FlowFixMe: HTMLElement is a Node
      getDocumentElement(element)
    );
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getScrollParent.js
  function getScrollParent(node) {
    if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
      return node.ownerDocument.body;
    }
    if (isHTMLElement(node) && isScrollParent(node)) {
      return node;
    }
    return getScrollParent(getParentNode(node));
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/listScrollParents.js
  function listScrollParents(element, list = []) {
    const scrollParent = getScrollParent(element);
    const isBody = getNodeName(scrollParent) === "body";
    const win = getWindow(scrollParent);
    const target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
    const updatedList = list.concat(target);
    return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/isTableElement.js
  function isTableElement(element) {
    return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getOffsetParent.js
  function getTrueOffsetParent(element) {
    if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
    getComputedStyle2(element).position === "fixed") {
      return null;
    }
    const offsetParent = element.offsetParent;
    if (offsetParent) {
      const html = getDocumentElement(offsetParent);
      if (getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static" && getComputedStyle2(html).position !== "static") {
        return html;
      }
    }
    return offsetParent;
  }
  function getContainingBlock(element) {
    let currentNode = getParentNode(element);
    while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
      const css3 = getComputedStyle2(currentNode);
      if (css3.transform !== "none" || css3.perspective !== "none" || css3.willChange && css3.willChange !== "auto") {
        return currentNode;
      } else {
        currentNode = currentNode.parentNode;
      }
    }
    return null;
  }
  function getOffsetParent(element) {
    const window2 = getWindow(element);
    let offsetParent = getTrueOffsetParent(element);
    while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") {
      offsetParent = getTrueOffsetParent(offsetParent);
    }
    if (offsetParent && getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static") {
      return window2;
    }
    return offsetParent || getContainingBlock(element) || window2;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/enums.js
  var top = "top";
  var bottom = "bottom";
  var right = "right";
  var left = "left";
  var auto = "auto";
  var basePlacements = [top, bottom, right, left];
  var start = "start";
  var end = "end";
  var clippingParents = "clippingParents";
  var viewport = "viewport";
  var popper = "popper";
  var reference = "reference";
  var variationPlacements = basePlacements.reduce((acc, placement) => acc.concat([`${placement}-${start}`, `${placement}-${end}`]), []);
  var placements = [...basePlacements, auto].reduce((acc, placement) => acc.concat([placement, `${placement}-${start}`, `${placement}-${end}`]), []);
  var beforeRead = "beforeRead";
  var read = "read";
  var afterRead = "afterRead";
  var beforeMain = "beforeMain";
  var main = "main";
  var afterMain = "afterMain";
  var beforeWrite = "beforeWrite";
  var write = "write";
  var afterWrite = "afterWrite";
  var modifierPhases = [
    beforeRead,
    read,
    afterRead,
    beforeMain,
    main,
    afterMain,
    beforeWrite,
    write,
    afterWrite
  ];

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/orderModifiers.js
  function order(modifiers) {
    const map2 = /* @__PURE__ */ new Map();
    const visited = /* @__PURE__ */ new Set();
    const result = [];
    modifiers.forEach((modifier) => {
      map2.set(modifier.name, modifier);
    });
    function sort(modifier) {
      visited.add(modifier.name);
      const requires = [...modifier.requires || [], ...modifier.requiresIfExists || []];
      requires.forEach((dep) => {
        if (!visited.has(dep)) {
          const depModifier = map2.get(dep);
          if (depModifier) {
            sort(depModifier);
          }
        }
      });
      result.push(modifier);
    }
    modifiers.forEach((modifier) => {
      if (!visited.has(modifier.name)) {
        sort(modifier);
      }
    });
    return result;
  }
  function orderModifiers(modifiers) {
    const orderedModifiers = order(modifiers);
    return modifierPhases.reduce((acc, phase) => acc.concat(orderedModifiers.filter((modifier) => modifier.phase === phase)), []);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/debounce.js
  function debounce2(fn) {
    let pending;
    return () => {
      if (!pending) {
        pending = new Promise((resolve2) => {
          Promise.resolve().then(() => {
            pending = void 0;
            resolve2(fn());
          });
        });
      }
      return pending;
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getBasePlacement.js
  function getBasePlacement(placement) {
    return placement.split("-")[0];
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/mergeByName.js
  function mergeByName(modifiers) {
    const merged = modifiers.reduce((merged2, current) => {
      const existing = merged2[current.name];
      merged2[current.name] = existing ? Object.assign(Object.assign(Object.assign({}, existing), current), { options: Object.assign(Object.assign({}, existing.options), current.options), data: Object.assign(Object.assign({}, existing.data), current.data) }) : current;
      return merged2;
    }, {});
    return Object.keys(merged).map((key) => merged[key]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getViewportRect.js
  function getViewportRect(element) {
    const win = getWindow(element);
    const html = getDocumentElement(element);
    const visualViewport = win.visualViewport;
    let width = html.clientWidth;
    let height = html.clientHeight;
    let x2 = 0;
    let y2 = 0;
    if (visualViewport) {
      width = visualViewport.width;
      height = visualViewport.height;
      if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
        x2 = visualViewport.offsetLeft;
        y2 = visualViewport.offsetTop;
      }
    }
    return {
      width,
      height,
      x: x2 + getWindowScrollBarX(element),
      y: y2
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getDocumentRect.js
  function getDocumentRect(element) {
    const html = getDocumentElement(element);
    const winScroll = getWindowScroll(element);
    const body = element.ownerDocument.body;
    const width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
    const height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
    let x2 = -winScroll.scrollLeft + getWindowScrollBarX(element);
    const y2 = -winScroll.scrollTop;
    if (getComputedStyle2(body || html).direction === "rtl") {
      x2 += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;
    }
    return { width, height, x: x2, y: y2 };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/contains.js
  function contains(parent, child) {
    const isShadow = Boolean(child.getRootNode && child.getRootNode().host);
    if (parent.contains(child)) {
      return true;
    } else if (isShadow) {
      let next = child;
      do {
        if (next && parent.isSameNode(next)) {
          return true;
        }
        next = next.parentNode || next.host;
      } while (next);
    }
    return false;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/rectToClientRect.js
  function rectToClientRect(rect) {
    return Object.assign(Object.assign({}, rect), { left: rect.x, top: rect.y, right: rect.x + rect.width, bottom: rect.y + rect.height });
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getClippingRect.js
  function getInnerBoundingClientRect(element) {
    const rect = getBoundingClientRect(element);
    rect.top = rect.top + element.clientTop;
    rect.left = rect.left + element.clientLeft;
    rect.bottom = rect.top + element.clientHeight;
    rect.right = rect.left + element.clientWidth;
    rect.width = element.clientWidth;
    rect.height = element.clientHeight;
    rect.x = rect.left;
    rect.y = rect.top;
    return rect;
  }
  function getClientRectFromMixedType(element, clippingParent) {
    return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
  }
  function getClippingParents(element) {
    const clippingParents2 = listScrollParents(getParentNode(element));
    const canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle2(element).position) >= 0;
    const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
    if (!isElement(clipperElement)) {
      return [];
    }
    return clippingParents2.filter((clippingParent) => isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body");
  }
  function getClippingRect(element, boundary, rootBoundary) {
    const mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
    const clippingParents2 = [...mainClippingParents, rootBoundary];
    const firstClippingParent = clippingParents2[0];
    const clippingRect = clippingParents2.reduce((accRect, clippingParent) => {
      const rect = getClientRectFromMixedType(element, clippingParent);
      accRect.top = Math.max(rect.top, accRect.top);
      accRect.right = Math.min(rect.right, accRect.right);
      accRect.bottom = Math.min(rect.bottom, accRect.bottom);
      accRect.left = Math.max(rect.left, accRect.left);
      return accRect;
    }, getClientRectFromMixedType(element, firstClippingParent));
    clippingRect.width = clippingRect.right - clippingRect.left;
    clippingRect.height = clippingRect.bottom - clippingRect.top;
    clippingRect.x = clippingRect.left;
    clippingRect.y = clippingRect.top;
    return clippingRect;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getVariation.js
  function getVariation(placement) {
    return placement.split("-")[1];
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getMainAxisFromPlacement.js
  function getMainAxisFromPlacement(placement) {
    return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/computeOffsets.js
  function computeOffsets({ reference: reference2, element, placement }) {
    const basePlacement = placement ? getBasePlacement(placement) : null;
    const variation = placement ? getVariation(placement) : null;
    const commonX = reference2.x + reference2.width / 2 - element.width / 2;
    const commonY = reference2.y + reference2.height / 2 - element.height / 2;
    let offsets;
    switch (basePlacement) {
      case top:
        offsets = {
          x: commonX,
          y: reference2.y - element.height
        };
        break;
      case bottom:
        offsets = {
          x: commonX,
          y: reference2.y + reference2.height
        };
        break;
      case right:
        offsets = {
          x: reference2.x + reference2.width,
          y: commonY
        };
        break;
      case left:
        offsets = {
          x: reference2.x - element.width,
          y: commonY
        };
        break;
      default:
        offsets = {
          x: reference2.x,
          y: reference2.y
        };
    }
    const mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
    if (mainAxis != null) {
      const len = mainAxis === "y" ? "height" : "width";
      switch (variation) {
        case start:
          offsets[mainAxis] = Math.floor(offsets[mainAxis]) - Math.floor(reference2[len] / 2 - element[len] / 2);
          break;
        case end:
          offsets[mainAxis] = Math.floor(offsets[mainAxis]) + Math.ceil(reference2[len] / 2 - element[len] / 2);
          break;
        default:
      }
    }
    return offsets;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getFreshSideObject.js
  function getFreshSideObject() {
    return {
      top: 0,
      right: 0,
      bottom: 0,
      left: 0
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/mergePaddingObject.js
  function mergePaddingObject(paddingObject) {
    return Object.assign(Object.assign({}, getFreshSideObject()), paddingObject);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/expandToHashMap.js
  function expandToHashMap(value, keys) {
    return keys.reduce((hashMap, key) => {
      hashMap[key] = value;
      return hashMap;
    }, {});
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/detectOverflow.js
  function detectOverflow(state, options4 = {}) {
    const { placement = state.placement, boundary = clippingParents, rootBoundary = viewport, elementContext = popper, altBoundary = false, padding: padding2 = 0 } = options4;
    const paddingObject = mergePaddingObject(typeof padding2 !== "number" ? padding2 : expandToHashMap(padding2, basePlacements));
    const altContext = elementContext === popper ? reference : popper;
    const referenceElement = state.elements.reference;
    const popperRect = state.rects.popper;
    const element = state.elements[altBoundary ? altContext : elementContext];
    const clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
    const referenceClientRect = getBoundingClientRect(referenceElement);
    const popperOffsets2 = computeOffsets({
      reference: referenceClientRect,
      element: popperRect,
      strategy: "absolute",
      placement
    });
    const popperClientRect = rectToClientRect(Object.assign(Object.assign({}, popperRect), popperOffsets2));
    const elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
    const overflowOffsets = {
      top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
      bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
      left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
      right: elementClientRect.right - clippingClientRect.right + paddingObject.right
    };
    const offsetData = state.modifiersData.offset;
    if (elementContext === popper && offsetData) {
      const offset2 = offsetData[placement];
      Object.keys(overflowOffsets).forEach((key) => {
        const multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
        const axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
        overflowOffsets[key] += offset2[axis] * multiply;
      });
    }
    return overflowOffsets;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/index.js
  var DEFAULT_OPTIONS = {
    placement: "bottom",
    modifiers: [],
    strategy: "absolute"
  };
  function areValidElements(...args) {
    return !args.some((element) => !(element && typeof element.getBoundingClientRect === "function"));
  }
  function popperGenerator(generatorOptions = {}) {
    const { defaultModifiers: defaultModifiers2 = [], defaultOptions = DEFAULT_OPTIONS } = generatorOptions;
    return function createPopper3(reference2, popper2, options4 = defaultOptions) {
      let state = {
        placement: "bottom",
        orderedModifiers: [],
        options: Object.assign(Object.assign({}, DEFAULT_OPTIONS), defaultOptions),
        modifiersData: {},
        elements: {
          reference: reference2,
          popper: popper2
        },
        attributes: {},
        styles: {}
      };
      let effectCleanupFns = [];
      let isDestroyed = false;
      const instance = {
        state,
        setOptions(options5) {
          cleanupModifierEffects();
          state.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), state.options), options5);
          state.scrollParents = {
            reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
            popper: listScrollParents(popper2)
          };
          const orderedModifiers = orderModifiers(mergeByName([...defaultModifiers2, ...state.options.modifiers]));
          state.orderedModifiers = orderedModifiers.filter((m) => m.enabled);
          if (false) {
            const modifiers = uniqueBy([...orderedModifiers, ...state.options.modifiers], ({ name: name2 }) => name2);
            validateModifiers(modifiers);
            if (getBasePlacement(state.options.placement) === auto) {
              const flipModifier = state.orderedModifiers.find(({ name: name2 }) => name2 === "flip");
              if (!flipModifier) {
                console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
              }
            }
            const { marginTop, marginRight, marginBottom, marginLeft } = getComputedStyle2(popper2);
            if ([marginTop, marginRight, marginBottom, marginLeft].some((margin) => parseFloat(margin))) {
              console.warn([
                'Popper: CSS "margin" styles cannot be used to apply padding',
                "between the popper and its reference element or boundary.",
                "To replicate margin, use the `offset` modifier, as well as",
                "the `padding` option in the `preventOverflow` and `flip`",
                "modifiers."
              ].join(" "));
            }
          }
          runModifierEffects();
          return instance.update();
        },
        // Sync update – it will always be executed, even if not necessary. This
        // is useful for low frequency updates where sync behavior simplifies the
        // logic.
        // For high frequency updates (e.g. `resize` and `scroll` events), always
        // prefer the async Popper#update method
        forceUpdate() {
          if (isDestroyed) {
            return;
          }
          const { reference: reference3, popper: popper3 } = state.elements;
          if (!areValidElements(reference3, popper3)) {
            if (false) {
              console.error(INVALID_ELEMENT_ERROR);
            }
            return;
          }
          state.rects = {
            reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
            popper: getLayoutRect(popper3)
          };
          state.reset = false;
          state.placement = state.options.placement;
          state.orderedModifiers.forEach((modifier) => state.modifiersData[modifier.name] = Object.assign({}, modifier.data));
          let __debug_loops__ = 0;
          for (let index = 0; index < state.orderedModifiers.length; index++) {
            if (false) {
              __debug_loops__ += 1;
              if (__debug_loops__ > 100) {
                console.error(INFINITE_LOOP_ERROR);
                break;
              }
            }
            if (state.reset === true) {
              state.reset = false;
              index = -1;
              continue;
            }
            const { fn, options: options5 = {}, name: name2 } = state.orderedModifiers[index];
            if (typeof fn === "function") {
              state = fn({ state, options: options5, name: name2, instance }) || state;
            }
          }
        },
        // Async and optimistically optimized update – it will not be executed if
        // not necessary (debounced to run at most once-per-tick)
        update: debounce2(() => new Promise((resolve2) => {
          instance.forceUpdate();
          resolve2(state);
        })),
        destroy() {
          cleanupModifierEffects();
          isDestroyed = true;
        }
      };
      if (!areValidElements(reference2, popper2)) {
        if (false) {
          console.error(INVALID_ELEMENT_ERROR);
        }
        return instance;
      }
      instance.setOptions(options4).then((state2) => {
        if (!isDestroyed && options4.onFirstUpdate) {
          options4.onFirstUpdate(state2);
        }
      });
      function runModifierEffects() {
        state.orderedModifiers.forEach(({ name: name2, options: options5 = {}, effect: effect4 }) => {
          if (typeof effect4 === "function") {
            const cleanupFn = effect4({ state, name: name2, instance, options: options5 });
            const noopFn = () => {
            };
            effectCleanupFns.push(cleanupFn || noopFn);
          }
        });
      }
      function cleanupModifierEffects() {
        effectCleanupFns.forEach((fn) => fn());
        effectCleanupFns = [];
      }
      return instance;
    };
  }
  var createPopper = popperGenerator();

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/eventListeners.js
  var passive = { passive: true };
  function effect({ state, instance, options: options4 }) {
    const { scroll = true, resize = true } = options4;
    const window2 = getWindow(state.elements.popper);
    const scrollParents = [...state.scrollParents.reference, ...state.scrollParents.popper];
    if (scroll) {
      scrollParents.forEach((scrollParent) => {
        scrollParent.addEventListener("scroll", instance.update, passive);
      });
    }
    if (resize) {
      window2.addEventListener("resize", instance.update, passive);
    }
    return () => {
      if (scroll) {
        scrollParents.forEach((scrollParent) => {
          scrollParent.removeEventListener("scroll", instance.update, passive);
        });
      }
      if (resize) {
        window2.removeEventListener("resize", instance.update, passive);
      }
    };
  }
  var eventListeners_default = {
    name: "eventListeners",
    enabled: true,
    phase: "write",
    fn: () => {
    },
    effect,
    data: {}
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/popperOffsets.js
  function popperOffsets({ state, name: name2 }) {
    state.modifiersData[name2] = computeOffsets({
      reference: state.rects.reference,
      element: state.rects.popper,
      strategy: "absolute",
      placement: state.placement
    });
  }
  var popperOffsets_default = {
    name: "popperOffsets",
    enabled: true,
    phase: "read",
    fn: popperOffsets,
    data: {}
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/computeStyles.js
  var unsetSides = {
    top: "auto",
    right: "auto",
    bottom: "auto",
    left: "auto"
  };
  function roundOffsets({ x: x2, y: y2 }) {
    const win = window;
    const dpr = win.devicePixelRatio || 1;
    return {
      x: Math.round(x2 * dpr) / dpr || 0,
      y: Math.round(y2 * dpr) / dpr || 0
    };
  }
  function mapToStyles({ popper: popper2, popperRect, placement, offsets, position, gpuAcceleration, adaptive }) {
    let { x: x2, y: y2 } = roundOffsets(offsets);
    const hasX = offsets.hasOwnProperty("x");
    const hasY = offsets.hasOwnProperty("y");
    let sideX = left;
    let sideY = top;
    const win = window;
    if (adaptive) {
      let offsetParent = getOffsetParent(popper2);
      if (offsetParent === getWindow(popper2)) {
        offsetParent = getDocumentElement(popper2);
      }
      if (placement === top) {
        sideY = bottom;
        y2 -= offsetParent.clientHeight - popperRect.height;
        y2 *= gpuAcceleration ? 1 : -1;
      }
      if (placement === left) {
        sideX = right;
        x2 -= offsetParent.clientWidth - popperRect.width;
        x2 *= gpuAcceleration ? 1 : -1;
      }
    }
    const commonStyles = Object.assign({ position }, adaptive && unsetSides);
    if (gpuAcceleration) {
      return Object.assign(Object.assign({}, commonStyles), {
        [sideY]: hasY ? "0" : "",
        [sideX]: hasX ? "0" : "",
        // Layer acceleration can disable subpixel rendering which causes slightly
        // blurry text on low PPI displays, so we want to use 2D transforms
        // instead
        transform: (win.devicePixelRatio || 1) < 2 ? `translate(${x2}px, ${y2}px)` : `translate3d(${x2}px, ${y2}px, 0)`
      });
    }
    return Object.assign(Object.assign({}, commonStyles), { [sideY]: hasY ? `${y2}px` : "", [sideX]: hasX ? `${x2}px` : "", transform: "" });
  }
  function computeStyles({ state, options: options4 }) {
    const { gpuAcceleration = true, adaptive = true } = options4;
    if (false) {
      const transitionProperty = getComputedStyle2(state.elements.popper).transitionProperty || "";
      if (adaptive && ["transform", "top", "right", "bottom", "left"].some((property) => transitionProperty.indexOf(property) >= 0)) {
        console.warn([
          "Popper: Detected CSS transitions on at least one of the following",
          'CSS properties: "transform", "top", "right", "bottom", "left".',
          "\n\n",
          'Disable the "computeStyles" modifier\'s `adaptive` option to allow',
          "for smooth transitions, or remove these properties from the CSS",
          "transition declaration on the popper element if only transitioning",
          "opacity or background-color for example.",
          "\n\n",
          "We recommend using the popper element as a wrapper around an inner",
          "element that can have any CSS property transitioned for animations."
        ].join(" "));
      }
    }
    const commonStyles = {
      placement: getBasePlacement(state.placement),
      popper: state.elements.popper,
      popperRect: state.rects.popper,
      gpuAcceleration
    };
    if (state.modifiersData.popperOffsets != null) {
      state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), mapToStyles(Object.assign(Object.assign({}, commonStyles), { offsets: state.modifiersData.popperOffsets, position: state.options.strategy, adaptive })));
    }
    if (state.modifiersData.arrow != null) {
      state.styles.arrow = Object.assign(Object.assign({}, state.styles.arrow), mapToStyles(Object.assign(Object.assign({}, commonStyles), { offsets: state.modifiersData.arrow, position: "absolute", adaptive: false })));
    }
    state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), { "data-popper-placement": state.placement });
  }
  var computeStyles_default = {
    name: "computeStyles",
    enabled: true,
    phase: "beforeWrite",
    fn: computeStyles,
    data: {}
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/applyStyles.js
  function applyStyles({ state }) {
    Object.keys(state.elements).forEach((name2) => {
      const style = state.styles[name2] || {};
      const attributes = state.attributes[name2] || {};
      const element = state.elements[name2];
      if (!isHTMLElement(element) || !getNodeName(element)) {
        return;
      }
      Object.assign(element.style, style);
      Object.keys(attributes).forEach((name3) => {
        const value = attributes[name3];
        if (value === false) {
          element.removeAttribute(name3);
        } else {
          element.setAttribute(name3, value === true ? "" : value);
        }
      });
    });
  }
  function effect2({ state }) {
    const initialStyles = {
      popper: {
        position: state.options.strategy,
        left: "0",
        top: "0",
        margin: "0"
      },
      arrow: {
        position: "absolute"
      },
      reference: {}
    };
    Object.assign(state.elements.popper.style, initialStyles.popper);
    if (state.elements.arrow) {
      Object.assign(state.elements.arrow.style, initialStyles.arrow);
    }
    return () => {
      Object.keys(state.elements).forEach((name2) => {
        const element = state.elements[name2];
        const attributes = state.attributes[name2] || {};
        const styleProperties = Object.keys(state.styles.hasOwnProperty(name2) ? state.styles[name2] : initialStyles[name2]);
        const style = styleProperties.reduce((style2, property) => {
          style2[property] = "";
          return style2;
        }, {});
        if (!isHTMLElement(element) || !getNodeName(element)) {
          return;
        }
        Object.assign(element.style, style);
        Object.keys(attributes).forEach((attribute) => {
          element.removeAttribute(attribute);
        });
      });
    };
  }
  var applyStyles_default = {
    name: "applyStyles",
    enabled: true,
    phase: "write",
    fn: applyStyles,
    effect: effect2,
    requires: ["computeStyles"]
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/offset.js
  function distanceAndSkiddingToXY(placement, rects, offset2) {
    const basePlacement = getBasePlacement(placement);
    const invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
    let [skidding, distance] = typeof offset2 === "function" ? offset2(Object.assign(Object.assign({}, rects), { placement })) : offset2;
    skidding = skidding || 0;
    distance = (distance || 0) * invertDistance;
    return [left, right].indexOf(basePlacement) >= 0 ? { x: distance, y: skidding } : { x: skidding, y: distance };
  }
  function offset({ state, options: options4, name: name2 }) {
    const { offset: offset2 = [0, 0] } = options4;
    const data = placements.reduce((acc, placement) => {
      acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
      return acc;
    }, {});
    const { x: x2, y: y2 } = data[state.placement];
    if (state.modifiersData.popperOffsets != null) {
      state.modifiersData.popperOffsets.x += x2;
      state.modifiersData.popperOffsets.y += y2;
    }
    state.modifiersData[name2] = data;
  }
  var offset_default = {
    name: "offset",
    enabled: true,
    phase: "main",
    requires: ["popperOffsets"],
    fn: offset
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getOppositePlacement.js
  var hash = { left: "right", right: "left", bottom: "top", top: "bottom" };
  function getOppositePlacement(placement) {
    return placement.replace(/left|right|bottom|top/g, (matched) => hash[matched]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getOppositeVariationPlacement.js
  var hash2 = { start: "end", end: "start" };
  function getOppositeVariationPlacement(placement) {
    return placement.replace(/start|end/g, (matched) => hash2[matched]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/computeAutoPlacement.js
  function computeAutoPlacement(state, options4 = {}) {
    const { placement, boundary, rootBoundary, padding: padding2, flipVariations, allowedAutoPlacements = placements } = options4;
    const variation = getVariation(placement);
    const placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter((placement2) => getVariation(placement2) === variation) : basePlacements;
    let allowedPlacements = placements2.filter((placement2) => allowedAutoPlacements.indexOf(placement2) >= 0);
    if (allowedPlacements.length === 0) {
      allowedPlacements = placements2;
      if (false) {
        console.error([
          "Popper: The `allowedAutoPlacements` option did not allow any",
          "placements. Ensure the `placement` option matches the variation",
          "of the allowed placements.",
          'For example, "auto" cannot be used to allow "bottom-start".',
          'Use "auto-start" instead.'
        ].join(" "));
      }
    }
    const overflows = allowedPlacements.reduce((acc, placement2) => {
      acc[placement2] = detectOverflow(state, {
        placement: placement2,
        boundary,
        rootBoundary,
        padding: padding2
      })[getBasePlacement(placement2)];
      return acc;
    }, {});
    return Object.keys(overflows).sort((a2, b) => overflows[a2] - overflows[b]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/flip.js
  function getExpandedFallbackPlacements(placement) {
    if (getBasePlacement(placement) === auto) {
      return [];
    }
    const oppositePlacement = getOppositePlacement(placement);
    return [
      getOppositeVariationPlacement(placement),
      oppositePlacement,
      getOppositeVariationPlacement(oppositePlacement)
    ];
  }
  function flip({ state, options: options4, name: name2 }) {
    if (state.modifiersData[name2]._skip) {
      return;
    }
    const { mainAxis: checkMainAxis = true, altAxis: checkAltAxis = true, fallbackPlacements: specifiedFallbackPlacements, padding: padding2, boundary, rootBoundary, altBoundary, flipVariations = true, allowedAutoPlacements } = options4;
    const preferredPlacement = state.options.placement;
    const basePlacement = getBasePlacement(preferredPlacement);
    const isBasePlacement = basePlacement === preferredPlacement;
    const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
    const placements2 = [preferredPlacement, ...fallbackPlacements].reduce((acc, placement) => acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
      placement,
      boundary,
      rootBoundary,
      padding: padding2,
      flipVariations,
      allowedAutoPlacements
    }) : placement), []);
    const referenceRect = state.rects.reference;
    const popperRect = state.rects.popper;
    const checksMap = /* @__PURE__ */ new Map();
    let makeFallbackChecks = true;
    let firstFittingPlacement = placements2[0];
    for (let i = 0; i < placements2.length; i++) {
      const placement = placements2[i];
      const basePlacement2 = getBasePlacement(placement);
      const isStartVariation = getVariation(placement) === start;
      const isVertical2 = [top, bottom].indexOf(basePlacement2) >= 0;
      const len = isVertical2 ? "width" : "height";
      const overflow = detectOverflow(state, {
        placement,
        boundary,
        rootBoundary,
        altBoundary,
        padding: padding2
      });
      let mainVariationSide = isVertical2 ? isStartVariation ? right : left : isStartVariation ? bottom : top;
      if (referenceRect[len] > popperRect[len]) {
        mainVariationSide = getOppositePlacement(mainVariationSide);
      }
      const altVariationSide = getOppositePlacement(mainVariationSide);
      const checks = [];
      if (checkMainAxis) {
        checks.push(overflow[basePlacement2] <= 0);
      }
      if (checkAltAxis) {
        checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
      }
      if (checks.every((check) => check)) {
        firstFittingPlacement = placement;
        makeFallbackChecks = false;
        break;
      }
      checksMap.set(placement, checks);
    }
    if (makeFallbackChecks) {
      const numberOfChecks = flipVariations ? 3 : 1;
      for (let i = numberOfChecks; i > 0; i--) {
        const fittingPlacement = placements2.find((placement) => {
          const checks = checksMap.get(placement);
          if (checks) {
            return checks.slice(0, i).every((check) => check);
          }
        });
        if (fittingPlacement) {
          firstFittingPlacement = fittingPlacement;
          break;
        }
      }
    }
    if (state.placement !== firstFittingPlacement) {
      state.modifiersData[name2]._skip = true;
      state.placement = firstFittingPlacement;
      state.reset = true;
    }
  }
  var flip_default = {
    name: "flip",
    enabled: true,
    phase: "main",
    fn: flip,
    requiresIfExists: ["offset"],
    data: { _skip: false }
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getAltAxis.js
  function getAltAxis(axis) {
    return axis === "x" ? "y" : "x";
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/within.js
  function within(min3, value, max3) {
    return Math.max(min3, Math.min(value, max3));
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/preventOverflow.js
  function preventOverflow({ state, options: options4, name: name2 }) {
    const { mainAxis: checkMainAxis = true, altAxis: checkAltAxis = false, boundary, rootBoundary, altBoundary, padding: padding2, tether = true, tetherOffset = 0 } = options4;
    const overflow = detectOverflow(state, {
      boundary,
      rootBoundary,
      padding: padding2,
      altBoundary
    });
    const basePlacement = getBasePlacement(state.placement);
    const variation = getVariation(state.placement);
    const isBasePlacement = !variation;
    const mainAxis = getMainAxisFromPlacement(basePlacement);
    const altAxis = getAltAxis(mainAxis);
    const popperOffsets2 = state.modifiersData.popperOffsets;
    const referenceRect = state.rects.reference;
    const popperRect = state.rects.popper;
    const tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign(Object.assign({}, state.rects), { placement: state.placement })) : tetherOffset;
    const data = { x: 0, y: 0 };
    if (!popperOffsets2) {
      return;
    }
    if (checkMainAxis) {
      const mainSide = mainAxis === "y" ? top : left;
      const altSide = mainAxis === "y" ? bottom : right;
      const len = mainAxis === "y" ? "height" : "width";
      const offset2 = popperOffsets2[mainAxis];
      const min3 = popperOffsets2[mainAxis] + overflow[mainSide];
      const max3 = popperOffsets2[mainAxis] - overflow[altSide];
      const additive = tether ? -popperRect[len] / 2 : 0;
      const minLen = variation === start ? referenceRect[len] : popperRect[len];
      const maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
      const arrowElement = state.elements.arrow;
      const arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { width: 0, height: 0 };
      const arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
      const arrowPaddingMin = arrowPaddingObject[mainSide];
      const arrowPaddingMax = arrowPaddingObject[altSide];
      const arrowLen = within(0, referenceRect[len], arrowRect[len]);
      const minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
      const maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
      const arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
      const clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
      const offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
      const tetherMin = popperOffsets2[mainAxis] + minOffset - offsetModifierValue - clientOffset;
      const tetherMax = popperOffsets2[mainAxis] + maxOffset - offsetModifierValue;
      const preventedOffset = within(tether ? Math.min(min3, tetherMin) : min3, offset2, tether ? Math.max(max3, tetherMax) : max3);
      popperOffsets2[mainAxis] = preventedOffset;
      data[mainAxis] = preventedOffset - offset2;
    }
    if (checkAltAxis) {
      const mainSide = mainAxis === "x" ? top : left;
      const altSide = mainAxis === "x" ? bottom : right;
      const offset2 = popperOffsets2[altAxis];
      const min3 = offset2 + overflow[mainSide];
      const max3 = offset2 - overflow[altSide];
      const preventedOffset = within(min3, offset2, max3);
      popperOffsets2[altAxis] = preventedOffset;
      data[altAxis] = preventedOffset - offset2;
    }
    state.modifiersData[name2] = data;
  }
  var preventOverflow_default = {
    name: "preventOverflow",
    enabled: true,
    phase: "main",
    fn: preventOverflow,
    requiresIfExists: ["offset"]
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/arrow.js
  function arrow({ state, name: name2 }) {
    const arrowElement = state.elements.arrow;
    const popperOffsets2 = state.modifiersData.popperOffsets;
    const basePlacement = getBasePlacement(state.placement);
    const axis = getMainAxisFromPlacement(basePlacement);
    const isVertical2 = [left, right].indexOf(basePlacement) >= 0;
    const len = isVertical2 ? "height" : "width";
    if (!arrowElement || !popperOffsets2) {
      return;
    }
    const paddingObject = state.modifiersData[`${name2}#persistent`].padding;
    const arrowRect = getLayoutRect(arrowElement);
    const minProp = axis === "y" ? top : left;
    const maxProp = axis === "y" ? bottom : right;
    const endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
    const startDiff = popperOffsets2[axis] - state.rects.reference[axis];
    const arrowOffsetParent = getOffsetParent(arrowElement);
    const clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
    const centerToReference = endDiff / 2 - startDiff / 2;
    const min3 = paddingObject[minProp];
    const max3 = clientSize - arrowRect[len] - paddingObject[maxProp];
    const center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
    const offset2 = within(min3, center, max3);
    const axisProp = axis;
    state.modifiersData[name2] = {
      [axisProp]: offset2,
      centerOffset: offset2 - center
    };
  }
  function effect3({ state, options: options4, name: name2 }) {
    let { element: arrowElement = "[data-popper-arrow]", padding: padding2 = 0 } = options4;
    if (arrowElement == null) {
      return;
    }
    if (typeof arrowElement === "string") {
      arrowElement = state.elements.popper.querySelector(arrowElement);
      if (!arrowElement) {
        return;
      }
    }
    if (false) {
      if (!isHTMLElement(arrowElement)) {
        console.error([
          'Popper: "arrow" element must be an HTMLElement (not an SVGElement).',
          "To use an SVG arrow, wrap it in an HTMLElement that will be used as",
          "the arrow."
        ].join(" "));
      }
    }
    if (!contains(state.elements.popper, arrowElement)) {
      if (false) {
        console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
      }
      return;
    }
    state.elements.arrow = arrowElement;
    state.modifiersData[`${name2}#persistent`] = {
      padding: mergePaddingObject(typeof padding2 !== "number" ? padding2 : expandToHashMap(padding2, basePlacements))
    };
  }
  var arrow_default = {
    name: "arrow",
    enabled: true,
    phase: "main",
    fn: arrow,
    effect: effect3,
    requires: ["popperOffsets"],
    requiresIfExists: ["preventOverflow"]
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/hide.js
  function getSideOffsets(overflow, rect, preventedOffsets = { x: 0, y: 0 }) {
    return {
      top: overflow.top - rect.height - preventedOffsets.y,
      right: overflow.right - rect.width + preventedOffsets.x,
      bottom: overflow.bottom - rect.height + preventedOffsets.y,
      left: overflow.left - rect.width - preventedOffsets.x
    };
  }
  function isAnySideFullyClipped(overflow) {
    return [top, right, bottom, left].some((side) => overflow[side] >= 0);
  }
  function hide({ state, name: name2 }) {
    const referenceRect = state.rects.reference;
    const popperRect = state.rects.popper;
    const preventedOffsets = state.modifiersData.preventOverflow;
    const referenceOverflow = detectOverflow(state, {
      elementContext: "reference"
    });
    const popperAltOverflow = detectOverflow(state, {
      altBoundary: true
    });
    const referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
    const popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
    const isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
    const hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
    state.modifiersData[name2] = {
      referenceClippingOffsets,
      popperEscapeOffsets,
      isReferenceHidden,
      hasPopperEscaped
    };
    state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), { "data-popper-reference-hidden": isReferenceHidden, "data-popper-escaped": hasPopperEscaped });
  }
  var hide_default = {
    name: "hide",
    enabled: true,
    phase: "main",
    requiresIfExists: ["preventOverflow"],
    fn: hide
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/popper.js
  var defaultModifiers = [
    eventListeners_default,
    popperOffsets_default,
    computeStyles_default,
    applyStyles_default,
    offset_default,
    flip_default,
    preventOverflow_default,
    arrow_default,
    hide_default
  ];
  var createPopper2 = popperGenerator({ defaultModifiers });

  // node_modules/@patternfly/react-core/dist/esm/helpers/useIsomorphicLayout.js
  var React3 = __toESM(require_react());
  var useIsomorphicLayoutEffect = canUseDOM ? React3.useLayoutEffect : React3.useEffect;

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/react-popper/usePopper.js
  var isEqual = (a2, b) => JSON.stringify(a2) === JSON.stringify(b);
  var fromEntries = (entries) => entries.reduce((acc, [key, value]) => {
    acc[key] = value;
    return acc;
  }, {});
  var EMPTY_MODIFIERS = [];
  var usePopper = (referenceElement, popperElement, options4 = {}) => {
    const prevOptions = React4.useRef(null);
    const optionsWithDefaults = {
      onFirstUpdate: options4.onFirstUpdate,
      placement: options4.placement || "bottom",
      strategy: options4.strategy || "absolute",
      modifiers: options4.modifiers || EMPTY_MODIFIERS
    };
    const [state, setState] = React4.useState({
      styles: {
        popper: {
          position: optionsWithDefaults.strategy,
          left: "0",
          top: "0"
        }
      },
      attributes: {}
    });
    const updateStateModifier = React4.useMemo(() => ({
      name: "updateState",
      enabled: true,
      phase: "write",
      // eslint-disable-next-line no-shadow
      fn: ({ state: state2 }) => {
        const elements = Object.keys(state2.elements);
        setState({
          styles: fromEntries(elements.map((element) => [element, state2.styles[element] || {}])),
          attributes: fromEntries(elements.map((element) => [element, state2.attributes[element]]))
        });
      },
      requires: ["computeStyles"]
    }), []);
    const popperOptions = React4.useMemo(() => {
      const newOptions = {
        onFirstUpdate: optionsWithDefaults.onFirstUpdate,
        placement: optionsWithDefaults.placement,
        strategy: optionsWithDefaults.strategy,
        modifiers: [...optionsWithDefaults.modifiers, updateStateModifier, { name: "applyStyles", enabled: false }]
      };
      if (isEqual(prevOptions.current, newOptions)) {
        return prevOptions.current || newOptions;
      } else {
        prevOptions.current = newOptions;
        return newOptions;
      }
    }, [
      optionsWithDefaults.onFirstUpdate,
      optionsWithDefaults.placement,
      optionsWithDefaults.strategy,
      optionsWithDefaults.modifiers,
      updateStateModifier
    ]);
    const popperInstanceRef = React4.useRef();
    useIsomorphicLayoutEffect(() => {
      if (popperInstanceRef && popperInstanceRef.current) {
        popperInstanceRef.current.setOptions(popperOptions);
      }
    }, [popperOptions]);
    useIsomorphicLayoutEffect(() => {
      if (referenceElement == null || popperElement == null) {
        return;
      }
      const createPopper3 = options4.createPopper || createPopper2;
      const popperInstance = createPopper3(referenceElement, popperElement, popperOptions);
      popperInstanceRef.current = popperInstance;
      return () => {
        popperInstance.destroy();
        popperInstanceRef.current = null;
      };
    }, [referenceElement, popperElement, options4.createPopper]);
    return {
      state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
      styles: state.styles,
      attributes: state.attributes,
      update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
      forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
    };
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/FindRefWrapper.js
  var React5 = __toESM(require_react());
  var ReactDOM2 = __toESM(require_react_dom());
  var FindRefWrapper = class extends React5.Component {
    componentDidMount() {
      const root = ReactDOM2.findDOMNode(this);
      this.props.onFoundRef(root);
    }
    render() {
      return this.props.children || null;
    }
  };
  FindRefWrapper.displayName = "FindRefWrapper";

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/Popper.js
  var hash3 = {
    left: "right",
    right: "left",
    bottom: "top",
    top: "bottom",
    "top-start": "bottom-end",
    "top-end": "bottom-start",
    "bottom-start": "top-end",
    "bottom-end": "top-start",
    "left-start": "right-end",
    "left-end": "right-start",
    "right-start": "left-end",
    "right-end": "left-start"
  };
  var getOppositePlacement2 = (placement) => placement.replace(/left|right|bottom|top|top-start|top-end|bottom-start|bottom-end|right-start|right-end|left-start|left-end/g, (matched) => hash3[matched]);
  var getOpacityTransition = (animationDuration) => `opacity ${animationDuration}ms cubic-bezier(.54, 1.5, .38, 1.11)`;
  var Popper = ({ trigger, popper: popper2, popperMatchesTriggerWidth = true, direction = "down", position = "left", placement, appendTo = () => document.body, zIndex = 9999, isVisible = true, positionModifiers, distance = 0, onMouseEnter, onMouseLeave, onFocus, onBlur, onDocumentClick, onTriggerClick, onTriggerEnter, onPopperClick, onPopperMouseEnter, onPopperMouseLeave, onDocumentKeyDown, enableFlip = true, flipBehavior = "flip", reference: reference2, removeFindDomNode = false, popperRef }) => {
    const [triggerElement, setTriggerElement] = React6.useState(null);
    const [refElement, setRefElement] = React6.useState(null);
    const [popperElement, setPopperElement] = React6.useState(null);
    const [ready, setReady] = React6.useState(false);
    const refOrTrigger = refElement || triggerElement;
    const onDocumentClickCallback = React6.useCallback((event) => onDocumentClick(event, refOrTrigger, popperElement), [isVisible, triggerElement, refElement, popperElement, onDocumentClick]);
    React6.useEffect(() => {
      setReady(true);
    }, []);
    React6.useEffect(() => {
      if (reference2) {
        if (reference2.current) {
          setRefElement(reference2.current);
        } else if (typeof reference2 === "function") {
          setRefElement(reference2());
        }
      }
    }, [reference2]);
    React6.useEffect(() => {
      if (popperRef) {
        if (popperRef.current) {
          setPopperElement(popperRef.current);
        } else if (typeof popperRef === "function") {
          setPopperElement(popperRef());
        }
      }
    }, [isVisible, popperRef]);
    const addEventListener = (listener3, element, event, capture = false) => {
      if (listener3 && element) {
        element.addEventListener(event, listener3, { capture });
      }
    };
    const removeEventListener = (listener3, element, event, capture = false) => {
      if (listener3 && element) {
        element.removeEventListener(event, listener3, { capture });
      }
    };
    React6.useEffect(() => {
      addEventListener(onMouseEnter, refOrTrigger, "mouseenter");
      addEventListener(onMouseLeave, refOrTrigger, "mouseleave");
      addEventListener(onFocus, refOrTrigger, "focus");
      addEventListener(onBlur, refOrTrigger, "blur");
      addEventListener(onTriggerClick, refOrTrigger, "click");
      addEventListener(onTriggerEnter, refOrTrigger, "keydown");
      addEventListener(onPopperClick, popperElement, "click");
      addEventListener(onPopperMouseEnter, popperElement, "mouseenter");
      addEventListener(onPopperMouseLeave, popperElement, "mouseleave");
      onDocumentClick && addEventListener(onDocumentClickCallback, document, "click", true);
      addEventListener(onDocumentKeyDown, document, "keydown", true);
      const observer = new MutationObserver(() => {
        update && update();
      });
      popperElement && observer.observe(popperElement, { attributes: true, childList: true, subtree: true });
      return () => {
        removeEventListener(onMouseEnter, refOrTrigger, "mouseenter");
        removeEventListener(onMouseLeave, refOrTrigger, "mouseleave");
        removeEventListener(onFocus, refOrTrigger, "focus");
        removeEventListener(onBlur, refOrTrigger, "blur");
        removeEventListener(onTriggerClick, refOrTrigger, "click");
        removeEventListener(onTriggerEnter, refOrTrigger, "keydown");
        removeEventListener(onPopperClick, popperElement, "click");
        removeEventListener(onPopperMouseEnter, popperElement, "mouseenter");
        removeEventListener(onPopperMouseLeave, popperElement, "mouseleave");
        onDocumentClick && removeEventListener(onDocumentClickCallback, document, "click", true);
        removeEventListener(onDocumentKeyDown, document, "keydown", true);
        observer.disconnect();
      };
    }, [
      triggerElement,
      popperElement,
      onMouseEnter,
      onMouseLeave,
      onFocus,
      onBlur,
      onTriggerClick,
      onTriggerEnter,
      onPopperClick,
      onPopperMouseEnter,
      onPopperMouseLeave,
      onDocumentClick,
      onDocumentKeyDown,
      refElement
    ]);
    const getPlacement = () => {
      if (placement) {
        return placement;
      }
      let convertedPlacement = direction === "up" ? "top" : "bottom";
      if (position !== "center") {
        convertedPlacement = `${convertedPlacement}-${position === "right" ? "end" : "start"}`;
      }
      return convertedPlacement;
    };
    const getPlacementMemo = React6.useMemo(getPlacement, [direction, position, placement]);
    const getOppositePlacementMemo = React6.useMemo(() => getOppositePlacement2(getPlacement()), [
      direction,
      position,
      placement
    ]);
    const sameWidthMod = React6.useMemo(() => ({
      name: "sameWidth",
      enabled: popperMatchesTriggerWidth,
      phase: "beforeWrite",
      requires: ["computeStyles"],
      fn: ({ state }) => {
        state.styles.popper.width = `${state.rects.reference.width}px`;
      },
      effect: ({ state }) => {
        state.elements.popper.style.width = `${state.elements.reference.offsetWidth}px`;
        return () => {
        };
      }
    }), [popperMatchesTriggerWidth]);
    const { styles: popperStyles, attributes, update, forceUpdate } = usePopper(refOrTrigger, popperElement, {
      placement: getPlacementMemo,
      modifiers: [
        {
          name: "offset",
          options: {
            offset: [0, distance]
          }
        },
        {
          name: "preventOverflow",
          enabled: false
        },
        {
          // adds attribute [data-popper-reference-hidden] to the popper element which can be used to hide it using CSS
          name: "hide",
          enabled: true
        },
        {
          name: "flip",
          enabled: getPlacementMemo.startsWith("auto") || enableFlip,
          options: {
            fallbackPlacements: flipBehavior === "flip" ? [getOppositePlacementMemo] : flipBehavior
          }
        },
        sameWidthMod
      ]
    });
    React6.useEffect(() => {
      forceUpdate && forceUpdate();
    }, [popper2]);
    const modifierFromPopperPosition = () => {
      if (attributes && attributes.popper && attributes.popper["data-popper-placement"]) {
        const popperPlacement = attributes.popper["data-popper-placement"];
        return positionModifiers[popperPlacement];
      }
      return positionModifiers.top;
    };
    const options4 = Object.assign({ className: css(popper2.props && popper2.props.className, positionModifiers && modifierFromPopperPosition()), style: Object.assign(Object.assign(Object.assign({}, popper2.props && popper2.props.style || {}), popperStyles.popper), { zIndex }) }, attributes.popper);
    const menuWithPopper = React6.cloneElement(popper2, options4);
    const getTarget = () => {
      if (typeof appendTo === "function") {
        return appendTo();
      }
      return appendTo;
    };
    let popperPortal;
    if (removeFindDomNode) {
      popperPortal = React6.createElement("div", { style: { display: "contents" }, ref: (node) => setPopperElement(node === null || node === void 0 ? void 0 : node.firstElementChild) }, menuWithPopper);
    } else if (popperRef) {
      popperPortal = menuWithPopper;
    } else {
      popperPortal = React6.createElement(FindRefWrapper, { onFoundRef: (foundRef) => setPopperElement(foundRef) }, menuWithPopper);
    }
    return React6.createElement(
      React6.Fragment,
      null,
      !reference2 && trigger && React6.isValidElement(trigger) && !removeFindDomNode && React6.createElement(FindRefWrapper, { onFoundRef: (foundRef) => setTriggerElement(foundRef) }, trigger),
      !reference2 && trigger && React6.isValidElement(trigger) && removeFindDomNode && React6.createElement("div", { style: { display: "contents" }, ref: (node) => setTriggerElement(node === null || node === void 0 ? void 0 : node.firstElementChild) }, trigger),
      ready && isVisible && ReactDOM3.createPortal(popperPortal, getTarget())
    );
  };
  Popper.displayName = "Popper";

  // node_modules/@patternfly/react-core/dist/esm/helpers/KeyboardHandler.js
  var React7 = __toESM(require_react());
  var handleArrows = (event, navigableElements, isActiveElement = (element) => document.activeElement.contains(element), getFocusableElement = (element) => element, validSiblingTags = ["A", "BUTTON", "INPUT"], noVerticalArrowHandling = false, noHorizontalArrowHandling = false, updateTabIndex = true, onlyTraverseSiblings = true) => {
    const activeElement = document.activeElement;
    const key = event.key;
    let moveTarget = null;
    if (!noVerticalArrowHandling) {
      if (["ArrowUp", "ArrowDown"].includes(key)) {
        event.preventDefault();
        event.stopImmediatePropagation();
        let currentIndex = -1;
        navigableElements.forEach((element, index) => {
          if (isActiveElement(element)) {
            let increment = 0;
            while (!moveTarget && increment < navigableElements.length && increment * -1 < navigableElements.length) {
              key === "ArrowUp" ? increment-- : increment++;
              currentIndex = index + increment;
              if (currentIndex >= navigableElements.length) {
                currentIndex = 0;
              }
              if (currentIndex < 0) {
                currentIndex = navigableElements.length - 1;
              }
              moveTarget = getFocusableElement(navigableElements[currentIndex]);
            }
          }
        });
      }
    }
    if (!noHorizontalArrowHandling) {
      if (["ArrowLeft", "ArrowRight"].includes(key)) {
        event.preventDefault();
        event.stopImmediatePropagation();
        let currentIndex = -1;
        navigableElements.forEach((element, index) => {
          if (isActiveElement(element)) {
            const activeRow = navigableElements[index].querySelectorAll(validSiblingTags.join(","));
            if (!activeRow.length || onlyTraverseSiblings) {
              let nextSibling = activeElement;
              while (nextSibling) {
                nextSibling = key === "ArrowLeft" ? nextSibling.previousElementSibling : nextSibling.nextElementSibling;
                if (nextSibling) {
                  if (validSiblingTags.includes(nextSibling.tagName)) {
                    moveTarget = nextSibling;
                    break;
                  }
                }
              }
            } else {
              activeRow.forEach((focusableElement, index2) => {
                if (event.target === focusableElement) {
                  const increment = key === "ArrowLeft" ? -1 : 1;
                  currentIndex = index2 + increment;
                  if (currentIndex >= activeRow.length) {
                    currentIndex = 0;
                  }
                  if (currentIndex < 0) {
                    currentIndex = activeRow.length - 1;
                  }
                  moveTarget = activeRow[currentIndex];
                }
              });
            }
          }
        });
      }
    }
    if (moveTarget) {
      if (updateTabIndex) {
        activeElement.tabIndex = -1;
        moveTarget.tabIndex = 0;
      }
      moveTarget.focus();
    }
  };
  var setTabIndex = (options4) => {
    if (options4 && options4.length > 0) {
      options4.forEach((option) => {
        option.tabIndex = -1;
      });
      options4[0].tabIndex = 0;
    }
  };
  var KeyboardHandler = class extends React7.Component {
    constructor() {
      super(...arguments);
      this.keyHandler = (event) => {
        const { isEventFromContainer } = this.props;
        if (isEventFromContainer ? !isEventFromContainer(event) : !this._isEventFromContainer(event)) {
          return;
        }
        const { isActiveElement, getFocusableElement, noVerticalArrowHandling, noHorizontalArrowHandling, noEnterHandling, noSpaceHandling, updateTabIndex, validSiblingTags, additionalKeyHandler, createNavigableElements, onlyTraverseSiblings } = this.props;
        additionalKeyHandler && additionalKeyHandler(event);
        const navigableElements = createNavigableElements();
        if (!navigableElements) {
          console.warn("No navigable elements have been passed to the KeyboardHandler. Keyboard navigation provided by this component will be ignored.");
          return;
        }
        const key = event.key;
        if (!noEnterHandling) {
          if (key === "Enter") {
            event.preventDefault();
            event.stopImmediatePropagation();
            document.activeElement.click();
          }
        }
        if (!noSpaceHandling) {
          if (key === " ") {
            event.preventDefault();
            event.stopImmediatePropagation();
            document.activeElement.click();
          }
        }
        handleArrows(event, navigableElements, isActiveElement, getFocusableElement, validSiblingTags, noVerticalArrowHandling, noHorizontalArrowHandling, updateTabIndex, onlyTraverseSiblings);
      };
      this._isEventFromContainer = (event) => {
        const { containerRef } = this.props;
        return containerRef.current && containerRef.current.contains(event.target);
      };
    }
    componentDidMount() {
      if (canUseDOM) {
        window.addEventListener("keydown", this.keyHandler);
      }
    }
    componentWillUnmount() {
      if (canUseDOM) {
        window.removeEventListener("keydown", this.keyHandler);
      }
    }
    render() {
      return null;
    }
  };
  KeyboardHandler.displayName = "KeyboardHandler";
  KeyboardHandler.defaultProps = {
    containerRef: null,
    createNavigableElements: () => null,
    isActiveElement: (navigableElement) => document.activeElement === navigableElement,
    getFocusableElement: (navigableElement) => navigableElement,
    validSiblingTags: ["BUTTON", "A"],
    onlyTraverseSiblings: true,
    updateTabIndex: true,
    noHorizontalArrowHandling: false,
    noVerticalArrowHandling: false,
    noEnterHandling: false,
    noSpaceHandling: false
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/resizeObserver.js
  var getResizeObserver = (containerRefElement, handleResize, useRequestAnimationFrame = true) => {
    let unobserve;
    if (canUseDOM) {
      const { ResizeObserver } = window;
      if (containerRefElement && ResizeObserver) {
        const resizeObserver = new ResizeObserver((entries) => {
          if (useRequestAnimationFrame) {
            window.requestAnimationFrame(() => {
              if (Array.isArray(entries) && entries.length > 0) {
                handleResize();
              }
            });
          } else {
            if (Array.isArray(entries) && entries.length > 0) {
              handleResize();
            }
          }
        });
        resizeObserver.observe(containerRefElement);
        unobserve = () => resizeObserver.unobserve(containerRefElement);
      } else {
        window.addEventListener("resize", handleResize);
        unobserve = () => window.removeEventListener("resize", handleResize);
      }
    }
    return () => {
      if (unobserve) {
        unobserve();
      }
    };
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Title/Title.js
  init_tslib_es6();
  var React8 = __toESM(require_react());
  var import_title = __toESM(require_title());
  var TitleSizes;
  (function(TitleSizes2) {
    TitleSizes2["md"] = "md";
    TitleSizes2["lg"] = "lg";
    TitleSizes2["xl"] = "xl";
    TitleSizes2["2xl"] = "2xl";
    TitleSizes2["3xl"] = "3xl";
    TitleSizes2["4xl"] = "4xl";
  })(TitleSizes || (TitleSizes = {}));
  var headingLevelSizeMap;
  (function(headingLevelSizeMap2) {
    headingLevelSizeMap2["h1"] = "2xl";
    headingLevelSizeMap2["h2"] = "xl";
    headingLevelSizeMap2["h3"] = "lg";
    headingLevelSizeMap2["h4"] = "md";
    headingLevelSizeMap2["h5"] = "md";
    headingLevelSizeMap2["h6"] = "md";
  })(headingLevelSizeMap || (headingLevelSizeMap = {}));
  var Title = (_a) => {
    var { className = "", children = "", headingLevel: HeadingLevel, size = headingLevelSizeMap[HeadingLevel], ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["className", "children", "headingLevel", "size", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(Title.displayName, ouiaId, ouiaSafe);
    return React8.createElement(HeadingLevel, Object.assign({}, ouiaProps, props, { className: css(import_title.default.title, size && import_title.default.modifiers[size], className) }), children);
  };
  Title.displayName = "Title";

  // node_modules/@patternfly/react-core/dist/esm/components/Button/Button.js
  init_tslib_es6();
  var React11 = __toESM(require_react());
  var import_button = __toESM(require_button());

  // node_modules/@patternfly/react-core/dist/esm/components/Spinner/Spinner.js
  init_tslib_es6();
  var React9 = __toESM(require_react());
  var import_spinner = __toESM(require_spinner());
  var spinnerSize;
  (function(spinnerSize2) {
    spinnerSize2["sm"] = "sm";
    spinnerSize2["md"] = "md";
    spinnerSize2["lg"] = "lg";
    spinnerSize2["xl"] = "xl";
  })(spinnerSize || (spinnerSize = {}));
  var Spinner = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      size = "xl",
      "aria-valuetext": ariaValueText = "Loading...",
      isSVG = false,
      diameter,
      isInline = false,
      "aria-label": ariaLabel,
      "aria-labelledBy": ariaLabelledBy
    } = _a, props = __rest(_a, ["className", "size", "aria-valuetext", "isSVG", "diameter", "isInline", "aria-label", "aria-labelledBy"]);
    const Component50 = isSVG ? "svg" : "span";
    return React9.createElement(Component50, Object.assign({ className: css(import_spinner.default.spinner, isInline ? import_spinner.default.modifiers.inline : import_spinner.default.modifiers[size], className), role: "progressbar", "aria-valuetext": ariaValueText }, isSVG && { viewBox: "0 0 100 100" }, diameter && { style: { "--pf-c-spinner--diameter": diameter } }, ariaLabel && { "aria-label": ariaLabel }, ariaLabelledBy && { "aria-labelledBy": ariaLabelledBy }, !ariaLabel && !ariaLabelledBy && { "aria-label": "Contents" }, props), isSVG ? React9.createElement("circle", { className: import_spinner.default.spinnerPath, cx: "50", cy: "50", r: "45", fill: "none" }) : React9.createElement(
      React9.Fragment,
      null,
      React9.createElement("span", { className: css(import_spinner.default.spinnerClipper) }),
      React9.createElement("span", { className: css(import_spinner.default.spinnerLeadBall) }),
      React9.createElement("span", { className: css(import_spinner.default.spinnerTailBall) })
    ));
  };
  Spinner.displayName = "Spinner";

  // node_modules/@patternfly/react-core/dist/esm/components/Badge/Badge.js
  init_tslib_es6();
  var React10 = __toESM(require_react());
  var import_badge = __toESM(require_badge());
  var Badge = (_a) => {
    var { isRead = false, className = "", children = "", screenReaderText } = _a, props = __rest(_a, ["isRead", "className", "children", "screenReaderText"]);
    return React10.createElement(
      "span",
      Object.assign({}, props, { className: css(import_badge.default.badge, isRead ? import_badge.default.modifiers.read : import_badge.default.modifiers.unread, className) }),
      children,
      screenReaderText && React10.createElement("span", { className: "pf-screen-reader" }, screenReaderText)
    );
  };
  Badge.displayName = "Badge";

  // node_modules/@patternfly/react-core/dist/esm/components/Button/Button.js
  var ButtonVariant;
  (function(ButtonVariant2) {
    ButtonVariant2["primary"] = "primary";
    ButtonVariant2["secondary"] = "secondary";
    ButtonVariant2["tertiary"] = "tertiary";
    ButtonVariant2["danger"] = "danger";
    ButtonVariant2["warning"] = "warning";
    ButtonVariant2["link"] = "link";
    ButtonVariant2["plain"] = "plain";
    ButtonVariant2["control"] = "control";
  })(ButtonVariant || (ButtonVariant = {}));
  var ButtonType;
  (function(ButtonType2) {
    ButtonType2["button"] = "button";
    ButtonType2["submit"] = "submit";
    ButtonType2["reset"] = "reset";
  })(ButtonType || (ButtonType = {}));
  var ButtonBase = (_a) => {
    var { children = null, className = "", component = "button", isActive = false, isBlock = false, isDisabled = false, isAriaDisabled = false, isLoading = null, isDanger = false, spinnerAriaValueText, spinnerAriaLabelledBy, spinnerAriaLabel, isSmall = false, isLarge = false, inoperableEvents = ["onClick", "onKeyPress"], isInline = false, type = ButtonType.button, variant = ButtonVariant.primary, iconPosition = "left", "aria-label": ariaLabel = null, icon: icon2 = null, ouiaId, ouiaSafe = true, tabIndex = null, innerRef, countOptions } = _a, props = __rest(_a, ["children", "className", "component", "isActive", "isBlock", "isDisabled", "isAriaDisabled", "isLoading", "isDanger", "spinnerAriaValueText", "spinnerAriaLabelledBy", "spinnerAriaLabel", "isSmall", "isLarge", "inoperableEvents", "isInline", "type", "variant", "iconPosition", "aria-label", "icon", "ouiaId", "ouiaSafe", "tabIndex", "innerRef", "countOptions"]);
    const ouiaProps = useOUIAProps(Button.displayName, ouiaId, ouiaSafe, variant);
    const Component50 = component;
    const isButtonElement = Component50 === "button";
    const isInlineSpan = isInline && Component50 === "span";
    const preventedEvents2 = inoperableEvents.reduce((handlers, eventToPrevent) => Object.assign(Object.assign({}, handlers), { [eventToPrevent]: (event) => {
      event.preventDefault();
    } }), {});
    const getDefaultTabIdx = () => {
      if (isDisabled) {
        return isButtonElement ? null : -1;
      } else if (isAriaDisabled) {
        return null;
      } else if (isInlineSpan) {
        return 0;
      }
    };
    return React11.createElement(
      Component50,
      Object.assign({}, props, isAriaDisabled ? preventedEvents2 : null, { "aria-disabled": isDisabled || isAriaDisabled, "aria-label": ariaLabel, className: css(import_button.default.button, import_button.default.modifiers[variant], isBlock && import_button.default.modifiers.block, isDisabled && import_button.default.modifiers.disabled, isAriaDisabled && import_button.default.modifiers.ariaDisabled, isActive && import_button.default.modifiers.active, isInline && variant === ButtonVariant.link && import_button.default.modifiers.inline, isDanger && (variant === ButtonVariant.secondary || variant === ButtonVariant.link) && import_button.default.modifiers.danger, isLoading !== null && children !== null && import_button.default.modifiers.progress, isLoading && import_button.default.modifiers.inProgress, isSmall && import_button.default.modifiers.small, isLarge && import_button.default.modifiers.displayLg, className), disabled: isButtonElement ? isDisabled : null, tabIndex: tabIndex !== null ? tabIndex : getDefaultTabIdx(), type: isButtonElement || isInlineSpan ? type : null, role: isInlineSpan ? "button" : null, ref: innerRef }, ouiaProps),
      isLoading && React11.createElement(
        "span",
        { className: css(import_button.default.buttonProgress) },
        React11.createElement(Spinner, { size: spinnerSize.md, isInline, "aria-valuetext": spinnerAriaValueText, "aria-label": spinnerAriaLabel, "aria-labelledby": spinnerAriaLabelledBy })
      ),
      variant === ButtonVariant.plain && children === null && icon2 ? icon2 : null,
      variant !== ButtonVariant.plain && icon2 && iconPosition === "left" && React11.createElement("span", { className: css(import_button.default.buttonIcon, import_button.default.modifiers.start) }, icon2),
      children,
      variant !== ButtonVariant.plain && icon2 && iconPosition === "right" && React11.createElement("span", { className: css(import_button.default.buttonIcon, import_button.default.modifiers.end) }, icon2),
      countOptions && React11.createElement(
        "span",
        { className: css(import_button.default.buttonCount, countOptions.className) },
        React11.createElement(Badge, { isRead: countOptions.isRead }, countOptions.count)
      )
    );
  };
  var Button = React11.forwardRef((props, ref) => React11.createElement(ButtonBase, Object.assign({ innerRef: ref }, props)));
  Button.displayName = "Button";

  // node_modules/@patternfly/react-icons/dist/esm/createIcon.js
  init_tslib_es6();
  var React12 = __toESM(require_react());
  var IconSize;
  (function(IconSize2) {
    IconSize2["sm"] = "sm";
    IconSize2["md"] = "md";
    IconSize2["lg"] = "lg";
    IconSize2["xl"] = "xl";
  })(IconSize || (IconSize = {}));
  var getSize = (size) => {
    switch (size) {
      case IconSize.sm:
        return "1em";
      case IconSize.md:
        return "1.5em";
      case IconSize.lg:
        return "2em";
      case IconSize.xl:
        return "3em";
      default:
        return "1em";
    }
  };
  var currentId2 = 0;
  function createIcon({ name: name2, xOffset = 0, yOffset = 0, width, height, svgPath }) {
    var _a;
    return _a = class SVGIcon extends React12.Component {
      constructor() {
        super(...arguments);
        this.id = `icon-title-${currentId2++}`;
      }
      render() {
        const _a2 = this.props, { size, color: color2, title, noVerticalAlign } = _a2, props = __rest(_a2, ["size", "color", "title", "noVerticalAlign"]);
        const hasTitle = Boolean(title);
        const heightWidth = getSize(size);
        const baseAlign = -0.125 * Number.parseFloat(heightWidth);
        const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };
        const viewBox = [xOffset, yOffset, width, height].join(" ");
        return React12.createElement(
          "svg",
          Object.assign({ style, fill: color2, height: heightWidth, width: heightWidth, viewBox, "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img" }, props),
          hasTitle && React12.createElement("title", { id: this.id }, title),
          React12.createElement("path", { d: svgPath })
        );
      }
    }, _a.displayName = name2, _a.defaultProps = {
      color: "currentColor",
      size: IconSize.sm,
      noVerticalAlign: false
    }, _a;
  }

  // node_modules/@patternfly/react-icons/dist/esm/icons/times-icon.js
  var TimesIconConfig = {
    name: "TimesIcon",
    height: 512,
    width: 352,
    svgPath: "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",
    yOffset: 0,
    xOffset: 0
  };
  var TimesIcon = createIcon(TimesIconConfig);
  var times_icon_default = TimesIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Backdrop/Backdrop.js
  init_tslib_es6();
  var React13 = __toESM(require_react());
  var import_backdrop = __toESM(require_backdrop());
  var Backdrop = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React13.createElement("div", Object.assign({}, props, { className: css(import_backdrop.default.backdrop, className) }), children);
  };
  Backdrop.displayName = "Backdrop";

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-right-icon.js
  var AngleRightIconConfig = {
    name: "AngleRightIcon",
    height: 512,
    width: 256,
    svgPath: "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleRightIcon = createIcon(AngleRightIconConfig);
  var angle_right_icon_default = AngleRightIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/Alert.js
  init_tslib_es6();
  var React20 = __toESM(require_react());
  var import_react2 = __toESM(require_react());
  var import_alert3 = __toESM(require_alert());
  var import_accessibility = __toESM(require_accessibility());

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertIcon.js
  init_tslib_es6();
  var React14 = __toESM(require_react());
  var import_alert = __toESM(require_alert());

  // node_modules/@patternfly/react-icons/dist/esm/icons/check-circle-icon.js
  var CheckCircleIconConfig = {
    name: "CheckCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z",
    yOffset: 0,
    xOffset: 0
  };
  var CheckCircleIcon = createIcon(CheckCircleIconConfig);
  var check_circle_icon_default = CheckCircleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon.js
  var ExclamationCircleIconConfig = {
    name: "ExclamationCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
    yOffset: 0,
    xOffset: 0
  };
  var ExclamationCircleIcon = createIcon(ExclamationCircleIconConfig);
  var exclamation_circle_icon_default = ExclamationCircleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon.js
  var ExclamationTriangleIconConfig = {
    name: "ExclamationTriangleIcon",
    height: 512,
    width: 576,
    svgPath: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
    yOffset: 0,
    xOffset: 0
  };
  var ExclamationTriangleIcon = createIcon(ExclamationTriangleIconConfig);
  var exclamation_triangle_icon_default = ExclamationTriangleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/info-circle-icon.js
  var InfoCircleIconConfig = {
    name: "InfoCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z",
    yOffset: 0,
    xOffset: 0
  };
  var InfoCircleIcon = createIcon(InfoCircleIconConfig);
  var info_circle_icon_default = InfoCircleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/bell-icon.js
  var BellIconConfig = {
    name: "BellIcon",
    height: 1024,
    width: 896,
    svgPath: "M448,0 C465.333333,0 480.333333,6.33333333 493,19 C505.666667,31.6666667 512,46.6666667 512,64 L512,106 L514.23,106.45 C587.89,121.39 648.48,157.24 696,214 C744,271.333333 768,338.666667 768,416 C768,500 780,568.666667 804,622 C818.666667,652.666667 841.333333,684 872,716 C873.773676,718.829136 875.780658,721.505113 878,724 C890,737.333333 896,752.333333 896,769 C896,785.666667 890,800.333333 878,813 C866,825.666667 850.666667,832 832,832 L63.3,832 C44.9533333,831.84 29.8533333,825.506667 18,813 C6,800.333333 0,785.666667 0,769 C0,752.333333 6,737.333333 18,724 L24,716 L25.06,714.9 C55.1933333,683.28 77.5066667,652.313333 92,622 C116,568.666667 128,500 128,416 C128,338.666667 152,271.333333 200,214 C248,156.666667 309.333333,120.666667 384,106 L384,63.31 C384.166667,46.27 390.5,31.5 403,19 C415.666667,6.33333333 430.666667,0 448,0 Z M576,896 L576,897.08 C575.74,932.6 563.073333,962.573333 538,987 C512.666667,1011.66667 482.666667,1024 448,1024 C413.333333,1024 383.333333,1011.66667 358,987 C332.666667,962.333333 320,932 320,896 L576,896 Z",
    yOffset: 0,
    xOffset: 0
  };
  var BellIcon = createIcon(BellIconConfig);
  var bell_icon_default = BellIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertIcon.js
  var variantIcons = {
    success: check_circle_icon_default,
    danger: exclamation_circle_icon_default,
    warning: exclamation_triangle_icon_default,
    info: info_circle_icon_default,
    default: bell_icon_default
  };
  var AlertIcon = (_a) => {
    var { variant, customIcon, className = "" } = _a, props = __rest(_a, ["variant", "customIcon", "className"]);
    const Icon = variantIcons[variant];
    return Icon ? React14.createElement("div", Object.assign({}, props, { className: css(import_alert.default.alertIcon, className) }), customIcon || React14.createElement(Icon, null)) : null;
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertContext.js
  var React15 = __toESM(require_react());
  var AlertContext = React15.createContext(null);

  // node_modules/@patternfly/react-tokens/dist/esm/c_alert__title_max_lines.js
  var c_alert__title_max_lines = {
    "name": "--pf-c-alert__title--max-lines",
    "value": "1",
    "var": "var(--pf-c-alert__title--max-lines)"
  };
  var c_alert_title_max_lines_default = c_alert__title_max_lines;

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/Tooltip.js
  init_tslib_es6();
  var React18 = __toESM(require_react());
  var import_tooltip3 = __toESM(require_tooltip());

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/TooltipContent.js
  init_tslib_es6();
  var React16 = __toESM(require_react());
  var import_tooltip = __toESM(require_tooltip());
  var TooltipContent = (_a) => {
    var { className, children, isLeftAligned } = _a, props = __rest(_a, ["className", "children", "isLeftAligned"]);
    return React16.createElement("div", Object.assign({ className: css(import_tooltip.default.tooltipContent, isLeftAligned && import_tooltip.default.modifiers.textAlignLeft, className) }, props), children);
  };
  TooltipContent.displayName = "TooltipContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/TooltipArrow.js
  init_tslib_es6();
  var React17 = __toESM(require_react());
  var import_tooltip2 = __toESM(require_tooltip());
  var TooltipArrow = (_a) => {
    var { className } = _a, props = __rest(_a, ["className"]);
    return React17.createElement("div", Object.assign({ className: css(import_tooltip2.default.tooltipArrow, className) }, props));
  };
  TooltipArrow.displayName = "TooltipArrow";

  // node_modules/@patternfly/react-tokens/dist/esm/c_tooltip_MaxWidth.js
  var c_tooltip_MaxWidth = {
    "name": "--pf-c-tooltip--MaxWidth",
    "value": "18.75rem",
    "var": "var(--pf-c-tooltip--MaxWidth)"
  };
  var c_tooltip_MaxWidth_default = c_tooltip_MaxWidth;

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/Tooltip.js
  var TooltipPosition;
  (function(TooltipPosition2) {
    TooltipPosition2["auto"] = "auto";
    TooltipPosition2["top"] = "top";
    TooltipPosition2["bottom"] = "bottom";
    TooltipPosition2["left"] = "left";
    TooltipPosition2["right"] = "right";
    TooltipPosition2["topStart"] = "top-start";
    TooltipPosition2["topEnd"] = "top-end";
    TooltipPosition2["bottomStart"] = "bottom-start";
    TooltipPosition2["bottomEnd"] = "bottom-end";
    TooltipPosition2["leftStart"] = "left-start";
    TooltipPosition2["leftEnd"] = "left-end";
    TooltipPosition2["rightStart"] = "right-start";
    TooltipPosition2["rightEnd"] = "right-end";
  })(TooltipPosition || (TooltipPosition = {}));
  var pfTooltipIdCounter = 1;
  var Tooltip = (_a) => {
    var {
      content: bodyContent,
      position = "top",
      trigger = "mouseenter focus",
      isVisible = false,
      isContentLeftAligned = false,
      enableFlip = true,
      className = "",
      entryDelay = 300,
      exitDelay = 300,
      appendTo = () => document.body,
      zIndex = 9999,
      maxWidth = c_tooltip_MaxWidth_default.value,
      distance = 15,
      aria = "describedby",
      // For every initial starting position, there are 3 escape positions
      flipBehavior = ["top", "right", "bottom", "left", "top", "right", "bottom"],
      id = `pf-tooltip-${pfTooltipIdCounter++}`,
      children,
      animationDuration = 300,
      reference: reference2,
      "aria-live": ariaLive = reference2 ? "polite" : "off",
      boundary,
      isAppLauncher,
      tippyProps,
      removeFindDomNode = false,
      onTooltipHidden = () => {
      }
    } = _a, rest = __rest(_a, ["content", "position", "trigger", "isVisible", "isContentLeftAligned", "enableFlip", "className", "entryDelay", "exitDelay", "appendTo", "zIndex", "maxWidth", "distance", "aria", "flipBehavior", "id", "children", "animationDuration", "reference", "aria-live", "boundary", "isAppLauncher", "tippyProps", "removeFindDomNode", "onTooltipHidden"]);
    if (true) {
      boundary !== void 0 && console.warn("The Tooltip boundary prop has been deprecated. If you want to constrain the popper to a specific element use the appendTo prop instead.");
      isAppLauncher !== void 0 && console.warn("The Tooltip isAppLauncher prop has been deprecated and is no longer used.");
      tippyProps !== void 0 && console.warn("The Tooltip tippyProps prop has been deprecated and is no longer used.");
    }
    const hideOnClick = true;
    const triggerOnMouseenter = trigger.includes("mouseenter");
    const triggerOnFocus = trigger.includes("focus");
    const triggerOnClick = trigger.includes("click");
    const triggerManually = trigger === "manual";
    const [visible, setVisible] = React18.useState(false);
    const [opacity, setOpacity] = React18.useState(0);
    const transitionTimerRef = React18.useRef(null);
    const showTimerRef = React18.useRef(null);
    const hideTimerRef = React18.useRef(null);
    const prevExitDelayRef = React18.useRef();
    const clearTimeouts = (timeoutRefs) => {
      timeoutRefs.forEach((ref) => {
        if (ref.current) {
          clearTimeout(ref.current);
        }
      });
    };
    React18.useEffect(() => () => {
      clearTimeouts([transitionTimerRef, hideTimerRef, showTimerRef]);
    }, []);
    const onDocumentKeyDown = (event) => {
      if (!triggerManually) {
        if (event.key === KeyTypes.Escape && visible) {
          hide2();
        }
      }
    };
    const onTriggerEnter = (event) => {
      if (event.key === KeyTypes.Enter) {
        if (!visible) {
          show();
        } else {
          hide2();
        }
      }
    };
    React18.useEffect(() => {
      if (isVisible) {
        show();
      } else {
        hide2();
      }
    }, [isVisible]);
    React18.useEffect(() => {
      if (prevExitDelayRef.current < exitDelay) {
        clearTimeouts([transitionTimerRef, hideTimerRef]);
        hideTimerRef.current = setTimeout(() => {
          setOpacity(0);
          transitionTimerRef.current = setTimeout(() => {
            setVisible(false);
            onTooltipHidden();
          }, animationDuration);
        }, exitDelay);
      }
      prevExitDelayRef.current = exitDelay;
    }, [exitDelay]);
    const show = () => {
      clearTimeouts([transitionTimerRef, hideTimerRef]);
      showTimerRef.current = setTimeout(() => {
        setVisible(true);
        setOpacity(1);
      }, entryDelay);
    };
    const hide2 = () => {
      clearTimeouts([showTimerRef]);
      hideTimerRef.current = setTimeout(() => {
        setOpacity(0);
        transitionTimerRef.current = setTimeout(() => {
          setVisible(false);
          onTooltipHidden();
        }, animationDuration);
      }, exitDelay);
    };
    const positionModifiers = {
      top: import_tooltip3.default.modifiers.top,
      bottom: import_tooltip3.default.modifiers.bottom,
      left: import_tooltip3.default.modifiers.left,
      right: import_tooltip3.default.modifiers.right,
      "top-start": import_tooltip3.default.modifiers.topLeft,
      "top-end": import_tooltip3.default.modifiers.topRight,
      "bottom-start": import_tooltip3.default.modifiers.bottomLeft,
      "bottom-end": import_tooltip3.default.modifiers.bottomRight,
      "left-start": import_tooltip3.default.modifiers.leftTop,
      "left-end": import_tooltip3.default.modifiers.leftBottom,
      "right-start": import_tooltip3.default.modifiers.rightTop,
      "right-end": import_tooltip3.default.modifiers.rightBottom
    };
    const hasCustomMaxWidth = maxWidth !== c_tooltip_MaxWidth_default.value;
    const content = React18.createElement(
      "div",
      Object.assign({ "aria-live": ariaLive, className: css(import_tooltip3.default.tooltip, className), role: "tooltip", id, style: {
        maxWidth: hasCustomMaxWidth ? maxWidth : null,
        opacity,
        transition: getOpacityTransition(animationDuration)
      } }, rest),
      React18.createElement(TooltipArrow, null),
      React18.createElement(TooltipContent, { isLeftAligned: isContentLeftAligned }, bodyContent)
    );
    const onDocumentClick = (event, triggerElement) => {
      if (hideOnClick === true) {
        if (visible) {
          hide2();
        } else if (event.target === triggerElement) {
          show();
        }
      } else if (hideOnClick === "toggle" && event.target === triggerElement) {
        if (visible) {
          hide2();
        } else {
          show();
        }
      } else if (hideOnClick === false && !visible && event.target === triggerElement) {
        show();
      }
    };
    const addAriaToTrigger = () => {
      if (aria === "describedby" && children && children.props && !children.props["aria-describedby"]) {
        return React18.cloneElement(children, { "aria-describedby": id });
      } else if (aria === "labelledby" && children.props && !children.props["aria-labelledby"]) {
        return React18.cloneElement(children, { "aria-labelledby": id });
      }
      return children;
    };
    return React18.createElement(Popper, { trigger: aria !== "none" && visible ? addAriaToTrigger() : children, reference: reference2, popper: content, popperMatchesTriggerWidth: false, appendTo, isVisible: visible, positionModifiers, distance, placement: position, onMouseEnter: triggerOnMouseenter && show, onMouseLeave: triggerOnMouseenter && hide2, onPopperMouseEnter: triggerOnMouseenter && show, onPopperMouseLeave: triggerOnMouseenter && hide2, onFocus: triggerOnFocus && show, onBlur: triggerOnFocus && hide2, onDocumentClick: triggerOnClick && onDocumentClick, onDocumentKeyDown: triggerManually ? null : onDocumentKeyDown, onTriggerEnter: triggerManually ? null : onTriggerEnter, enableFlip, zIndex, flipBehavior, removeFindDomNode });
  };
  Tooltip.displayName = "Tooltip";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertToggleExpandButton.js
  init_tslib_es6();
  var React19 = __toESM(require_react());
  var import_alert2 = __toESM(require_alert());
  var AlertToggleExpandButton = (_a) => {
    var { "aria-label": ariaLabel = "", variantLabel, onToggleExpand, isExpanded = false } = _a, props = __rest(_a, ["aria-label", "variantLabel", "onToggleExpand", "isExpanded"]);
    const { title, variantLabel: alertVariantLabel } = React19.useContext(AlertContext);
    return React19.createElement(
      Button,
      Object.assign({ variant: ButtonVariant.plain, onClick: onToggleExpand, "aria-expanded": isExpanded, "aria-label": ariaLabel === "" ? `Toggle ${variantLabel || alertVariantLabel} alert: ${title}` : ariaLabel }, props),
      React19.createElement(
        "span",
        { className: css(import_alert2.default.alertToggleIcon) },
        React19.createElement(angle_right_icon_default, { "aria-hidden": "true" })
      )
    );
  };
  AlertToggleExpandButton.displayName = "AlertToggleExpandButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/Alert.js
  var AlertVariant;
  (function(AlertVariant2) {
    AlertVariant2["success"] = "success";
    AlertVariant2["danger"] = "danger";
    AlertVariant2["warning"] = "warning";
    AlertVariant2["info"] = "info";
    AlertVariant2["default"] = "default";
  })(AlertVariant || (AlertVariant = {}));
  var Alert = (_a) => {
    var { variant = AlertVariant.default, isInline = false, isPlain = false, isLiveRegion = false, variantLabel = `${capitalize(variant)} alert:`, "aria-label": ariaLabel = `${capitalize(variant)} Alert`, actionClose, actionLinks, title, titleHeadingLevel, component = "h4", children = "", className = "", ouiaId, ouiaSafe = true, timeout: timeout2 = false, timeoutAnimation = 3e3, onTimeout = () => {
    }, truncateTitle = 0, tooltipPosition, customIcon, isExpandable = false, toggleAriaLabel = `${capitalize(variant)} alert details`, onMouseEnter = () => {
    }, onMouseLeave = () => {
    }, id } = _a, props = __rest(_a, ["variant", "isInline", "isPlain", "isLiveRegion", "variantLabel", "aria-label", "actionClose", "actionLinks", "title", "titleHeadingLevel", "component", "children", "className", "ouiaId", "ouiaSafe", "timeout", "timeoutAnimation", "onTimeout", "truncateTitle", "tooltipPosition", "customIcon", "isExpandable", "toggleAriaLabel", "onMouseEnter", "onMouseLeave", "id"]);
    const ouiaProps = useOUIAProps(Alert.displayName, ouiaId, ouiaSafe, variant);
    const getHeadingContent = React20.createElement(
      React20.Fragment,
      null,
      React20.createElement("span", { className: css(import_accessibility.default.screenReader) }, variantLabel),
      title
    );
    const titleRef = React20.useRef(null);
    const TitleComponent = titleHeadingLevel || component;
    if (titleHeadingLevel !== void 0) {
      console.warn("Alert: titleHeadingLevel is deprecated, please use the newer component prop instead to set the alert title element.");
    }
    const divRef = React20.useRef();
    const [isTooltipVisible, setIsTooltipVisible] = (0, import_react2.useState)(false);
    React20.useEffect(() => {
      if (!titleRef.current || !truncateTitle) {
        return;
      }
      titleRef.current.style.setProperty(c_alert_title_max_lines_default.name, truncateTitle.toString());
      const showTooltip = titleRef.current && titleRef.current.offsetHeight < titleRef.current.scrollHeight;
      if (isTooltipVisible !== showTooltip) {
        setIsTooltipVisible(showTooltip);
      }
    }, [titleRef, truncateTitle, isTooltipVisible]);
    const [timedOut, setTimedOut] = (0, import_react2.useState)(false);
    const [timedOutAnimation, setTimedOutAnimation] = (0, import_react2.useState)(true);
    const [isMouseOver, setIsMouseOver] = (0, import_react2.useState)();
    const [containsFocus, setContainsFocus] = (0, import_react2.useState)();
    const dismissed = timedOut && timedOutAnimation && !isMouseOver && !containsFocus;
    React20.useEffect(() => {
      const calculatedTimeout = timeout2 === true ? 8e3 : Number(timeout2);
      if (calculatedTimeout > 0) {
        const timer2 = setTimeout(() => setTimedOut(true), calculatedTimeout);
        return () => clearTimeout(timer2);
      }
    }, [timeout2]);
    React20.useEffect(() => {
      const onDocumentFocus = () => {
        if (divRef.current) {
          if (divRef.current.contains(document.activeElement)) {
            setContainsFocus(true);
            setTimedOutAnimation(false);
          } else if (containsFocus) {
            setContainsFocus(false);
          }
        }
      };
      document.addEventListener("focus", onDocumentFocus, true);
      return () => document.removeEventListener("focus", onDocumentFocus, true);
    }, [containsFocus]);
    React20.useEffect(() => {
      if (containsFocus === false || isMouseOver === false) {
        const timer2 = setTimeout(() => setTimedOutAnimation(true), timeoutAnimation);
        return () => clearTimeout(timer2);
      }
    }, [containsFocus, isMouseOver, timeoutAnimation]);
    React20.useEffect(() => {
      dismissed && onTimeout();
    }, [dismissed, onTimeout]);
    const [isExpanded, setIsExpanded] = (0, import_react2.useState)(false);
    const onToggleExpand = () => {
      setIsExpanded(!isExpanded);
    };
    const myOnMouseEnter = (ev) => {
      setIsMouseOver(true);
      setTimedOutAnimation(false);
      onMouseEnter(ev);
    };
    const myOnMouseLeave = (ev) => {
      setIsMouseOver(false);
      onMouseLeave(ev);
    };
    if (dismissed) {
      return null;
    }
    const Title2 = React20.createElement(TitleComponent, Object.assign({}, isTooltipVisible && { tabIndex: 0 }, { ref: titleRef, className: css(import_alert3.default.alertTitle, truncateTitle && import_alert3.default.modifiers.truncate) }), getHeadingContent);
    return React20.createElement(
      "div",
      Object.assign({ ref: divRef, className: css(import_alert3.default.alert, isInline && import_alert3.default.modifiers.inline, isPlain && import_alert3.default.modifiers.plain, isExpandable && import_alert3.default.modifiers.expandable, isExpanded && import_alert3.default.modifiers.expanded, import_alert3.default.modifiers[variant], className), "aria-label": ariaLabel }, ouiaProps, isLiveRegion && {
        "aria-live": "polite",
        "aria-atomic": "false"
      }, { onMouseEnter: myOnMouseEnter, onMouseLeave: myOnMouseLeave, id }, props),
      isExpandable && React20.createElement(
        AlertContext.Provider,
        { value: { title, variantLabel } },
        React20.createElement(
          "div",
          { className: css(import_alert3.default.alertToggle) },
          React20.createElement(AlertToggleExpandButton, { isExpanded, onToggleExpand, "aria-label": toggleAriaLabel })
        )
      ),
      React20.createElement(AlertIcon, { variant, customIcon }),
      isTooltipVisible ? React20.createElement(Tooltip, { content: getHeadingContent, position: tooltipPosition }, Title2) : Title2,
      actionClose && React20.createElement(
        AlertContext.Provider,
        { value: { title, variantLabel } },
        React20.createElement("div", { className: css(import_alert3.default.alertAction) }, actionClose)
      ),
      children && (!isExpandable || isExpandable && isExpanded) && React20.createElement("div", { className: css(import_alert3.default.alertDescription) }, children),
      actionLinks && React20.createElement("div", { className: css(import_alert3.default.alertActionGroup) }, actionLinks)
    );
  };
  Alert.displayName = "Alert";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertActionCloseButton.js
  init_tslib_es6();
  var React21 = __toESM(require_react());
  var AlertActionCloseButton = (_a) => {
    var { className, onClose = () => void 0, "aria-label": ariaLabel = "", variantLabel } = _a, props = __rest(_a, ["className", "onClose", "aria-label", "variantLabel"]);
    return React21.createElement(AlertContext.Consumer, null, ({ title, variantLabel: alertVariantLabel }) => React21.createElement(
      Button,
      Object.assign({ variant: ButtonVariant.plain, onClick: onClose, "aria-label": ariaLabel === "" ? `Close ${variantLabel || alertVariantLabel} alert: ${title}` : ariaLabel, className }, props),
      React21.createElement(times_icon_default, null)
    ));
  };
  AlertActionCloseButton.displayName = "AlertActionCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/AlertGroup/AlertGroup.js
  init_tslib_es6();
  var React23 = __toESM(require_react());
  var ReactDOM4 = __toESM(require_react_dom());

  // node_modules/@patternfly/react-core/dist/esm/components/AlertGroup/AlertGroupInline.js
  init_tslib_es6();
  var React22 = __toESM(require_react());
  var import_alert_group = __toESM(require_alert_group());
  var AlertGroupInline = (_a) => {
    var { className, children, isToast, isLiveRegion, onOverflowClick, overflowMessage } = _a, rest = __rest(_a, ["className", "children", "isToast", "isLiveRegion", "onOverflowClick", "overflowMessage"]);
    return React22.createElement(
      "ul",
      Object.assign({ "aria-live": isLiveRegion ? "polite" : null, "aria-atomic": isLiveRegion ? false : null, className: css(import_alert_group.default.alertGroup, className, isToast ? import_alert_group.default.modifiers.toast : "") }, rest),
      React22.Children.toArray(children).map((alert, index) => {
        var _a2;
        return React22.createElement("li", { key: ((_a2 = alert.props) === null || _a2 === void 0 ? void 0 : _a2.id) || index }, alert);
      }),
      overflowMessage && React22.createElement(
        "li",
        null,
        React22.createElement("button", { onClick: onOverflowClick, className: css(import_alert_group.default.alertGroupOverflowButton) }, overflowMessage)
      )
    );
  };
  AlertGroupInline.displayName = "AlertGroupInline";

  // node_modules/@patternfly/react-core/dist/esm/components/AlertGroup/AlertGroup.js
  var AlertGroup = class extends React23.Component {
    constructor() {
      super(...arguments);
      this.state = {
        container: void 0
      };
    }
    componentDidMount() {
      const container = document.createElement("div");
      const target = this.getTargetElement();
      this.setState({ container });
      target.appendChild(container);
    }
    componentWillUnmount() {
      const target = this.getTargetElement();
      if (this.state.container) {
        target.removeChild(this.state.container);
      }
    }
    getTargetElement() {
      const appendTo = this.props.appendTo;
      if (typeof appendTo === "function") {
        return appendTo();
      }
      return appendTo || document.body;
    }
    render() {
      const _a = this.props, { className, children, isToast, isLiveRegion, onOverflowClick, overflowMessage } = _a, props = __rest(_a, ["className", "children", "isToast", "isLiveRegion", "onOverflowClick", "overflowMessage"]);
      const alertGroup = React23.createElement(AlertGroupInline, Object.assign({ onOverflowClick, className, isToast, isLiveRegion, overflowMessage }, props), children);
      if (!this.props.isToast) {
        return alertGroup;
      }
      const container = this.state.container;
      if (!canUseDOM || !container) {
        return null;
      }
      return ReactDOM4.createPortal(alertGroup, container);
    }
  };
  AlertGroup.displayName = "AlertGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/Dropdown.js
  init_tslib_es6();
  var React27 = __toESM(require_react());
  var import_dropdown3 = __toESM(require_dropdown());

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/dropdownConstants.js
  var React24 = __toESM(require_react());
  var DropdownPosition;
  (function(DropdownPosition2) {
    DropdownPosition2["right"] = "right";
    DropdownPosition2["left"] = "left";
  })(DropdownPosition || (DropdownPosition = {}));
  var DropdownDirection;
  (function(DropdownDirection2) {
    DropdownDirection2["up"] = "up";
    DropdownDirection2["down"] = "down";
  })(DropdownDirection || (DropdownDirection = {}));
  var DropdownContext = React24.createContext({
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onSelect: (event) => void 0,
    id: "",
    toggleIndicatorClass: "",
    toggleIconClass: "",
    toggleTextClass: "",
    menuClass: "",
    itemClass: "",
    toggleClass: "",
    baseClass: "",
    baseComponent: "div",
    sectionClass: "",
    sectionTitleClass: "",
    sectionComponent: "section",
    disabledClass: "",
    plainTextClass: "",
    menuComponent: "ul"
  });
  var DropdownArrowContext = React24.createContext({
    keyHandler: null,
    sendRef: null
  });

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownWithContext.js
  init_tslib_es6();
  var React26 = __toESM(require_react());
  var import_dropdown2 = __toESM(require_dropdown());

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownMenu.js
  init_tslib_es6();
  var React25 = __toESM(require_react());
  var ReactDOM5 = __toESM(require_react_dom());
  var import_dropdown = __toESM(require_dropdown());
  var DropdownMenu = class extends React25.Component {
    constructor() {
      super(...arguments);
      this.refsCollection = [];
      this.componentWillUnmount = () => {
        document.removeEventListener("keydown", this.onKeyDown);
      };
      this.onKeyDown = (event) => {
        if (!this.props.isOpen || !Array.from(document.activeElement.classList).find((className) => DropdownMenu.validToggleClasses.concat(this.context.toggleClass).includes(className))) {
          return;
        }
        const refs = this.refsCollection;
        if (event.key === "ArrowDown") {
          const firstFocusTargetCollection = refs.find((ref) => ref && ref[0] && !ref[0].hasAttribute("disabled"));
          DropdownMenu.focusFirstRef(firstFocusTargetCollection);
          event.stopPropagation();
        } else if (event.key === "ArrowUp") {
          const collectionLength = refs.length;
          const lastFocusTargetCollection = refs.slice(collectionLength - 1, collectionLength);
          const lastFocusTarget = lastFocusTargetCollection && lastFocusTargetCollection[0];
          DropdownMenu.focusFirstRef(lastFocusTarget);
          event.stopPropagation();
        }
      };
      this.childKeyHandler = (index, innerIndex, position, custom17 = false) => {
        keyHandler(index, innerIndex, position, this.refsCollection, this.props.isGrouped ? this.refsCollection : React25.Children.toArray(this.props.children), custom17);
      };
      this.sendRef = (index, nodes, isDisabled, isSeparator) => {
        this.refsCollection[index] = [];
        nodes.map((node, innerIndex) => {
          if (!node) {
            this.refsCollection[index][innerIndex] = null;
          } else if (!node.getAttribute) {
            this.refsCollection[index][innerIndex] = ReactDOM5.findDOMNode(node);
          } else if (isSeparator) {
            this.refsCollection[index][innerIndex] = null;
          } else {
            this.refsCollection[index][innerIndex] = node;
          }
        });
      };
    }
    componentDidMount() {
      document.addEventListener("keydown", this.onKeyDown);
      const { autoFocus } = this.props;
      if (autoFocus) {
        const focusTargetCollection = this.refsCollection.find((ref) => ref && ref[0] && !ref[0].hasAttribute("disabled"));
        const focusTarget = focusTargetCollection && focusTargetCollection[0];
        if (focusTarget && focusTarget.focus) {
          setTimeout(() => focusTarget.focus());
        }
      }
    }
    shouldComponentUpdate() {
      this.refsCollection = [];
      return true;
    }
    extendChildren() {
      const { children, isGrouped } = this.props;
      if (isGrouped) {
        let index = 0;
        return React25.Children.map(children, (groupedChildren) => {
          const group = groupedChildren;
          const props = {};
          if (group.props && group.props.children) {
            if (Array.isArray(group.props.children)) {
              props.children = React25.Children.map(group.props.children, (option) => React25.cloneElement(option, {
                index: index++
              }));
            } else {
              props.children = React25.cloneElement(group.props.children, {
                index: index++
              });
            }
          }
          return React25.cloneElement(group, props);
        });
      }
      return React25.Children.map(children, (child, index) => React25.cloneElement(child, {
        index
      }));
    }
    render() {
      const _a = this.props, {
        className,
        isOpen,
        position,
        children,
        component,
        isGrouped,
        setMenuComponentRef,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        openedOnEnter,
        alignments
      } = _a, props = __rest(_a, ["className", "isOpen", "position", "children", "component", "isGrouped", "setMenuComponentRef", "openedOnEnter", "alignments"]);
      return React25.createElement(DropdownArrowContext.Provider, { value: {
        keyHandler: this.childKeyHandler,
        sendRef: this.sendRef
      } }, component === "div" ? React25.createElement(DropdownContext.Consumer, null, ({ onSelect, menuClass }) => React25.createElement("div", { className: css(menuClass, position === DropdownPosition.right && import_dropdown.default.modifiers.alignRight, formatBreakpointMods(alignments, import_dropdown.default, "align-"), className), hidden: !isOpen, onClick: (event) => onSelect && onSelect(event), ref: setMenuComponentRef }, children)) : isGrouped && React25.createElement(DropdownContext.Consumer, null, ({ menuClass, menuComponent }) => {
        const MenuComponent = menuComponent || "div";
        return React25.createElement(MenuComponent, Object.assign({}, props, { className: css(menuClass, position === DropdownPosition.right && import_dropdown.default.modifiers.alignRight, formatBreakpointMods(alignments, import_dropdown.default, "align-"), className), hidden: !isOpen, role: "menu", ref: setMenuComponentRef }), this.extendChildren());
      }) || React25.createElement(DropdownContext.Consumer, null, ({ menuClass, menuComponent }) => {
        const MenuComponent = menuComponent || component;
        return React25.createElement(MenuComponent, Object.assign({}, props, { className: css(menuClass, position === DropdownPosition.right && import_dropdown.default.modifiers.alignRight, formatBreakpointMods(alignments, import_dropdown.default, "align-"), className), hidden: !isOpen, role: "menu", ref: setMenuComponentRef }), this.extendChildren());
      }));
    }
  };
  DropdownMenu.displayName = "DropdownMenu";
  DropdownMenu.defaultProps = {
    className: "",
    isOpen: true,
    openedOnEnter: false,
    autoFocus: true,
    position: DropdownPosition.left,
    component: "ul",
    isGrouped: false,
    setMenuComponentRef: null
  };
  DropdownMenu.validToggleClasses = [import_dropdown.default.dropdownToggle, import_dropdown.default.dropdownToggleButton];
  DropdownMenu.focusFirstRef = (refCollection) => {
    if (refCollection && refCollection[0] && refCollection[0].focus) {
      setTimeout(() => refCollection[0].focus());
    }
  };
  DropdownMenu.contextType = DropdownContext;

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownWithContext.js
  var DropdownWithContext = class extends React26.Component {
    constructor(props) {
      super(props);
      this.openedOnEnter = false;
      this.baseComponentRef = React26.createRef();
      this.menuComponentRef = React26.createRef();
      this.onEnter = () => {
        this.openedOnEnter = true;
      };
      this.setMenuComponentRef = (element) => {
        this.menuComponentRef = element;
      };
      this.getMenuComponentRef = () => this.menuComponentRef;
      if (props.dropdownItems && props.dropdownItems.length > 0 && props.children) {
        console.error("Children and dropdownItems props have been provided. Only the dropdownItems prop items will be rendered");
      }
    }
    componentDidUpdate() {
      if (!this.props.isOpen) {
        this.openedOnEnter = false;
      }
    }
    render() {
      const _a = this.props, {
        children,
        className,
        direction,
        dropdownItems,
        isOpen,
        isPlain,
        isText,
        isGrouped,
        isFullHeight,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onSelect,
        position,
        toggle,
        autoFocus,
        menuAppendTo,
        isFlipEnabled,
        removeFindDomNode,
        zIndex
      } = _a, props = __rest(_a, ["children", "className", "direction", "dropdownItems", "isOpen", "isPlain", "isText", "isGrouped", "isFullHeight", "onSelect", "position", "toggle", "autoFocus", "menuAppendTo", "isFlipEnabled", "removeFindDomNode", "zIndex"]);
      const id = toggle.props.id || `pf-dropdown-toggle-id-${DropdownWithContext.currentId++}`;
      let component;
      let renderedContent;
      let ariaHasPopup = false;
      if (dropdownItems && dropdownItems.length > 0) {
        component = "ul";
        renderedContent = dropdownItems;
        ariaHasPopup = true;
      } else {
        component = "div";
        renderedContent = React26.Children.toArray(children);
      }
      const openedOnEnter = this.openedOnEnter;
      const isStatic = isFlipEnabled && menuAppendTo !== "inline";
      return React26.createElement(DropdownContext.Consumer, null, ({ baseClass, baseComponent, id: contextId, ouiaId, ouiaComponentType, ouiaSafe, alignments }) => {
        const BaseComponent = baseComponent;
        const menuContainer = React26.createElement(DropdownMenu, { className: css(isStatic && import_dropdown2.default.modifiers.static), setMenuComponentRef: this.setMenuComponentRef, component, isOpen, position, "aria-labelledby": contextId ? `${contextId}-toggle` : id, isGrouped, autoFocus: openedOnEnter && autoFocus, alignments }, renderedContent);
        const popperContainer = React26.createElement("div", { className: css(baseClass, direction === DropdownDirection.up && import_dropdown2.default.modifiers.top, position === DropdownPosition.right && import_dropdown2.default.modifiers.alignRight, isOpen && import_dropdown2.default.modifiers.expanded, className) }, isOpen && menuContainer);
        const mainContainer = React26.createElement(
          BaseComponent,
          Object.assign({}, props, { className: css(baseClass, direction === DropdownDirection.up && import_dropdown2.default.modifiers.top, position === DropdownPosition.right && import_dropdown2.default.modifiers.alignRight, isOpen && import_dropdown2.default.modifiers.expanded, isFullHeight && import_dropdown2.default.modifiers.fullHeight, className), ref: this.baseComponentRef }, getOUIAProps(ouiaComponentType, ouiaId, ouiaSafe)),
          React26.Children.map(toggle, (oneToggle) => React26.cloneElement(oneToggle, {
            parentRef: this.baseComponentRef,
            getMenuRef: this.getMenuComponentRef,
            isOpen,
            id,
            isPlain,
            isText,
            "aria-haspopup": ariaHasPopup,
            onEnter: () => {
              this.onEnter();
              oneToggle.props.onEnter && oneToggle.props.onEnter();
            }
          })),
          menuAppendTo === "inline" && isOpen && menuContainer
        );
        const getParentElement = () => {
          if (this.baseComponentRef && this.baseComponentRef.current) {
            return this.baseComponentRef.current.parentElement;
          }
          return null;
        };
        return menuAppendTo === "inline" ? mainContainer : React26.createElement(Popper, { trigger: mainContainer, popper: popperContainer, direction, position, appendTo: menuAppendTo === "parent" ? getParentElement() : menuAppendTo, isVisible: isOpen, removeFindDomNode, zIndex, popperMatchesTriggerWidth: false });
      });
    }
  };
  DropdownWithContext.displayName = "DropdownWithContext";
  DropdownWithContext.currentId = 0;
  DropdownWithContext.defaultProps = {
    className: "",
    dropdownItems: [],
    isOpen: false,
    isPlain: false,
    isText: false,
    isGrouped: false,
    position: DropdownPosition.left,
    direction: DropdownDirection.down,
    onSelect: () => void 0,
    autoFocus: true,
    menuAppendTo: "inline",
    isFlipEnabled: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/Dropdown.js
  var Dropdown = (_a) => {
    var {
      onSelect,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref,
      // Types of Ref are different for React.FunctionComponent vs React.Component
      ouiaId,
      ouiaSafe,
      alignments,
      contextProps,
      menuAppendTo = "inline",
      isFlipEnabled = true,
      removeFindDomNode = false,
      zIndex = 9999
    } = _a, props = __rest(_a, ["onSelect", "ref", "ouiaId", "ouiaSafe", "alignments", "contextProps", "menuAppendTo", "isFlipEnabled", "removeFindDomNode", "zIndex"]);
    return React27.createElement(
      DropdownContext.Provider,
      { value: Object.assign({ onSelect: (event) => onSelect && onSelect(event), toggleTextClass: import_dropdown3.default.dropdownToggleText, toggleIconClass: import_dropdown3.default.dropdownToggleImage, toggleIndicatorClass: import_dropdown3.default.dropdownToggleIcon, menuClass: import_dropdown3.default.dropdownMenu, itemClass: import_dropdown3.default.dropdownMenuItem, toggleClass: import_dropdown3.default.dropdownToggle, baseClass: import_dropdown3.default.dropdown, baseComponent: "div", sectionClass: import_dropdown3.default.dropdownGroup, sectionTitleClass: import_dropdown3.default.dropdownGroupTitle, sectionComponent: "section", disabledClass: import_dropdown3.default.modifiers.disabled, plainTextClass: import_dropdown3.default.modifiers.text, ouiaId: useOUIAId(Dropdown.displayName, ouiaId), ouiaSafe, ouiaComponentType: Dropdown.displayName, alignments }, contextProps) },
      React27.createElement(DropdownWithContext, Object.assign({ menuAppendTo, isFlipEnabled, removeFindDomNode, zIndex }, props))
    );
  };
  Dropdown.displayName = "Dropdown";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownItem.js
  init_tslib_es6();
  var React29 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/InternalDropdownItem.js
  init_tslib_es6();
  var React28 = __toESM(require_react());
  var import_dropdown4 = __toESM(require_dropdown());
  var InternalDropdownItem = class extends React28.Component {
    constructor() {
      super(...arguments);
      this.ref = React28.createRef();
      this.additionalRef = React28.createRef();
      this.getInnerNode = (node) => node && node.childNodes && node.childNodes.length ? node.childNodes[0] : node;
      this.onKeyDown = (event) => {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
        const innerIndex = event.target === this.ref.current ? 0 : 1;
        if (!this.props.customChild) {
          event.preventDefault();
        }
        if (event.key === "ArrowUp") {
          (_b = (_a = this.props.context) === null || _a === void 0 ? void 0 : _a.keyHandler) === null || _b === void 0 ? void 0 : _b.call(_a, this.props.index, innerIndex, KEYHANDLER_DIRECTION.UP);
          event.stopPropagation();
        } else if (event.key === "ArrowDown") {
          (_d = (_c = this.props.context) === null || _c === void 0 ? void 0 : _c.keyHandler) === null || _d === void 0 ? void 0 : _d.call(_c, this.props.index, innerIndex, KEYHANDLER_DIRECTION.DOWN);
          event.stopPropagation();
        } else if (event.key === "ArrowRight") {
          (_f = (_e = this.props.context) === null || _e === void 0 ? void 0 : _e.keyHandler) === null || _f === void 0 ? void 0 : _f.call(_e, this.props.index, innerIndex, KEYHANDLER_DIRECTION.RIGHT);
          event.stopPropagation();
        } else if (event.key === "ArrowLeft") {
          (_h = (_g = this.props.context) === null || _g === void 0 ? void 0 : _g.keyHandler) === null || _h === void 0 ? void 0 : _h.call(_g, this.props.index, innerIndex, KEYHANDLER_DIRECTION.LEFT);
          event.stopPropagation();
        } else if (event.key === "Enter" || event.key === " ") {
          event.target.click();
          this.props.enterTriggersArrowDown && ((_k = (_j = this.props.context) === null || _j === void 0 ? void 0 : _j.keyHandler) === null || _k === void 0 ? void 0 : _k.call(_j, this.props.index, innerIndex, KEYHANDLER_DIRECTION.DOWN));
        }
      };
      this.componentRef = (element) => {
        this.ref.current = element;
        const { component } = this.props;
        const ref = component.ref;
        if (ref) {
          if (typeof ref === "function") {
            ref(element);
          } else {
            ref.current = element;
          }
        }
      };
    }
    componentDidMount() {
      var _a;
      const { context, index, isDisabled, role, customChild, autoFocus } = this.props;
      const customRef = customChild ? this.getInnerNode(this.ref.current) : this.ref.current;
      (_a = context === null || context === void 0 ? void 0 : context.sendRef) === null || _a === void 0 ? void 0 : _a.call(context, index, [customRef, customChild ? customRef : this.additionalRef.current], isDisabled, role === "separator");
      autoFocus && setTimeout(() => customRef.focus());
    }
    componentDidUpdate() {
      var _a;
      const { context, index, isDisabled, role, customChild } = this.props;
      const customRef = customChild ? this.getInnerNode(this.ref.current) : this.ref.current;
      (_a = context === null || context === void 0 ? void 0 : context.sendRef) === null || _a === void 0 ? void 0 : _a.call(context, index, [customRef, customChild ? customRef : this.additionalRef.current], isDisabled, role === "separator");
    }
    extendAdditionalChildRef() {
      const { additionalChild } = this.props;
      return React28.cloneElement(additionalChild, {
        ref: this.additionalRef
      });
    }
    render() {
      const _a = this.props, { className, children, context, onClick, component, role, isDisabled, isAriaDisabled, isPlainText, index, href, tooltip, tooltipProps, id, componentID, listItemClassName, additionalChild, customChild, enterTriggersArrowDown, icon: icon2, autoFocus, styleChildren, description, inoperableEvents } = _a, additionalProps = __rest(_a, ["className", "children", "context", "onClick", "component", "role", "isDisabled", "isAriaDisabled", "isPlainText", "index", "href", "tooltip", "tooltipProps", "id", "componentID", "listItemClassName", "additionalChild", "customChild", "enterTriggersArrowDown", "icon", "autoFocus", "styleChildren", "description", "inoperableEvents"]);
      let classes = css(icon2 && import_dropdown4.default.modifiers.icon, isAriaDisabled && import_dropdown4.default.modifiers.ariaDisabled, className);
      if (component === "a") {
        additionalProps["aria-disabled"] = isDisabled || isAriaDisabled;
      } else if (component === "button") {
        additionalProps["aria-disabled"] = isDisabled || isAriaDisabled;
        additionalProps.type = additionalProps.type || "button";
      }
      const renderWithTooltip = (childNode) => tooltip ? React28.createElement(Tooltip, Object.assign({ content: tooltip }, tooltipProps), childNode) : childNode;
      const renderClonedComponent = (element) => React28.cloneElement(element, Object.assign(Object.assign({}, styleChildren && {
        className: css(element.props.className, classes)
      }), this.props.role !== "separator" && { role, ref: this.componentRef }));
      const renderDefaultComponent = (tag) => {
        const Component50 = tag;
        const componentContent = description ? React28.createElement(
          React28.Fragment,
          null,
          React28.createElement(
            "div",
            { className: import_dropdown4.default.dropdownMenuItemMain },
            icon2 && React28.createElement("span", { className: css(import_dropdown4.default.dropdownMenuItemIcon) }, icon2),
            children
          ),
          React28.createElement("div", { className: import_dropdown4.default.dropdownMenuItemDescription }, description)
        ) : React28.createElement(
          React28.Fragment,
          null,
          icon2 && React28.createElement("span", { className: css(import_dropdown4.default.dropdownMenuItemIcon) }, icon2),
          children
        );
        return React28.createElement(Component50, Object.assign({}, additionalProps, isDisabled || isAriaDisabled ? preventedEvents(inoperableEvents) : null, { href, ref: this.ref, className: classes, id: componentID, role }), componentContent);
      };
      return React28.createElement(DropdownContext.Consumer, null, ({ onSelect, itemClass, disabledClass, plainTextClass }) => {
        if (this.props.role !== "separator") {
          classes = css(classes, isDisabled && disabledClass, isPlainText && plainTextClass, itemClass, description && import_dropdown4.default.modifiers.description);
        }
        if (customChild) {
          return React28.cloneElement(customChild, {
            ref: this.ref,
            onKeyDown: this.onKeyDown
          });
        }
        return React28.createElement(
          "li",
          Object.assign({}, listItemClassName && { className: listItemClassName }, { role: "none", onKeyDown: this.onKeyDown, onClick: (event) => {
            if (!isDisabled && !isAriaDisabled) {
              onClick === null || onClick === void 0 ? void 0 : onClick(event);
              onSelect === null || onSelect === void 0 ? void 0 : onSelect(event);
            }
          }, id }),
          renderWithTooltip(React28.isValidElement(component) ? renderClonedComponent(component) : renderDefaultComponent(component)),
          additionalChild && this.extendAdditionalChildRef()
        );
      });
    }
  };
  InternalDropdownItem.displayName = "InternalDropdownItem";
  InternalDropdownItem.defaultProps = {
    className: "",
    component: "a",
    role: "none",
    isDisabled: false,
    isPlainText: false,
    tooltipProps: {},
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onClick: (event) => void 0,
    index: -1,
    context: {
      keyHandler: () => {
      },
      sendRef: () => {
      }
    },
    enterTriggersArrowDown: false,
    icon: null,
    styleChildren: true,
    description: null,
    inoperableEvents: ["onClick", "onKeyPress"]
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownItem.js
  var DropdownItem = (_a) => {
    var {
      children,
      className,
      component = "a",
      isDisabled = false,
      isAriaDisabled = false,
      isPlainText = false,
      href,
      tooltip,
      tooltipProps = {},
      listItemClassName,
      onClick,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref,
      // Types of Ref are different for React.FunctionComponent vs React.Component
      additionalChild,
      customChild,
      tabIndex = -1,
      icon: icon2 = null,
      autoFocus,
      description = null,
      styleChildren,
      ouiaId,
      ouiaSafe
    } = _a, props = __rest(_a, ["children", "className", "component", "isDisabled", "isAriaDisabled", "isPlainText", "href", "tooltip", "tooltipProps", "listItemClassName", "onClick", "ref", "additionalChild", "customChild", "tabIndex", "icon", "autoFocus", "description", "styleChildren", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(DropdownItem.displayName, ouiaId, ouiaSafe);
    return React29.createElement(DropdownArrowContext.Consumer, null, (context) => React29.createElement(InternalDropdownItem, Object.assign({ context, role: "menuitem", tabIndex, className, component, isDisabled, isAriaDisabled, isPlainText, href, tooltip, tooltipProps, listItemClassName, onClick, additionalChild, customChild, icon: icon2, autoFocus, styleChildren, description }, ouiaProps, props), children));
  };
  DropdownItem.displayName = "DropdownItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownSeparator.js
  init_tslib_es6();
  var React31 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Divider/Divider.js
  init_tslib_es6();
  var React30 = __toESM(require_react());
  var import_divider = __toESM(require_divider());
  var DividerVariant;
  (function(DividerVariant2) {
    DividerVariant2["hr"] = "hr";
    DividerVariant2["li"] = "li";
    DividerVariant2["div"] = "div";
  })(DividerVariant || (DividerVariant = {}));
  var Divider = (_a) => {
    var { className, component = DividerVariant.hr, isVertical: isVertical2 = false, inset, orientation } = _a, props = __rest(_a, ["className", "component", "isVertical", "inset", "orientation"]);
    const Component50 = component;
    return React30.createElement(Component50, Object.assign({ className: css(import_divider.default.divider, isVertical2 && import_divider.default.modifiers.vertical, formatBreakpointMods(inset, import_divider.default), formatBreakpointMods(orientation, import_divider.default), className) }, component !== "hr" && { role: "separator" }, props));
  };
  Divider.displayName = "Divider";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownSeparator.js
  var DropdownSeparator = (_a) => {
    var {
      className = "",
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref,
      // Types of Ref are different for React.FunctionComponent vs React.Component
      ouiaId,
      ouiaSafe
    } = _a, props = __rest(_a, ["className", "ref", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(DropdownSeparator.displayName, ouiaId, ouiaSafe);
    return React31.createElement(DropdownArrowContext.Consumer, null, (context) => React31.createElement(InternalDropdownItem, Object.assign({}, props, { context, component: React31.createElement(Divider, { component: DividerVariant.div }), className, role: "separator" }, ouiaProps)));
  };
  DropdownSeparator.displayName = "DropdownSeparator";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/BadgeToggle.js
  init_tslib_es6();
  var React33 = __toESM(require_react());
  var import_dropdown6 = __toESM(require_dropdown());

  // node_modules/@patternfly/react-icons/dist/esm/icons/caret-down-icon.js
  var CaretDownIconConfig = {
    name: "CaretDownIcon",
    height: 512,
    width: 320,
    svgPath: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z",
    yOffset: 0,
    xOffset: 0
  };
  var CaretDownIcon = createIcon(CaretDownIconConfig);
  var caret_down_icon_default = CaretDownIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/Toggle.js
  init_tslib_es6();
  var React32 = __toESM(require_react());
  var import_dropdown5 = __toESM(require_dropdown());
  var buttonVariantStyles = {
    default: "",
    primary: import_dropdown5.default.modifiers.primary,
    secondary: import_dropdown5.default.modifiers.secondary
  };
  var Toggle = class extends React32.Component {
    constructor() {
      super(...arguments);
      this.buttonRef = React32.createRef();
      this.componentDidMount = () => {
        document.addEventListener("click", this.onDocClick);
        document.addEventListener("touchstart", this.onDocClick);
        document.addEventListener("keydown", this.onEscPress);
      };
      this.componentWillUnmount = () => {
        document.removeEventListener("click", this.onDocClick);
        document.removeEventListener("touchstart", this.onDocClick);
        document.removeEventListener("keydown", this.onEscPress);
      };
      this.onDocClick = (event) => {
        const { isOpen, parentRef, onToggle, getMenuRef } = this.props;
        const menuRef = getMenuRef && getMenuRef();
        const clickedOnToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
        const clickedWithinMenu = menuRef && menuRef.contains && menuRef.contains(event.target);
        if (isOpen && !(clickedOnToggle || clickedWithinMenu)) {
          onToggle === null || onToggle === void 0 ? void 0 : onToggle(false, event);
        }
      };
      this.onEscPress = (event) => {
        var _a, _b, _c;
        const { parentRef, getMenuRef } = this.props;
        const menuRef = getMenuRef && getMenuRef();
        const escFromToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
        const escFromWithinMenu = menuRef && menuRef.contains && menuRef.contains(event.target);
        if (this.props.isOpen && (event.key === KeyTypes.Escape || event.key === "Tab") && (escFromToggle || escFromWithinMenu)) {
          (_b = (_a = this.props).onToggle) === null || _b === void 0 ? void 0 : _b.call(_a, false, event);
          (_c = this.buttonRef.current) === null || _c === void 0 ? void 0 : _c.focus();
        }
      };
      this.onKeyDown = (event) => {
        var _a, _b, _c, _d, _e, _f;
        if (event.key === "Tab" && !this.props.isOpen) {
          return;
        }
        if ((event.key === "Tab" || event.key === "Enter" || event.key === " ") && this.props.isOpen) {
          if (!this.props.bubbleEvent) {
            event.stopPropagation();
          }
          event.preventDefault();
          (_b = (_a = this.props).onToggle) === null || _b === void 0 ? void 0 : _b.call(_a, !this.props.isOpen, event);
        } else if ((event.key === "Enter" || event.key === " ") && !this.props.isOpen) {
          if (!this.props.bubbleEvent) {
            event.stopPropagation();
          }
          event.preventDefault();
          (_d = (_c = this.props).onToggle) === null || _d === void 0 ? void 0 : _d.call(_c, !this.props.isOpen, event);
          (_f = (_e = this.props).onEnter) === null || _f === void 0 ? void 0 : _f.call(_e);
        }
      };
    }
    render() {
      const _a = this.props, {
        className,
        children,
        isOpen,
        isDisabled,
        isPlain,
        isText,
        isPrimary,
        isSplitButton,
        toggleVariant,
        onToggle,
        "aria-haspopup": ariaHasPopup,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        isActive,
        bubbleEvent,
        onEnter,
        parentRef,
        getMenuRef,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        id,
        type
      } = _a, props = __rest(_a, ["className", "children", "isOpen", "isDisabled", "isPlain", "isText", "isPrimary", "isSplitButton", "toggleVariant", "onToggle", "aria-haspopup", "isActive", "bubbleEvent", "onEnter", "parentRef", "getMenuRef", "id", "type"]);
      return React32.createElement(DropdownContext.Consumer, null, ({ toggleClass }) => React32.createElement("button", Object.assign({}, props, { id, ref: this.buttonRef, className: css(isSplitButton ? import_dropdown5.default.dropdownToggleButton : toggleClass || import_dropdown5.default.dropdownToggle, isActive && import_dropdown5.default.modifiers.active, isPlain && import_dropdown5.default.modifiers.plain, isText && import_dropdown5.default.modifiers.text, isPrimary && import_dropdown5.default.modifiers.primary, toggleVariant && buttonVariantStyles[toggleVariant], className), type: type || "button", onClick: (event) => onToggle === null || onToggle === void 0 ? void 0 : onToggle(!isOpen, event), "aria-expanded": isOpen, "aria-haspopup": ariaHasPopup, onKeyDown: (event) => this.onKeyDown(event), disabled: isDisabled }), children));
    }
  };
  Toggle.displayName = "Toggle";
  Toggle.defaultProps = {
    className: "",
    isOpen: false,
    isActive: false,
    isDisabled: false,
    isPlain: false,
    isText: false,
    isPrimary: false,
    isSplitButton: false,
    onToggle: () => {
    },
    onEnter: () => {
    },
    bubbleEvent: false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/BadgeToggle.js
  var BadgeToggle = (_a) => {
    var {
      id = "",
      children = null,
      badgeProps = { isRead: true },
      className = "",
      isOpen = false,
      "aria-label": ariaLabel = "Actions",
      parentRef = null,
      getMenuRef = null,
      isActive = false,
      isPlain = null,
      isDisabled = false,
      bubbleEvent = false,
      onToggle = () => void 0,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref
    } = _a, props = __rest(_a, ["id", "children", "badgeProps", "className", "isOpen", "aria-label", "parentRef", "getMenuRef", "isActive", "isPlain", "isDisabled", "bubbleEvent", "onToggle", "ref"]);
    return React33.createElement(
      Toggle,
      Object.assign({ id, className, isOpen, "aria-label": ariaLabel, parentRef, getMenuRef, isActive, isPlain: isPlain || true, isDisabled, onToggle, bubbleEvent }, props),
      React33.createElement(
        Badge,
        Object.assign({}, badgeProps),
        children,
        React33.createElement(
          "span",
          { className: css(import_dropdown6.default.dropdownToggleIcon) },
          React33.createElement(caret_down_icon_default, null)
        )
      )
    );
  };
  BadgeToggle.displayName = "BadgeToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/KebabToggle.js
  init_tslib_es6();
  var React34 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon.js
  var EllipsisVIconConfig = {
    name: "EllipsisVIcon",
    height: 512,
    width: 192,
    svgPath: "M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z",
    yOffset: 0,
    xOffset: 0
  };
  var EllipsisVIcon = createIcon(EllipsisVIconConfig);
  var ellipsis_v_icon_default = EllipsisVIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/KebabToggle.js
  var KebabToggle = (_a) => {
    var {
      id = "",
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      children = null,
      className = "",
      isOpen = false,
      "aria-label": ariaLabel = "Actions",
      parentRef = null,
      getMenuRef = null,
      isActive = false,
      isPlain = false,
      isDisabled = false,
      bubbleEvent = false,
      onToggle = () => void 0,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref
    } = _a, props = __rest(_a, ["id", "children", "className", "isOpen", "aria-label", "parentRef", "getMenuRef", "isActive", "isPlain", "isDisabled", "bubbleEvent", "onToggle", "ref"]);
    return React34.createElement(
      Toggle,
      Object.assign({ id, className, isOpen, "aria-label": ariaLabel, parentRef, getMenuRef, isActive, isPlain, isDisabled, onToggle, bubbleEvent }, props),
      React34.createElement(ellipsis_v_icon_default, null)
    );
  };
  KebabToggle.displayName = "KebabToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownToggle.js
  init_tslib_es6();
  var React35 = __toESM(require_react());
  var import_dropdown7 = __toESM(require_dropdown());
  var DropdownToggle = (_a) => {
    var {
      id = "",
      children = null,
      className = "",
      isOpen = false,
      parentRef = null,
      getMenuRef = null,
      isDisabled = false,
      isPlain = false,
      isText = false,
      isPrimary = false,
      toggleVariant = "default",
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      isActive = false,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      onToggle = (_isOpen) => void 0,
      icon: icon2 = null,
      toggleIndicator: ToggleIndicator = caret_down_icon_default,
      splitButtonItems,
      splitButtonVariant = "checkbox",
      "aria-haspopup": ariaHasPopup,
      ouiaId,
      ouiaSafe,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref
    } = _a, props = __rest(_a, ["id", "children", "className", "isOpen", "parentRef", "getMenuRef", "isDisabled", "isPlain", "isText", "isPrimary", "toggleVariant", "isActive", "onToggle", "icon", "toggleIndicator", "splitButtonItems", "splitButtonVariant", "aria-haspopup", "ouiaId", "ouiaSafe", "ref"]);
    const ouiaProps = useOUIAProps(DropdownToggle.displayName, ouiaId, ouiaSafe);
    const toggle = React35.createElement(DropdownContext.Consumer, null, ({ toggleTextClass, toggleIndicatorClass, toggleIconClass }) => React35.createElement(
      Toggle,
      Object.assign({}, props, { id, className, isOpen, parentRef, getMenuRef, isActive, isDisabled, isPlain, isText, isPrimary, toggleVariant, onToggle, "aria-haspopup": ariaHasPopup }, ouiaProps, splitButtonItems && { isSplitButton: true, "aria-label": props["aria-label"] || "Select" }),
      icon2 && React35.createElement("span", { className: css(toggleIconClass) }, icon2),
      children && React35.createElement("span", { className: ToggleIndicator && css(toggleTextClass) }, children),
      ToggleIndicator && React35.createElement(
        "span",
        { className: css(!splitButtonItems && toggleIndicatorClass) },
        React35.createElement(ToggleIndicator, null)
      )
    ));
    if (splitButtonItems) {
      return React35.createElement(
        "div",
        { className: css(import_dropdown7.default.dropdownToggle, import_dropdown7.default.modifiers.splitButton, splitButtonVariant === "action" && import_dropdown7.default.modifiers.action, (toggleVariant === "primary" || isPrimary) && splitButtonVariant === "action" && import_dropdown7.default.modifiers.primary, toggleVariant === "secondary" && splitButtonVariant === "action" && import_dropdown7.default.modifiers.secondary, isDisabled && import_dropdown7.default.modifiers.disabled) },
        splitButtonItems,
        toggle
      );
    }
    return toggle;
  };
  DropdownToggle.displayName = "DropdownToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/ApplicationLauncher/ApplicationLauncherSeparator.js
  init_tslib_es6();
  var React36 = __toESM(require_react());
  var ApplicationLauncherSeparator = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      children
    } = _a, props = __rest(_a, ["children"]);
    return React36.createElement(DropdownSeparator, Object.assign({}, props));
  };
  ApplicationLauncherSeparator.displayName = "ApplicationLauncherSeparator";

  // node_modules/@patternfly/react-icons/dist/esm/icons/external-link-alt-icon.js
  var ExternalLinkAltIconConfig = {
    name: "ExternalLinkAltIcon",
    height: 512,
    width: 512,
    svgPath: "M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z",
    yOffset: 0,
    xOffset: 0
  };
  var ExternalLinkAltIcon = createIcon(ExternalLinkAltIconConfig);
  var external_link_alt_icon_default = ExternalLinkAltIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/star-icon.js
  var StarIconConfig = {
    name: "StarIcon",
    height: 512,
    width: 576,
    svgPath: "M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z",
    yOffset: 0,
    xOffset: 0
  };
  var StarIcon = createIcon(StarIconConfig);
  var star_icon_default = StarIcon;

  // node_modules/@patternfly/react-core/dist/esm/helpers/favorites.js
  var React37 = __toESM(require_react());
  var createRenderableFavorites = (items, isGrouped, favorites, isEnterTriggersArrowDown) => {
    if (isGrouped) {
      const favoriteItems = [];
      items.forEach((group) => {
        if (favorites.length > 0) {
          return group.props.children && group.props.children.filter((item) => favorites.includes(item.props.id)).map((item) => {
            if (isEnterTriggersArrowDown) {
              return favoriteItems.push(React37.cloneElement(item, {
                isFavorite: true,
                enterTriggersArrowDown: isEnterTriggersArrowDown,
                id: `favorite-${item.props.id}`
              }));
            } else {
              return favoriteItems.push(React37.cloneElement(item, { isFavorite: true, id: `favorite-${item.props.id}` }));
            }
          });
        }
      });
      return favoriteItems;
    }
    return items.filter((item) => favorites.includes(item.props.id)).map((item) => React37.cloneElement(item, { isFavorite: true, enterTriggersArrowDown: isEnterTriggersArrowDown }));
  };
  var extendItemsWithFavorite = (items, isGrouped, favorites) => {
    if (isGrouped) {
      return items.map((group) => React37.cloneElement(group, {
        children: React37.Children.map(group.props.children, (item) => {
          if (item.type === ApplicationLauncherSeparator || item.type === Divider) {
            return item;
          }
          return React37.cloneElement(item, {
            isFavorite: favorites.some((favoriteId) => favoriteId === item.props.id || `favorite-${favoriteId}` === item.props.id)
          });
        })
      }));
    }
    return items.map((item) => React37.cloneElement(item, {
      isFavorite: favorites.some((favoriteId) => favoriteId === item.props.id)
    }));
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-up-icon.js
  var AngleUpIconConfig = {
    name: "AngleUpIcon",
    height: 512,
    width: 320,
    svgPath: "M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleUpIcon = createIcon(AngleUpIconConfig);
  var angle_up_icon_default = AngleUpIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Breadcrumb/Breadcrumb.js
  init_tslib_es6();
  var React38 = __toESM(require_react());
  var import_breadcrumb = __toESM(require_breadcrumb());
  var Breadcrumb = (_a) => {
    var { children = null, className = "", "aria-label": ariaLabel = "Breadcrumb", ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["children", "className", "aria-label", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(Breadcrumb.displayName, ouiaId, ouiaSafe);
    return React38.createElement(
      "nav",
      Object.assign({}, props, { "aria-label": ariaLabel, className: css(import_breadcrumb.default.breadcrumb, className) }, ouiaProps),
      React38.createElement("ol", { className: import_breadcrumb.default.breadcrumbList }, React38.Children.map(children, (child, index) => {
        const showDivider = index > 0;
        if (React38.isValidElement(child)) {
          return React38.cloneElement(child, { showDivider });
        }
        return child;
      }))
    );
  };
  Breadcrumb.displayName = "Breadcrumb";

  // node_modules/@patternfly/react-core/dist/esm/components/Breadcrumb/BreadcrumbItem.js
  init_tslib_es6();
  var React39 = __toESM(require_react());
  var import_breadcrumb2 = __toESM(require_breadcrumb());
  var BreadcrumbItem = (_a) => {
    var { children = null, className: classNameProp = "", to = void 0, isActive = false, isDropdown = false, showDivider, target = void 0, component = "a", render = void 0 } = _a, props = __rest(_a, ["children", "className", "to", "isActive", "isDropdown", "showDivider", "target", "component", "render"]);
    const Component50 = component;
    const ariaCurrent = isActive ? "page" : void 0;
    const className = css(import_breadcrumb2.default.breadcrumbLink, isActive && import_breadcrumb2.default.modifiers.current);
    return React39.createElement(
      "li",
      Object.assign({}, props, { className: css(import_breadcrumb2.default.breadcrumbItem, classNameProp) }),
      showDivider && React39.createElement(
        "span",
        { className: import_breadcrumb2.default.breadcrumbItemDivider },
        React39.createElement(angle_right_icon_default, null)
      ),
      component === "button" && React39.createElement("button", { className, "aria-current": ariaCurrent, type: "button" }, children),
      isDropdown && React39.createElement("span", { className: css(import_breadcrumb2.default.breadcrumbDropdown) }, children),
      render && render({ className, ariaCurrent }),
      to && !render && React39.createElement(Component50, { href: to, target, className, "aria-current": ariaCurrent }, children),
      !to && component !== "button" && !isDropdown && children
    );
  };
  BreadcrumbItem.displayName = "BreadcrumbItem";

  // node_modules/@patternfly/react-core/dist/esm/components/TextInput/TextInput.js
  init_tslib_es6();
  var React40 = __toESM(require_react());
  var import_form_control = __toESM(require_form_control());
  var TextInputTypes;
  (function(TextInputTypes2) {
    TextInputTypes2["text"] = "text";
    TextInputTypes2["date"] = "date";
    TextInputTypes2["datetimeLocal"] = "datetime-local";
    TextInputTypes2["email"] = "email";
    TextInputTypes2["month"] = "month";
    TextInputTypes2["number"] = "number";
    TextInputTypes2["password"] = "password";
    TextInputTypes2["search"] = "search";
    TextInputTypes2["tel"] = "tel";
    TextInputTypes2["time"] = "time";
    TextInputTypes2["url"] = "url";
  })(TextInputTypes || (TextInputTypes = {}));
  var TextInputReadOnlyVariant;
  (function(TextInputReadOnlyVariant2) {
    TextInputReadOnlyVariant2["default"] = "default";
    TextInputReadOnlyVariant2["plain"] = "plain";
  })(TextInputReadOnlyVariant || (TextInputReadOnlyVariant = {}));
  var TextInputBase = class extends React40.Component {
    constructor(props) {
      super(props);
      this.inputRef = React40.createRef();
      this.observer = () => {
      };
      this.handleChange = (event) => {
        if (this.props.onChange) {
          this.props.onChange(event.currentTarget.value, event);
        }
      };
      this.handleResize = () => {
        const inputRef = this.props.innerRef || this.inputRef;
        if (inputRef && inputRef.current) {
          trimLeft(inputRef.current, String(this.props.value));
        }
      };
      this.restoreText = () => {
        const inputRef = this.props.innerRef || this.inputRef;
        inputRef.current.value = String(this.props.value);
        inputRef.current.scrollLeft = inputRef.current.scrollWidth;
      };
      this.onFocus = (event) => {
        const { isLeftTruncated, onFocus } = this.props;
        if (isLeftTruncated) {
          this.restoreText();
        }
        onFocus && onFocus(event);
      };
      this.onBlur = (event) => {
        const { isLeftTruncated, onBlur } = this.props;
        if (isLeftTruncated) {
          this.handleResize();
        }
        onBlur && onBlur(event);
      };
      this.sanitizeInputValue = (value) => typeof value === "string" ? value.replace(/\n/g, " ") : value;
      if (!props.id && !props["aria-label"] && !props["aria-labelledby"]) {
        console.error("Text input:", "Text input requires either an id or aria-label to be specified");
      }
      this.state = {
        ouiaStateId: getDefaultOUIAId(TextInputBase.displayName)
      };
    }
    componentDidMount() {
      if (this.props.isLeftTruncated) {
        const inputRef = this.props.innerRef || this.inputRef;
        this.observer = getResizeObserver(inputRef.current, this.handleResize);
        this.handleResize();
      }
    }
    componentWillUnmount() {
      if (this.props.isLeftTruncated) {
        this.observer();
      }
    }
    render() {
      const _a = this.props, {
        innerRef,
        className,
        type,
        value,
        validated,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        onChange,
        onFocus,
        onBlur,
        isLeftTruncated,
        isReadOnly,
        readOnly,
        readOnlyVariant,
        isRequired,
        isDisabled,
        isIconSprite,
        iconVariant,
        customIconUrl,
        customIconDimensions,
        ouiaId,
        ouiaSafe
      } = _a, props = __rest(_a, ["innerRef", "className", "type", "value", "validated", "onChange", "onFocus", "onBlur", "isLeftTruncated", "isReadOnly", "readOnly", "readOnlyVariant", "isRequired", "isDisabled", "isIconSprite", "iconVariant", "customIconUrl", "customIconDimensions", "ouiaId", "ouiaSafe"]);
      const customIconStyle = {};
      if (customIconUrl) {
        customIconStyle.backgroundImage = `url('${customIconUrl}')`;
      }
      if (customIconDimensions) {
        customIconStyle.backgroundSize = customIconDimensions;
      }
      return React40.createElement("input", Object.assign({}, props, { onFocus: this.onFocus, onBlur: this.onBlur, className: css(import_form_control.default.formControl, isIconSprite && import_form_control.default.modifiers.iconSprite, readOnlyVariant === "plain" && import_form_control.default.modifiers.plain, validated === ValidatedOptions.success && import_form_control.default.modifiers.success, validated === ValidatedOptions.warning && import_form_control.default.modifiers.warning, (iconVariant && iconVariant !== "search" || customIconUrl) && import_form_control.default.modifiers.icon, iconVariant && import_form_control.default.modifiers[iconVariant], className), onChange: this.handleChange, type, value: this.sanitizeInputValue(value), "aria-invalid": props["aria-invalid"] ? props["aria-invalid"] : validated === ValidatedOptions.error, required: isRequired, disabled: isDisabled, readOnly: !!readOnlyVariant || isReadOnly || readOnly, ref: innerRef || this.inputRef }, (customIconUrl || customIconDimensions) && { style: customIconStyle }, getOUIAProps(TextInput.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe)));
    }
  };
  TextInputBase.displayName = "TextInputBase";
  TextInputBase.defaultProps = {
    "aria-label": null,
    className: "",
    isRequired: false,
    validated: "default",
    isDisabled: false,
    isReadOnly: false,
    isIconSprite: false,
    type: TextInputTypes.text,
    isLeftTruncated: false,
    onChange: () => void 0,
    ouiaSafe: true
  };
  var TextInput = React40.forwardRef((props, ref) => React40.createElement(TextInputBase, Object.assign({}, props, { innerRef: ref })));
  TextInput.displayName = "TextInput";

  // node_modules/@patternfly/react-core/dist/esm/components/Select/Select.js
  init_tslib_es6();
  var React48 = __toESM(require_react());
  var import_select5 = __toESM(require_select());
  var import_badge2 = __toESM(require_badge());
  var import_form_control2 = __toESM(require_form_control());
  var import_button3 = __toESM(require_button());

  // node_modules/@patternfly/react-icons/dist/esm/icons/times-circle-icon.js
  var TimesCircleIconConfig = {
    name: "TimesCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z",
    yOffset: 0,
    xOffset: 0
  };
  var TimesCircleIcon = createIcon(TimesCircleIconConfig);
  var times_circle_icon_default = TimesCircleIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectMenu.js
  init_tslib_es6();
  var React44 = __toESM(require_react());
  var import_select3 = __toESM(require_select());
  var import_form = __toESM(require_form());

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectOption.js
  init_tslib_es6();
  var React42 = __toESM(require_react());
  var import_select = __toESM(require_select());
  var import_check = __toESM(require_check());

  // node_modules/@patternfly/react-icons/dist/esm/icons/check-icon.js
  var CheckIconConfig = {
    name: "CheckIcon",
    height: 512,
    width: 512,
    svgPath: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z",
    yOffset: 0,
    xOffset: 0
  };
  var CheckIcon = createIcon(CheckIconConfig);
  var check_icon_default = CheckIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Select/selectConstants.js
  var React41 = __toESM(require_react());
  var SelectContext = React41.createContext(null);
  var SelectProvider = SelectContext.Provider;
  var SelectConsumer = SelectContext.Consumer;
  var SelectVariant;
  (function(SelectVariant2) {
    SelectVariant2["single"] = "single";
    SelectVariant2["checkbox"] = "checkbox";
    SelectVariant2["typeahead"] = "typeahead";
    SelectVariant2["typeaheadMulti"] = "typeaheadmulti";
  })(SelectVariant || (SelectVariant = {}));
  var SelectPosition;
  (function(SelectPosition2) {
    SelectPosition2["right"] = "right";
    SelectPosition2["left"] = "left";
  })(SelectPosition || (SelectPosition = {}));
  var SelectDirection;
  (function(SelectDirection2) {
    SelectDirection2["up"] = "up";
    SelectDirection2["down"] = "down";
  })(SelectDirection || (SelectDirection = {}));
  var SelectFooterTabbableItems = "input, button, select, textarea, a[href]";

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectOption.js
  var SelectOption = class extends React42.Component {
    constructor() {
      super(...arguments);
      this.ref = React42.createRef();
      this.liRef = React42.createRef();
      this.favoriteRef = React42.createRef();
      this.onKeyDown = (event, innerIndex, onEnter, isCheckbox) => {
        const { index, keyHandler: keyHandler2, isLastOptionBeforeFooter } = this.props;
        let isLastItemBeforeFooter = false;
        if (isLastOptionBeforeFooter !== void 0) {
          isLastItemBeforeFooter = isLastOptionBeforeFooter(index);
        }
        if (event.key === KeyTypes.Tab) {
          if (isCheckbox && !isLastItemBeforeFooter) {
            if (event.shiftKey) {
              keyHandler2(index, innerIndex, "up");
            } else {
              keyHandler2(index, innerIndex, "down");
            }
            event.stopPropagation();
          } else {
            if (event.shiftKey) {
              keyHandler2(index, innerIndex, "up");
            } else {
              keyHandler2(index, innerIndex, "tab");
            }
          }
        }
        event.preventDefault();
        if (event.key === KeyTypes.ArrowUp) {
          keyHandler2(index, innerIndex, "up");
        } else if (event.key === KeyTypes.ArrowDown) {
          keyHandler2(index, innerIndex, "down");
        } else if (event.key === KeyTypes.ArrowLeft) {
          keyHandler2(index, innerIndex, "left");
        } else if (event.key === KeyTypes.ArrowRight) {
          keyHandler2(index, innerIndex, "right");
        } else if (event.key === KeyTypes.Enter) {
          if (onEnter !== void 0) {
            onEnter();
          } else {
            this.ref.current.click();
          }
        }
      };
    }
    componentDidMount() {
      this.props.sendRef(this.props.isDisabled ? null : this.ref.current, this.props.isDisabled ? null : this.favoriteRef.current, this.props.isDisabled ? null : this.liRef.current, this.props.index);
    }
    componentDidUpdate() {
      this.props.sendRef(this.props.isDisabled ? null : this.ref.current, this.props.isDisabled ? null : this.favoriteRef.current, this.props.isDisabled ? null : this.liRef.current, this.props.index);
    }
    render() {
      const _a = this.props, {
        children,
        className,
        id,
        description,
        itemCount,
        value,
        onClick,
        isDisabled,
        isPlaceholder,
        isNoResultsOption,
        isSelected,
        isChecked,
        isFocused,
        sendRef,
        keyHandler: keyHandler2,
        index,
        component,
        inputId,
        isFavorite,
        ariaIsFavoriteLabel = "starred",
        ariaIsNotFavoriteLabel = "not starred",
        isLoad,
        isLoading,
        setViewMoreNextIndex,
        // eslint-disable-next-line no-console
        isLastOptionBeforeFooter,
        isGrouped = false
      } = _a, props = __rest(_a, ["children", "className", "id", "description", "itemCount", "value", "onClick", "isDisabled", "isPlaceholder", "isNoResultsOption", "isSelected", "isChecked", "isFocused", "sendRef", "keyHandler", "index", "component", "inputId", "isFavorite", "ariaIsFavoriteLabel", "ariaIsNotFavoriteLabel", "isLoad", "isLoading", "setViewMoreNextIndex", "isLastOptionBeforeFooter", "isGrouped"]);
      const Component50 = component;
      if (!id && isFavorite !== null) {
        console.error("Please provide an id to use the favorites feature.");
      }
      const generatedId = id || getUniqueId("select-option");
      const favoriteButton = (onFavorite) => React42.createElement(
        "button",
        { className: css(import_select.default.selectMenuItem, import_select.default.modifiers.action, import_select.default.modifiers.favoriteAction), "aria-label": isFavorite ? ariaIsFavoriteLabel : ariaIsNotFavoriteLabel, onClick: () => {
          onFavorite(generatedId.replace("favorite-", ""), isFavorite);
        }, onKeyDown: (event) => {
          this.onKeyDown(event, 1, () => onFavorite(generatedId.replace("favorite-", ""), isFavorite));
        }, ref: this.favoriteRef },
        React42.createElement(
          "span",
          { className: css(import_select.default.selectMenuItemActionIcon) },
          React42.createElement(star_icon_default, null)
        )
      );
      const itemDisplay = itemCount ? React42.createElement(
        "span",
        { className: css(import_select.default.selectMenuItemRow) },
        React42.createElement("span", { className: css(import_select.default.selectMenuItemText) }, children || value && value.toString && value.toString()),
        React42.createElement("span", { className: css(import_select.default.selectMenuItemCount) }, itemCount)
      ) : children || value.toString();
      const onViewMoreClick = (event) => {
        setViewMoreNextIndex();
        onClick(event);
      };
      const renderOption = (onSelect, onClose, variant, inputIdPrefix, onFavorite, shouldResetOnSelect) => {
        if (variant !== SelectVariant.checkbox && isLoading && isGrouped) {
          return React42.createElement("div", { role: "presentation", className: css(import_select.default.selectListItem, isLoading && import_select.default.modifiers.loading, className) }, children);
        } else if (variant !== SelectVariant.checkbox && isLoad && isGrouped) {
          return React42.createElement(
            "div",
            null,
            React42.createElement("button", Object.assign({}, props, { role: "presentation", className: css(import_select.default.selectMenuItem, import_select.default.modifiers.load, className), onClick: (event) => {
              onViewMoreClick(event);
              event.stopPropagation();
            }, ref: this.ref, type: "button" }), children || value.toString())
          );
        } else if (variant !== SelectVariant.checkbox) {
          return React42.createElement(
            "li",
            { id: generatedId, role: "presentation", className: css(isLoading && import_select.default.selectListItem, !isLoading && import_select.default.selectMenuWrapper, isFavorite && import_select.default.modifiers.favorite, isFocused && import_select.default.modifiers.focus, isLoading && import_select.default.modifiers.loading), ref: this.liRef },
            isLoading && children,
            isLoad && !isGrouped && React42.createElement("button", Object.assign({}, props, { className: css(import_select.default.selectMenuItem, import_select.default.modifiers.load, className), onClick: (event) => {
              onViewMoreClick(event);
              event.stopPropagation();
            }, ref: this.ref, onKeyDown: (event) => {
              this.onKeyDown(event, 0);
            }, type: "button" }), itemDisplay),
            !isLoading && !isLoad && React42.createElement(
              React42.Fragment,
              null,
              React42.createElement(
                Component50,
                Object.assign({}, props, { className: css(import_select.default.selectMenuItem, isLoad && import_select.default.modifiers.load, isSelected && import_select.default.modifiers.selected, isDisabled && import_select.default.modifiers.disabled, description && import_select.default.modifiers.description, isFavorite !== null && import_select.default.modifiers.link, className), onClick: (event) => {
                  if (!isDisabled) {
                    onClick(event);
                    onSelect(event, value, isPlaceholder);
                    shouldResetOnSelect && onClose();
                  }
                }, role: "option", "aria-selected": isSelected || null, ref: this.ref, onKeyDown: (event) => {
                  this.onKeyDown(event, 0);
                }, type: "button" }),
                description && React42.createElement(
                  React42.Fragment,
                  null,
                  React42.createElement(
                    "span",
                    { className: css(import_select.default.selectMenuItemMain) },
                    itemDisplay,
                    isSelected && React42.createElement(
                      "span",
                      { className: css(import_select.default.selectMenuItemIcon) },
                      React42.createElement(check_icon_default, { "aria-hidden": true })
                    )
                  ),
                  React42.createElement("span", { className: css(import_select.default.selectMenuItemDescription) }, description)
                ),
                !description && React42.createElement(
                  React42.Fragment,
                  null,
                  itemDisplay,
                  isSelected && React42.createElement(
                    "span",
                    { className: css(import_select.default.selectMenuItemIcon) },
                    React42.createElement(check_icon_default, { "aria-hidden": true })
                  )
                )
              ),
              isFavorite !== null && id && favoriteButton(onFavorite)
            )
          );
        } else if (variant === SelectVariant.checkbox && isLoad) {
          return React42.createElement("button", { className: css(import_select.default.selectMenuItem, import_select.default.modifiers.load, isFocused && import_select.default.modifiers.focus, className), onKeyDown: (event) => {
            this.onKeyDown(event, 0, void 0, true);
          }, onClick: (event) => {
            onViewMoreClick(event);
            event.stopPropagation();
          }, ref: this.ref }, children || value && value.toString && value.toString());
        } else if (variant === SelectVariant.checkbox && isLoading) {
          return React42.createElement("div", { className: css(import_select.default.selectListItem, isLoading && import_select.default.modifiers.loading, className) }, children);
        } else if (variant === SelectVariant.checkbox && !isNoResultsOption && !isLoading && !isLoad) {
          return React42.createElement(
            "label",
            Object.assign({}, props, { className: css(import_check.default.check, import_select.default.selectMenuItem, isDisabled && import_select.default.modifiers.disabled, description && import_select.default.modifiers.description, className), onKeyDown: (event) => {
              this.onKeyDown(event, 0, void 0, true);
            } }),
            React42.createElement("input", { id: inputId || `${inputIdPrefix}-${value.toString()}`, className: css(import_check.default.checkInput), type: "checkbox", onChange: (event) => {
              if (!isDisabled) {
                onClick(event);
                onSelect(event, value);
              }
            }, ref: this.ref, checked: isChecked || false, disabled: isDisabled }),
            React42.createElement("span", { className: css(import_check.default.checkLabel, isDisabled && import_select.default.modifiers.disabled) }, itemDisplay),
            description && React42.createElement("div", { className: css(import_check.default.checkDescription) }, description)
          );
        } else if (variant === SelectVariant.checkbox && isNoResultsOption && !isLoading && !isLoad) {
          return React42.createElement(
            "div",
            null,
            React42.createElement(Component50, Object.assign({}, props, { className: css(import_select.default.selectMenuItem, isSelected && import_select.default.modifiers.selected, isDisabled && import_select.default.modifiers.disabled, className), role: "option", "aria-selected": isSelected || null, ref: this.ref, onKeyDown: (event) => {
              this.onKeyDown(event, 0, void 0, true);
            }, type: "button" }), itemDisplay)
          );
        }
      };
      return React42.createElement(SelectConsumer, null, ({ onSelect, onClose, variant, inputIdPrefix, onFavorite, shouldResetOnSelect }) => React42.createElement(React42.Fragment, null, renderOption(onSelect, onClose, variant, inputIdPrefix, onFavorite, shouldResetOnSelect)));
    }
  };
  SelectOption.displayName = "SelectOption";
  SelectOption.defaultProps = {
    className: "",
    value: "",
    index: 0,
    isDisabled: false,
    isPlaceholder: false,
    isSelected: false,
    isChecked: false,
    isNoResultsOption: false,
    component: "button",
    onClick: () => {
    },
    sendRef: () => {
    },
    keyHandler: () => {
    },
    inputId: "",
    isFavorite: null,
    isLoad: false,
    isLoading: false,
    setViewMoreNextIndex: () => {
    },
    isLastOptionBeforeFooter: () => false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectGroup.js
  init_tslib_es6();
  var React43 = __toESM(require_react());
  var import_select2 = __toESM(require_select());
  var SelectGroup = (_a) => {
    var { children = [], className = "", label = "", titleId = "" } = _a, props = __rest(_a, ["children", "className", "label", "titleId"]);
    return React43.createElement(SelectConsumer, null, ({ variant }) => React43.createElement(
      "div",
      Object.assign({}, props, { className: css(import_select2.default.selectMenuGroup, className) }),
      React43.createElement("div", { className: css(import_select2.default.selectMenuGroupTitle), id: titleId, "aria-hidden": true }, label),
      variant === SelectVariant.checkbox ? children : React43.createElement("ul", { role: "listbox" }, children)
    ));
  };
  SelectGroup.displayName = "SelectGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectMenu.js
  var SelectMenuWithRef = class extends React44.Component {
    extendChildren(randomId) {
      const { children, hasInlineFilter, isGrouped } = this.props;
      const childrenArray = children;
      let index = hasInlineFilter ? 1 : 0;
      if (isGrouped) {
        return React44.Children.map(childrenArray, (group) => {
          if (group.type === SelectGroup) {
            return React44.cloneElement(group, {
              titleId: group.props.label && group.props.label.replace(/\W/g, "-"),
              children: React44.Children.map(group.props.children, (option) => this.cloneOption(option, index++, randomId))
            });
          } else {
            return this.cloneOption(group, index++, randomId);
          }
        });
      }
      return React44.Children.map(childrenArray, (child) => this.cloneOption(child, index++, randomId));
    }
    cloneOption(child, index, randomId) {
      const { selected, sendRef, keyHandler: keyHandler2 } = this.props;
      const isSelected = this.checkForValue(child.props.value, selected);
      if (child.type === Divider) {
        return child;
      }
      return React44.cloneElement(child, {
        inputId: `${randomId}-${index}`,
        isSelected,
        sendRef,
        keyHandler: keyHandler2,
        index
      });
    }
    checkForValue(valueToCheck, options4) {
      if (!options4 || !valueToCheck) {
        return false;
      }
      const isSelectOptionObject = typeof valueToCheck !== "string" && valueToCheck.toString && valueToCheck.compareTo;
      if (Array.isArray(options4)) {
        if (isSelectOptionObject) {
          return options4.some((option) => option.compareTo(valueToCheck));
        } else {
          return options4.includes(valueToCheck);
        }
      } else {
        if (isSelectOptionObject) {
          return options4.compareTo(valueToCheck);
        } else {
          return options4 === valueToCheck;
        }
      }
    }
    extendCheckboxChildren(children) {
      const { isGrouped, checked, sendRef, keyHandler: keyHandler2, hasInlineFilter, isLastOptionBeforeFooter } = this.props;
      let index = hasInlineFilter ? 1 : 0;
      if (isGrouped) {
        return React44.Children.map(children, (group) => {
          if (group.type === Divider) {
            return group;
          } else if (group.type === SelectOption) {
            return React44.cloneElement(group, {
              isChecked: this.checkForValue(group.props.value, checked),
              sendRef,
              keyHandler: keyHandler2,
              index: index++,
              isLastOptionBeforeFooter
            });
          }
          return React44.cloneElement(group, {
            titleId: group.props.label && group.props.label.replace(/\W/g, "-"),
            children: group.props.children ? React44.createElement("fieldset", { "aria-labelledby": group.props.label && group.props.label.replace(/\W/g, "-"), className: css(import_select3.default.selectMenuFieldset) }, React44.Children.map(group.props.children, (option) => option.type === Divider ? option : React44.cloneElement(option, {
              isChecked: this.checkForValue(option.props.value, checked),
              sendRef,
              keyHandler: keyHandler2,
              index: index++,
              isLastOptionBeforeFooter
            }))) : null
          });
        });
      }
      return React44.Children.map(children, (child) => child.type === Divider ? child : React44.cloneElement(child, {
        isChecked: this.checkForValue(child.props.value, checked),
        sendRef,
        keyHandler: keyHandler2,
        index: index++,
        isLastOptionBeforeFooter
      }));
    }
    renderSelectMenu({ variant, inputIdPrefix }) {
      const _a = this.props, { children, isCustomContent, className, isExpanded, openedOnEnter, selected, checked, isGrouped, position, sendRef, keyHandler: keyHandler2, maxHeight, noResultsFoundText, createText, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, hasInlineFilter, innerRef, footer, footerRef, isLastOptionBeforeFooter } = _a, props = __rest(_a, ["children", "isCustomContent", "className", "isExpanded", "openedOnEnter", "selected", "checked", "isGrouped", "position", "sendRef", "keyHandler", "maxHeight", "noResultsFoundText", "createText", "aria-label", "aria-labelledby", "hasInlineFilter", "innerRef", "footer", "footerRef", "isLastOptionBeforeFooter"]);
      let Component50 = "div";
      const variantProps = Object.assign({ ref: innerRef, className: css(!footer ? import_select3.default.selectMenu : "pf-c-select__menu-list", position === SelectPosition.right && import_select3.default.modifiers.alignRight, className) }, maxHeight && { style: { maxHeight, overflow: "auto" } });
      const extendedChildren = () => variant === SelectVariant.checkbox ? this.extendCheckboxChildren(children) : this.extendChildren(inputIdPrefix);
      if (isCustomContent) {
        variantProps.children = children;
      } else if (hasInlineFilter) {
        if (React44.Children.count(children) === 0) {
          variantProps.children = React44.createElement("fieldset", { className: css(import_select3.default.selectMenuFieldset) });
        } else {
          variantProps.children = React44.createElement(
            "fieldset",
            { "aria-label": ariaLabel, "aria-labelledby": !ariaLabel && ariaLabelledBy || null, className: css(import_form.default.formFieldset) },
            children.shift(),
            extendedChildren()
          );
        }
      } else {
        variantProps.children = extendedChildren();
        if (!isGrouped) {
          Component50 = "ul";
          variantProps.role = "listbox";
          variantProps["aria-label"] = ariaLabel;
          variantProps["aria-labelledby"] = !ariaLabel && ariaLabelledBy || null;
        }
      }
      return React44.createElement(
        React44.Fragment,
        null,
        React44.createElement(Component50, Object.assign({}, variantProps, props)),
        footer && React44.createElement("div", { className: css(import_select3.default.selectMenuFooter), ref: footerRef }, footer)
      );
    }
    render() {
      return React44.createElement(SelectConsumer, null, (context) => this.renderSelectMenu(context));
    }
  };
  SelectMenuWithRef.displayName = "SelectMenu";
  SelectMenuWithRef.defaultProps = {
    className: "",
    isExpanded: false,
    isGrouped: false,
    openedOnEnter: false,
    selected: "",
    maxHeight: "",
    position: SelectPosition.left,
    sendRef: () => {
    },
    keyHandler: () => {
    },
    isCustomContent: false,
    hasInlineFilter: false,
    isLastOptionBeforeFooter: () => {
    }
  };
  var SelectMenu = React44.forwardRef((props, ref) => React44.createElement(SelectMenuWithRef, Object.assign({ innerRef: ref }, props), props.children));

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectToggle.js
  init_tslib_es6();
  var React45 = __toESM(require_react());
  var import_select4 = __toESM(require_select());
  var import_button2 = __toESM(require_button());
  var SelectToggleBase = class extends React45.Component {
    constructor(props) {
      super(props);
      this.onDocClick = (event) => {
        const { parentRef, menuRef, footerRef, isOpen, onToggle, onClose } = this.props;
        const clickedOnToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
        const clickedWithinMenu = menuRef && menuRef.current && menuRef.current.contains && menuRef.current.contains(event.target);
        const clickedWithinFooter = footerRef && footerRef.current && footerRef.current.contains && footerRef.current.contains(event.target);
        if (isOpen && !(clickedOnToggle || clickedWithinMenu || clickedWithinFooter)) {
          onToggle(false, event);
          onClose();
        }
      };
      this.handleGlobalKeys = (event) => {
        const { parentRef, menuRef, hasFooter, footerRef, isOpen, variant: variant2, onToggle, onClose, moveFocusToLastMenuItem } = this.props;
        const escFromToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
        const escFromWithinMenu = menuRef && menuRef.current && menuRef.current.contains && menuRef.current.contains(event.target);
        if (isOpen && event.key === KeyTypes.Tab && (variant2 === SelectVariant.typeahead || variant2 === SelectVariant.typeaheadMulti)) {
          this.props.handleTypeaheadKeys("tab", event.shiftKey);
          event.preventDefault();
          return;
        }
        if (isOpen && event.key === KeyTypes.Tab && hasFooter) {
          const tabbableItems = findTabbableElements(footerRef, SelectFooterTabbableItems);
          if (tabbableItems.length <= 0) {
            onToggle(false, event);
            onClose();
            this.toggle.current.focus();
            return;
          } else {
            const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
            if (currentElementIndex === -1) {
              if (event.shiftKey) {
                if (variant2 !== "checkbox") {
                  onToggle(false, event);
                  onClose();
                  this.toggle.current.focus();
                }
              } else {
                tabbableItems[0].focus();
                return;
              }
            }
            if (event.shiftKey) {
              if (currentElementIndex === 0) {
                moveFocusToLastMenuItem();
                event.preventDefault();
              }
              return;
            }
            if (currentElementIndex + 1 < tabbableItems.length) {
              tabbableItems[currentElementIndex + 1].focus();
            } else {
              onToggle(false, event);
              onClose();
              this.toggle.current.focus();
            }
            event.preventDefault();
            return;
          }
        }
        if (isOpen && (event.key === KeyTypes.Escape || event.key === KeyTypes.Tab) && (escFromToggle || escFromWithinMenu)) {
          onToggle(false, event);
          onClose();
          this.toggle.current.focus();
        }
      };
      this.onKeyDown = (event) => {
        const { isOpen, onToggle, variant: variant2, onClose, onEnter, handleTypeaheadKeys } = this.props;
        if (variant2 === SelectVariant.typeahead || variant2 === SelectVariant.typeaheadMulti) {
          if (event.key === KeyTypes.ArrowDown || event.key === KeyTypes.ArrowUp) {
            handleTypeaheadKeys(event.key === KeyTypes.ArrowDown && "down" || event.key === KeyTypes.ArrowUp && "up");
            event.preventDefault();
          } else if (event.key === KeyTypes.Enter) {
            if (isOpen) {
              handleTypeaheadKeys("enter");
            } else {
              onToggle(!isOpen, event);
            }
          }
        }
        if (variant2 === SelectVariant.typeahead || variant2 === SelectVariant.typeaheadMulti || event.key === KeyTypes.Tab && !isOpen || event.key !== KeyTypes.Enter && event.key !== KeyTypes.Space) {
          return;
        }
        event.preventDefault();
        if ((event.key === KeyTypes.Tab || event.key === KeyTypes.Enter || event.key === KeyTypes.Space) && isOpen) {
          onToggle(!isOpen, event);
          onClose();
          this.toggle.current.focus();
        } else if ((event.key === KeyTypes.Enter || event.key === KeyTypes.Space) && !isOpen) {
          onToggle(!isOpen, event);
          onEnter();
        }
      };
      const { variant } = props;
      const isTypeahead = variant === SelectVariant.typeahead || variant === SelectVariant.typeaheadMulti;
      if (this.props.innerRef) {
        this.toggle = this.props.innerRef;
      } else {
        this.toggle = isTypeahead ? React45.createRef() : React45.createRef();
      }
    }
    componentDidMount() {
      document.addEventListener("click", this.onDocClick, { capture: true });
      document.addEventListener("touchstart", this.onDocClick);
      document.addEventListener("keydown", this.handleGlobalKeys);
    }
    componentWillUnmount() {
      document.removeEventListener("click", this.onDocClick);
      document.removeEventListener("touchstart", this.onDocClick);
      document.removeEventListener("keydown", this.handleGlobalKeys);
    }
    render() {
      const _a = this.props, { className, children, isOpen, isActive, isPlain, isDisabled, hasPlaceholderStyle, variant, onToggle, onEnter, onClose, onBlur, onClickTypeaheadToggleButton, handleTypeaheadKeys, moveFocusToLastMenuItem, parentRef, menuRef, id, type, hasClearButton, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, hasFooter, footerRef, toggleIndicator, innerRef } = _a, props = __rest(_a, ["className", "children", "isOpen", "isActive", "isPlain", "isDisabled", "hasPlaceholderStyle", "variant", "onToggle", "onEnter", "onClose", "onBlur", "onClickTypeaheadToggleButton", "handleTypeaheadKeys", "moveFocusToLastMenuItem", "parentRef", "menuRef", "id", "type", "hasClearButton", "aria-labelledby", "aria-label", "hasFooter", "footerRef", "toggleIndicator", "innerRef"]);
      const isTypeahead = variant === SelectVariant.typeahead || variant === SelectVariant.typeaheadMulti || hasClearButton;
      const toggleProps = {
        id,
        "aria-labelledby": ariaLabelledBy,
        "aria-expanded": isOpen,
        "aria-haspopup": variant !== SelectVariant.checkbox && "listbox" || null
      };
      return React45.createElement(
        React45.Fragment,
        null,
        !isTypeahead && React45.createElement(
          "button",
          Object.assign({}, props, toggleProps, {
            ref: this.toggle,
            type,
            className: css(import_select4.default.selectToggle, hasPlaceholderStyle && import_select4.default.modifiers.placeholder, isDisabled && import_select4.default.modifiers.disabled, isPlain && import_select4.default.modifiers.plain, isActive && import_select4.default.modifiers.active, className),
            "aria-label": ariaLabel,
            onBlur,
            // eslint-disable-next-line @typescript-eslint/no-unused-vars
            onClick: (event) => {
              onToggle(!isOpen, event);
              if (isOpen) {
                onClose();
              }
            },
            onKeyDown: this.onKeyDown,
            disabled: isDisabled
          }),
          children,
          React45.createElement("span", { className: css(import_select4.default.selectToggleArrow) }, toggleIndicator !== null && toggleIndicator !== void 0 ? toggleIndicator : React45.createElement(caret_down_icon_default, null))
        ),
        isTypeahead && React45.createElement(
          "div",
          Object.assign({}, props, {
            ref: this.toggle,
            className: css(import_select4.default.selectToggle, hasPlaceholderStyle && import_select4.default.modifiers.placeholder, isDisabled && import_select4.default.modifiers.disabled, isPlain && import_select4.default.modifiers.plain, isTypeahead && import_select4.default.modifiers.typeahead, className),
            onBlur,
            // eslint-disable-next-line @typescript-eslint/no-unused-vars
            onClick: (event) => {
              if (!isDisabled) {
                onToggle(!isOpen, event);
                if (isOpen) {
                  onClose();
                }
              }
            },
            onKeyDown: this.onKeyDown
          }),
          children,
          React45.createElement("button", Object.assign({}, toggleProps, { type, className: css(import_button2.default.button, import_select4.default.selectToggleButton, import_select4.default.modifiers.plain), "aria-label": ariaLabel, onClick: (event) => {
            onToggle(!isOpen, event);
            if (isOpen) {
              onClose();
            }
            onClickTypeaheadToggleButton();
          } }, (variant === SelectVariant.typeahead || variant === SelectVariant.typeaheadMulti) && {
            tabIndex: -1
          }, { disabled: isDisabled }), toggleIndicator !== null && toggleIndicator !== void 0 ? toggleIndicator : React45.createElement(caret_down_icon_default, { className: css(import_select4.default.selectToggleArrow) }))
        )
      );
    }
  };
  SelectToggleBase.displayName = "SelectToggle";
  SelectToggleBase.defaultProps = {
    className: "",
    isOpen: false,
    isActive: false,
    isPlain: false,
    isDisabled: false,
    hasPlaceholderStyle: false,
    hasClearButton: false,
    hasFooter: false,
    variant: "single",
    "aria-labelledby": "",
    "aria-label": "",
    type: "button",
    onToggle: () => {
    },
    onEnter: () => {
    },
    onClose: () => {
    },
    onClickTypeaheadToggleButton: () => {
    }
  };
  var SelectToggle = React45.forwardRef((props, ref) => React45.createElement(SelectToggleBase, Object.assign({ innerRef: ref }, props)));

  // node_modules/@patternfly/react-core/dist/esm/components/ChipGroup/ChipGroup.js
  init_tslib_es6();
  var React47 = __toESM(require_react());
  var import_chip_group = __toESM(require_chip_group());

  // node_modules/@patternfly/react-core/dist/esm/components/Chip/Chip.js
  init_tslib_es6();
  var React46 = __toESM(require_react());
  var import_chip = __toESM(require_chip());
  var Chip = class extends React46.Component {
    constructor(props) {
      super(props);
      this.span = React46.createRef();
      this.setChipStyle = () => ({
        "--pf-c-chip__text--MaxWidth": this.props.textMaxWidth
      });
      this.renderOverflowChip = () => {
        const _a = this.props, {
          children,
          className,
          onClick,
          ouiaId,
          textMaxWidth,
          style,
          component,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          tooltipPosition,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          isOverflowChip,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          closeBtnAriaLabel,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          isReadOnly
        } = _a, props2 = __rest(_a, ["children", "className", "onClick", "ouiaId", "textMaxWidth", "style", "component", "tooltipPosition", "isOverflowChip", "closeBtnAriaLabel", "isReadOnly"]);
        const Component50 = component;
        return React46.createElement(
          Component50,
          Object.assign({ onClick }, textMaxWidth && Object.assign({ style: this.setChipStyle() }, style), { className: css(import_chip.default.chip, import_chip.default.modifiers.overflow, className) }, component === "button" ? { type: "button" } : {}, getOUIAProps("OverflowChip", ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId), props2),
          React46.createElement("span", { className: css(import_chip.default.chipText) }, children)
        );
      };
      this.renderChip = (randomId) => {
        const { children, tooltipPosition } = this.props;
        if (this.state.isTooltipVisible) {
          return React46.createElement(Tooltip, { position: tooltipPosition, content: children }, this.renderInnerChip(randomId));
        }
        return this.renderInnerChip(randomId);
      };
      this.state = {
        isTooltipVisible: false,
        ouiaStateId: getDefaultOUIAId(Chip.displayName)
      };
    }
    componentDidMount() {
      this.setState({
        isTooltipVisible: Boolean(this.span.current && this.span.current.offsetWidth < this.span.current.scrollWidth)
      });
    }
    renderInnerChip(id) {
      const _a = this.props, {
        children,
        className,
        onClick,
        closeBtnAriaLabel,
        isReadOnly,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        isOverflowChip,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        tooltipPosition,
        component,
        ouiaId
      } = _a, props = __rest(_a, ["children", "className", "onClick", "closeBtnAriaLabel", "isReadOnly", "isOverflowChip", "tooltipPosition", "component", "ouiaId"]);
      const Component50 = component;
      return React46.createElement(
        Component50,
        Object.assign({}, this.props.textMaxWidth && {
          style: this.setChipStyle()
        }, { className: css(import_chip.default.chip, className) }, this.state.isTooltipVisible && { tabIndex: 0 }, getOUIAProps(Chip.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId), props),
        React46.createElement("span", { ref: this.span, className: css(import_chip.default.chipText), id }, children),
        !isReadOnly && React46.createElement(
          Button,
          { onClick, variant: "plain", "aria-label": closeBtnAriaLabel, id: `remove_${id}`, "aria-labelledby": `remove_${id} ${id}`, ouiaId: ouiaId || closeBtnAriaLabel },
          React46.createElement(times_icon_default, { "aria-hidden": "true" })
        )
      );
    }
    render() {
      const { isOverflowChip } = this.props;
      return React46.createElement(GenerateId, null, (randomId) => isOverflowChip ? this.renderOverflowChip() : this.renderChip(this.props.id || randomId));
    }
  };
  Chip.displayName = "Chip";
  Chip.defaultProps = {
    closeBtnAriaLabel: "close",
    className: "",
    isOverflowChip: false,
    isReadOnly: false,
    tooltipPosition: "top",
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onClick: (_e) => void 0,
    component: "div"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ChipGroup/ChipGroup.js
  var ChipGroup = class extends React47.Component {
    constructor(props) {
      super(props);
      this.headingRef = React47.createRef();
      this.toggleCollapse = () => {
        this.setState((prevState) => ({
          isOpen: !prevState.isOpen,
          isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
        }));
      };
      this.state = {
        isOpen: this.props.defaultIsOpen,
        isTooltipVisible: false
      };
    }
    componentDidMount() {
      this.setState({
        isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
      });
    }
    renderLabel(id) {
      const { categoryName, tooltipPosition } = this.props;
      const { isTooltipVisible } = this.state;
      return isTooltipVisible ? React47.createElement(
        Tooltip,
        { position: tooltipPosition, content: categoryName },
        React47.createElement(
          "span",
          { tabIndex: 0, ref: this.headingRef, className: css(import_chip_group.default.chipGroupLabel) },
          React47.createElement("span", { id }, categoryName)
        )
      ) : React47.createElement("span", { ref: this.headingRef, className: css(import_chip_group.default.chipGroupLabel), id }, categoryName);
    }
    render() {
      const _a = this.props, {
        categoryName,
        children,
        className,
        isClosable,
        closeBtnAriaLabel,
        "aria-label": ariaLabel,
        onClick,
        onOverflowChipClick,
        numChips,
        expandedText,
        collapsedText,
        ouiaId,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        defaultIsOpen,
        tooltipPosition
      } = _a, rest = __rest(_a, ["categoryName", "children", "className", "isClosable", "closeBtnAriaLabel", "aria-label", "onClick", "onOverflowChipClick", "numChips", "expandedText", "collapsedText", "ouiaId", "defaultIsOpen", "tooltipPosition"]);
      const { isOpen } = this.state;
      const numChildren = React47.Children.count(children);
      const collapsedTextResult = fillTemplate(collapsedText, {
        remaining: React47.Children.count(children) - numChips
      });
      const renderChipGroup = (id) => {
        const chipArray = !isOpen ? React47.Children.toArray(children).slice(0, numChips) : React47.Children.toArray(children);
        return React47.createElement(
          "div",
          Object.assign({ className: css(import_chip_group.default.chipGroup, className, categoryName && import_chip_group.default.modifiers.category), role: "group" }, categoryName && { "aria-labelledby": id }, !categoryName && { "aria-label": ariaLabel }, getOUIAProps(ChipGroup.displayName, ouiaId)),
          React47.createElement(
            "div",
            { className: css(import_chip_group.default.chipGroupMain) },
            categoryName && this.renderLabel(id),
            React47.createElement(
              "ul",
              Object.assign({ className: css(import_chip_group.default.chipGroupList) }, categoryName && { "aria-labelledby": id }, !categoryName && { "aria-label": ariaLabel }, { role: "list" }, rest),
              chipArray.map((child, i) => React47.createElement("li", { className: css(import_chip_group.default.chipGroupListItem), key: i }, child)),
              numChildren > numChips && React47.createElement(
                "li",
                { className: css(import_chip_group.default.chipGroupListItem) },
                React47.createElement(Chip, { isOverflowChip: true, onClick: (event) => {
                  this.toggleCollapse();
                  onOverflowChipClick(event);
                }, component: "button" }, isOpen ? expandedText : collapsedTextResult)
              )
            )
          ),
          isClosable && React47.createElement(
            "div",
            { className: css(import_chip_group.default.chipGroupClose) },
            React47.createElement(
              Button,
              { variant: "plain", "aria-label": closeBtnAriaLabel, onClick, id: `remove_group_${id}`, "aria-labelledby": `remove_group_${id} ${id}`, ouiaId: ouiaId || closeBtnAriaLabel },
              React47.createElement(times_circle_icon_default, { "aria-hidden": "true" })
            )
          )
        );
      };
      return numChildren === 0 ? null : React47.createElement(GenerateId, null, (randomId) => renderChipGroup(this.props.id || randomId));
    }
  };
  ChipGroup.displayName = "ChipGroup";
  ChipGroup.defaultProps = {
    expandedText: "Show Less",
    collapsedText: "${remaining} more",
    categoryName: "",
    defaultIsOpen: false,
    numChips: 3,
    isClosable: false,
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onClick: (_e) => void 0,
    onOverflowChipClick: (_e) => void 0,
    closeBtnAriaLabel: "Close chip group",
    tooltipPosition: "top",
    "aria-label": "Chip group category"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Select/Select.js
  var currentId3 = 0;
  var Select = class extends React48.Component {
    constructor() {
      super(...arguments);
      this.parentRef = React48.createRef();
      this.menuComponentRef = React48.createRef();
      this.filterRef = React48.createRef();
      this.clearRef = React48.createRef();
      this.inputRef = React48.createRef();
      this.refCollection = [[]];
      this.optionContainerRefCollection = [];
      this.footerRef = React48.createRef();
      this.state = {
        focusFirstOption: false,
        typeaheadInputValue: null,
        typeaheadFilteredChildren: React48.Children.toArray(this.props.children),
        favoritesGroup: [],
        typeaheadCurrIndex: -1,
        typeaheadStoredIndex: -1,
        creatableValue: "",
        tabbedIntoFavoritesMenu: false,
        ouiaStateId: getDefaultOUIAId(Select.displayName, this.props.variant),
        viewMoreNextIndex: -1
      };
      this.getTypeaheadActiveChild = (typeaheadCurrIndex) => this.refCollection[typeaheadCurrIndex] ? this.refCollection[typeaheadCurrIndex][0] : null;
      this.componentDidUpdate = (prevProps, prevState) => {
        if (this.props.hasInlineFilter) {
          this.refCollection[0][0] = this.filterRef.current;
        }
        if (!prevState.focusFirstOption && this.state.focusFirstOption && !this.props.customContent) {
          const firstRef = this.refCollection.find((ref) => (
            // If a select option is disabled then ref[0] will be undefined, so we want to return
            // the first ref that both a) is not null and b) is not disabled.
            ref !== null && ref[0]
          ));
          if (firstRef && firstRef[0]) {
            firstRef[0].focus();
          }
        } else if (
          // if viewMoreNextIndex is not -1, view more was clicked, set focus on first newly loaded item
          this.state.viewMoreNextIndex !== -1 && this.refCollection.length > this.state.viewMoreNextIndex && this.props.loadingVariant !== "spinner" && this.refCollection[this.state.viewMoreNextIndex][0] && this.props.variant !== "typeahead" && // do not hard focus newly added items for typeahead variants
          this.props.variant !== "typeaheadmulti"
        ) {
          this.refCollection[this.state.viewMoreNextIndex][0].focus();
          this.setState({ viewMoreNextIndex: -1 });
        }
        const checkUpdatedChildren = (prevChildren, currChildren) => Array.from(prevChildren).some((prevChild, index) => {
          const prevChildProps = prevChild.props;
          const currChild = currChildren[index];
          const { props: currChildProps } = currChild;
          if (prevChildProps && currChildProps) {
            return prevChildProps.value !== currChildProps.value || prevChildProps.label !== currChildProps.label || prevChildProps.isDisabled !== currChildProps.isDisabled || prevChildProps.isPlaceholder !== currChildProps.isPlaceholder;
          } else {
            return prevChild !== currChild;
          }
        });
        const hasUpdatedChildren = prevProps.children.length !== this.props.children.length || checkUpdatedChildren(prevProps.children, this.props.children) || this.props.isGrouped && Array.from(prevProps.children).some((prevChild, index) => prevChild.type === SelectGroup && prevChild.props.children && this.props.children[index].props.children && (prevChild.props.children.length !== this.props.children[index].props.children.length || checkUpdatedChildren(prevChild.props.children, this.props.children[index].props.children)));
        if (hasUpdatedChildren) {
          this.updateTypeAheadFilteredChildren(prevState.typeaheadInputValue || "", null);
        }
        if (this.props.onFavorite && (this.props.favorites.length !== prevProps.favorites.length || this.state.typeaheadFilteredChildren !== prevState.typeaheadFilteredChildren)) {
          const tempRenderableChildren = this.props.variant === "typeahead" || this.props.variant === "typeaheadmulti" ? this.state.typeaheadFilteredChildren : this.props.children;
          const renderableFavorites = createRenderableFavorites(tempRenderableChildren, this.props.isGrouped, this.props.favorites);
          const favoritesGroup = renderableFavorites.length ? [
            React48.createElement(SelectGroup, { key: "favorites", label: this.props.favoritesLabel }, renderableFavorites),
            React48.createElement(Divider, { key: "favorites-group-divider" })
          ] : [];
          this.setState({ favoritesGroup });
        }
      };
      this.onEnter = () => {
        this.setState({ focusFirstOption: true });
      };
      this.onToggle = (isExpanded, e) => {
        const { isInputValuePersisted, onSelect, onToggle, hasInlineFilter } = this.props;
        if (!isExpanded && isInputValuePersisted && onSelect) {
          onSelect(void 0, this.inputRef.current ? this.inputRef.current.value : "");
        }
        if (isExpanded && hasInlineFilter) {
          this.setState({
            focusFirstOption: true
          });
        }
        onToggle(isExpanded, e);
      };
      this.onClose = () => {
        const { isInputFilterPersisted } = this.props;
        this.setState(Object.assign(Object.assign({ focusFirstOption: false, typeaheadInputValue: null }, !isInputFilterPersisted && {
          typeaheadFilteredChildren: React48.Children.toArray(this.props.children)
        }), { typeaheadCurrIndex: -1, tabbedIntoFavoritesMenu: false, viewMoreNextIndex: -1 }));
      };
      this.onChange = (e) => {
        if (e.target.value.toString() !== "" && !this.props.isOpen) {
          this.onToggle(true, e);
        }
        if (this.props.onTypeaheadInputChanged) {
          this.props.onTypeaheadInputChanged(e.target.value.toString());
        }
        this.setState({
          typeaheadCurrIndex: -1,
          typeaheadInputValue: e.target.value,
          creatableValue: e.target.value
        });
        this.updateTypeAheadFilteredChildren(e.target.value.toString(), e);
        this.refCollection = [[]];
      };
      this.updateTypeAheadFilteredChildren = (typeaheadInputValue, e) => {
        let typeaheadFilteredChildren;
        const { onFilter, isCreatable, isCreateOptionOnTop, onCreateOption, createText, noResultsFoundText, children, isGrouped, isCreateSelectOptionObject, loadingVariant } = this.props;
        if (onFilter) {
          typeaheadFilteredChildren = onFilter(e, e ? e.target.value : typeaheadInputValue) || children;
        } else {
          let input;
          try {
            input = new RegExp(typeaheadInputValue.toString(), "i");
          } catch (err) {
            input = new RegExp(typeaheadInputValue.toString().replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
          }
          const childrenArray = React48.Children.toArray(children);
          if (isGrouped) {
            const childFilter = (child) => child.props.value && child.props.value.toString && this.getDisplay(child.props.value.toString(), "text").search(input) === 0;
            typeaheadFilteredChildren = typeaheadInputValue.toString() !== "" ? React48.Children.map(children, (group) => {
              if (React48.isValidElement(group) && group.type === SelectGroup) {
                const filteredGroupChildren = React48.Children.toArray(group.props.children).filter(childFilter);
                if (filteredGroupChildren.length > 0) {
                  return React48.cloneElement(group, {
                    titleId: group.props.label && group.props.label.replace(/\W/g, "-"),
                    children: filteredGroupChildren
                  });
                }
              } else {
                return React48.Children.toArray(group).filter(childFilter);
              }
            }) : childrenArray;
          } else {
            typeaheadFilteredChildren = typeaheadInputValue.toString() !== "" ? childrenArray.filter((child) => {
              const valueToCheck = child.props.value;
              if (!valueToCheck) {
                return true;
              }
              const isSelectOptionObject = typeof valueToCheck !== "string" && valueToCheck.toString && valueToCheck.compareTo;
              if (loadingVariant !== "spinner" && (loadingVariant === null || loadingVariant === void 0 ? void 0 : loadingVariant.text) === valueToCheck) {
                return true;
              }
              if (loadingVariant === "spinner" && valueToCheck === "loading") {
                return true;
              }
              if (isSelectOptionObject) {
                return valueToCheck.compareTo(typeaheadInputValue);
              } else {
                return this.getDisplay(child.props.value.toString(), "text").search(input) === 0;
              }
            }) : childrenArray;
          }
        }
        if (!typeaheadFilteredChildren) {
          typeaheadFilteredChildren = [];
        }
        if (typeaheadFilteredChildren.length === 0) {
          !isCreatable && typeaheadFilteredChildren.push(React48.createElement(SelectOption, { isDisabled: true, key: "no-results", value: noResultsFoundText, isNoResultsOption: true }));
        }
        if (isCreatable && typeaheadInputValue !== "") {
          const newValue = typeaheadInputValue;
          if (!typeaheadFilteredChildren.find((i) => i.props.value && i.props.value.toString().toLowerCase() === newValue.toString().toLowerCase())) {
            const newOptionValue = isCreateSelectOptionObject ? {
              toString: () => newValue,
              compareTo: (value) => this.toString().toLowerCase().includes(value.toString().toLowerCase())
            } : newValue;
            const createSelectOption = React48.createElement(
              SelectOption,
              { key: `create ${newValue}`, value: newOptionValue, onClick: () => onCreateOption && onCreateOption(newValue) },
              createText,
              ' "',
              newValue,
              '"'
            );
            if (isCreateOptionOnTop) {
              typeaheadFilteredChildren.unshift(createSelectOption);
            } else {
              typeaheadFilteredChildren.push(createSelectOption);
            }
          }
        }
        this.setState({
          typeaheadFilteredChildren
        });
      };
      this.onClick = (e) => {
        if (!this.props.isOpen) {
          this.onToggle(true, e);
        }
      };
      this.clearSelection = (_e) => {
        this.setState({
          typeaheadInputValue: null,
          typeaheadFilteredChildren: React48.Children.toArray(this.props.children),
          typeaheadCurrIndex: -1
        });
      };
      this.sendRef = (optionRef, favoriteRef, optionContainerRef, index) => {
        this.refCollection[index] = [optionRef, favoriteRef];
        this.optionContainerRefCollection[index] = optionContainerRef;
      };
      this.handleMenuKeys = (index, innerIndex, position) => {
        keyHandler(index, innerIndex, position, this.refCollection, this.refCollection);
        if (this.props.variant === SelectVariant.typeahead || this.props.variant === SelectVariant.typeaheadMulti) {
          if (position !== "tab") {
            this.handleTypeaheadKeys(position);
          }
        }
      };
      this.moveFocus = (nextIndex, updateCurrentIndex = true) => {
        const { isCreatable, createText } = this.props;
        const hasDescriptionElm = Boolean(this.refCollection[nextIndex][0] && this.refCollection[nextIndex][0].classList.contains("pf-m-description"));
        const isLoad = Boolean(this.refCollection[nextIndex][0] && this.refCollection[nextIndex][0].classList.contains("pf-m-load"));
        const optionTextElm = hasDescriptionElm ? this.refCollection[nextIndex][0].firstElementChild : this.refCollection[nextIndex][0];
        let typeaheadInputValue = "";
        if (isCreatable && optionTextElm.textContent.includes(createText)) {
          typeaheadInputValue = this.state.creatableValue;
        } else if (optionTextElm && !isLoad) {
          typeaheadInputValue = optionTextElm.textContent;
        }
        this.setState((prevState) => ({
          typeaheadCurrIndex: updateCurrentIndex ? nextIndex : prevState.typeaheadCurrIndex,
          typeaheadStoredIndex: nextIndex,
          typeaheadInputValue
        }));
      };
      this.switchFocusToFavoriteMenu = () => {
        const { typeaheadCurrIndex, typeaheadStoredIndex } = this.state;
        let indexForFocus = 0;
        if (typeaheadCurrIndex !== -1) {
          indexForFocus = typeaheadCurrIndex;
        } else if (typeaheadStoredIndex !== -1) {
          indexForFocus = typeaheadStoredIndex;
        }
        if (this.refCollection[indexForFocus] !== null && this.refCollection[indexForFocus][0] !== null) {
          this.refCollection[indexForFocus][0].focus();
        } else {
          this.clearRef.current.focus();
        }
        this.setState({
          tabbedIntoFavoritesMenu: true,
          typeaheadCurrIndex: -1
        });
      };
      this.moveFocusToLastMenuItem = () => {
        const refCollectionLen = this.refCollection.length;
        if (refCollectionLen > 0 && this.refCollection[refCollectionLen - 1] !== null && this.refCollection[refCollectionLen - 1][0] !== null) {
          this.refCollection[refCollectionLen - 1][0].focus();
        }
      };
      this.handleTypeaheadKeys = (position, shiftKey = false) => {
        const { isOpen, onFavorite, isCreatable } = this.props;
        const { typeaheadCurrIndex, tabbedIntoFavoritesMenu } = this.state;
        const typeaheadActiveChild = this.getTypeaheadActiveChild(typeaheadCurrIndex);
        if (isOpen) {
          if (position === "enter") {
            if ((typeaheadCurrIndex !== -1 || isCreatable && this.refCollection.length === 1) && // do not allow selection without moving to an initial option unless it is a single create option
            (typeaheadActiveChild || this.refCollection[0] && this.refCollection[0][0])) {
              if (typeaheadActiveChild) {
                if (!typeaheadActiveChild.classList.contains("pf-m-load")) {
                  const hasDescriptionElm = typeaheadActiveChild.childElementCount > 1;
                  const typeaheadActiveChildText = hasDescriptionElm ? typeaheadActiveChild.firstChild.textContent : typeaheadActiveChild.textContent;
                  this.setState({
                    typeaheadInputValue: typeaheadActiveChildText
                  });
                }
              } else if (this.refCollection[0] && this.refCollection[0][0]) {
                this.setState({
                  typeaheadInputValue: this.refCollection[0][0].textContent
                });
              }
              if (typeaheadActiveChild) {
                typeaheadActiveChild.click();
              } else {
                this.refCollection[0][0].click();
              }
            }
          } else if (position === "tab") {
            if (onFavorite) {
              if (this.inputRef.current === document.activeElement) {
                if (this.props.footer && shiftKey) {
                  const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
                  if (tabbableItems.length > 0) {
                    if (tabbableItems[tabbableItems.length - 1]) {
                      tabbableItems[tabbableItems.length - 1].focus();
                    }
                  }
                } else {
                  this.switchFocusToFavoriteMenu();
                }
              } else {
                if (this.props.footer) {
                  let tabbedIntoMenu = false;
                  const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
                  if (tabbableItems.length > 0) {
                    const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
                    if (currentElementIndex === -1) {
                      if (shiftKey) {
                        this.inputRef.current.focus();
                      } else {
                        tabbableItems[0].focus();
                      }
                    } else {
                      if (shiftKey) {
                        if (currentElementIndex === 0) {
                          this.switchFocusToFavoriteMenu();
                          tabbedIntoMenu = true;
                        } else {
                          tabbableItems[currentElementIndex - 1].focus();
                        }
                      } else {
                        if (tabbableItems[currentElementIndex + 1]) {
                          tabbableItems[currentElementIndex + 1].focus();
                        } else {
                          this.inputRef.current.focus();
                        }
                      }
                    }
                  } else {
                    this.inputRef.current.focus();
                    tabbedIntoMenu = false;
                  }
                  this.setState({ tabbedIntoFavoritesMenu: tabbedIntoMenu });
                } else {
                  this.inputRef.current.focus();
                  this.setState({ tabbedIntoFavoritesMenu: false });
                }
              }
            } else {
              if (!this.props.footer) {
                this.onToggle(false, null);
                this.onClose();
              } else {
                const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
                const currentElementIndex = tabbableItems.findIndex((item) => item === document.activeElement);
                if (this.inputRef.current === document.activeElement) {
                  if (shiftKey) {
                    this.onToggle(false, null);
                    this.onClose();
                  } else {
                    if (tabbableItems[0]) {
                      tabbableItems[0].focus();
                    } else {
                      this.onToggle(false, null);
                      this.onClose();
                    }
                  }
                } else {
                  if (shiftKey) {
                    if (currentElementIndex === 0) {
                      this.inputRef.current.focus();
                    } else {
                      tabbableItems[currentElementIndex - 1].focus();
                    }
                  } else {
                    if (tabbableItems[currentElementIndex + 1]) {
                      tabbableItems[currentElementIndex + 1].focus();
                    } else {
                      this.onToggle(false, null);
                      this.inputRef.current.focus();
                      this.onClose();
                    }
                  }
                }
              }
            }
          } else if (!tabbedIntoFavoritesMenu) {
            if (this.refCollection[0][0] === null) {
              return;
            }
            let nextIndex;
            if (typeaheadCurrIndex === -1 && position === "down") {
              nextIndex = 0;
            } else if (typeaheadCurrIndex === -1 && position === "up") {
              nextIndex = this.refCollection.length - 1;
            } else if (position !== "left" && position !== "right") {
              nextIndex = getNextIndex(typeaheadCurrIndex, position, this.refCollection);
            } else {
              nextIndex = typeaheadCurrIndex;
            }
            if (this.refCollection[nextIndex] === null) {
              return;
            }
            this.moveFocus(nextIndex);
          } else {
            const nextIndex = this.refCollection.findIndex((ref) => ref !== void 0 && (ref[0] === document.activeElement || ref[1] === document.activeElement));
            this.moveFocus(nextIndex);
          }
        }
      };
      this.onClickTypeaheadToggleButton = () => {
        if (this.inputRef && this.inputRef.current) {
          this.inputRef.current.focus();
        }
      };
      this.getDisplay = (value, type = "node") => {
        if (!value) {
          return;
        }
        const item = this.props.isGrouped ? React48.Children.toArray(this.props.children).reduce((acc, curr) => [...acc, ...React48.Children.toArray(curr.props.children)], []).find((child) => child.props.value.toString() === value.toString()) : React48.Children.toArray(this.props.children).find((child) => child.props.value && child.props.value.toString() === value.toString());
        if (item) {
          if (item && item.props.children) {
            if (type === "node") {
              return item.props.children;
            }
            return this.findText(item);
          }
          return item.props.value.toString();
        }
        return value.toString();
      };
      this.findText = (item) => {
        if (typeof item === "string") {
          return item;
        } else if (!React48.isValidElement(item)) {
          return "";
        } else {
          const multi = [];
          React48.Children.toArray(item.props.children).forEach((child) => multi.push(this.findText(child)));
          return multi.join("");
        }
      };
      this.generateSelectedBadge = () => {
        const { customBadgeText, selections } = this.props;
        if (customBadgeText !== null) {
          return customBadgeText;
        }
        if (Array.isArray(selections) && selections.length > 0) {
          return selections.length;
        }
        return null;
      };
      this.setVieMoreNextIndex = () => {
        this.setState({ viewMoreNextIndex: this.refCollection.length - 1 });
      };
      this.isLastOptionBeforeFooter = (index) => this.props.footer && index === this.refCollection.length - 1 ? true : false;
    }
    extendTypeaheadChildren(typeaheadCurrIndex, favoritesGroup) {
      const { isGrouped, onFavorite, createText } = this.props;
      const typeaheadChildren = favoritesGroup ? favoritesGroup.concat(this.state.typeaheadFilteredChildren) : this.state.typeaheadFilteredChildren;
      const activeElement = this.optionContainerRefCollection[typeaheadCurrIndex];
      let typeaheadActiveChild = this.getTypeaheadActiveChild(typeaheadCurrIndex);
      if (typeaheadActiveChild && typeaheadActiveChild.classList.contains("pf-m-description")) {
        typeaheadActiveChild = typeaheadActiveChild.firstElementChild;
      }
      this.refCollection = [[]];
      this.optionContainerRefCollection = [];
      if (isGrouped) {
        return React48.Children.map(typeaheadChildren, (group) => {
          if (group.type === Divider) {
            return group;
          } else if (group.type === SelectGroup && onFavorite) {
            return React48.cloneElement(group, {
              titleId: group.props.label && group.props.label.replace(/\W/g, "-"),
              children: React48.Children.map(group.props.children, (child) => child.type === Divider ? child : React48.cloneElement(child, {
                isFocused: activeElement && (activeElement.id === child.props.id || this.props.isCreatable && typeaheadActiveChild.textContent === `${createText} "${group.props.value}"`)
              }))
            });
          } else if (group.type === SelectGroup) {
            return React48.cloneElement(group, {
              titleId: group.props.label && group.props.label.replace(/\W/g, "-"),
              children: React48.Children.map(group.props.children, (child) => child.type === Divider ? child : React48.cloneElement(child, {
                isFocused: typeaheadActiveChild && (typeaheadActiveChild.textContent === child.props.value.toString() || this.props.isCreatable && typeaheadActiveChild.textContent === `${createText} "${child.props.value}"`)
              }))
            });
          } else {
            return React48.cloneElement(group, {
              isFocused: typeaheadActiveChild && (typeaheadActiveChild.textContent === group.props.value.toString() || this.props.isCreatable && typeaheadActiveChild.textContent === `${createText} "${group.props.value}"`)
            });
          }
        });
      }
      return typeaheadChildren.map((child, index) => {
        const childElement = child;
        return childElement.type.displayName === "Divider" ? child : React48.cloneElement(child, {
          isFocused: typeaheadActiveChild ? typeaheadActiveChild.textContent === child.props.value.toString() || this.props.isCreatable && typeaheadActiveChild.textContent === `${createText} "${child.props.value}"` : index === typeaheadCurrIndex
          // fallback for view more + typeahead use cases, when the new expanded list is loaded and refCollection hasn't be updated yet
        });
      });
    }
    render() {
      const _a = this.props, {
        children,
        chipGroupProps,
        chipGroupComponent,
        className,
        customContent,
        variant,
        direction,
        onSelect,
        onClear,
        onBlur,
        toggleId,
        toggleRef,
        isOpen,
        isGrouped,
        isPlain,
        isDisabled,
        hasPlaceholderStyle,
        validated,
        selections: selectionsProp,
        typeAheadAriaLabel,
        typeAheadAriaDescribedby,
        clearSelectionsAriaLabel,
        toggleAriaLabel,
        removeSelectionAriaLabel,
        "aria-label": ariaLabel,
        "aria-labelledby": ariaLabelledBy,
        "aria-describedby": ariaDescribedby,
        "aria-invalid": ariaInvalid,
        placeholderText,
        width,
        maxHeight,
        toggleIcon,
        toggleIndicator,
        ouiaId,
        ouiaSafe,
        hasInlineFilter,
        isCheckboxSelectionBadgeHidden,
        inlineFilterPlaceholderText,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        onFilter,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        onTypeaheadInputChanged,
        onCreateOption,
        isCreatable,
        onToggle,
        createText,
        noResultsFoundText,
        customBadgeText,
        inputIdPrefix,
        inputAutoComplete,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        isInputValuePersisted,
        isInputFilterPersisted,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        menuAppendTo,
        favorites,
        onFavorite,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        favoritesLabel,
        footer,
        loadingVariant,
        isCreateSelectOptionObject,
        isCreateOptionOnTop,
        shouldResetOnSelect,
        isFlipEnabled,
        removeFindDomNode,
        zIndex
      } = _a, props = __rest(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "onBlur", "toggleId", "toggleRef", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "typeAheadAriaDescribedby", "clearSelectionsAriaLabel", "toggleAriaLabel", "removeSelectionAriaLabel", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "placeholderText", "width", "maxHeight", "toggleIcon", "toggleIndicator", "ouiaId", "ouiaSafe", "hasInlineFilter", "isCheckboxSelectionBadgeHidden", "inlineFilterPlaceholderText", "onFilter", "onTypeaheadInputChanged", "onCreateOption", "isCreatable", "onToggle", "createText", "noResultsFoundText", "customBadgeText", "inputIdPrefix", "inputAutoComplete", "isInputValuePersisted", "isInputFilterPersisted", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject", "isCreateOptionOnTop", "shouldResetOnSelect", "isFlipEnabled", "removeFindDomNode", "zIndex"]);
      const { focusFirstOption: openedOnEnter, typeaheadCurrIndex, typeaheadInputValue, typeaheadFilteredChildren, favoritesGroup } = this.state;
      const selectToggleId = toggleId || `pf-select-toggle-id-${currentId3++}`;
      const selections = Array.isArray(selectionsProp) ? selectionsProp : [selectionsProp];
      const selectedOption = React48.Children.toArray(children).find((option) => option.props.value === selections[0]);
      const isSelectedPlaceholder = selectedOption && selectedOption.props.isPlaceholder;
      const hasAnySelections = Boolean(selections[0] && selections[0] !== "");
      const typeaheadActiveChild = this.getTypeaheadActiveChild(typeaheadCurrIndex);
      let childPlaceholderText = null;
      let renderableItems = [];
      if (onFavorite) {
        let tempExtendedChildren = children;
        if (variant === "typeahead" || variant === "typeaheadmulti") {
          tempExtendedChildren = this.extendTypeaheadChildren(typeaheadCurrIndex, favoritesGroup);
        } else if (onFavorite) {
          tempExtendedChildren = favoritesGroup.concat(children);
        }
        renderableItems = extendItemsWithFavorite(tempExtendedChildren, isGrouped, favorites);
      } else {
        renderableItems = children;
      }
      if (!customContent) {
        if (!hasAnySelections && !placeholderText) {
          const childPlaceholder = React48.Children.toArray(children).filter((child) => child.props.isPlaceholder === true);
          childPlaceholderText = childPlaceholder[0] && this.getDisplay(childPlaceholder[0].props.value, "node") || children[0] && this.getDisplay(children[0].props.value, "node");
        }
      }
      if (isOpen) {
        if (renderableItems.find((item) => (item === null || item === void 0 ? void 0 : item.key) === "loading") === void 0) {
          if (loadingVariant === "spinner") {
            renderableItems.push(React48.createElement(
              SelectOption,
              { isLoading: true, key: "loading", value: "loading" },
              React48.createElement(Spinner, { size: "lg" })
            ));
          } else if (loadingVariant === null || loadingVariant === void 0 ? void 0 : loadingVariant.text) {
            renderableItems.push(React48.createElement(SelectOption, { isLoad: true, key: "loading", value: loadingVariant.text, setViewMoreNextIndex: this.setVieMoreNextIndex, onClick: loadingVariant === null || loadingVariant === void 0 ? void 0 : loadingVariant.onClick }));
          }
        }
      }
      const hasOnClear = onClear !== Select.defaultProps.onClear;
      const clearBtn = React48.createElement(
        "button",
        { className: css(import_button3.default.button, import_button3.default.modifiers.plain, import_select5.default.selectToggleClear), onClick: (e) => {
          this.clearSelection(e);
          onClear(e);
          e.stopPropagation();
        }, "aria-label": clearSelectionsAriaLabel, type: "button", disabled: isDisabled, ref: this.clearRef, onKeyDown: (event) => {
          if (event.key === KeyTypes.Enter) {
            this.clearRef.current.click();
          }
        } },
        React48.createElement(times_circle_icon_default, { "aria-hidden": true })
      );
      let selectedChips = null;
      if (variant === SelectVariant.typeaheadMulti) {
        selectedChips = chipGroupComponent ? chipGroupComponent : React48.createElement(ChipGroup, Object.assign({}, chipGroupProps), selections && selections.map((item) => React48.createElement(Chip, { key: item, onClick: (e) => onSelect(e, item), closeBtnAriaLabel: removeSelectionAriaLabel }, this.getDisplay(item, "node"))));
      }
      if (hasInlineFilter) {
        const filterBox = React48.createElement(
          React48.Fragment,
          null,
          React48.createElement(
            "div",
            { key: "inline-filter", className: css(import_select5.default.selectMenuSearch) },
            React48.createElement("input", { key: "inline-filter-input", type: "search", className: css(import_form_control2.default.formControl, import_form_control2.default.modifiers.search), onChange: this.onChange, placeholder: inlineFilterPlaceholderText, onKeyDown: (event) => {
              if (event.key === KeyTypes.ArrowUp) {
                this.handleMenuKeys(0, 0, "up");
                event.preventDefault();
              } else if (event.key === KeyTypes.ArrowDown) {
                this.handleMenuKeys(0, 0, "down");
                event.preventDefault();
              } else if (event.key === KeyTypes.ArrowLeft) {
                this.handleMenuKeys(0, 0, "left");
                event.preventDefault();
              } else if (event.key === KeyTypes.ArrowRight) {
                this.handleMenuKeys(0, 0, "right");
                event.preventDefault();
              } else if (event.key === KeyTypes.Tab && variant !== SelectVariant.checkbox && this.props.footer) {
                if (event.shiftKey) {
                  this.onToggle(false, event);
                } else {
                  const tabbableItems = findTabbableElements(this.footerRef, SelectFooterTabbableItems);
                  if (tabbableItems.length > 0) {
                    tabbableItems[0].focus();
                    event.stopPropagation();
                    event.preventDefault();
                  } else {
                    this.onToggle(false, event);
                  }
                }
              } else if (event.key === KeyTypes.Tab && variant === SelectVariant.checkbox) {
                if (event.shiftKey) {
                  this.handleMenuKeys(0, 0, "up");
                } else {
                  this.handleMenuKeys(0, 0, "down");
                }
                event.stopPropagation();
                event.preventDefault();
              }
            }, ref: this.filterRef, autoComplete: inputAutoComplete })
          ),
          React48.createElement(Divider, { key: "inline-filter-divider" })
        );
        renderableItems = [filterBox, ...typeaheadFilteredChildren].map((option, index) => React48.cloneElement(option, { key: index }));
      }
      let variantProps;
      let variantChildren;
      if (customContent) {
        variantProps = {
          selected: selections,
          openedOnEnter,
          isCustomContent: true
        };
        variantChildren = customContent;
      } else {
        switch (variant) {
          case "single":
            variantProps = {
              selected: selections[0],
              hasInlineFilter,
              openedOnEnter
            };
            variantChildren = renderableItems;
            break;
          case "checkbox":
            variantProps = {
              checked: selections,
              isGrouped,
              hasInlineFilter,
              openedOnEnter
            };
            variantChildren = renderableItems;
            break;
          case "typeahead":
            variantProps = {
              selected: selections[0],
              openedOnEnter
            };
            variantChildren = onFavorite ? renderableItems : this.extendTypeaheadChildren(typeaheadCurrIndex);
            if (variantChildren.length === 0) {
              variantChildren.push(React48.createElement(SelectOption, { isDisabled: true, key: 0, value: noResultsFoundText, isNoResultsOption: true }));
            }
            break;
          case "typeaheadmulti":
            variantProps = {
              selected: selections,
              openedOnEnter
            };
            variantChildren = onFavorite ? renderableItems : this.extendTypeaheadChildren(typeaheadCurrIndex);
            if (variantChildren.length === 0) {
              variantChildren.push(React48.createElement(SelectOption, { isDisabled: true, key: 0, value: noResultsFoundText, isNoResultsOption: true }));
            }
            break;
        }
      }
      const isStatic = isFlipEnabled && menuAppendTo !== "inline";
      const innerMenu = React48.createElement(SelectMenu, Object.assign({ className: css(isStatic && import_select5.default.modifiers.static) }, props, { isGrouped, selected: selections }, variantProps, { openedOnEnter, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, sendRef: this.sendRef, keyHandler: this.handleMenuKeys, maxHeight, ref: this.menuComponentRef, footer, footerRef: this.footerRef, isLastOptionBeforeFooter: this.isLastOptionBeforeFooter }), variantChildren);
      const menuContainer = footer ? React48.createElement(
        "div",
        { className: css(import_select5.default.selectMenu) },
        " ",
        innerMenu,
        " "
      ) : innerMenu;
      const popperContainer = React48.createElement("div", Object.assign({ className: css(import_select5.default.select, isOpen && import_select5.default.modifiers.expanded, validated === ValidatedOptions.success && import_select5.default.modifiers.success, validated === ValidatedOptions.warning && import_select5.default.modifiers.warning, validated === ValidatedOptions.error && import_select5.default.modifiers.invalid, direction === SelectDirection.up && import_select5.default.modifiers.top, className) }, width && { style: { width } }, validated !== ValidatedOptions.default && { "aria-invalid": ariaInvalid }), isOpen && menuContainer);
      const mainContainer = React48.createElement(
        "div",
        Object.assign({ className: css(import_select5.default.select, isOpen && import_select5.default.modifiers.expanded, validated === ValidatedOptions.success && import_select5.default.modifiers.success, validated === ValidatedOptions.warning && import_select5.default.modifiers.warning, validated === ValidatedOptions.error && import_select5.default.modifiers.invalid, direction === SelectDirection.up && import_select5.default.modifiers.top, className), ref: this.parentRef }, getOUIAProps(Select.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), width && { style: { width } }, validated !== ValidatedOptions.default && { "aria-invalid": ariaInvalid }),
        React48.createElement(
          SelectToggle,
          Object.assign({ id: selectToggleId, parentRef: this.parentRef, menuRef: this.menuComponentRef, ref: toggleRef }, footer && { footerRef: this.footerRef }, { isOpen, isPlain, hasPlaceholderStyle: hasPlaceholderStyle && (!selections.length || selections[0] === null || isSelectedPlaceholder), onToggle: this.onToggle, onEnter: this.onEnter, onClose: this.onClose, onBlur, variant, toggleIndicator, "aria-labelledby": `${ariaLabelledBy || ""} ${selectToggleId}`, "aria-label": toggleAriaLabel }, ariaDescribedby && { "aria-describedby": ariaDescribedby }, { handleTypeaheadKeys: this.handleTypeaheadKeys, moveFocusToLastMenuItem: this.moveFocusToLastMenuItem, isDisabled, hasClearButton: hasOnClear, hasFooter: footer !== void 0, onClickTypeaheadToggleButton: this.onClickTypeaheadToggleButton }),
          customContent && React48.createElement(
            "div",
            { className: css(import_select5.default.selectToggleWrapper) },
            toggleIcon && React48.createElement("span", { className: css(import_select5.default.selectToggleIcon) }, toggleIcon),
            React48.createElement("span", { className: css(import_select5.default.selectToggleText) }, placeholderText)
          ),
          variant === SelectVariant.single && !customContent && React48.createElement(
            React48.Fragment,
            null,
            React48.createElement(
              "div",
              { className: css(import_select5.default.selectToggleWrapper) },
              toggleIcon && React48.createElement("span", { className: css(import_select5.default.selectToggleIcon) }, toggleIcon),
              React48.createElement("span", { className: css(import_select5.default.selectToggleText) }, this.getDisplay(selections[0], "node") || placeholderText || childPlaceholderText)
            ),
            hasOnClear && hasAnySelections && clearBtn
          ),
          variant === SelectVariant.checkbox && !customContent && React48.createElement(
            React48.Fragment,
            null,
            React48.createElement(
              "div",
              { className: css(import_select5.default.selectToggleWrapper) },
              toggleIcon && React48.createElement("span", { className: css(import_select5.default.selectToggleIcon) }, toggleIcon),
              React48.createElement("span", { className: css(import_select5.default.selectToggleText) }, placeholderText),
              !isCheckboxSelectionBadgeHidden && hasAnySelections && React48.createElement(
                "div",
                { className: css(import_select5.default.selectToggleBadge) },
                React48.createElement("span", { className: css(import_badge2.default.badge, import_badge2.default.modifiers.read) }, this.generateSelectedBadge())
              )
            ),
            hasOnClear && hasAnySelections && clearBtn
          ),
          variant === SelectVariant.typeahead && !customContent && React48.createElement(
            React48.Fragment,
            null,
            React48.createElement(
              "div",
              { className: css(import_select5.default.selectToggleWrapper) },
              toggleIcon && React48.createElement("span", { className: css(import_select5.default.selectToggleIcon) }, toggleIcon),
              React48.createElement("input", Object.assign({ className: css(import_form_control2.default.formControl, import_select5.default.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-typeahead`, "aria-label": typeAheadAriaLabel }, typeAheadAriaDescribedby && { "aria-describedby": typeAheadAriaDescribedby }, { placeholder: placeholderText, value: typeaheadInputValue !== null ? typeaheadInputValue : this.getDisplay(selections[0], "text") || "", type: "text", onClick: this.onClick, onChange: this.onChange, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef }))
            ),
            hasOnClear && (selections[0] || typeaheadInputValue) && clearBtn
          ),
          variant === SelectVariant.typeaheadMulti && !customContent && React48.createElement(
            React48.Fragment,
            null,
            React48.createElement(
              "div",
              { className: css(import_select5.default.selectToggleWrapper) },
              toggleIcon && React48.createElement("span", { className: css(import_select5.default.selectToggleIcon) }, toggleIcon),
              selections && Array.isArray(selections) && selections.length > 0 && selectedChips,
              React48.createElement("input", Object.assign({ className: css(import_form_control2.default.formControl, import_select5.default.selectToggleTypeahead), "aria-activedescendant": typeaheadActiveChild && typeaheadActiveChild.id, id: `${selectToggleId}-select-multi-typeahead-typeahead`, "aria-label": typeAheadAriaLabel, "aria-invalid": validated === ValidatedOptions.error }, typeAheadAriaDescribedby && { "aria-describedby": typeAheadAriaDescribedby }, { placeholder: placeholderText, value: typeaheadInputValue !== null ? typeaheadInputValue : "", type: "text", onChange: this.onChange, onClick: this.onClick, autoComplete: inputAutoComplete, disabled: isDisabled, ref: this.inputRef }))
            ),
            hasOnClear && (selections && selections.length > 0 || typeaheadInputValue) && clearBtn
          ),
          validated === ValidatedOptions.success && React48.createElement(
            "span",
            { className: css(import_select5.default.selectToggleStatusIcon) },
            React48.createElement(check_circle_icon_default, { "aria-hidden": "true" })
          ),
          validated === ValidatedOptions.error && React48.createElement(
            "span",
            { className: css(import_select5.default.selectToggleStatusIcon) },
            React48.createElement(exclamation_circle_icon_default, { "aria-hidden": "true" })
          ),
          validated === ValidatedOptions.warning && React48.createElement(
            "span",
            { className: css(import_select5.default.selectToggleStatusIcon) },
            React48.createElement(exclamation_triangle_icon_default, { "aria-hidden": "true" })
          )
        ),
        isOpen && menuAppendTo === "inline" && menuContainer
      );
      const getParentElement = () => {
        if (this.parentRef && this.parentRef.current) {
          return this.parentRef.current.parentElement;
        }
        return null;
      };
      return React48.createElement(GenerateId, null, (randomId) => React48.createElement(SelectContext.Provider, { value: {
        onSelect,
        onFavorite,
        onClose: this.onClose,
        variant,
        inputIdPrefix: inputIdPrefix || randomId,
        shouldResetOnSelect
      } }, menuAppendTo === "inline" ? mainContainer : React48.createElement(Popper, { trigger: mainContainer, popper: popperContainer, direction, appendTo: menuAppendTo === "parent" ? getParentElement() : menuAppendTo, isVisible: isOpen, removeFindDomNode, zIndex })));
    }
  };
  Select.displayName = "Select";
  Select.defaultProps = {
    children: [],
    className: "",
    position: SelectPosition.left,
    direction: SelectDirection.down,
    toggleId: null,
    isOpen: false,
    isGrouped: false,
    isPlain: false,
    isDisabled: false,
    hasPlaceholderStyle: false,
    isCreatable: false,
    isCreateOptionOnTop: false,
    validated: "default",
    "aria-label": "",
    "aria-labelledby": "",
    "aria-describedby": "",
    "aria-invalid": false,
    typeAheadAriaLabel: "",
    typeAheadAriaDescribedby: "",
    clearSelectionsAriaLabel: "Clear all",
    toggleAriaLabel: "Options menu",
    removeSelectionAriaLabel: "Remove",
    selections: [],
    createText: "Create",
    placeholderText: "",
    noResultsFoundText: "No results found",
    variant: SelectVariant.single,
    width: "",
    onClear: () => void 0,
    onCreateOption: () => void 0,
    toggleIcon: null,
    toggleIndicator: null,
    onFilter: null,
    onTypeaheadInputChanged: null,
    customContent: null,
    hasInlineFilter: false,
    inlineFilterPlaceholderText: null,
    customBadgeText: null,
    inputIdPrefix: "",
    inputAutoComplete: "off",
    menuAppendTo: "inline",
    favorites: [],
    favoritesLabel: "Favorites",
    ouiaSafe: true,
    chipGroupComponent: null,
    isInputValuePersisted: false,
    isInputFilterPersisted: false,
    isCreateSelectOptionObject: false,
    shouldResetOnSelect: true,
    isFlipEnabled: true,
    removeFindDomNode: false,
    zIndex: 9999
  };

  // node_modules/@patternfly/react-core/dist/esm/components/InputGroup/InputGroup.js
  init_tslib_es6();
  var React52 = __toESM(require_react());
  var import_input_group = __toESM(require_input_group());

  // node_modules/@patternfly/react-core/dist/esm/components/FormSelect/FormSelect.js
  init_tslib_es6();
  var React49 = __toESM(require_react());
  var import_form_control3 = __toESM(require_form_control());
  var FormSelect = class extends React49.Component {
    constructor(props) {
      super(props);
      this.handleChange = (event) => {
        this.props.onChange(event.currentTarget.value, event);
      };
      if (!props.id && !props["aria-label"]) {
        console.error("FormSelect requires either an id or aria-label to be specified");
      }
      this.state = {
        ouiaStateId: getDefaultOUIAId(FormSelect.displayName, props.validated)
      };
    }
    render() {
      const _a = this.props, { children, className, value, validated, isDisabled, isRequired, isIconSprite, ouiaId, ouiaSafe } = _a, props = __rest(_a, ["children", "className", "value", "validated", "isDisabled", "isRequired", "isIconSprite", "ouiaId", "ouiaSafe"]);
      const selectedOption = React49.Children.toArray(children).find((option) => option.props.value === value);
      const isSelectedPlaceholder = selectedOption && selectedOption.props.isPlaceholder;
      return React49.createElement("select", Object.assign({}, props, { className: css(import_form_control3.default.formControl, isIconSprite && import_form_control3.default.modifiers.iconSprite, className, validated === ValidatedOptions.success && import_form_control3.default.modifiers.success, validated === ValidatedOptions.warning && import_form_control3.default.modifiers.warning, isSelectedPlaceholder && import_form_control3.default.modifiers.placeholder), "aria-invalid": validated === ValidatedOptions.error }, getOUIAProps(FormSelect.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), { onChange: this.handleChange, disabled: isDisabled, required: isRequired, value }), children);
    }
  };
  FormSelect.displayName = "FormSelect";
  FormSelect.defaultProps = {
    className: "",
    value: "",
    validated: "default",
    isDisabled: false,
    isRequired: false,
    isIconSprite: false,
    onBlur: () => void 0,
    onFocus: () => void 0,
    onChange: () => void 0,
    ouiaSafe: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/FormSelect/FormSelectOption.js
  init_tslib_es6();
  var React50 = __toESM(require_react());
  var FormSelectOption = (_a) => {
    var {
      className = "",
      value = "",
      isDisabled = false,
      label,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      isPlaceholder = false
    } = _a, props = __rest(_a, ["className", "value", "isDisabled", "label", "isPlaceholder"]);
    return React50.createElement("option", Object.assign({}, props, { className, value, disabled: isDisabled }), label);
  };
  FormSelectOption.displayName = "FormSelectOption";

  // node_modules/@patternfly/react-core/dist/esm/components/TextArea/TextArea.js
  init_tslib_es6();
  var React51 = __toESM(require_react());
  var import_form_control4 = __toESM(require_form_control());

  // node_modules/@patternfly/react-tokens/dist/esm/c_form_control_textarea_Height.js
  var c_form_control_textarea_Height = {
    "name": "--pf-c-form-control--textarea--Height",
    "value": "auto",
    "var": "var(--pf-c-form-control--textarea--Height)"
  };
  var c_form_control_textarea_Height_default = c_form_control_textarea_Height;

  // node_modules/@patternfly/react-core/dist/esm/components/TextArea/TextArea.js
  var TextAreResizeOrientation;
  (function(TextAreResizeOrientation2) {
    TextAreResizeOrientation2["horizontal"] = "horizontal";
    TextAreResizeOrientation2["vertical"] = "vertical";
    TextAreResizeOrientation2["both"] = "both";
  })(TextAreResizeOrientation || (TextAreResizeOrientation = {}));
  var TextAreaReadOnlyVariant;
  (function(TextAreaReadOnlyVariant2) {
    TextAreaReadOnlyVariant2["default"] = "default";
    TextAreaReadOnlyVariant2["plain"] = "plain";
  })(TextAreaReadOnlyVariant || (TextAreaReadOnlyVariant = {}));
  var TextAreaBase = class extends React51.Component {
    constructor(props) {
      super(props);
      this.inputRef = React51.createRef();
      this.setAutoHeight = (field) => {
        field.style.setProperty(c_form_control_textarea_Height_default.name, "inherit");
        const computed = window.getComputedStyle(field);
        const height = parseInt(computed.getPropertyValue("border-top-width")) + parseInt(computed.getPropertyValue("padding-top")) + field.scrollHeight + parseInt(computed.getPropertyValue("padding-bottom")) + parseInt(computed.getPropertyValue("border-bottom-width"));
        field.style.setProperty(c_form_control_textarea_Height_default.name, `${height}px`);
      };
      this.handleChange = (event) => {
        const field = event.currentTarget;
        if (this.props.autoResize && canUseDOM) {
          this.setAutoHeight(field);
        }
        if (this.props.onChange) {
          this.props.onChange(field.value, event);
        }
      };
      if (!props.id && !props["aria-label"]) {
        console.error("TextArea: TextArea requires either an id or aria-label to be specified");
      }
    }
    componentDidMount() {
      const inputRef = this.props.innerRef || this.inputRef;
      if (this.props.autoResize && canUseDOM) {
        const field = inputRef.current;
        this.setAutoHeight(field);
      }
    }
    render() {
      const _a = this.props, {
        className,
        value,
        validated,
        isRequired,
        isDisabled,
        isIconSprite,
        isReadOnly,
        readOnlyVariant,
        resizeOrientation,
        innerRef,
        disabled,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        autoResize,
        onChange
      } = _a, props = __rest(_a, ["className", "value", "validated", "isRequired", "isDisabled", "isIconSprite", "isReadOnly", "readOnlyVariant", "resizeOrientation", "innerRef", "disabled", "autoResize", "onChange"]);
      const orientation = `resize${capitalize(resizeOrientation)}`;
      return React51.createElement("textarea", Object.assign({ className: css(import_form_control4.default.formControl, isIconSprite && import_form_control4.default.modifiers.iconSprite, readOnlyVariant === "plain" && import_form_control4.default.modifiers.plain, className, resizeOrientation !== TextAreResizeOrientation.both && import_form_control4.default.modifiers[orientation], validated === ValidatedOptions.success && import_form_control4.default.modifiers.success, validated === ValidatedOptions.warning && import_form_control4.default.modifiers.warning), onChange: this.handleChange }, typeof this.props.defaultValue !== "string" && { value }, { "aria-invalid": validated === ValidatedOptions.error, required: isRequired, disabled: isDisabled || disabled, readOnly: !!readOnlyVariant || isReadOnly, ref: innerRef || this.inputRef }, props));
    }
  };
  TextAreaBase.displayName = "TextArea";
  TextAreaBase.defaultProps = {
    innerRef: React51.createRef(),
    className: "",
    isRequired: false,
    isDisabled: false,
    isIconSprite: false,
    validated: "default",
    resizeOrientation: "both",
    "aria-label": null
  };
  var TextArea = React51.forwardRef((props, ref) => React51.createElement(TextAreaBase, Object.assign({}, props, { innerRef: ref })));
  TextArea.displayName = "TextArea";

  // node_modules/@patternfly/react-core/dist/esm/components/InputGroup/InputGroup.js
  var InputGroup = (_a) => {
    var { className = "", children, innerRef } = _a, props = __rest(_a, ["className", "children", "innerRef"]);
    const formCtrls = [FormSelect, TextArea, TextInput].map((comp) => comp.displayName);
    const idItem = React52.Children.toArray(children).find((child) => !formCtrls.includes(child.type.displayName) && child.props.id);
    const ref = React52.useRef(null);
    const inputGroupRef = innerRef || ref;
    return React52.createElement("div", Object.assign({ ref: inputGroupRef, className: css(import_input_group.default.inputGroup, className) }, props), idItem ? React52.Children.map(children, (child) => !formCtrls.includes(child.type.displayName) || child.props["aria-describedby"] ? child : React52.cloneElement(child, {
      "aria-describedby": child.props["aria-describedby"] === "" ? void 0 : idItem.props.id
    })) : children);
  };
  InputGroup.displayName = "InputGroup";

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-left-icon.js
  var AngleLeftIconConfig = {
    name: "AngleLeftIcon",
    height: 512,
    width: 256,
    svgPath: "M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleLeftIcon = createIcon(AngleLeftIconConfig);
  var angle_left_icon_default = AngleLeftIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Card/Card.js
  init_tslib_es6();
  var React53 = __toESM(require_react());
  var import_card = __toESM(require_card());
  var CardContext = React53.createContext({
    cardId: "",
    registerTitleId: () => {
    },
    isExpanded: false
  });
  var Card = (_a) => {
    var { children = null, id = "", className = "", component = "article", isHoverable = false, isCompact = false, isSelectable = false, isSelectableRaised = false, isSelected = false, isDisabledRaised = false, isFlat = false, isExpanded = false, isRounded = false, isLarge = false, isFullHeight = false, isPlain = false, ouiaId, ouiaSafe = true, hasSelectableInput = false, selectableInputAriaLabel, onSelectableInputChange = () => {
    } } = _a, props = __rest(_a, ["children", "id", "className", "component", "isHoverable", "isCompact", "isSelectable", "isSelectableRaised", "isSelected", "isDisabledRaised", "isFlat", "isExpanded", "isRounded", "isLarge", "isFullHeight", "isPlain", "ouiaId", "ouiaSafe", "hasSelectableInput", "selectableInputAriaLabel", "onSelectableInputChange"]);
    const Component50 = component;
    const ouiaProps = useOUIAProps(Card.displayName, ouiaId, ouiaSafe);
    const [titleId, setTitleId] = React53.useState("");
    const [ariaProps, setAriaProps] = React53.useState();
    if (isCompact && isLarge) {
      console.warn("Card: Cannot use isCompact with isLarge. Defaulting to isCompact");
      isLarge = false;
    }
    const getSelectableModifiers = () => {
      if (isDisabledRaised) {
        return css(import_card.default.modifiers.nonSelectableRaised);
      }
      if (isSelectableRaised) {
        return css(import_card.default.modifiers.selectableRaised, isSelected && import_card.default.modifiers.selectedRaised);
      }
      if (isSelectable || isHoverable) {
        return css(import_card.default.modifiers.selectable, isSelected && import_card.default.modifiers.selected);
      }
      return "";
    };
    const containsCardTitleChildRef = React53.useRef(false);
    const registerTitleId = (id2) => {
      setTitleId(id2);
      containsCardTitleChildRef.current = !!id2;
    };
    React53.useEffect(() => {
      if (selectableInputAriaLabel) {
        setAriaProps({ "aria-label": selectableInputAriaLabel });
      } else if (titleId) {
        setAriaProps({ "aria-labelledby": titleId });
      } else if (hasSelectableInput && !containsCardTitleChildRef.current) {
        setAriaProps({});
        console.warn("If no CardTitle component is passed as a child of Card the selectableInputAriaLabel prop must be passed");
      }
    }, [hasSelectableInput, selectableInputAriaLabel, titleId]);
    return React53.createElement(
      CardContext.Provider,
      { value: {
        cardId: id,
        registerTitleId,
        isExpanded
      } },
      hasSelectableInput && React53.createElement("input", Object.assign({ className: "pf-screen-reader", id: `${id}-input` }, ariaProps, { type: "checkbox", checked: isSelected, onChange: (event) => onSelectableInputChange(id, event), disabled: isDisabledRaised, tabIndex: -1 })),
      React53.createElement(Component50, Object.assign({ id, className: css(import_card.default.card, isCompact && import_card.default.modifiers.compact, isExpanded && import_card.default.modifiers.expanded, isFlat && import_card.default.modifiers.flat, isRounded && import_card.default.modifiers.rounded, isLarge && import_card.default.modifiers.displayLg, isFullHeight && import_card.default.modifiers.fullHeight, isPlain && import_card.default.modifiers.plain, getSelectableModifiers(), className), tabIndex: isSelectable || isSelectableRaised ? "0" : void 0 }, props, ouiaProps), children)
    );
  };
  Card.displayName = "Card";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardActions.js
  init_tslib_es6();
  var React54 = __toESM(require_react());
  var import_card2 = __toESM(require_card());
  var CardActions = (_a) => {
    var { children = null, className = "", hasNoOffset = false } = _a, props = __rest(_a, ["children", "className", "hasNoOffset"]);
    return React54.createElement("div", Object.assign({ className: css(import_card2.default.cardActions, hasNoOffset && import_card2.default.modifiers.noOffset, className) }, props), children);
  };
  CardActions.displayName = "CardActions";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardBody.js
  init_tslib_es6();
  var React55 = __toESM(require_react());
  var import_card3 = __toESM(require_card());
  var CardBody = (_a) => {
    var { children = null, className = "", component = "div", isFilled = true } = _a, props = __rest(_a, ["children", "className", "component", "isFilled"]);
    const Component50 = component;
    return React55.createElement(Component50, Object.assign({ className: css(import_card3.default.cardBody, !isFilled && import_card3.default.modifiers.noFill, className) }, props), children);
  };
  CardBody.displayName = "CardBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardFooter.js
  init_tslib_es6();
  var React56 = __toESM(require_react());
  var import_card4 = __toESM(require_card());
  var CardFooter = (_a) => {
    var { children = null, className = "", component = "div" } = _a, props = __rest(_a, ["children", "className", "component"]);
    const Component50 = component;
    return React56.createElement(Component50, Object.assign({ className: css(import_card4.default.cardFooter, className) }, props), children);
  };
  CardFooter.displayName = "CardFooter";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardTitle.js
  init_tslib_es6();
  var React57 = __toESM(require_react());
  var import_card5 = __toESM(require_card());
  var CardTitle = (_a) => {
    var { children = null, className = "", component = "div" } = _a, props = __rest(_a, ["children", "className", "component"]);
    const { cardId, registerTitleId } = React57.useContext(CardContext);
    const Component50 = component;
    const titleId = cardId ? `${cardId}-title` : "";
    React57.useEffect(() => {
      registerTitleId(titleId);
      return () => registerTitleId("");
    }, [registerTitleId, titleId]);
    return React57.createElement(Component50, Object.assign({ className: css(import_card5.default.cardTitle, className), id: titleId || void 0 }, props), children);
  };
  CardTitle.displayName = "CardTitle";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardHeader.js
  init_tslib_es6();
  var React58 = __toESM(require_react());
  var import_card6 = __toESM(require_card());
  var CardHeader = (_a) => {
    var { children = null, className = "", id, onExpand, toggleButtonProps, isToggleRightAligned } = _a, props = __rest(_a, ["children", "className", "id", "onExpand", "toggleButtonProps", "isToggleRightAligned"]);
    return React58.createElement(CardContext.Consumer, null, ({ cardId }) => {
      const cardHeaderToggle = React58.createElement(
        "div",
        { className: css(import_card6.default.cardHeaderToggle) },
        React58.createElement(
          Button,
          Object.assign({ variant: "plain", type: "button", onClick: (evt) => {
            onExpand(evt, cardId);
          } }, toggleButtonProps),
          React58.createElement(
            "span",
            { className: css(import_card6.default.cardHeaderToggleIcon) },
            React58.createElement(angle_right_icon_default, { "aria-hidden": "true" })
          )
        )
      );
      return React58.createElement(
        "div",
        Object.assign({ className: css(import_card6.default.cardHeader, isToggleRightAligned && import_card6.default.modifiers.toggleRight, className), id }, props),
        onExpand && !isToggleRightAligned && cardHeaderToggle,
        children,
        onExpand && isToggleRightAligned && cardHeaderToggle
      );
    });
  };
  CardHeader.displayName = "CardHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardHeaderMain.js
  init_tslib_es6();
  var React59 = __toESM(require_react());
  var CardHeaderMain = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React59.createElement("div", Object.assign({ className }, props), children);
  };
  CardHeaderMain.displayName = "CardHeaderMain";

  // node_modules/@patternfly/react-core/dist/esm/components/Checkbox/Checkbox.js
  init_tslib_es6();
  var React60 = __toESM(require_react());
  var import_check2 = __toESM(require_check());
  var defaultOnChange = () => {
  };
  var Checkbox = class extends React60.Component {
    constructor(props) {
      super(props);
      this.handleChange = (event) => {
        this.props.onChange(event.currentTarget.checked, event);
      };
      this.state = {
        ouiaStateId: getDefaultOUIAId(Checkbox.displayName)
      };
    }
    render() {
      const _a = this.props, { "aria-label": ariaLabel, className, onChange, isValid, isDisabled, isRequired, isChecked, label, checked, defaultChecked, description, body, ouiaId, ouiaSafe, component: Component50 } = _a, props = __rest(_a, ["aria-label", "className", "onChange", "isValid", "isDisabled", "isRequired", "isChecked", "label", "checked", "defaultChecked", "description", "body", "ouiaId", "ouiaSafe", "component"]);
      if (!props.id) {
        console.error("Checkbox:", "id is required to make input accessible");
      }
      const checkedProps = {};
      if ([true, false].includes(checked) || isChecked === true) {
        checkedProps.checked = checked || isChecked;
      }
      if (onChange !== defaultOnChange) {
        checkedProps.checked = isChecked;
      }
      if ([false, true].includes(defaultChecked)) {
        checkedProps.defaultChecked = defaultChecked;
      }
      checkedProps.checked = checkedProps.checked === null ? false : checkedProps.checked;
      return React60.createElement(
        Component50,
        { className: css(import_check2.default.check, !label && import_check2.default.modifiers.standalone, className) },
        React60.createElement("input", Object.assign({}, props, { className: css(import_check2.default.checkInput), type: "checkbox", onChange: this.handleChange, "aria-invalid": !isValid, "aria-label": ariaLabel, disabled: isDisabled, required: isRequired, ref: (elem) => elem && (elem.indeterminate = isChecked === null) }, checkedProps, getOUIAProps(Checkbox.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe))),
        label && React60.createElement(
          "label",
          { className: css(import_check2.default.checkLabel, isDisabled && import_check2.default.modifiers.disabled), htmlFor: props.id },
          label,
          isRequired && React60.createElement("span", { className: css(import_check2.default.checkLabelRequired), "aria-hidden": "true" }, ASTERISK)
        ),
        description && React60.createElement("span", { className: css(import_check2.default.checkDescription) }, description),
        body && React60.createElement("span", { className: css(import_check2.default.checkBody) }, body)
      );
    }
  };
  Checkbox.displayName = "Checkbox";
  Checkbox.defaultProps = {
    className: "",
    isValid: true,
    isDisabled: false,
    isRequired: false,
    isChecked: false,
    onChange: defaultOnChange,
    ouiaSafe: true,
    component: "div"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopy.js
  init_tslib_es6();
  var React74 = __toESM(require_react());
  var import_clipboard_copy2 = __toESM(require_clipboard_copy());

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/Popover.js
  init_tslib_es6();
  var React70 = __toESM(require_react());
  var import_popover8 = __toESM(require_popover());

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverContext.js
  var React61 = __toESM(require_react());
  var PopoverContext = React61.createContext({});

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverContent.js
  init_tslib_es6();
  var React62 = __toESM(require_react());
  var import_popover = __toESM(require_popover());
  var PopoverContent = (_a) => {
    var { className = null, children } = _a, props = __rest(_a, ["className", "children"]);
    return React62.createElement("div", Object.assign({ className: css(import_popover.default.popoverContent, className) }, props), children);
  };
  PopoverContent.displayName = "PopoverContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverBody.js
  init_tslib_es6();
  var React63 = __toESM(require_react());
  var import_popover2 = __toESM(require_popover());
  var PopoverBody = (_a) => {
    var { children, id, className } = _a, props = __rest(_a, ["children", "id", "className"]);
    return React63.createElement("div", Object.assign({ className: css(import_popover2.default.popoverBody, className), id }, props), children);
  };
  PopoverBody.displayName = "PopoverBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeader.js
  init_tslib_es6();
  var React66 = __toESM(require_react());
  var import_popover5 = __toESM(require_popover());

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeaderIcon.js
  init_tslib_es6();
  var React64 = __toESM(require_react());
  var import_popover3 = __toESM(require_popover());
  var PopoverHeaderIcon = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React64.createElement("span", Object.assign({ className: css(import_popover3.default.popoverTitleIcon, className) }, props), children);
  };
  PopoverHeaderIcon.displayName = "PopoverHeaderIcon";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeaderText.js
  init_tslib_es6();
  var React65 = __toESM(require_react());
  var import_popover4 = __toESM(require_popover());
  var PopoverHeaderText = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React65.createElement("span", Object.assign({ className: css(import_popover4.default.popoverTitleText, className) }, props), children);
  };
  PopoverHeaderText.displayName = "PopoverHeaderText";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeader.js
  var PopoverHeader = (_a) => {
    var { children, icon: icon2, className, titleHeadingLevel = "h6", alertSeverityVariant, id, alertSeverityScreenReaderText } = _a, props = __rest(_a, ["children", "icon", "className", "titleHeadingLevel", "alertSeverityVariant", "id", "alertSeverityScreenReaderText"]);
    const HeadingLevel = titleHeadingLevel;
    return icon2 || alertSeverityVariant ? React66.createElement(
      "header",
      Object.assign({ className: css("pf-c-popover__header", className), id }, props),
      React66.createElement(
        HeadingLevel,
        { className: css(import_popover5.default.popoverTitle, icon2 && import_popover5.default.modifiers.icon) },
        icon2 && React66.createElement(PopoverHeaderIcon, null, icon2),
        alertSeverityVariant && alertSeverityScreenReaderText && React66.createElement("span", { className: "pf-u-screen-reader" }, alertSeverityScreenReaderText),
        React66.createElement(PopoverHeaderText, null, children)
      )
    ) : React66.createElement(Title, Object.assign({ headingLevel: titleHeadingLevel, size: TitleSizes.md, id, className }, props), children);
  };
  PopoverHeader.displayName = "PopoverHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverFooter.js
  init_tslib_es6();
  var React67 = __toESM(require_react());
  var import_popover6 = __toESM(require_popover());
  var PopoverFooter = (_a) => {
    var { children, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React67.createElement("footer", Object.assign({ className: css(import_popover6.default.popoverFooter, className) }, props), children);
  };
  PopoverFooter.displayName = "PopoverFooter";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverCloseButton.js
  init_tslib_es6();
  var React68 = __toESM(require_react());
  var PopoverCloseButton = (_a) => {
    var { onClose = () => void 0 } = _a, props = __rest(_a, ["onClose"]);
    return React68.createElement(
      Button,
      Object.assign({ onClick: onClose, variant: "plain", "aria-label": true }, props, { style: { pointerEvents: "auto" } }),
      React68.createElement(times_icon_default, null)
    );
  };
  PopoverCloseButton.displayName = "PopoverCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverArrow.js
  init_tslib_es6();
  var React69 = __toESM(require_react());
  var import_popover7 = __toESM(require_popover());
  var PopoverArrow = (_a) => {
    var { className = "" } = _a, props = __rest(_a, ["className"]);
    return React69.createElement("div", Object.assign({ className: css(import_popover7.default.popoverArrow, className) }, props));
  };
  PopoverArrow.displayName = "PopoverArrow";

  // node_modules/@patternfly/react-tokens/dist/esm/c_popover_MaxWidth.js
  var c_popover_MaxWidth = {
    "name": "--pf-c-popover--MaxWidth",
    "value": "none",
    "var": "var(--pf-c-popover--MaxWidth)"
  };
  var c_popover_MaxWidth_default = c_popover_MaxWidth;

  // node_modules/@patternfly/react-tokens/dist/esm/c_popover_MinWidth.js
  var c_popover_MinWidth = {
    "name": "--pf-c-popover--MinWidth",
    "value": "auto",
    "var": "var(--pf-c-popover--MinWidth)"
  };
  var c_popover_MinWidth_default = c_popover_MinWidth;

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/Popover.js
  var PopoverPosition;
  (function(PopoverPosition2) {
    PopoverPosition2["auto"] = "auto";
    PopoverPosition2["top"] = "top";
    PopoverPosition2["bottom"] = "bottom";
    PopoverPosition2["left"] = "left";
    PopoverPosition2["right"] = "right";
    PopoverPosition2["topStart"] = "top-start";
    PopoverPosition2["topEnd"] = "top-end";
    PopoverPosition2["bottomStart"] = "bottom-start";
    PopoverPosition2["bottomEnd"] = "bottom-end";
    PopoverPosition2["leftStart"] = "left-start";
    PopoverPosition2["leftEnd"] = "left-end";
    PopoverPosition2["rightStart"] = "right-start";
    PopoverPosition2["rightEnd"] = "right-end";
  })(PopoverPosition || (PopoverPosition = {}));
  var alertStyle = {
    default: import_popover8.default.modifiers.default,
    info: import_popover8.default.modifiers.info,
    success: import_popover8.default.modifiers.success,
    warning: import_popover8.default.modifiers.warning,
    danger: import_popover8.default.modifiers.danger
  };
  var Popover = (_a) => {
    var { children, position = "top", enableFlip = true, className = "", isVisible = null, shouldClose = () => null, shouldOpen = () => null, "aria-label": ariaLabel = "", bodyContent, headerContent = null, headerComponent = "h6", headerIcon = null, alertSeverityVariant, alertSeverityScreenReaderText, footerContent = null, appendTo = () => document.body, hideOnOutsideClick = true, onHide = () => null, onHidden = () => null, onShow = () => null, onShown = () => null, onMount = () => null, zIndex = 9999, minWidth = c_popover_MinWidth_default && c_popover_MinWidth_default.value, maxWidth = c_popover_MaxWidth_default && c_popover_MaxWidth_default.value, closeBtnAriaLabel = "Close", showClose = true, distance = 25, flipBehavior = [
      "top",
      "bottom",
      "left",
      "right",
      "top-start",
      "top-end",
      "bottom-start",
      "bottom-end",
      "left-start",
      "left-end",
      "right-start",
      "right-end"
    ], animationDuration = 300, id, withFocusTrap: propWithFocusTrap, boundary, tippyProps, reference: reference2, hasNoPadding = false, hasAutoWidth = false, removeFindDomNode = false } = _a, rest = __rest(_a, ["children", "position", "enableFlip", "className", "isVisible", "shouldClose", "shouldOpen", "aria-label", "bodyContent", "headerContent", "headerComponent", "headerIcon", "alertSeverityVariant", "alertSeverityScreenReaderText", "footerContent", "appendTo", "hideOnOutsideClick", "onHide", "onHidden", "onShow", "onShown", "onMount", "zIndex", "minWidth", "maxWidth", "closeBtnAriaLabel", "showClose", "distance", "flipBehavior", "animationDuration", "id", "withFocusTrap", "boundary", "tippyProps", "reference", "hasNoPadding", "hasAutoWidth", "removeFindDomNode"]);
    if (true) {
      boundary !== void 0 && console.warn("The Popover boundary prop has been deprecated. If you want to constrain the popper to a specific element use the appendTo prop instead.");
      tippyProps !== void 0 && console.warn("The Popover tippyProps prop has been deprecated and is no longer used.");
    }
    const uniqueId2 = id || getUniqueId();
    const triggerManually = isVisible !== null;
    const [visible, setVisible] = React70.useState(false);
    const [opacity, setOpacity] = React70.useState(0);
    const [focusTrapActive, setFocusTrapActive] = React70.useState(Boolean(propWithFocusTrap));
    const transitionTimerRef = React70.useRef(null);
    const showTimerRef = React70.useRef(null);
    const hideTimerRef = React70.useRef(null);
    React70.useEffect(() => {
      onMount();
    }, []);
    React70.useEffect(() => {
      if (triggerManually) {
        if (isVisible) {
          show();
        } else {
          hide2();
        }
      }
    }, [isVisible, triggerManually]);
    const show = (withFocusTrap) => {
      onShow();
      if (transitionTimerRef.current) {
        clearTimeout(transitionTimerRef.current);
      }
      if (hideTimerRef.current) {
        clearTimeout(hideTimerRef.current);
      }
      showTimerRef.current = setTimeout(() => {
        setVisible(true);
        setOpacity(1);
        propWithFocusTrap !== false && withFocusTrap && setFocusTrapActive(true);
        onShown();
      }, 0);
    };
    const hide2 = () => {
      onHide();
      if (showTimerRef.current) {
        clearTimeout(showTimerRef.current);
      }
      hideTimerRef.current = setTimeout(() => {
        setVisible(false);
        setOpacity(0);
        setFocusTrapActive(false);
        transitionTimerRef.current = setTimeout(() => {
          onHidden();
        }, animationDuration);
      }, 0);
    };
    const positionModifiers = {
      top: import_popover8.default.modifiers.top,
      bottom: import_popover8.default.modifiers.bottom,
      left: import_popover8.default.modifiers.left,
      right: import_popover8.default.modifiers.right,
      "top-start": import_popover8.default.modifiers.topLeft,
      "top-end": import_popover8.default.modifiers.topRight,
      "bottom-start": import_popover8.default.modifiers.bottomLeft,
      "bottom-end": import_popover8.default.modifiers.bottomRight,
      "left-start": import_popover8.default.modifiers.leftTop,
      "left-end": import_popover8.default.modifiers.leftBottom,
      "right-start": import_popover8.default.modifiers.rightTop,
      "right-end": import_popover8.default.modifiers.rightBottom
    };
    const hasCustomMinWidth = minWidth !== c_popover_MinWidth_default.value;
    const hasCustomMaxWidth = maxWidth !== c_popover_MaxWidth_default.value;
    const onDocumentKeyDown = (event) => {
      if (event.key === KeyTypes.Escape && visible) {
        if (triggerManually) {
          shouldClose(null, hide2, event);
        } else {
          hide2();
        }
      }
    };
    const onDocumentClick = (event, triggerElement, popperElement) => {
      if (hideOnOutsideClick && visible) {
        const isChild = popperElement && popperElement.contains(event.target);
        if (isChild) {
          return;
        }
        if (triggerManually) {
          shouldClose(null, hide2, event);
        } else {
          hide2();
        }
      }
    };
    const onTriggerClick = (event) => {
      if (triggerManually) {
        if (visible) {
          shouldClose(null, hide2, event);
        } else {
          shouldOpen(show, event);
        }
      } else {
        if (visible) {
          hide2();
        } else {
          show(true);
        }
      }
    };
    const onContentMouseDown = () => {
      if (focusTrapActive) {
        setFocusTrapActive(false);
      }
    };
    const closePopover = (event) => {
      event.stopPropagation();
      if (triggerManually) {
        shouldClose(null, hide2, event);
      } else {
        hide2();
      }
    };
    const content = React70.createElement(
      FocusTrap,
      Object.assign({ active: focusTrapActive, focusTrapOptions: {
        returnFocusOnDeactivate: true,
        clickOutsideDeactivates: true,
        tabbableOptions: { displayCheck: "none" },
        fallbackFocus: () => {
          let node = null;
          if (document && document.activeElement) {
            node = document.activeElement;
          }
          return node;
        }
      }, preventScrollOnDeactivate: true, className: css(import_popover8.default.popover, alertSeverityVariant && alertStyle[alertSeverityVariant], hasNoPadding && import_popover8.default.modifiers.noPadding, hasAutoWidth && import_popover8.default.modifiers.widthAuto, className), role: "dialog", "aria-modal": "true", "aria-label": headerContent ? void 0 : ariaLabel, "aria-labelledby": headerContent ? `popover-${uniqueId2}-header` : void 0, "aria-describedby": `popover-${uniqueId2}-body`, onMouseDown: onContentMouseDown, style: {
        minWidth: hasCustomMinWidth ? minWidth : null,
        maxWidth: hasCustomMaxWidth ? maxWidth : null,
        opacity,
        transition: getOpacityTransition(animationDuration)
      } }, rest),
      React70.createElement(PopoverArrow, null),
      React70.createElement(
        PopoverContent,
        null,
        showClose && React70.createElement(PopoverCloseButton, { onClose: closePopover, "aria-label": closeBtnAriaLabel }),
        headerContent && React70.createElement(PopoverHeader, { id: `popover-${uniqueId2}-header`, icon: headerIcon, alertSeverityVariant, alertSeverityScreenReaderText: alertSeverityScreenReaderText || `${alertSeverityVariant} alert:`, titleHeadingLevel: headerComponent }, typeof headerContent === "function" ? headerContent(hide2) : headerContent),
        React70.createElement(PopoverBody, { id: `popover-${uniqueId2}-body` }, typeof bodyContent === "function" ? bodyContent(hide2) : bodyContent),
        footerContent && React70.createElement(PopoverFooter, { id: `popover-${uniqueId2}-footer` }, typeof footerContent === "function" ? footerContent(hide2) : footerContent)
      )
    );
    return React70.createElement(
      PopoverContext.Provider,
      { value: { headerComponent } },
      React70.createElement(Popper, { trigger: children, reference: reference2, popper: content, popperMatchesTriggerWidth: false, appendTo, isVisible: visible, positionModifiers, distance, placement: position, onTriggerClick, onDocumentClick, onDocumentKeyDown, enableFlip, zIndex, flipBehavior, removeFindDomNode })
    );
  };
  Popover.displayName = "Popover";

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js
  init_tslib_es6();
  var React71 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/copy-icon.js
  var CopyIconConfig = {
    name: "CopyIcon",
    height: 512,
    width: 448,
    svgPath: "M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z",
    yOffset: 0,
    xOffset: 0
  };
  var CopyIcon = createIcon(CopyIconConfig);
  var copy_icon_default = CopyIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js
  var ClipboardCopyButton = (_a) => {
    var { onClick, exitDelay = 0, entryDelay = 300, maxWidth = "100px", position = "top", "aria-label": ariaLabel = "Copyable input", id, textId, children, variant = "control", onTooltipHidden = () => {
    }, removeFindDomNode = false } = _a, props = __rest(_a, ["onClick", "exitDelay", "entryDelay", "maxWidth", "position", "aria-label", "id", "textId", "children", "variant", "onTooltipHidden", "removeFindDomNode"]);
    return React71.createElement(
      Tooltip,
      { trigger: "mouseenter focus click", exitDelay, entryDelay, maxWidth, position, "aria-live": "polite", aria: "none", content: React71.createElement("div", null, children), onTooltipHidden, removeFindDomNode },
      React71.createElement(
        Button,
        Object.assign({ type: "button", variant, onClick, "aria-label": ariaLabel, id, "aria-labelledby": `${id} ${textId}` }, props),
        React71.createElement(copy_icon_default, null)
      )
    );
  };
  ClipboardCopyButton.displayName = "ClipboardCopyButton";

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js
  init_tslib_es6();
  var React72 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-down-icon.js
  var AngleDownIconConfig = {
    name: "AngleDownIcon",
    height: 512,
    width: 320,
    svgPath: "M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleDownIcon = createIcon(AngleDownIconConfig);
  var angle_down_icon_default = AngleDownIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js
  var ClipboardCopyToggle = (_a) => {
    var { onClick, id, textId, contentId, isExpanded = false } = _a, props = __rest(_a, ["onClick", "id", "textId", "contentId", "isExpanded"]);
    return React72.createElement(Button, Object.assign({ type: "button", variant: "control", onClick, id, "aria-labelledby": `${id} ${textId}`, "aria-controls": `${id} ${contentId}`, "aria-expanded": isExpanded }, props), isExpanded ? React72.createElement(angle_down_icon_default, { "aria-hidden": "true" }) : React72.createElement(angle_right_icon_default, { "aria-hidden": "true" }));
  };
  ClipboardCopyToggle.displayName = "ClipboardCopyToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js
  init_tslib_es6();
  var React73 = __toESM(require_react());
  var import_clipboard_copy = __toESM(require_clipboard_copy());
  var ClipboardCopyExpanded = class extends React73.Component {
    constructor(props) {
      super(props);
    }
    render() {
      const _a = this.props, { className, children, onChange, isReadOnly, isCode } = _a, props = __rest(_a, ["className", "children", "onChange", "isReadOnly", "isCode"]);
      return React73.createElement("div", Object.assign({ suppressContentEditableWarning: true, className: css(import_clipboard_copy.default.clipboardCopyExpandableContent, className), onInput: (e) => onChange(e.target.innerText, e), contentEditable: !isReadOnly }, props), isCode ? React73.createElement("pre", null, children) : children);
    }
  };
  ClipboardCopyExpanded.displayName = "ClipboardCopyExpanded";
  ClipboardCopyExpanded.defaultProps = {
    onChange: () => void 0,
    className: "",
    isReadOnly: false,
    isCode: false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopy.js
  var clipboardCopyFunc = (event, text) => {
    navigator.clipboard.writeText(text.toString());
  };
  var ClipboardCopyVariant;
  (function(ClipboardCopyVariant2) {
    ClipboardCopyVariant2["inline"] = "inline";
    ClipboardCopyVariant2["expansion"] = "expansion";
    ClipboardCopyVariant2["inlineCompact"] = "inline-compact";
  })(ClipboardCopyVariant || (ClipboardCopyVariant = {}));
  var ClipboardCopy = class extends React74.Component {
    constructor(props) {
      super(props);
      this.timer = null;
      this.componentDidUpdate = (prevProps, prevState) => {
        if (prevProps.children !== this.props.children) {
          this.updateText(this.props.children);
        }
      };
      this.componentWillUnmount = () => {
        if (this.timer) {
          window.clearTimeout(this.timer);
        }
      };
      this.expandContent = (_event) => {
        this.setState((prevState) => ({
          expanded: !prevState.expanded
        }));
      };
      this.updateText = (text) => {
        this.setState({ text });
        this.props.onChange(text);
      };
      this.render = () => {
        const _a = this.props, {
          /* eslint-disable @typescript-eslint/no-unused-vars */
          isExpanded,
          onChange,
          // Don't pass to <div>
          switchDelay,
          /* eslint-enable @typescript-eslint/no-unused-vars */
          isReadOnly,
          isCode,
          isBlock,
          exitDelay,
          maxWidth,
          entryDelay,
          onCopy,
          hoverTip,
          clickTip,
          textAriaLabel,
          toggleAriaLabel,
          variant,
          position,
          className,
          additionalActions,
          ouiaId,
          ouiaSafe,
          removeFindDomNode
        } = _a, divProps = __rest(_a, ["isExpanded", "onChange", "switchDelay", "isReadOnly", "isCode", "isBlock", "exitDelay", "maxWidth", "entryDelay", "onCopy", "hoverTip", "clickTip", "textAriaLabel", "toggleAriaLabel", "variant", "position", "className", "additionalActions", "ouiaId", "ouiaSafe", "removeFindDomNode"]);
        const textIdPrefix = "text-input-";
        const toggleIdPrefix = "toggle-";
        const contentIdPrefix = "content-";
        return React74.createElement(
          "div",
          Object.assign({ className: css(import_clipboard_copy2.default.clipboardCopy, variant === "inline-compact" && import_clipboard_copy2.default.modifiers.inline, isBlock && import_clipboard_copy2.default.modifiers.block, this.state.expanded && import_clipboard_copy2.default.modifiers.expanded, className) }, divProps, getOUIAProps(ClipboardCopy.displayName, ouiaId, ouiaSafe)),
          variant === "inline-compact" && React74.createElement(GenerateId, { prefix: "" }, (id) => React74.createElement(
            React74.Fragment,
            null,
            !isCode && React74.createElement("span", { className: css(import_clipboard_copy2.default.clipboardCopyText), id: `${textIdPrefix}${id}` }, this.state.text),
            isCode && React74.createElement("code", { className: css(import_clipboard_copy2.default.clipboardCopyText, import_clipboard_copy2.default.modifiers.code), id: `${textIdPrefix}${id}` }, this.state.text),
            React74.createElement(
              "span",
              { className: css(import_clipboard_copy2.default.clipboardCopyActions) },
              React74.createElement(
                "span",
                { className: css(import_clipboard_copy2.default.clipboardCopyActionsItem) },
                React74.createElement(ClipboardCopyButton, { variant: "plain", exitDelay, entryDelay, maxWidth, position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
                  onCopy(event, this.state.text);
                  this.setState({ copied: true });
                }, onTooltipHidden: () => this.setState({ copied: false }) }, this.state.copied ? clickTip : hoverTip)
              ),
              additionalActions && additionalActions
            )
          )),
          variant !== "inline-compact" && React74.createElement(GenerateId, { prefix: "" }, (id) => React74.createElement(
            React74.Fragment,
            null,
            React74.createElement(
              "div",
              { className: css(import_clipboard_copy2.default.clipboardCopyGroup) },
              variant === "expansion" && React74.createElement(ClipboardCopyToggle, { isExpanded: this.state.expanded, onClick: this.expandContent, id: `${toggleIdPrefix}${id}`, textId: `${textIdPrefix}${id}`, contentId: `${contentIdPrefix}${id}`, "aria-label": toggleAriaLabel }),
              React74.createElement(TextInput, { isReadOnly: isReadOnly || this.state.expanded, onChange: this.updateText, value: this.state.text, id: `text-input-${id}`, "aria-label": textAriaLabel }),
              React74.createElement(ClipboardCopyButton, { exitDelay, entryDelay, maxWidth, position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
                onCopy(event, this.state.text);
                this.setState({ copied: true });
              }, onTooltipHidden: () => this.setState({ copied: false }), removeFindDomNode }, this.state.copied ? clickTip : hoverTip)
            ),
            this.state.expanded && React74.createElement(ClipboardCopyExpanded, { isReadOnly, isCode, id: `content-${id}`, onChange: this.updateText }, this.state.text)
          ))
        );
      };
      this.state = {
        text: Array.isArray(this.props.children) ? this.props.children.join("") : this.props.children,
        expanded: this.props.isExpanded,
        copied: false
      };
      if (this.props.switchDelay !== void 0) {
        console.warn("ClipboardCopy: switchDelay prop has been deprecated. The tooltip message will switch back to the hover tip as soon as the tooltip is hidden.");
      }
    }
  };
  ClipboardCopy.displayName = "ClipboardCopy";
  ClipboardCopy.defaultProps = {
    hoverTip: "Copy to clipboard",
    clickTip: "Successfully copied to clipboard!",
    isReadOnly: false,
    isExpanded: false,
    isCode: false,
    variant: "inline",
    position: PopoverPosition.top,
    maxWidth: "150px",
    exitDelay: 1500,
    entryDelay: 300,
    onCopy: clipboardCopyFunc,
    onChange: () => void 0,
    textAriaLabel: "Copyable input",
    toggleAriaLabel: "Show content",
    additionalActions: null,
    ouiaSafe: true,
    removeFindDomNode: false
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/search-icon.js
  var SearchIconConfig = {
    name: "SearchIcon",
    height: 512,
    width: 512,
    svgPath: "M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z",
    yOffset: 0,
    xOffset: 0
  };
  var SearchIcon = createIcon(SearchIconConfig);
  var search_icon_default = SearchIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/grip-vertical-icon.js
  var GripVerticalIconConfig = {
    name: "GripVerticalIcon",
    height: 512,
    width: 320,
    svgPath: "M96 32H32C14.33 32 0 46.33 0 64v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zM288 32h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32z",
    yOffset: 0,
    xOffset: 0
  };
  var GripVerticalIcon = createIcon(GripVerticalIconConfig);
  var grip_vertical_icon_default = GripVerticalIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/Drawer.js
  init_tslib_es6();
  var React75 = __toESM(require_react());
  var import_drawer = __toESM(require_drawer());
  var DrawerColorVariant;
  (function(DrawerColorVariant2) {
    DrawerColorVariant2["default"] = "default";
    DrawerColorVariant2["light200"] = "light-200";
  })(DrawerColorVariant || (DrawerColorVariant = {}));
  var DrawerContext = React75.createContext({
    isExpanded: false,
    isStatic: false,
    onExpand: () => {
    },
    position: "right",
    drawerRef: null,
    drawerContentRef: null,
    isInline: false
  });
  var Drawer = (_a) => {
    var { className = "", children, isExpanded = false, isInline = false, isStatic = false, position = "right", onExpand = () => {
    } } = _a, props = __rest(_a, ["className", "children", "isExpanded", "isInline", "isStatic", "position", "onExpand"]);
    const drawerRef = React75.useRef();
    const drawerContentRef = React75.useRef();
    return React75.createElement(
      DrawerContext.Provider,
      { value: { isExpanded, isStatic, onExpand, position, drawerRef, drawerContentRef, isInline } },
      React75.createElement("div", Object.assign({ className: css(import_drawer.default.drawer, isExpanded && import_drawer.default.modifiers.expanded, isInline && import_drawer.default.modifiers.inline, isStatic && import_drawer.default.modifiers.static, position === "left" && import_drawer.default.modifiers.panelLeft, position === "bottom" && import_drawer.default.modifiers.panelBottom, className), ref: drawerRef }, props), children)
    );
  };
  Drawer.displayName = "Drawer";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerActions.js
  init_tslib_es6();
  var React76 = __toESM(require_react());
  var import_drawer2 = __toESM(require_drawer());
  var DrawerActions = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      children
    } = _a, props = __rest(_a, ["className", "children"]);
    return React76.createElement("div", Object.assign({ className: css(import_drawer2.default.drawerActions, className) }, props), children);
  };
  DrawerActions.displayName = "DrawerActions";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerCloseButton.js
  init_tslib_es6();
  var React77 = __toESM(require_react());
  var import_drawer3 = __toESM(require_drawer());
  var DrawerCloseButton = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      onClose = () => void 0,
      "aria-label": ariaLabel = "Close drawer panel"
    } = _a, props = __rest(_a, ["className", "onClose", "aria-label"]);
    return React77.createElement(
      "div",
      Object.assign({ className: css(import_drawer3.default.drawerClose, className) }, props),
      React77.createElement(
        Button,
        { variant: "plain", onClick: onClose, "aria-label": ariaLabel },
        React77.createElement(times_icon_default, null)
      )
    );
  };
  DrawerCloseButton.displayName = "DrawerCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerContent.js
  init_tslib_es6();
  var React79 = __toESM(require_react());
  var import_drawer5 = __toESM(require_drawer());

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerMain.js
  init_tslib_es6();
  var React78 = __toESM(require_react());
  var import_drawer4 = __toESM(require_drawer());
  var DrawerMain = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      children
    } = _a, props = __rest(_a, ["className", "children"]);
    return React78.createElement("div", Object.assign({ className: css(import_drawer4.default.drawerMain, className) }, props), children);
  };
  DrawerMain.displayName = "DrawerMain";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerContent.js
  var DrawerContent = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      children,
      panelContent,
      colorVariant = DrawerColorVariant.default
    } = _a, props = __rest(_a, ["className", "children", "panelContent", "colorVariant"]);
    const { drawerContentRef } = React79.useContext(DrawerContext);
    return React79.createElement(
      DrawerMain,
      null,
      React79.createElement("div", Object.assign({ className: css(import_drawer5.default.drawerContent, colorVariant === DrawerColorVariant.light200 && import_drawer5.default.modifiers.light_200, className), ref: drawerContentRef }, props), children),
      panelContent
    );
  };
  DrawerContent.displayName = "DrawerContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerContentBody.js
  init_tslib_es6();
  var React80 = __toESM(require_react());
  var import_drawer6 = __toESM(require_drawer());
  var DrawerContentBody = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      children,
      hasPadding = false
    } = _a, props = __rest(_a, ["className", "children", "hasPadding"]);
    return React80.createElement("div", Object.assign({ className: css(import_drawer6.default.drawerBody, hasPadding && import_drawer6.default.modifiers.padding, className) }, props), children);
  };
  DrawerContentBody.displayName = "DrawerContentBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerHead.js
  init_tslib_es6();
  var React82 = __toESM(require_react());
  var import_drawer8 = __toESM(require_drawer());

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerPanelBody.js
  init_tslib_es6();
  var React81 = __toESM(require_react());
  var import_drawer7 = __toESM(require_drawer());
  var DrawerPanelBody = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      children,
      hasNoPadding = false
    } = _a, props = __rest(_a, ["className", "children", "hasNoPadding"]);
    return React81.createElement("div", Object.assign({ className: css(import_drawer7.default.drawerBody, hasNoPadding && import_drawer7.default.modifiers.noPadding, className) }, props), children);
  };
  DrawerPanelBody.displayName = "DrawerPanelBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerHead.js
  var DrawerHead = (_a) => {
    var {
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className = "",
      children,
      hasNoPadding = false
    } = _a, props = __rest(_a, ["className", "children", "hasNoPadding"]);
    return React82.createElement(
      DrawerPanelBody,
      { hasNoPadding },
      React82.createElement("div", Object.assign({ className: css(import_drawer8.default.drawerHead, className) }, props), children)
    );
  };
  DrawerHead.displayName = "DrawerHead";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerPanelContent.js
  init_tslib_es6();
  var React83 = __toESM(require_react());
  var import_drawer9 = __toESM(require_drawer());
  var isResizing = null;
  var newSize = 0;
  var DrawerPanelContent = (_a) => {
    var { className = "", id, children, hasNoBorder = false, isResizable = false, onResize, minSize, defaultSize, maxSize, increment = 5, resizeAriaLabel = "Resize", widths, colorVariant = DrawerColorVariant.default } = _a, props = __rest(_a, ["className", "id", "children", "hasNoBorder", "isResizable", "onResize", "minSize", "defaultSize", "maxSize", "increment", "resizeAriaLabel", "widths", "colorVariant"]);
    const panel = React83.useRef();
    const splitterRef = React83.useRef();
    const [separatorValue, setSeparatorValue] = React83.useState(0);
    const { position, isExpanded, isStatic, onExpand, drawerRef, drawerContentRef, isInline } = React83.useContext(DrawerContext);
    const hidden = isStatic ? false : !isExpanded;
    const [isExpandedInternal, setIsExpandedInternal] = React83.useState(!hidden);
    let currWidth = 0;
    let panelRect;
    let right2;
    let left2;
    let bottom2;
    let setInitialVals = true;
    React83.useEffect(() => {
      if (!isStatic && isExpanded) {
        setIsExpandedInternal(isExpanded);
      }
    }, [isStatic, isExpanded]);
    const calcValueNow = () => {
      let splitterPos;
      let drawerSize;
      if (isInline && position === "right") {
        splitterPos = panel.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
        drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
      } else if (isInline && position === "left") {
        splitterPos = splitterRef.current.getBoundingClientRect().right - panel.current.getBoundingClientRect().left;
        drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
      } else if (position === "right") {
        splitterPos = drawerContentRef.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
        drawerSize = drawerContentRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
      } else if (position === "left") {
        splitterPos = splitterRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
        drawerSize = drawerContentRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
      } else if (position === "bottom") {
        splitterPos = drawerContentRef.current.getBoundingClientRect().bottom - splitterRef.current.getBoundingClientRect().top;
        drawerSize = drawerContentRef.current.getBoundingClientRect().bottom - drawerContentRef.current.getBoundingClientRect().top;
      }
      const newSplitterPos = splitterPos / drawerSize * 100;
      return Math.round((newSplitterPos + Number.EPSILON) * 100) / 100;
    };
    const handleTouchStart = (e) => {
      e.stopPropagation();
      document.addEventListener("touchmove", callbackTouchMove, { passive: false });
      document.addEventListener("touchend", callbackTouchEnd);
      isResizing = true;
    };
    const handleMousedown = (e) => {
      e.stopPropagation();
      e.preventDefault();
      document.addEventListener("mousemove", callbackMouseMove);
      document.addEventListener("mouseup", callbackMouseUp);
      drawerRef.current.classList.add(css(import_drawer9.default.modifiers.resizing));
      isResizing = true;
      setInitialVals = true;
    };
    const handleMouseMove = (e) => {
      const mousePos = position === "bottom" ? e.clientY : e.clientX;
      handleControlMove(e, mousePos);
    };
    const handleTouchMove = (e) => {
      e.preventDefault();
      e.stopImmediatePropagation();
      const touchPos = position === "bottom" ? e.touches[0].clientY : e.touches[0].clientX;
      handleControlMove(e, touchPos);
    };
    const handleControlMove = (e, controlPosition) => {
      e.stopPropagation();
      if (!isResizing) {
        return;
      }
      if (setInitialVals) {
        panelRect = panel.current.getBoundingClientRect();
        right2 = panelRect.right;
        left2 = panelRect.left;
        bottom2 = panelRect.bottom;
        setInitialVals = false;
      }
      const mousePos = controlPosition;
      let newSize2 = 0;
      if (position === "right") {
        newSize2 = right2 - mousePos;
      } else if (position === "left") {
        newSize2 = mousePos - left2;
      } else {
        newSize2 = bottom2 - mousePos;
      }
      if (position === "bottom") {
        panel.current.style.overflowAnchor = "none";
      }
      panel.current.style.setProperty("--pf-c-drawer__panel--md--FlexBasis", newSize2 + "px");
      currWidth = newSize2;
      setSeparatorValue(calcValueNow());
    };
    const handleMouseup = () => {
      if (!isResizing) {
        return;
      }
      drawerRef.current.classList.remove(css(import_drawer9.default.modifiers.resizing));
      isResizing = false;
      onResize && onResize(currWidth, id);
      setInitialVals = true;
      document.removeEventListener("mousemove", callbackMouseMove);
      document.removeEventListener("mouseup", callbackMouseUp);
    };
    const handleTouchEnd = (e) => {
      e.stopPropagation();
      if (!isResizing) {
        return;
      }
      isResizing = false;
      onResize && onResize(currWidth, id);
      document.removeEventListener("touchmove", callbackTouchMove);
      document.removeEventListener("touchend", callbackTouchEnd);
    };
    const callbackMouseMove = React83.useCallback(handleMouseMove, []);
    const callbackTouchEnd = React83.useCallback(handleTouchEnd, []);
    const callbackTouchMove = React83.useCallback(handleTouchMove, []);
    const callbackMouseUp = React83.useCallback(handleMouseup, []);
    const handleKeys = (e) => {
      const key = e.key;
      if (key !== "Escape" && key !== "Enter" && key !== "ArrowUp" && key !== "ArrowDown" && key !== "ArrowLeft" && key !== "ArrowRight") {
        if (isResizing) {
          e.preventDefault();
        }
        return;
      }
      e.preventDefault();
      if (key === "Escape" || key === "Enter") {
        onResize && onResize(currWidth, id);
      }
      const panelRect2 = panel.current.getBoundingClientRect();
      newSize = position === "bottom" ? panelRect2.height : panelRect2.width;
      let delta = 0;
      if (key === "ArrowRight") {
        delta = position === "left" ? increment : -increment;
      } else if (key === "ArrowLeft") {
        delta = position === "left" ? -increment : increment;
      } else if (key === "ArrowUp") {
        delta = increment;
      } else if (key === "ArrowDown") {
        delta = -increment;
      }
      newSize = newSize + delta;
      if (position === "bottom") {
        panel.current.style.overflowAnchor = "none";
      }
      panel.current.style.setProperty("--pf-c-drawer__panel--md--FlexBasis", newSize + "px");
      currWidth = newSize;
      setSeparatorValue(calcValueNow());
    };
    const boundaryCssVars = {};
    if (defaultSize) {
      boundaryCssVars["--pf-c-drawer__panel--md--FlexBasis"] = defaultSize;
    }
    if (minSize) {
      boundaryCssVars["--pf-c-drawer__panel--md--FlexBasis--min"] = minSize;
    }
    if (maxSize) {
      boundaryCssVars["--pf-c-drawer__panel--md--FlexBasis--max"] = maxSize;
    }
    return React83.createElement(GenerateId, { prefix: "pf-drawer-panel-" }, (panelId) => React83.createElement("div", Object.assign({ id: id || panelId, className: css(import_drawer9.default.drawerPanel, isResizable && import_drawer9.default.modifiers.resizable, hasNoBorder && import_drawer9.default.modifiers.noBorder, formatBreakpointMods(widths, import_drawer9.default), colorVariant === DrawerColorVariant.light200 && import_drawer9.default.modifiers.light_200, className), ref: panel, onTransitionEnd: (ev) => {
      if (!hidden && ev.nativeEvent.propertyName === "transform") {
        onExpand();
      }
      setIsExpandedInternal(!hidden);
    }, hidden }, (defaultSize || minSize || maxSize) && {
      style: boundaryCssVars
    }, props), isExpandedInternal && React83.createElement(
      React83.Fragment,
      null,
      isResizable && React83.createElement(
        React83.Fragment,
        null,
        React83.createElement(
          "div",
          { className: css(import_drawer9.default.drawerSplitter, position !== "bottom" && import_drawer9.default.modifiers.vertical), role: "separator", tabIndex: 0, "aria-orientation": position === "bottom" ? "horizontal" : "vertical", "aria-label": resizeAriaLabel, "aria-valuenow": separatorValue, "aria-valuemin": 0, "aria-valuemax": 100, "aria-controls": id || panelId, onMouseDown: handleMousedown, onKeyDown: handleKeys, onTouchStart: handleTouchStart, ref: splitterRef },
          React83.createElement("div", { className: css(import_drawer9.default.drawerSplitterHandle), "aria-hidden": true })
        ),
        React83.createElement("div", { className: css(import_drawer9.default.drawerPanelMain) }, children)
      ),
      !isResizable && children
    )));
  };
  DrawerPanelContent.displayName = "DrawerPanelContent";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelector.js
  init_tslib_es6();
  var React106 = __toESM(require_react());
  var import_dual_list_selector8 = __toESM(require_dual_list_selector());

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-double-left-icon.js
  var AngleDoubleLeftIconConfig = {
    name: "AngleDoubleLeftIcon",
    height: 512,
    width: 448,
    svgPath: "M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleDoubleLeftIcon = createIcon(AngleDoubleLeftIconConfig);
  var angle_double_left_icon_default = AngleDoubleLeftIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-double-right-icon.js
  var AngleDoubleRightIconConfig = {
    name: "AngleDoubleRightIcon",
    height: 512,
    width: 448,
    svgPath: "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleDoubleRightIcon = createIcon(AngleDoubleRightIconConfig);
  var angle_double_right_icon_default = AngleDoubleRightIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorPane.js
  init_tslib_es6();
  var React103 = __toESM(require_react());
  var import_dual_list_selector6 = __toESM(require_dual_list_selector());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTree.js
  init_tslib_es6();
  var React86 = __toESM(require_react());
  var import_dual_list_selector2 = __toESM(require_dual_list_selector());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTreeItem.js
  init_tslib_es6();
  var React85 = __toESM(require_react());
  var import_dual_list_selector = __toESM(require_dual_list_selector());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/treeUtils.js
  function flattenTree(tree) {
    let result = [];
    tree.forEach((item) => {
      if (item.children) {
        result = result.concat(flattenTree(item.children));
      } else {
        result.push(item.id);
      }
    });
    return result;
  }
  function flattenTreeWithFolders(tree) {
    let result = [];
    tree.forEach((item) => {
      result.push(item.id);
      if (item.children) {
        result = result.concat(flattenTreeWithFolders(item.children));
      }
    });
    return result;
  }
  function filterFolders(tree, inputList) {
    let result = [];
    tree.forEach((item) => {
      if (item.children) {
        result = result.concat(filterFolders(item.children, inputList));
      } else {
        if (inputList.includes(item.id)) {
          result.push(item.id);
        }
      }
    });
    return result;
  }
  function filterTreeItems(item, inputList) {
    if (inputList.includes(item.id)) {
      return true;
    }
    if (item.children) {
      return (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child) => filterTreeItems(child, inputList))).length > 0;
    }
  }
  function filterTreeItemsWithoutFolders(item, inputList) {
    if (item.children) {
      return (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child) => child.children ? filterTreeItemsWithoutFolders(child, inputList) : filterTreeItems(child, inputList))).length > 0;
    }
    if (inputList.includes(item.id)) {
      return true;
    }
  }
  function filterRestTreeItems(item, inputList) {
    if (item.children) {
      const child = (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child2) => filterRestTreeItems(child2, inputList))).length > 0;
      return child;
    }
    if (!inputList.includes(item.id)) {
      return true;
    }
  }

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorContext.js
  var React84 = __toESM(require_react());
  var DualListSelectorContext = React84.createContext({ isTree: false });
  var DualListSelectorListContext = React84.createContext({});
  var DualListSelectorPaneContext = React84.createContext({ isChosen: false });

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTreeItem.js
  var DualListSelectorTreeItemBase = (_a) => {
    var {
      onOptionCheck,
      children,
      className,
      id,
      text,
      defaultExpanded,
      hasBadge,
      isChecked,
      checkProps,
      badgeProps,
      itemData,
      isDisabled = false,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      useMemo: useMemo5
    } = _a, props = __rest(_a, ["onOptionCheck", "children", "className", "id", "text", "defaultExpanded", "hasBadge", "isChecked", "checkProps", "badgeProps", "itemData", "isDisabled", "useMemo"]);
    const ref = React85.useRef(null);
    const [isExpanded, setIsExpanded] = React85.useState(defaultExpanded || false);
    const { setFocusedOption } = React85.useContext(DualListSelectorListContext);
    React85.useEffect(() => {
      setIsExpanded(defaultExpanded);
    }, [defaultExpanded]);
    return React85.createElement(
      "li",
      Object.assign({ className: css(import_dual_list_selector.default.dualListSelectorListItem, className, children && import_dual_list_selector.default.modifiers.expandable, isExpanded && import_dual_list_selector.default.modifiers.expanded, isDisabled && import_dual_list_selector.default.modifiers.disabled), id }, props, { "aria-selected": isChecked, role: "treeitem" }, isExpanded && { "aria-expanded": "true" }),
      React85.createElement(
        "div",
        { className: css(import_dual_list_selector.default.dualListSelectorListItemRow, isChecked && import_dual_list_selector.default.modifiers.selected, import_dual_list_selector.default.modifiers.check) },
        React85.createElement(
          "div",
          { className: css(import_dual_list_selector.default.dualListSelectorItem), ref, tabIndex: -1, onClick: isDisabled ? void 0 : (evt) => {
            onOptionCheck && onOptionCheck(evt, !isChecked, itemData);
            setFocusedOption(id);
          } },
          React85.createElement(
            "span",
            { className: css(import_dual_list_selector.default.dualListSelectorItemMain) },
            children && React85.createElement(
              "div",
              { className: css(import_dual_list_selector.default.dualListSelectorItemToggle), onClick: (e) => {
                if (children) {
                  setIsExpanded(!isExpanded);
                }
                e.stopPropagation();
              }, onKeyDown: (e) => {
                if (e.key === " " || e.key === "Enter") {
                  document.activeElement.click();
                  e.preventDefault();
                }
              }, tabIndex: -1 },
              React85.createElement(
                "span",
                { className: css(import_dual_list_selector.default.dualListSelectorItemToggleIcon) },
                React85.createElement(angle_right_icon_default, { "aria-hidden": true })
              )
            ),
            React85.createElement(
              "span",
              { className: css(import_dual_list_selector.default.dualListSelectorItemCheck) },
              React85.createElement("input", Object.assign({ type: "checkbox", onChange: (evt) => {
                onOptionCheck && onOptionCheck(evt, !isChecked, itemData);
                setFocusedOption(id);
              }, onClick: (evt) => evt.stopPropagation(), onKeyDown: (e) => {
                if (e.key === " " || e.key === "Enter") {
                  onOptionCheck && onOptionCheck(e, !isChecked, itemData);
                  setFocusedOption(id);
                  e.preventDefault();
                }
              }, ref: (elem) => elem && (elem.indeterminate = isChecked === null), checked: isChecked || false, tabIndex: -1 }, checkProps))
            ),
            React85.createElement("span", { className: css(import_dual_list_selector.default.dualListSelectorItemText) }, text),
            hasBadge && children && React85.createElement(
              "span",
              { className: css(import_dual_list_selector.default.dualListSelectorItemCount) },
              React85.createElement(Badge, Object.assign({}, badgeProps), flattenTree(children.props.data).length)
            )
          )
        )
      ),
      isExpanded && children
    );
  };
  var DualListSelectorTreeItem = React85.memo(DualListSelectorTreeItemBase, (prevProps, nextProps) => {
    if (!nextProps.useMemo) {
      return false;
    }
    if (prevProps.className !== nextProps.className || prevProps.text !== nextProps.text || prevProps.id !== nextProps.id || prevProps.defaultExpanded !== nextProps.defaultExpanded || prevProps.checkProps !== nextProps.checkProps || prevProps.hasBadge !== nextProps.hasBadge || prevProps.badgeProps !== nextProps.badgeProps || prevProps.isChecked !== nextProps.isChecked || prevProps.itemData !== nextProps.itemData) {
      return false;
    }
    return true;
  });
  DualListSelectorTreeItem.displayName = "DualListSelectorTreeItem";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTree.js
  var DualListSelectorTree = (_a) => {
    var { data, hasBadges = false, isNested = false, defaultAllExpanded = false, onOptionCheck, isDisabled = false } = _a, props = __rest(_a, ["data", "hasBadges", "isNested", "defaultAllExpanded", "onOptionCheck", "isDisabled"]);
    const dataToRender = typeof data === "function" ? data() : data;
    const tree = dataToRender.map((item) => React86.createElement(DualListSelectorTreeItem, Object.assign({ key: item.id, text: item.text, id: item.id, defaultExpanded: item.defaultExpanded !== void 0 ? item.defaultExpanded : defaultAllExpanded, onOptionCheck, isChecked: item.isChecked, checkProps: item.checkProps, hasBadge: item.hasBadge !== void 0 ? item.hasBadge : hasBadges, badgeProps: item.badgeProps, itemData: item, isDisabled, useMemo: true }, item.children && {
      children: React86.createElement(DualListSelectorTree, { isNested: true, data: item.children, hasBadges, defaultAllExpanded, onOptionCheck, isDisabled })
    })));
    return isNested ? React86.createElement("ul", Object.assign({ className: css(import_dual_list_selector2.default.dualListSelectorList), role: "group" }, props), tree) : React86.createElement(React86.Fragment, null, tree);
  };
  DualListSelectorTree.displayName = "DualListSelectorTree";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js
  init_tslib_es6();
  var React89 = __toESM(require_react());
  var import_dual_list_selector5 = __toESM(require_dual_list_selector());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorList.js
  init_tslib_es6();
  var import_dual_list_selector4 = __toESM(require_dual_list_selector());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorListItem.js
  init_tslib_es6();
  var React87 = __toESM(require_react());
  var import_dual_list_selector3 = __toESM(require_dual_list_selector());
  var DualListSelectorListItemBase = (_a) => {
    var {
      onOptionSelect,
      orderIndex,
      children,
      className,
      id = getUniqueId("dual-list-selector-list-item"),
      isSelected,
      innerRef,
      isDraggable = false,
      isDisabled,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      draggableButtonAriaLabel = "Reorder option"
    } = _a, props = __rest(_a, ["onOptionSelect", "orderIndex", "children", "className", "id", "isSelected", "innerRef", "isDraggable", "isDisabled", "draggableButtonAriaLabel"]);
    const privateRef = React87.useRef(null);
    const ref = innerRef || privateRef;
    const { setFocusedOption } = React87.useContext(DualListSelectorListContext);
    return React87.createElement(
      "li",
      Object.assign({ className: css(import_dual_list_selector3.default.dualListSelectorListItem, className, isDisabled && import_dual_list_selector3.default.modifiers.disabled), key: orderIndex, onClick: isDisabled ? void 0 : (e) => {
        setFocusedOption(id);
        onOptionSelect(e, id);
      }, onKeyDown: (e) => {
        if (e.key === " " || e.key === "Enter") {
          document.activeElement.click();
          e.preventDefault();
        }
      }, "aria-selected": isSelected, id, ref, role: "option", tabIndex: -1 }, props),
      React87.createElement(
        "div",
        { className: css(import_dual_list_selector3.default.dualListSelectorListItemRow, isSelected && import_dual_list_selector3.default.modifiers.selected) },
        isDraggable && !isDisabled && React87.createElement(
          "div",
          { className: css(import_dual_list_selector3.default.dualListSelectorDraggable) },
          React87.createElement(
            Button,
            { variant: ButtonVariant.plain, component: "span" },
            React87.createElement(grip_vertical_icon_default, { style: { verticalAlign: "-0.3em" } })
          )
        ),
        React87.createElement(
          "span",
          { className: css(import_dual_list_selector3.default.dualListSelectorItem) },
          React87.createElement(
            "span",
            { className: css(import_dual_list_selector3.default.dualListSelectorItemMain) },
            React87.createElement("span", { className: css(import_dual_list_selector3.default.dualListSelectorItemText) }, children)
          )
        )
      )
    );
  };
  DualListSelectorListItemBase.displayName = "DualListSelectorListItemBase";
  var DualListSelectorListItem = React87.forwardRef((props, ref) => React87.createElement(DualListSelectorListItemBase, Object.assign({ innerRef: ref }, props)));
  DualListSelectorListItem.displayName = "DualListSelectorListItem";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorList.js
  var React88 = __toESM(require_react());
  var DualListSelectorList = (_a) => {
    var { children } = _a, props = __rest(_a, ["children"]);
    const { setFocusedOption, isTree, ariaLabelledBy, focusedOption, displayOption, selectedOptions, id, onOptionSelect, options: options4, isDisabled } = React88.useContext(DualListSelectorListContext);
    const onOptionClick = (e, index, id2) => {
      setFocusedOption(id2);
      onOptionSelect(e, index, id2);
    };
    const hasOptions = () => options4.length !== 0 || children !== void 0 && children.length !== 0;
    return React88.createElement("ul", Object.assign({ className: css(import_dual_list_selector4.default.dualListSelectorList) }, hasOptions() && {
      role: isTree ? "tree" : "listbox",
      "aria-multiselectable": true,
      "aria-labelledby": ariaLabelledBy,
      "aria-activedescendant": focusedOption
    }, { "aria-disabled": isDisabled ? "true" : void 0 }, props), options4.length === 0 ? children : options4.map((option, index) => {
      if (displayOption(option)) {
        return React88.createElement(DualListSelectorListItem, { key: index, isSelected: selectedOptions.indexOf(index) !== -1, id: `${id}-option-${index}`, onOptionSelect: (e, id2) => onOptionClick(e, index, id2), orderIndex: index, isDisabled }, option);
      }
      return;
    }));
  };
  DualListSelectorList.displayName = "DualListSelectorList";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js
  var DualListSelectorListWrapperBase = (_a) => {
    var { className, children, "aria-labelledby": ariaLabelledBy, innerRef, options: options4 = [], selectedOptions = [], onOptionSelect, displayOption, id = getUniqueId("dual-list-selector-list"), isDisabled = false } = _a, props = __rest(_a, ["className", "children", "aria-labelledby", "innerRef", "options", "selectedOptions", "onOptionSelect", "displayOption", "id", "isDisabled"]);
    const [focusedOption, setFocusedOption] = React89.useState("");
    const ref = React89.useRef(null);
    const menuRef = innerRef || ref;
    const { isTree } = React89.useContext(DualListSelectorContext);
    const handleKeys = (event) => {
      if (!menuRef.current || menuRef.current !== event.target.closest(".pf-c-dual-list-selector__menu") && !Array.from(menuRef.current.getElementsByClassName("pf-c-dual-list-selector__menu")).includes(event.target.closest(".pf-c-dual-list-selector__menu"))) {
        return;
      }
      event.stopImmediatePropagation();
      const validOptions = isTree ? Array.from(menuRef.current.querySelectorAll(".pf-c-dual-list-selector__item-toggle, .pf-c-dual-list-selector__item-check > input")) : Array.from(menuRef.current.getElementsByTagName("LI")).filter((el) => !el.classList.contains("pf-m-disabled"));
      const activeElement = document.activeElement;
      handleArrows(event, validOptions, (element) => activeElement.contains(element), (element) => {
        if (element.classList.contains(".pf-c-dual-list-selector__list-item")) {
          setFocusedOption(element.id);
        } else {
          setFocusedOption(element.closest(".pf-c-dual-list-selector__list-item").id);
        }
        return element;
      }, [".pf-c-dual-list-selector__item-toggle", ".pf-c-dual-list-selector__item-check > input"], void 0, false, false, false);
    };
    React89.useEffect(() => {
      window.addEventListener("keydown", handleKeys);
      return () => {
        window.removeEventListener("keydown", handleKeys);
      };
    }, [menuRef.current]);
    return React89.createElement(
      "div",
      Object.assign({ className: css(import_dual_list_selector5.default.dualListSelectorMenu, className), ref: menuRef, tabIndex: 0 }, props),
      React89.createElement(DualListSelectorListContext.Provider, { value: {
        setFocusedOption,
        isTree,
        focusedOption,
        ariaLabelledBy,
        displayOption,
        selectedOptions,
        id,
        options: options4,
        onOptionSelect,
        isDisabled
      } }, children ? children : React89.createElement(DualListSelectorList, null))
    );
  };
  DualListSelectorListWrapperBase.displayName = "DualListSelectorListWrapperBase";
  var DualListSelectorListWrapper = React89.forwardRef((props, ref) => React89.createElement(DualListSelectorListWrapperBase, Object.assign({ innerRef: ref }, props)));
  DualListSelectorListWrapper.displayName = "DualListSelectorListWrapper";

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/SearchInput.js
  init_tslib_es6();
  var React102 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/arrow-right-icon.js
  var ArrowRightIconConfig = {
    name: "ArrowRightIcon",
    height: 512,
    width: 448,
    svgPath: "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z",
    yOffset: 0,
    xOffset: 0
  };
  var ArrowRightIcon = createIcon(ArrowRightIconConfig);
  var arrow_right_icon_default = ArrowRightIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/AdvancedSearchMenu.js
  var React98 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Form/ActionGroup.js
  init_tslib_es6();
  var React90 = __toESM(require_react());
  var import_form2 = __toESM(require_form());
  var ActionGroup = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    const customClassName = css(import_form2.default.formGroup, import_form2.default.modifiers.action, className);
    const formActionsComponent = React90.createElement("div", { className: css(import_form2.default.formActions) }, children);
    return React90.createElement(
      "div",
      Object.assign({}, props, { className: customClassName }),
      React90.createElement("div", { className: css(import_form2.default.formGroupControl) }, formActionsComponent)
    );
  };
  ActionGroup.displayName = "ActionGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/Form.js
  init_tslib_es6();
  var React91 = __toESM(require_react());
  var import_form3 = __toESM(require_form());
  var FormBase = (_a) => {
    var { children = null, className = "", isHorizontal: isHorizontal2 = false, isWidthLimited = false, maxWidth = "", innerRef } = _a, props = __rest(_a, ["children", "className", "isHorizontal", "isWidthLimited", "maxWidth", "innerRef"]);
    return React91.createElement("form", Object.assign({ noValidate: true }, maxWidth && {
      style: Object.assign({ "--pf-c-form--m-limit-width--MaxWidth": maxWidth }, props.style)
    }, props, { className: css(import_form3.default.form, isHorizontal2 && import_form3.default.modifiers.horizontal, (isWidthLimited || maxWidth) && import_form3.default.modifiers.limitWidth, className), ref: innerRef }), children);
  };
  var Form = React91.forwardRef((props, ref) => React91.createElement(FormBase, Object.assign({ innerRef: ref }, props)));
  Form.displayName = "Form";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/FormAlert.js
  init_tslib_es6();
  var React92 = __toESM(require_react());
  var FormAlert = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return (
      // There are currently no associated styles with the pf-c-form_alert class.
      // Therefore, it does not exist in react-styles
      React92.createElement("div", Object.assign({}, props, { className: css("pf-c-form__alert", className) }), children)
    );
  };
  FormAlert.displayName = "FormAlert";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/FormGroup.js
  init_tslib_es6();
  var React93 = __toESM(require_react());
  var import_form4 = __toESM(require_form());
  var FormGroup = (_a) => {
    var { children = null, className = "", label, labelInfo, labelIcon, isRequired = false, validated = "default", isInline = false, hasNoPaddingTop = false, isStack = false, helperText, isHelperTextBeforeField = false, helperTextInvalid, helperTextIcon, helperTextInvalidIcon, fieldId, role } = _a, props = __rest(_a, ["children", "className", "label", "labelInfo", "labelIcon", "isRequired", "validated", "isInline", "hasNoPaddingTop", "isStack", "helperText", "isHelperTextBeforeField", "helperTextInvalid", "helperTextIcon", "helperTextInvalidIcon", "fieldId", "role"]);
    const validHelperText = typeof helperText !== "string" ? helperText : React93.createElement(
      "div",
      { className: css(import_form4.default.formHelperText, validated === ValidatedOptions.success && import_form4.default.modifiers.success, validated === ValidatedOptions.warning && import_form4.default.modifiers.warning), id: `${fieldId}-helper`, "aria-live": "polite" },
      helperTextIcon && React93.createElement("span", { className: css(import_form4.default.formHelperTextIcon) }, helperTextIcon),
      helperText
    );
    const inValidHelperText = typeof helperTextInvalid !== "string" ? helperTextInvalid : React93.createElement(
      "div",
      { className: css(import_form4.default.formHelperText, import_form4.default.modifiers.error), id: `${fieldId}-helper`, "aria-live": "polite" },
      helperTextInvalidIcon && React93.createElement("span", { className: css(import_form4.default.formHelperTextIcon) }, helperTextInvalidIcon),
      helperTextInvalid
    );
    const showValidHelperTxt = (validationType) => validationType !== ValidatedOptions.error && helperText ? validHelperText : "";
    const helperTextToDisplay = validated === ValidatedOptions.error && helperTextInvalid ? inValidHelperText : showValidHelperTxt(validated);
    const isGroupOrRadioGroup = role === "group" || role === "radiogroup";
    const LabelComponent = isGroupOrRadioGroup ? "span" : "label";
    const labelContent = React93.createElement(
      React93.Fragment,
      null,
      React93.createElement(
        LabelComponent,
        Object.assign({ className: css(import_form4.default.formLabel) }, !isGroupOrRadioGroup && { htmlFor: fieldId }),
        React93.createElement("span", { className: css(import_form4.default.formLabelText) }, label),
        isRequired && React93.createElement(
          "span",
          { className: css(import_form4.default.formLabelRequired), "aria-hidden": "true" },
          " ",
          ASTERISK
        )
      ),
      " ",
      React93.isValidElement(labelIcon) && labelIcon
    );
    return React93.createElement(GenerateId, null, (randomId) => React93.createElement(
      "div",
      Object.assign({ className: css(import_form4.default.formGroup, className) }, role && { role }, isGroupOrRadioGroup && { "aria-labelledby": `${fieldId || randomId}-legend` }, props),
      label && React93.createElement(
        "div",
        Object.assign({ className: css(import_form4.default.formGroupLabel, labelInfo && import_form4.default.modifiers.info, hasNoPaddingTop && import_form4.default.modifiers.noPaddingTop) }, isGroupOrRadioGroup && { id: `${fieldId || randomId}-legend` }),
        labelInfo && React93.createElement(
          React93.Fragment,
          null,
          React93.createElement("div", { className: css(import_form4.default.formGroupLabelMain) }, labelContent),
          React93.createElement("div", { className: css(import_form4.default.formGroupLabelInfo) }, labelInfo)
        ),
        !labelInfo && labelContent
      ),
      React93.createElement(
        "div",
        { className: css(import_form4.default.formGroupControl, isInline && import_form4.default.modifiers.inline, isStack && import_form4.default.modifiers.stack) },
        isHelperTextBeforeField && helperTextToDisplay,
        children,
        !isHelperTextBeforeField && helperTextToDisplay
      )
    ));
  };
  FormGroup.displayName = "FormGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/FormHelperText.js
  init_tslib_es6();
  var React94 = __toESM(require_react());
  var import_form5 = __toESM(require_form());
  var FormHelperText = (_a) => {
    var { children = null, isError = false, isHidden: isHidden3 = true, className = "", icon: icon2 = null, component = "p" } = _a, props = __rest(_a, ["children", "isError", "isHidden", "className", "icon", "component"]);
    const Component50 = component;
    return React94.createElement(
      Component50,
      Object.assign({ className: css(import_form5.default.formHelperText, isError && import_form5.default.modifiers.error, isHidden3 && import_form5.default.modifiers.hidden, className) }, props),
      icon2 && React94.createElement("span", { className: css(import_form5.default.formHelperTextIcon) }, icon2),
      children
    );
  };
  FormHelperText.displayName = "FormHelperText";

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/Panel.js
  init_tslib_es6();
  var React95 = __toESM(require_react());
  var import_panel = __toESM(require_panel());
  var PanelBase = (_a) => {
    var { className, children, variant, isScrollable, innerRef } = _a, props = __rest(_a, ["className", "children", "variant", "isScrollable", "innerRef"]);
    return React95.createElement("div", Object.assign({ className: css(import_panel.default.panel, variant === "raised" && import_panel.default.modifiers.raised, variant === "bordered" && import_panel.default.modifiers.bordered, isScrollable && import_panel.default.modifiers.scrollable, className), ref: innerRef }, props), children);
  };
  var Panel = React95.forwardRef((props, ref) => React95.createElement(PanelBase, Object.assign({ innerRef: ref }, props)));
  Panel.displayName = "Panel";

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/PanelMain.js
  init_tslib_es6();
  var React96 = __toESM(require_react());
  var import_panel2 = __toESM(require_panel());
  var PanelMain = (_a) => {
    var { className, children, maxHeight } = _a, props = __rest(_a, ["className", "children", "maxHeight"]);
    return React96.createElement("div", Object.assign({ className: css(import_panel2.default.panelMain, className), style: { "--pf-c-panel__main--MaxHeight": maxHeight } }, props), children);
  };
  PanelMain.displayName = "PanelMain";

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/PanelMainBody.js
  init_tslib_es6();
  var React97 = __toESM(require_react());
  var import_panel3 = __toESM(require_panel());
  var PanelMainBody = (_a) => {
    var { className, children } = _a, props = __rest(_a, ["className", "children"]);
    return React97.createElement("div", Object.assign({ className: css(import_panel3.default.panelMainBody, className) }, props), children);
  };
  PanelMainBody.displayName = "PanelMainBody";

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/AdvancedSearchMenu.js
  var AdvancedSearchMenu = ({ className, parentRef, parentInputRef, value = "", attributes = [], formAdditionalItems, hasWordsAttrLabel = "Has words", advancedSearchDelimiter, getAttrValueMap, onChange, onSearch, onClear, resetButtonLabel = "Reset", submitSearchButtonLabel = "Search", isSearchMenuOpen, onToggleAdvancedMenu }) => {
    const firstAttrRef = React98.useRef(null);
    const [putFocusBackOnInput, setPutFocusBackOnInput] = React98.useState(false);
    React98.useEffect(() => {
      if (attributes.length > 0 && !advancedSearchDelimiter) {
        console.error("AdvancedSearchMenu: An advancedSearchDelimiter prop is required when advanced search attributes are provided using the attributes prop");
      }
    });
    React98.useEffect(() => {
      if (isSearchMenuOpen && firstAttrRef && firstAttrRef.current) {
        firstAttrRef.current.focus();
        setPutFocusBackOnInput(true);
      } else if (!isSearchMenuOpen && putFocusBackOnInput && parentInputRef && parentInputRef.current) {
        parentInputRef.current.focus();
      }
    }, [isSearchMenuOpen]);
    React98.useEffect(() => {
      document.addEventListener("mousedown", onDocClick);
      document.addEventListener("touchstart", onDocClick);
      document.addEventListener("keydown", onEscPress);
      return function cleanup() {
        document.removeEventListener("mousedown", onDocClick);
        document.removeEventListener("touchstart", onDocClick);
        document.removeEventListener("keydown", onEscPress);
      };
    });
    const onDocClick = (event) => {
      const clickedWithinSearchInput = parentRef && parentRef.current.contains(event.target);
      if (isSearchMenuOpen && !clickedWithinSearchInput) {
        onToggleAdvancedMenu(event);
      }
    };
    const onEscPress = (event) => {
      if (isSearchMenuOpen && event.key === KeyTypes.Escape && parentRef && parentRef.current.contains(event.target)) {
        onToggleAdvancedMenu(event);
        if (parentInputRef) {
          parentInputRef.current.focus();
        }
      }
    };
    const onSearchHandler = (event) => {
      event.preventDefault();
      if (onSearch) {
        onSearch(event, value, getAttrValueMap());
      }
      if (isSearchMenuOpen) {
        onToggleAdvancedMenu(event);
      }
    };
    const handleValueChange = (attribute, newValue, event) => {
      const newMap = getAttrValueMap();
      newMap[attribute] = newValue;
      let updatedValue = "";
      Object.entries(newMap).forEach(([k2, v]) => {
        if (v.trim() !== "") {
          const quoteWrappedValue = v.includes(" ") ? `'${v.replace(/(^'|'$)/g, "")}'` : v;
          if (k2 !== "haswords") {
            updatedValue = `${updatedValue} ${k2}${advancedSearchDelimiter}${quoteWrappedValue}`;
          } else {
            updatedValue = `${updatedValue} ${quoteWrappedValue}`;
          }
        }
      });
      if (onChange) {
        onChange(event, updatedValue.replace(/^\s+/g, ""));
      }
    };
    const getValue2 = (attribute) => {
      const map2 = getAttrValueMap();
      return map2.hasOwnProperty(attribute) ? map2[attribute] : "";
    };
    const buildFormGroups = () => {
      const formGroups = [];
      attributes.forEach((attribute, index) => {
        const display = typeof attribute === "string" ? attribute : attribute.display;
        const queryAttr = typeof attribute === "string" ? attribute : attribute.attr;
        if (index === 0) {
          formGroups.push(React98.createElement(
            FormGroup,
            { label: display, fieldId: `${queryAttr}_${index}`, key: `${attribute}_${index}` },
            React98.createElement(TextInput, { ref: firstAttrRef, type: "text", id: `${queryAttr}_${index}`, value: getValue2(queryAttr), onChange: (value2, evt) => handleValueChange(queryAttr, value2, evt) })
          ));
        } else {
          formGroups.push(React98.createElement(
            FormGroup,
            { label: display, fieldId: `${queryAttr}_${index}`, key: `${attribute}_${index}` },
            React98.createElement(TextInput, { type: "text", id: `${queryAttr}_${index}`, value: getValue2(queryAttr), onChange: (value2, evt) => handleValueChange(queryAttr, value2, evt) })
          ));
        }
      });
      formGroups.push(React98.createElement(GenerateId, { key: "hasWords" }, (randomId) => React98.createElement(
        FormGroup,
        { label: hasWordsAttrLabel, fieldId: randomId },
        React98.createElement(TextInput, { type: "text", id: randomId, value: getValue2("haswords"), onChange: (value2, evt) => handleValueChange("haswords", value2, evt) })
      )));
      return formGroups;
    };
    return isSearchMenuOpen ? React98.createElement(
      Panel,
      { variant: "raised", className: css(className) },
      React98.createElement(
        PanelMain,
        null,
        React98.createElement(
          PanelMainBody,
          null,
          React98.createElement(
            Form,
            null,
            buildFormGroups(),
            formAdditionalItems ? formAdditionalItems : null,
            React98.createElement(
              ActionGroup,
              null,
              React98.createElement(Button, { variant: "primary", type: "submit", onClick: onSearchHandler, isDisabled: !value }, submitSearchButtonLabel),
              !!onClear && React98.createElement(Button, { variant: "link", type: "reset", onClick: onClear }, resetButtonLabel)
            )
          )
        )
      )
    ) : null;
  };
  AdvancedSearchMenu.displayName = "SearchInput";

  // node_modules/@patternfly/react-core/dist/esm/components/TextInputGroup/TextInputGroup.js
  init_tslib_es6();
  var React99 = __toESM(require_react());
  var import_text_input_group = __toESM(require_text_input_group());
  var TextInputGroupContext = React99.createContext({
    isDisabled: false
  });
  var TextInputGroup = (_a) => {
    var { children, className, isDisabled, isPlain, innerRef } = _a, props = __rest(_a, ["children", "className", "isDisabled", "isPlain", "innerRef"]);
    const ref = React99.useRef(null);
    const textInputGroupRef = innerRef || ref;
    return React99.createElement(
      TextInputGroupContext.Provider,
      { value: { isDisabled } },
      React99.createElement("div", Object.assign({ ref: textInputGroupRef, className: css(import_text_input_group.default.textInputGroup, isDisabled && import_text_input_group.default.modifiers.disabled, isPlain && import_text_input_group.default.modifiers.plain, className) }, props), children)
    );
  };
  TextInputGroup.displayName = "TextInputGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/TextInputGroup/TextInputGroupMain.js
  init_tslib_es6();
  var React100 = __toESM(require_react());
  var import_text_input_group2 = __toESM(require_text_input_group());
  var TextInputGroupMain = (_a) => {
    var { children, className, icon: icon2, type = "text", hint, onChange = () => void 0, onFocus, onBlur, "aria-label": ariaLabel = "Type to filter", value: inputValue, placeholder: inputPlaceHolder, innerRef, name: name2 } = _a, props = __rest(_a, ["children", "className", "icon", "type", "hint", "onChange", "onFocus", "onBlur", "aria-label", "value", "placeholder", "innerRef", "name"]);
    const { isDisabled } = React100.useContext(TextInputGroupContext);
    const ref = React100.useRef(null);
    const textInputGroupInputInputRef = innerRef || ref;
    const handleChange = (event) => {
      onChange(event, event.currentTarget.value);
    };
    return React100.createElement(
      "div",
      Object.assign({ className: css(import_text_input_group2.default.textInputGroupMain, icon2 && import_text_input_group2.default.modifiers.icon, className) }, props),
      children,
      React100.createElement(
        "span",
        { className: css(import_text_input_group2.default.textInputGroupText) },
        hint && React100.createElement("input", { className: css(import_text_input_group2.default.textInputGroupTextInput, import_text_input_group2.default.modifiers.hint), type: "text", disabled: true, "aria-hidden": "true", value: hint }),
        icon2 && React100.createElement("span", { className: css(import_text_input_group2.default.textInputGroupIcon) }, icon2),
        React100.createElement("input", { ref: textInputGroupInputInputRef, type, className: css(import_text_input_group2.default.textInputGroupTextInput), "aria-label": ariaLabel, disabled: isDisabled, onChange: handleChange, onFocus, onBlur, value: inputValue || "", placeholder: inputPlaceHolder, name: name2 })
      )
    );
  };
  TextInputGroupMain.displayName = "TextInputGroupMain";

  // node_modules/@patternfly/react-core/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js
  init_tslib_es6();
  var React101 = __toESM(require_react());
  var import_text_input_group3 = __toESM(require_text_input_group());
  var TextInputGroupUtilities = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React101.createElement("div", Object.assign({ className: css(import_text_input_group3.default.textInputGroupUtilities, className) }, props), children);
  };
  TextInputGroupUtilities.displayName = "TextInputGroupUtilities";

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/SearchInput.js
  var SearchInputBase = (_a) => {
    var { className, value = "", attributes = [], formAdditionalItems, hasWordsAttrLabel = "Has words", advancedSearchDelimiter, placeholder, hint, onChange, onSearch, onClear, onToggleAdvancedSearch, isAdvancedSearchOpen, resultsCount, onNextClick, onPreviousClick, innerRef, expandableInput, "aria-label": ariaLabel = "Search input", resetButtonLabel = "Reset", openMenuButtonAriaLabel = "Open advanced search", previousNavigationButtonAriaLabel = "Previous", isPreviousNavigationButtonDisabled = false, isNextNavigationButtonDisabled = false, nextNavigationButtonAriaLabel = "Next", submitSearchButtonLabel = "Search", isDisabled = false, appendTo, removeFindDomNode = false, zIndex = 9999, type = "text", name: name2 } = _a, props = __rest(_a, ["className", "value", "attributes", "formAdditionalItems", "hasWordsAttrLabel", "advancedSearchDelimiter", "placeholder", "hint", "onChange", "onSearch", "onClear", "onToggleAdvancedSearch", "isAdvancedSearchOpen", "resultsCount", "onNextClick", "onPreviousClick", "innerRef", "expandableInput", "aria-label", "resetButtonLabel", "openMenuButtonAriaLabel", "previousNavigationButtonAriaLabel", "isPreviousNavigationButtonDisabled", "isNextNavigationButtonDisabled", "nextNavigationButtonAriaLabel", "submitSearchButtonLabel", "isDisabled", "appendTo", "removeFindDomNode", "zIndex", "type", "name"]);
    const [isSearchMenuOpen, setIsSearchMenuOpen] = React102.useState(false);
    const [searchValue, setSearchValue] = React102.useState(value);
    const searchInputRef = React102.useRef(null);
    const ref = React102.useRef(null);
    const searchInputInputRef = innerRef || ref;
    const searchInputExpandableToggleRef = React102.useRef(null);
    const [focusAfterExpandChange, setFocusAfterExpandChange] = React102.useState(false);
    const { isExpanded, onToggleExpand, toggleAriaLabel } = expandableInput || {};
    React102.useEffect(() => {
      var _a2, _b;
      if (!focusAfterExpandChange) {
        return;
      } else if (isExpanded) {
        (_a2 = searchInputInputRef === null || searchInputInputRef === void 0 ? void 0 : searchInputInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus();
      } else {
        (_b = searchInputExpandableToggleRef === null || searchInputExpandableToggleRef === void 0 ? void 0 : searchInputExpandableToggleRef.current) === null || _b === void 0 ? void 0 : _b.focus();
      }
      setFocusAfterExpandChange(false);
    }, [focusAfterExpandChange, isExpanded, searchInputInputRef, searchInputExpandableToggleRef]);
    React102.useEffect(() => {
      setSearchValue(value);
    }, [value]);
    React102.useEffect(() => {
      if (attributes.length > 0 && !advancedSearchDelimiter) {
        console.error("An advancedSearchDelimiter prop is required when advanced search attributes are provided using the attributes prop");
      }
    });
    React102.useEffect(() => {
      setIsSearchMenuOpen(isAdvancedSearchOpen);
    }, [isAdvancedSearchOpen]);
    const onChangeHandler = (event, value2) => {
      if (onChange) {
        onChange(event, value2);
      }
      setSearchValue(value2);
    };
    const onToggle = (e) => {
      const isOpen = !isSearchMenuOpen;
      setIsSearchMenuOpen(isOpen);
      if (onToggleAdvancedSearch) {
        onToggleAdvancedSearch(e, isOpen);
      }
    };
    const onSearchHandler = (event) => {
      event.preventDefault();
      if (onSearch) {
        onSearch(event, value, getAttrValueMap());
      }
      setIsSearchMenuOpen(false);
    };
    const splitStringExceptInQuotes = (str) => {
      let quoteType;
      return str.match(/\\?.|^$/g).reduce((p2, c2) => {
        if (c2 === "'" || c2 === '"') {
          if (!quoteType) {
            quoteType = c2;
          }
          if (c2 === quoteType) {
            p2.quote = !p2.quote;
          }
        } else if (!p2.quote && c2 === " ") {
          p2.a.push("");
        } else {
          p2.a[p2.a.length - 1] += c2.replace(/\\(.)/, "$1");
        }
        return p2;
      }, { a: [""] }).a;
    };
    const getAttrValueMap = () => {
      const attrValue = {};
      const pairs = splitStringExceptInQuotes(searchValue);
      pairs.map((pair) => {
        const splitPair = pair.split(advancedSearchDelimiter);
        if (splitPair.length === 2) {
          attrValue[splitPair[0]] = splitPair[1].replace(/(^'|'$)/g, "");
        } else if (splitPair.length === 1) {
          attrValue.haswords = attrValue.hasOwnProperty("haswords") ? `${attrValue.haswords} ${splitPair[0]}` : splitPair[0];
        }
      });
      return attrValue;
    };
    const onEnter = (event) => {
      if (event.key === "Enter") {
        onSearchHandler(event);
      }
    };
    const onClearInput = (e) => {
      if (onClear) {
        onClear(e);
      }
      if (searchInputInputRef && searchInputInputRef.current) {
        searchInputInputRef.current.focus();
      }
    };
    const onExpandHandler = (event) => {
      setSearchValue("");
      onToggleExpand(event, isExpanded);
      setFocusAfterExpandChange(true);
    };
    const renderUtilities = value && (resultsCount || !!onNextClick && !!onPreviousClick || !!onClear && !expandableInput);
    const buildTextInputGroup = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      return React102.createElement(
        TextInputGroup,
        Object.assign({ isDisabled }, searchInputProps2),
        React102.createElement(TextInputGroupMain, { hint, icon: React102.createElement(search_icon_default, null), innerRef: searchInputInputRef, value: searchValue, placeholder, "aria-label": ariaLabel, onKeyDown: onEnter, onChange: onChangeHandler, type, name: name2 }),
        renderUtilities && React102.createElement(
          TextInputGroupUtilities,
          null,
          resultsCount && React102.createElement(Badge, { isRead: true }, resultsCount),
          !!onNextClick && !!onPreviousClick && React102.createElement(
            "div",
            { className: "pf-c-text-input-group__group" },
            React102.createElement(
              Button,
              { variant: ButtonVariant.plain, "aria-label": previousNavigationButtonAriaLabel, isDisabled: isDisabled || isPreviousNavigationButtonDisabled, onClick: onPreviousClick },
              React102.createElement(angle_up_icon_default, null)
            ),
            React102.createElement(
              Button,
              { variant: ButtonVariant.plain, "aria-label": nextNavigationButtonAriaLabel, isDisabled: isDisabled || isNextNavigationButtonDisabled, onClick: onNextClick },
              React102.createElement(angle_down_icon_default, null)
            )
          ),
          !!onClear && !expandableInput && React102.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled, "aria-label": resetButtonLabel, onClick: onClearInput },
            React102.createElement(times_icon_default, null)
          )
        )
      );
    };
    const expandableToggle = React102.createElement(Button, { variant: ButtonVariant.plain, "aria-label": toggleAriaLabel, "aria-expanded": isExpanded, icon: isExpanded ? React102.createElement(times_icon_default, null) : React102.createElement(search_icon_default, null), onClick: onExpandHandler, ref: searchInputExpandableToggleRef });
    const buildExpandableSearchInput = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      return React102.createElement(
        InputGroup,
        Object.assign({}, searchInputProps2),
        buildTextInputGroup(),
        expandableToggle
      );
    };
    const buildSearchTextInputGroup = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      if (expandableInput) {
        return buildExpandableSearchInput(Object.assign({}, searchInputProps2));
      }
      return buildTextInputGroup(Object.assign({}, searchInputProps2));
    };
    const buildSearchTextInputGroupWithExtraButtons = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      return React102.createElement(
        InputGroup,
        Object.assign({}, searchInputProps2),
        buildTextInputGroup(),
        (attributes.length > 0 || onToggleAdvancedSearch) && React102.createElement(
          Button,
          { className: isSearchMenuOpen && "pf-m-expanded", variant: ButtonVariant.control, "aria-label": openMenuButtonAriaLabel, onClick: onToggle, isDisabled, "aria-expanded": isSearchMenuOpen },
          React102.createElement(caret_down_icon_default, null)
        ),
        !!onSearch && React102.createElement(
          Button,
          { type: "submit", variant: ButtonVariant.control, "aria-label": submitSearchButtonLabel, onClick: onSearchHandler, isDisabled: isDisabled || !searchValue },
          React102.createElement(arrow_right_icon_default, null)
        ),
        expandableInput && expandableToggle
      );
    };
    const searchInputProps = Object.assign(Object.assign({}, props), { className: className && css(className), innerRef: searchInputRef });
    if (!!expandableInput && !isExpanded) {
      return React102.createElement(InputGroup, Object.assign({}, searchInputProps), expandableToggle);
    }
    if (!!onSearch || attributes.length > 0 || !!onToggleAdvancedSearch) {
      if (attributes.length > 0) {
        const AdvancedSearch = React102.createElement(
          "div",
          null,
          React102.createElement(AdvancedSearchMenu, { value, parentRef: searchInputRef, parentInputRef: searchInputInputRef, onSearch, onClear, onChange, onToggleAdvancedMenu: onToggle, resetButtonLabel, submitSearchButtonLabel, attributes, formAdditionalItems, hasWordsAttrLabel, advancedSearchDelimiter, getAttrValueMap, isSearchMenuOpen })
        );
        const AdvancedSearchWithPopper = React102.createElement(
          "div",
          Object.assign({ className: css(className), ref: searchInputRef }, props),
          React102.createElement(Popper, { trigger: buildSearchTextInputGroupWithExtraButtons(), popper: AdvancedSearch, isVisible: isSearchMenuOpen, enableFlip: true, appendTo: () => appendTo || searchInputRef.current, removeFindDomNode, zIndex })
        );
        const AdvancedSearchInline = React102.createElement(
          "div",
          Object.assign({ className: css(className), ref: searchInputRef }, props),
          buildSearchTextInputGroupWithExtraButtons(),
          AdvancedSearch
        );
        return appendTo !== "inline" ? AdvancedSearchWithPopper : AdvancedSearchInline;
      }
      return buildSearchTextInputGroupWithExtraButtons(Object.assign({}, searchInputProps));
    }
    return buildSearchTextInputGroup(searchInputProps);
  };
  SearchInputBase.displayName = "SearchInputBase";
  var SearchInput = React102.forwardRef((props, ref) => React102.createElement(SearchInputBase, Object.assign({}, props, { innerRef: ref })));
  SearchInput.displayName = "SearchInput";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorPane.js
  var DualListSelectorPane = (_a) => {
    var { isChosen = false, className = "", status = "", actions, searchInput, children, onOptionSelect, onOptionCheck, title = "", options: options4 = [], selectedOptions = [], isSearchable = false, searchInputAriaLabel = "", onFilterUpdate, onSearchInputChanged, onSearchInputClear, filterOption, id = getUniqueId("dual-list-selector-pane"), isDisabled = false, listMinHeight } = _a, props = __rest(_a, ["isChosen", "className", "status", "actions", "searchInput", "children", "onOptionSelect", "onOptionCheck", "title", "options", "selectedOptions", "isSearchable", "searchInputAriaLabel", "onFilterUpdate", "onSearchInputChanged", "onSearchInputClear", "filterOption", "id", "isDisabled", "listMinHeight"]);
    const [input, setInput] = React103.useState("");
    const { isTree } = React103.useContext(DualListSelectorContext);
    const onChange = (e, newValue) => {
      let filtered;
      if (isTree) {
        filtered = options4.map((opt) => Object.assign({}, opt)).filter((item) => filterInput(item, newValue));
      } else {
        filtered = options4.filter((option) => {
          if (displayOption(option)) {
            return option;
          }
        });
      }
      onFilterUpdate(filtered, isChosen ? "chosen" : "available", newValue === "");
      if (onSearchInputChanged) {
        onSearchInputChanged(newValue, e);
      }
      setInput(newValue);
    };
    const filterInput = (item, input2) => {
      if (filterOption) {
        return filterOption(item, input2);
      } else {
        if (item.text.toLowerCase().includes(input2.toLowerCase()) || input2 === "") {
          return true;
        }
      }
      if (item.children) {
        return (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child) => filterInput(child, input2))).length > 0;
      }
    };
    const displayOption = (option) => {
      if (filterOption) {
        return filterOption(option, input);
      } else {
        return option.toString().toLowerCase().includes(input.toLowerCase());
      }
    };
    return React103.createElement(
      "div",
      Object.assign({ className: css(import_dual_list_selector6.default.dualListSelectorPane, isChosen ? import_dual_list_selector6.default.modifiers.chosen : "pf-m-available", className) }, props),
      title && React103.createElement(
        "div",
        { className: css(import_dual_list_selector6.default.dualListSelectorHeader) },
        React103.createElement(
          "div",
          { className: "pf-c-dual-list-selector__title" },
          React103.createElement("div", { className: css(import_dual_list_selector6.default.dualListSelectorTitleText) }, title)
        )
      ),
      (actions || searchInput || isSearchable) && React103.createElement(
        "div",
        { className: css(import_dual_list_selector6.default.dualListSelectorTools) },
        (isSearchable || searchInput) && React103.createElement("div", { className: css(import_dual_list_selector6.default.dualListSelectorToolsFilter) }, searchInput ? searchInput : React103.createElement(SearchInput, { onChange: isDisabled ? void 0 : onChange, onClear: onSearchInputClear ? onSearchInputClear : (e) => onChange(e, ""), isDisabled, "aria-label": searchInputAriaLabel, type: "search" })),
        actions && React103.createElement("div", { className: css(import_dual_list_selector6.default.dualListSelectorToolsActions) }, actions)
      ),
      status && React103.createElement(
        "div",
        { className: css(import_dual_list_selector6.default.dualListSelectorStatus) },
        React103.createElement("div", { className: css(import_dual_list_selector6.default.dualListSelectorStatusText), id: `${id}-status` }, status)
      ),
      React103.createElement(
        DualListSelectorPaneContext.Provider,
        { value: { isChosen } },
        !isTree && React103.createElement(DualListSelectorListWrapper, Object.assign({ "aria-labelledby": `${id}-status`, options: options4, selectedOptions, onOptionSelect: (e, index, id2) => onOptionSelect(e, index, isChosen, id2), displayOption, id: `${id}-list`, isDisabled }, listMinHeight && {
          style: { "--pf-c-dual-list-selector__menu--MinHeight": listMinHeight }
        }), children),
        isTree && React103.createElement(DualListSelectorListWrapper, Object.assign({ "aria-labelledby": `${id}-status`, id: `${id}-list` }, listMinHeight && {
          style: { "--pf-c-dual-list-selector__menu--MinHeight": listMinHeight }
        }), options4.length > 0 ? React103.createElement(
          DualListSelectorList,
          null,
          React103.createElement(DualListSelectorTree, { data: isSearchable ? options4.map((opt) => Object.assign({}, opt)).filter((item) => filterInput(item, input)) : options4, onOptionCheck, id: `${id}-tree`, isDisabled })
        ) : children)
      )
    );
  };
  DualListSelectorPane.displayName = "DualListSelectorPane";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js
  init_tslib_es6();
  var React104 = __toESM(require_react());
  var import_dual_list_selector7 = __toESM(require_dual_list_selector());
  var DualListSelectorControlsWrapperBase = (_a) => {
    var { innerRef, children = null, className, "aria-label": ariaLabel = "Controls for moving options between lists" } = _a, props = __rest(_a, ["innerRef", "children", "className", "aria-label"]);
    const ref = React104.useRef(null);
    const wrapperRef = innerRef || ref;
    const handleKeys = (event) => {
      if (!wrapperRef.current || wrapperRef.current !== event.target.closest(".pf-c-dual-list-selector__controls") && !Array.from(wrapperRef.current.getElementsByClassName("pf-c-dual-list-selector__controls")).includes(event.target.closest(".pf-c-dual-list-selector__controls"))) {
        return;
      }
      event.stopImmediatePropagation();
      const controls = Array.from(wrapperRef.current.getElementsByTagName("BUTTON")).filter((el) => !el.classList.contains("pf-m-disabled"));
      const activeElement = document.activeElement;
      handleArrows(event, controls, (element) => activeElement.contains(element), (element) => element, void 0, void 0, true, false);
    };
    React104.useEffect(() => {
      window.addEventListener("keydown", handleKeys);
      return () => {
        window.removeEventListener("keydown", handleKeys);
      };
    }, [wrapperRef.current]);
    return React104.createElement("div", Object.assign({ className: css(import_dual_list_selector7.default.dualListSelectorControls, className), tabIndex: 0, ref: wrapperRef, "aria-label": ariaLabel }, props), children);
  };
  DualListSelectorControlsWrapperBase.displayName = "DualListSelectorControlsWrapperBase";
  var DualListSelectorControlsWrapper = React104.forwardRef((props, ref) => React104.createElement(DualListSelectorControlsWrapperBase, Object.assign({ innerRef: ref, role: "group" }, props)));
  DualListSelectorControlsWrapper.displayName = "DualListSelectorControlsWrapper";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorControl.js
  init_tslib_es6();
  var React105 = __toESM(require_react());
  var DualListSelectorControlBase = (_a) => {
    var { innerRef, children = null, className, "aria-label": ariaLabel, isDisabled = true, onClick = () => {
    }, tooltipContent, tooltipProps = {} } = _a, props = __rest(_a, ["innerRef", "children", "className", "aria-label", "isDisabled", "onClick", "tooltipContent", "tooltipProps"]);
    const privateRef = React105.useRef(null);
    const ref = innerRef || privateRef;
    return React105.createElement(
      "div",
      Object.assign({ className: css("pf-c-dual-list-selector__controls-item", className) }, props),
      React105.createElement(Button, { isDisabled, "aria-disabled": isDisabled, variant: ButtonVariant.plain, onClick, "aria-label": ariaLabel, tabIndex: -1, ref }, children),
      tooltipContent && React105.createElement(Tooltip, Object.assign({ content: tooltipContent, position: "left", reference: ref }, tooltipProps))
    );
  };
  DualListSelectorControlBase.displayName = "DualListSelectorControlBase";
  var DualListSelectorControl = React105.forwardRef((props, ref) => React105.createElement(DualListSelectorControlBase, Object.assign({ innerRef: ref }, props)));
  DualListSelectorControl.displayName = "DualListSelectorControl";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelector.js
  var DualListSelector = class extends React106.Component {
    constructor(props) {
      super(props);
      this.addAllButtonRef = React106.createRef();
      this.addSelectedButtonRef = React106.createRef();
      this.removeSelectedButtonRef = React106.createRef();
      this.removeAllButtonRef = React106.createRef();
      this.replacer = (key, value) => {
        if (key[0] === "_") {
          return void 0;
        }
        return value;
      };
      this.onFilterUpdate = (newFilteredOptions, paneType, isSearchReset) => {
        const { isTree } = this.props;
        if (paneType === "available") {
          if (isSearchReset) {
            this.setState({
              availableFilteredOptions: null,
              availableTreeFilteredOptions: null
            });
            return;
          }
          if (isTree) {
            this.setState({
              availableTreeFilteredOptions: flattenTreeWithFolders(newFilteredOptions)
            });
          } else {
            this.setState({
              availableFilteredOptions: newFilteredOptions
            });
          }
        } else if (paneType === "chosen") {
          if (isSearchReset) {
            this.setState({
              chosenFilteredOptions: null,
              chosenTreeFilteredOptions: null
            });
            return;
          }
          if (isTree) {
            this.setState({
              chosenTreeFilteredOptions: flattenTreeWithFolders(newFilteredOptions)
            });
          } else {
            this.setState({
              chosenFilteredOptions: newFilteredOptions
            });
          }
        }
      };
      this.addAllVisible = () => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newAvailable = [];
          const movedOptions = prevState.availableFilteredOptions || prevState.availableOptions;
          prevState.availableOptions.forEach((value) => {
            if (movedOptions.indexOf(value) !== -1) {
              itemsToRemove.push(value);
            } else {
              newAvailable.push(value);
            }
          });
          const newChosen = [...prevState.chosenOptions, ...itemsToRemove];
          this.props.addAll && this.props.addAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable,
            chosenOptionsSelected: [],
            availableOptionsSelected: []
          };
        });
      };
      this.addAllTreeVisible = () => {
        this.setState((prevState) => {
          const movedOptions = prevState.availableTreeFilteredOptions || flattenTreeWithFolders(prevState.availableOptions);
          const newAvailable = prevState.availableOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, movedOptions));
          const currChosen = flattenTree(prevState.chosenOptions);
          const nextChosenOptions = currChosen.concat(movedOptions);
          const newChosen = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextChosenOptions));
          this.props.addAll && this.props.addAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable,
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: []
          };
        });
      };
      this.addSelected = () => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newAvailable = [];
          prevState.availableOptions.forEach((value, index) => {
            if (prevState.availableOptionsSelected.indexOf(index) !== -1) {
              itemsToRemove.push(value);
            } else {
              newAvailable.push(value);
            }
          });
          const newChosen = [...prevState.chosenOptions, ...itemsToRemove];
          this.props.addSelected && this.props.addSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            chosenOptionsSelected: [],
            availableOptionsSelected: [],
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable
          };
        });
      };
      this.addTreeSelected = () => {
        this.setState((prevState) => {
          const newAvailable = prevState.availableOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, prevState.availableTreeOptionsChecked));
          const currChosen = flattenTree(prevState.chosenOptions);
          const nextChosenOptions = currChosen.concat(prevState.availableTreeOptionsChecked);
          const newChosen = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextChosenOptions));
          this.props.addSelected && this.props.addSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: [],
            availableOptions: newAvailable,
            chosenOptions: newChosen
          };
        });
      };
      this.removeAllVisible = () => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newChosen = [];
          const movedOptions = prevState.chosenFilteredOptions || prevState.chosenOptions;
          prevState.chosenOptions.forEach((value) => {
            if (movedOptions.indexOf(value) !== -1) {
              itemsToRemove.push(value);
            } else {
              newChosen.push(value);
            }
          });
          const newAvailable = [...prevState.availableOptions, ...itemsToRemove];
          this.props.removeAll && this.props.removeAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable,
            chosenOptionsSelected: [],
            availableOptionsSelected: []
          };
        });
      };
      this.removeAllTreeVisible = () => {
        this.setState((prevState) => {
          const movedOptions = prevState.chosenTreeFilteredOptions || flattenTreeWithFolders(prevState.chosenOptions);
          const newChosen = prevState.chosenOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, movedOptions));
          const currAvailable = flattenTree(prevState.availableOptions);
          const nextAvailableOptions = currAvailable.concat(movedOptions);
          const newAvailable = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextAvailableOptions));
          this.props.removeAll && this.props.removeAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            availableOptions: newAvailable,
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: []
          };
        });
      };
      this.removeSelected = () => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newChosen = [];
          prevState.chosenOptions.forEach((value, index) => {
            if (prevState.chosenOptionsSelected.indexOf(index) !== -1) {
              itemsToRemove.push(value);
            } else {
              newChosen.push(value);
            }
          });
          const newAvailable = [...prevState.availableOptions, ...itemsToRemove];
          this.props.removeSelected && this.props.removeSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            chosenOptionsSelected: [],
            availableOptionsSelected: [],
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable
          };
        });
      };
      this.removeTreeSelected = () => {
        this.setState((prevState) => {
          const newChosen = prevState.chosenOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, prevState.chosenTreeOptionsChecked));
          const currAvailable = flattenTree(prevState.availableOptions);
          const nextAvailableOptions = currAvailable.concat(prevState.chosenTreeOptionsChecked);
          const newAvailable = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextAvailableOptions));
          this.props.removeSelected && this.props.removeSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(newAvailable, newChosen);
          return {
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: [],
            availableOptions: newAvailable,
            chosenOptions: newChosen
          };
        });
      };
      this.onOptionSelect = (e, index, isChosen, id, itemData, parentData) => {
        this.setState((prevState) => {
          const originalArray = isChosen ? prevState.chosenOptionsSelected : prevState.availableOptionsSelected;
          let updatedArray = null;
          if (originalArray.indexOf(index) !== -1) {
            updatedArray = originalArray.filter((value) => value !== index);
          } else {
            updatedArray = [...originalArray, index];
          }
          return {
            chosenOptionsSelected: isChosen ? updatedArray : prevState.chosenOptionsSelected,
            availableOptionsSelected: isChosen ? prevState.availableOptionsSelected : updatedArray
          };
        });
        this.props.onOptionSelect && this.props.onOptionSelect(e, index, isChosen, id, itemData, parentData);
      };
      this.isChecked = (treeItem, isChosen) => isChosen ? this.state.chosenTreeOptionsChecked.includes(treeItem.id) : this.state.availableTreeOptionsChecked.includes(treeItem.id);
      this.areAllDescendantsChecked = (treeItem, isChosen) => treeItem.children ? treeItem.children.every((child) => this.areAllDescendantsChecked(child, isChosen)) : this.isChecked(treeItem, isChosen);
      this.areSomeDescendantsChecked = (treeItem, isChosen) => treeItem.children ? treeItem.children.some((child) => this.areSomeDescendantsChecked(child, isChosen)) : this.isChecked(treeItem, isChosen);
      this.mapChecked = (item, isChosen) => {
        const hasCheck = this.areAllDescendantsChecked(item, isChosen);
        item.isChecked = false;
        if (hasCheck) {
          item.isChecked = true;
        } else {
          const hasPartialCheck = this.areSomeDescendantsChecked(item, isChosen);
          if (hasPartialCheck) {
            item.isChecked = null;
          }
        }
        if (item.children) {
          return Object.assign(Object.assign({}, item), { children: item.children.map((child) => this.mapChecked(child, isChosen)) });
        }
        return item;
      };
      this.onTreeOptionCheck = (evt, isChecked, itemData, isChosen) => {
        const { availableOptions, availableTreeFilteredOptions, chosenOptions, chosenTreeFilteredOptions } = this.state;
        let panelOptions;
        if (isChosen) {
          if (chosenTreeFilteredOptions) {
            panelOptions = chosenOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, chosenTreeFilteredOptions));
          } else {
            panelOptions = chosenOptions;
          }
        } else {
          if (availableTreeFilteredOptions) {
            panelOptions = availableOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, availableTreeFilteredOptions));
          } else {
            panelOptions = availableOptions;
          }
        }
        const checkedOptionTree = panelOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItems(item, [itemData.id]));
        const flatTree = flattenTreeWithFolders(checkedOptionTree);
        const prevChecked = isChosen ? this.state.chosenTreeOptionsChecked : this.state.availableTreeOptionsChecked;
        let updatedChecked = [];
        if (isChecked) {
          updatedChecked = prevChecked.concat(flatTree.filter((id) => !prevChecked.includes(id)));
        } else {
          updatedChecked = prevChecked.filter((id) => !flatTree.includes(id));
        }
        this.setState((prevState) => ({
          availableTreeOptionsChecked: isChosen ? prevState.availableTreeOptionsChecked : updatedChecked,
          chosenTreeOptionsChecked: isChosen ? updatedChecked : prevState.chosenTreeOptionsChecked
        }), () => {
          this.props.onOptionCheck && this.props.onOptionCheck(evt, isChecked, itemData.id, updatedChecked);
        });
      };
      this.state = {
        availableOptions: [...this.props.availableOptions],
        availableOptionsSelected: [],
        availableFilteredOptions: null,
        availableTreeFilteredOptions: null,
        chosenOptions: [...this.props.chosenOptions],
        chosenOptionsSelected: [],
        chosenFilteredOptions: null,
        chosenTreeFilteredOptions: null,
        availableTreeOptionsChecked: [],
        chosenTreeOptionsChecked: []
      };
    }
    // If the DualListSelector uses trees, concat the two initial arrays and merge duplicate folder IDs
    createMergedCopy() {
      const copyOfAvailable = JSON.parse(JSON.stringify(this.props.availableOptions));
      const copyOfChosen = JSON.parse(JSON.stringify(this.props.chosenOptions));
      return this.props.isTree ? Object.values(copyOfAvailable.concat(copyOfChosen).reduce((mapObj, item) => {
        const key = item.id;
        if (mapObj[key]) {
          mapObj[key].children.push(...item.children);
        } else {
          mapObj[key] = Object.assign({}, item);
        }
        return mapObj;
      }, {})) : null;
    }
    componentDidUpdate() {
      if (JSON.stringify(this.props.availableOptions, this.replacer) !== JSON.stringify(this.state.availableOptions, this.replacer) || JSON.stringify(this.props.chosenOptions, this.replacer) !== JSON.stringify(this.state.chosenOptions, this.replacer)) {
        this.setState({
          availableOptions: [...this.props.availableOptions],
          chosenOptions: [...this.props.chosenOptions]
        });
      }
    }
    render() {
      const _a = this.props, {
        availableOptionsTitle,
        availableOptionsActions,
        availableOptionsSearchAriaLabel,
        className,
        children,
        chosenOptionsTitle,
        chosenOptionsActions,
        chosenOptionsSearchAriaLabel,
        filterOption,
        isSearchable,
        chosenOptionsStatus,
        availableOptionsStatus,
        controlsAriaLabel,
        addAllAriaLabel,
        addSelectedAriaLabel,
        removeSelectedAriaLabel,
        removeAllAriaLabel,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        availableOptions: consumerPassedAvailableOptions,
        chosenOptions: consumerPassedChosenOptions,
        removeSelected,
        addAll,
        removeAll,
        addSelected,
        onListChange,
        onAvailableOptionsSearchInputChanged,
        onChosenOptionsSearchInputChanged,
        onOptionSelect,
        onOptionCheck,
        id,
        isTree,
        isDisabled,
        addAllTooltip,
        addAllTooltipProps,
        addSelectedTooltip,
        addSelectedTooltipProps,
        removeAllTooltip,
        removeAllTooltipProps,
        removeSelectedTooltip,
        removeSelectedTooltipProps
      } = _a, props = __rest(_a, ["availableOptionsTitle", "availableOptionsActions", "availableOptionsSearchAriaLabel", "className", "children", "chosenOptionsTitle", "chosenOptionsActions", "chosenOptionsSearchAriaLabel", "filterOption", "isSearchable", "chosenOptionsStatus", "availableOptionsStatus", "controlsAriaLabel", "addAllAriaLabel", "addSelectedAriaLabel", "removeSelectedAriaLabel", "removeAllAriaLabel", "availableOptions", "chosenOptions", "removeSelected", "addAll", "removeAll", "addSelected", "onListChange", "onAvailableOptionsSearchInputChanged", "onChosenOptionsSearchInputChanged", "onOptionSelect", "onOptionCheck", "id", "isTree", "isDisabled", "addAllTooltip", "addAllTooltipProps", "addSelectedTooltip", "addSelectedTooltipProps", "removeAllTooltip", "removeAllTooltipProps", "removeSelectedTooltip", "removeSelectedTooltipProps"]);
      const { availableOptions, chosenOptions, chosenOptionsSelected, availableOptionsSelected, chosenTreeOptionsChecked, availableTreeOptionsChecked } = this.state;
      const availableOptionsStatusToDisplay = availableOptionsStatus || (isTree ? `${filterFolders(availableOptions, availableTreeOptionsChecked).length} of ${flattenTree(availableOptions).length} items selected` : `${availableOptionsSelected.length} of ${availableOptions.length} items selected`);
      const chosenOptionsStatusToDisplay = chosenOptionsStatus || (isTree ? `${filterFolders(chosenOptions, chosenTreeOptionsChecked).length} of ${flattenTree(chosenOptions).length} items selected` : `${chosenOptionsSelected.length} of ${chosenOptions.length} items selected`);
      const available = isTree ? availableOptions.map((item) => this.mapChecked(item, false)) : availableOptions;
      const chosen = isTree ? chosenOptions.map((item) => this.mapChecked(item, true)) : chosenOptions;
      return React106.createElement(
        DualListSelectorContext.Provider,
        { value: { isTree } },
        React106.createElement(GenerateId, null, (randomId) => React106.createElement("div", Object.assign({ className: css(import_dual_list_selector8.default.dualListSelector, className), id: id || randomId }, props), children === "" ? React106.createElement(
          React106.Fragment,
          null,
          React106.createElement(DualListSelectorPane, { isSearchable, onFilterUpdate: this.onFilterUpdate, searchInputAriaLabel: availableOptionsSearchAriaLabel, filterOption, onSearchInputChanged: onAvailableOptionsSearchInputChanged, status: availableOptionsStatusToDisplay, title: availableOptionsTitle, options: available, selectedOptions: isTree ? availableTreeOptionsChecked : availableOptionsSelected, onOptionSelect: this.onOptionSelect, onOptionCheck: (e, isChecked, itemData) => this.onTreeOptionCheck(e, isChecked, itemData, false), actions: availableOptionsActions, id: `${id || randomId}-available-pane`, isDisabled }),
          React106.createElement(
            DualListSelectorControlsWrapper,
            { "aria-label": controlsAriaLabel },
            React106.createElement(
              DualListSelectorControl,
              { isDisabled: (isTree ? availableTreeOptionsChecked.length === 0 : availableOptionsSelected.length === 0) || isDisabled, onClick: isTree ? this.addTreeSelected : this.addSelected, ref: this.addSelectedButtonRef, "aria-label": addSelectedAriaLabel, tooltipContent: addSelectedTooltip, tooltipProps: addSelectedTooltipProps },
              React106.createElement(angle_right_icon_default, null)
            ),
            React106.createElement(
              DualListSelectorControl,
              { isDisabled: availableOptions.length === 0 || isDisabled, onClick: isTree ? this.addAllTreeVisible : this.addAllVisible, ref: this.addAllButtonRef, "aria-label": addAllAriaLabel, tooltipContent: addAllTooltip, tooltipProps: addAllTooltipProps },
              React106.createElement(angle_double_right_icon_default, null)
            ),
            React106.createElement(
              DualListSelectorControl,
              { isDisabled: chosenOptions.length === 0 || isDisabled, onClick: isTree ? this.removeAllTreeVisible : this.removeAllVisible, "aria-label": removeAllAriaLabel, ref: this.removeAllButtonRef, tooltipContent: removeAllTooltip, tooltipProps: removeAllTooltipProps },
              React106.createElement(angle_double_left_icon_default, null)
            ),
            React106.createElement(
              DualListSelectorControl,
              { onClick: isTree ? this.removeTreeSelected : this.removeSelected, isDisabled: (isTree ? chosenTreeOptionsChecked.length === 0 : chosenOptionsSelected.length === 0) || isDisabled, ref: this.removeSelectedButtonRef, "aria-label": removeSelectedAriaLabel, tooltipContent: removeSelectedTooltip, tooltipProps: removeSelectedTooltipProps },
              React106.createElement(angle_left_icon_default, null)
            )
          ),
          React106.createElement(DualListSelectorPane, { isChosen: true, isSearchable, onFilterUpdate: this.onFilterUpdate, searchInputAriaLabel: chosenOptionsSearchAriaLabel, filterOption, onSearchInputChanged: onChosenOptionsSearchInputChanged, title: chosenOptionsTitle, status: chosenOptionsStatusToDisplay, options: chosen, selectedOptions: isTree ? chosenTreeOptionsChecked : chosenOptionsSelected, onOptionSelect: this.onOptionSelect, onOptionCheck: (e, isChecked, itemData) => this.onTreeOptionCheck(e, isChecked, itemData, true), actions: chosenOptionsActions, id: `${id || randomId}-chosen-pane`, isDisabled })
        ) : children))
      );
    }
  };
  DualListSelector.displayName = "DualListSelector";
  DualListSelector.defaultProps = {
    children: "",
    availableOptions: [],
    availableOptionsTitle: "Available options",
    availableOptionsSearchAriaLabel: "Available search input",
    chosenOptions: [],
    chosenOptionsTitle: "Chosen options",
    chosenOptionsSearchAriaLabel: "Chosen search input",
    controlsAriaLabel: "Selector controls",
    addAllAriaLabel: "Add all",
    addSelectedAriaLabel: "Add selected",
    removeSelectedAriaLabel: "Remove selected",
    removeAllAriaLabel: "Remove all",
    isTree: false,
    isDisabled: false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyState.js
  init_tslib_es6();
  var React107 = __toESM(require_react());
  var import_empty_state = __toESM(require_empty_state());
  var EmptyStateVariant;
  (function(EmptyStateVariant2) {
    EmptyStateVariant2["xs"] = "xs";
    EmptyStateVariant2["small"] = "small";
    EmptyStateVariant2["large"] = "large";
    EmptyStateVariant2["xl"] = "xl";
    EmptyStateVariant2["full"] = "full";
  })(EmptyStateVariant || (EmptyStateVariant = {}));
  var EmptyState = (_a) => {
    var { children, className = "", variant = EmptyStateVariant.full, isFullHeight } = _a, props = __rest(_a, ["children", "className", "variant", "isFullHeight"]);
    return React107.createElement(
      "div",
      Object.assign({ className: css(import_empty_state.default.emptyState, variant === "xs" && import_empty_state.default.modifiers.xs, variant === "small" && import_empty_state.default.modifiers.sm, variant === "large" && import_empty_state.default.modifiers.lg, variant === "xl" && import_empty_state.default.modifiers.xl, isFullHeight && import_empty_state.default.modifiers.fullHeight, className) }, props),
      React107.createElement("div", { className: css(import_empty_state.default.emptyStateContent) }, children)
    );
  };
  EmptyState.displayName = "EmptyState";

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyStateBody.js
  init_tslib_es6();
  var React108 = __toESM(require_react());
  var import_empty_state2 = __toESM(require_empty_state());
  var EmptyStateBody = (_a) => {
    var { children, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React108.createElement("div", Object.assign({ className: css(import_empty_state2.default.emptyStateBody, className) }, props), children);
  };
  EmptyStateBody.displayName = "EmptyStateBody";

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyStateIcon.js
  init_tslib_es6();
  var React109 = __toESM(require_react());
  var import_empty_state3 = __toESM(require_empty_state());
  var EmptyStateIcon = (_a) => {
    var { className = "", icon: IconComponent, component: AnyComponent, variant = "icon" } = _a, props = __rest(_a, ["className", "icon", "component", "variant"]);
    const classNames2 = css(import_empty_state3.default.emptyStateIcon, className);
    return variant === "icon" ? React109.createElement(IconComponent, Object.assign({ className: classNames2 }, props, { "aria-hidden": "true" })) : React109.createElement(
      "div",
      { className: classNames2 },
      React109.createElement(AnyComponent, null)
    );
  };
  EmptyStateIcon.displayName = "EmptyStateIcon";

  // node_modules/@patternfly/react-core/dist/esm/components/ExpandableSection/ExpandableSection.js
  init_tslib_es6();
  var React110 = __toESM(require_react());
  var import_expandable_section = __toESM(require_expandable_section());

  // node_modules/@patternfly/react-tokens/dist/esm/c_expandable_section_m_truncate__content_LineClamp.js
  var c_expandable_section_m_truncate__content_LineClamp = {
    "name": "--pf-c-expandable-section--m-truncate__content--LineClamp",
    "value": "3",
    "var": "var(--pf-c-expandable-section--m-truncate__content--LineClamp)"
  };
  var c_expandable_section_m_truncate_content_LineClamp_default = c_expandable_section_m_truncate__content_LineClamp;

  // node_modules/@patternfly/react-core/dist/esm/components/ExpandableSection/ExpandableSection.js
  var ExpandableSectionVariant;
  (function(ExpandableSectionVariant2) {
    ExpandableSectionVariant2["default"] = "default";
    ExpandableSectionVariant2["truncate"] = "truncate";
  })(ExpandableSectionVariant || (ExpandableSectionVariant = {}));
  var setLineClamp = (lines, element) => {
    if (!element || lines < 1) {
      return;
    }
    element.style.setProperty(c_expandable_section_m_truncate_content_LineClamp_default.name, lines.toString());
  };
  var ExpandableSection = class extends React110.Component {
    constructor(props) {
      super(props);
      this.expandableContentRef = React110.createRef();
      this.observer = () => {
      };
      this.checkToggleVisibility = () => {
        var _a;
        if ((_a = this.expandableContentRef) === null || _a === void 0 ? void 0 : _a.current) {
          const maxLines = this.props.truncateMaxLines || parseInt(c_expandable_section_m_truncate_content_LineClamp_default.value);
          const totalLines = this.expandableContentRef.current.scrollHeight / parseInt(getComputedStyle(this.expandableContentRef.current).lineHeight);
          this.setState({
            hasToggle: totalLines > maxLines
          });
        }
      };
      this.resize = () => {
        const { offsetWidth } = this.expandableContentRef.current;
        if (this.state.previousWidth !== offsetWidth) {
          this.setState({ previousWidth: offsetWidth });
          this.checkToggleVisibility();
        }
      };
      this.handleResize = debounce(this.resize, 250);
      this.state = {
        isExpanded: props.isExpanded,
        hasToggle: true,
        previousWidth: void 0
      };
    }
    calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded) {
      if (propOrStateIsExpanded && toggleTextExpanded !== "") {
        return toggleTextExpanded;
      }
      if (!propOrStateIsExpanded && toggleTextCollapsed !== "") {
        return toggleTextCollapsed;
      }
      return toggleText;
    }
    componentDidMount() {
      if (this.props.variant === ExpandableSectionVariant.truncate) {
        const expandableContent = this.expandableContentRef.current;
        this.setState({ previousWidth: expandableContent.offsetWidth });
        this.observer = getResizeObserver(expandableContent, this.handleResize, false);
        if (this.props.truncateMaxLines) {
          setLineClamp(this.props.truncateMaxLines, expandableContent);
        }
        this.checkToggleVisibility();
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.variant === ExpandableSectionVariant.truncate && prevProps.truncateMaxLines !== this.props.truncateMaxLines) {
        const expandableContent = this.expandableContentRef.current;
        setLineClamp(this.props.truncateMaxLines, expandableContent);
        this.checkToggleVisibility();
      }
    }
    componentWillUnmount() {
      if (this.props.variant === ExpandableSectionVariant.truncate) {
        this.observer();
      }
    }
    render() {
      const _a = this.props, {
        onToggle: onToggleProp,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        isActive,
        className,
        toggleText,
        toggleTextExpanded,
        toggleTextCollapsed,
        toggleContent,
        children,
        isExpanded,
        isDetached,
        displaySize,
        isWidthLimited,
        isIndented,
        contentId,
        variant,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        truncateMaxLines
      } = _a, props = __rest(_a, ["onToggle", "isActive", "className", "toggleText", "toggleTextExpanded", "toggleTextCollapsed", "toggleContent", "children", "isExpanded", "isDetached", "displaySize", "isWidthLimited", "isIndented", "contentId", "variant", "truncateMaxLines"]);
      let onToggle = onToggleProp;
      let propOrStateIsExpanded = isExpanded;
      if (isExpanded === void 0) {
        propOrStateIsExpanded = this.state.isExpanded;
        onToggle = (isOpen) => {
          this.setState({ isExpanded: isOpen }, () => onToggleProp(this.state.isExpanded));
        };
      }
      const computedToggleText = this.calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded);
      const expandableToggle = !isDetached && React110.createElement(
        "button",
        { className: css(import_expandable_section.default.expandableSectionToggle), type: "button", "aria-expanded": propOrStateIsExpanded, onClick: () => onToggle(!propOrStateIsExpanded) },
        variant !== ExpandableSectionVariant.truncate && React110.createElement(
          "span",
          { className: css(import_expandable_section.default.expandableSectionToggleIcon) },
          React110.createElement(angle_right_icon_default, { "aria-hidden": true })
        ),
        React110.createElement("span", { className: css(import_expandable_section.default.expandableSectionToggleText) }, toggleContent || computedToggleText)
      );
      return React110.createElement(
        "div",
        Object.assign({ className: css(import_expandable_section.default.expandableSection, propOrStateIsExpanded && import_expandable_section.default.modifiers.expanded, isActive && import_expandable_section.default.modifiers.active, isDetached && import_expandable_section.default.modifiers.detached, displaySize === "large" && import_expandable_section.default.modifiers.displayLg, isWidthLimited && import_expandable_section.default.modifiers.limitWidth, isIndented && import_expandable_section.default.modifiers.indented, variant === ExpandableSectionVariant.truncate && import_expandable_section.default.modifiers.truncate, className) }, props),
        variant === ExpandableSectionVariant.default && expandableToggle,
        React110.createElement("div", { ref: this.expandableContentRef, className: css(import_expandable_section.default.expandableSectionContent), hidden: variant !== ExpandableSectionVariant.truncate && !propOrStateIsExpanded, id: contentId }, children),
        variant === ExpandableSectionVariant.truncate && this.state.hasToggle && expandableToggle
      );
    }
  };
  ExpandableSection.displayName = "ExpandableSection";
  ExpandableSection.defaultProps = {
    className: "",
    toggleText: "",
    toggleTextExpanded: "",
    toggleTextCollapsed: "",
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onToggle: (isExpanded) => void 0,
    isActive: false,
    isDetached: false,
    displaySize: "default",
    isWidthLimited: false,
    isIndented: false,
    contentId: "",
    variant: "default"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUploadField.js
  init_tslib_es6();
  var React111 = __toESM(require_react());
  var import_file_upload = __toESM(require_file_upload());

  // node_modules/@patternfly/react-core/dist/esm/helpers/fileUtils.js
  var fileReaderType;
  (function(fileReaderType2) {
    fileReaderType2["text"] = "text";
    fileReaderType2["dataURL"] = "dataURL";
  })(fileReaderType || (fileReaderType = {}));
  function readFile(fileHandle, type) {
    return new Promise((resolve2, reject2) => {
      const reader = new FileReader();
      reader.onload = () => resolve2(reader.result);
      reader.onerror = () => reject2(reader.error);
      if (type === fileReaderType.text) {
        reader.readAsText(fileHandle);
      } else if (type === fileReaderType.dataURL) {
        reader.readAsDataURL(fileHandle);
      } else {
        reject2("unknown type");
      }
    });
  }

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUploadField.js
  var FileUploadField = (_a) => {
    var { id, type, value = "", filename = "", onChange = () => {
    }, onBrowseButtonClick = () => {
    }, onClearButtonClick = () => {
    }, onTextAreaClick, onTextChange, onTextAreaBlur, textAreaPlaceholder = "", className = "", isDisabled = false, isReadOnly = false, isLoading = false, spinnerAriaValueText, isRequired = false, isDragActive = false, validated = "default", "aria-label": ariaLabel = "File upload", filenamePlaceholder = "Drag a file here or browse to upload", filenameAriaLabel = filename ? "Read only filename" : filenamePlaceholder, browseButtonText = "Browse...", clearButtonText = "Clear", isClearButtonDisabled = !filename && !value, containerRef = null, allowEditingUploadedText = false, hideDefaultPreview = false, children = null } = _a, props = __rest(_a, ["id", "type", "value", "filename", "onChange", "onBrowseButtonClick", "onClearButtonClick", "onTextAreaClick", "onTextChange", "onTextAreaBlur", "textAreaPlaceholder", "className", "isDisabled", "isReadOnly", "isLoading", "spinnerAriaValueText", "isRequired", "isDragActive", "validated", "aria-label", "filenamePlaceholder", "filenameAriaLabel", "browseButtonText", "clearButtonText", "isClearButtonDisabled", "containerRef", "allowEditingUploadedText", "hideDefaultPreview", "children"]);
    const onTextAreaChange = (newValue, event) => {
      onChange(newValue, filename, event);
      onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(newValue);
    };
    return React111.createElement(
      "div",
      Object.assign({ className: css(import_file_upload.default.fileUpload, isDragActive && import_file_upload.default.modifiers.dragHover, isLoading && import_file_upload.default.modifiers.loading, className), ref: containerRef }, props),
      React111.createElement(
        "div",
        { className: import_file_upload.default.fileUploadFileSelect },
        React111.createElement(
          InputGroup,
          null,
          React111.createElement(TextInput, { isReadOnly: true, isDisabled, id: `${id}-filename`, name: `${id}-filename`, "aria-label": filenameAriaLabel, placeholder: filenamePlaceholder, "aria-describedby": `${id}-browse-button`, value: filename }),
          React111.createElement(Button, { id: `${id}-browse-button`, variant: ButtonVariant.control, onClick: onBrowseButtonClick, isDisabled }, browseButtonText),
          React111.createElement(Button, { variant: ButtonVariant.control, isDisabled: isDisabled || isClearButtonDisabled, onClick: onClearButtonClick }, clearButtonText)
        )
      ),
      React111.createElement(
        "div",
        { className: import_file_upload.default.fileUploadFileDetails },
        !hideDefaultPreview && type === fileReaderType.text && React111.createElement(TextArea, { readOnly: isReadOnly || !!filename && !allowEditingUploadedText, disabled: isDisabled, isRequired, resizeOrientation: TextAreResizeOrientation.vertical, validated, id, name: id, "aria-label": ariaLabel, value, onChange: onTextAreaChange, onClick: onTextAreaClick, onBlur: onTextAreaBlur, placeholder: textAreaPlaceholder }),
        isLoading && React111.createElement(
          "div",
          { className: import_file_upload.default.fileUploadFileDetailsSpinner },
          React111.createElement(Spinner, { size: spinnerSize.lg, "aria-valuetext": spinnerAriaValueText })
        )
      ),
      children
    );
  };
  FileUploadField.displayName = "FileUploadField";

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUpload.js
  init_tslib_es6();
  var React113 = __toESM(require_react());

  // node_modules/react-dropzone/dist/es/index.js
  var import_react3 = __toESM(require_react());

  // node_modules/file-selector/dist/es5/file-selector.js
  init_tslib_es6();

  // node_modules/file-selector/dist/es5/file.js
  var COMMON_MIME_TYPES = /* @__PURE__ */ new Map([
    ["avi", "video/avi"],
    ["gif", "image/gif"],
    ["ico", "image/x-icon"],
    ["jpeg", "image/jpeg"],
    ["jpg", "image/jpeg"],
    ["mkv", "video/x-matroska"],
    ["mov", "video/quicktime"],
    ["mp4", "video/mp4"],
    ["pdf", "application/pdf"],
    ["png", "image/png"],
    ["zip", "application/zip"],
    ["doc", "application/msword"],
    ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]
  ]);
  function toFileWithPath(file, path2) {
    var f = withMimeType(file);
    if (typeof f.path !== "string") {
      var webkitRelativePath = file.webkitRelativePath;
      Object.defineProperty(f, "path", {
        value: typeof path2 === "string" ? path2 : typeof webkitRelativePath === "string" && webkitRelativePath.length > 0 ? webkitRelativePath : file.name,
        writable: false,
        configurable: false,
        enumerable: true
      });
    }
    return f;
  }
  function withMimeType(file) {
    var name2 = file.name;
    var hasExtension = name2 && name2.lastIndexOf(".") !== -1;
    if (hasExtension && !file.type) {
      var ext = name2.split(".").pop().toLowerCase();
      var type = COMMON_MIME_TYPES.get(ext);
      if (type) {
        Object.defineProperty(file, "type", {
          value: type,
          writable: false,
          configurable: false,
          enumerable: true
        });
      }
    }
    return file;
  }

  // node_modules/file-selector/dist/es5/file-selector.js
  var FILES_TO_IGNORE = [
    // Thumbnail cache files for macOS and Windows
    ".DS_Store",
    "Thumbs.db"
    // Windows
  ];
  function fromEvent(evt) {
    return __awaiter(this, void 0, void 0, function() {
      return __generator(this, function(_a) {
        return [2, isDragEvt(evt) && evt.dataTransfer ? getDataTransferFiles(evt.dataTransfer, evt.type) : getInputFiles(evt)];
      });
    });
  }
  function isDragEvt(value) {
    return !!value.dataTransfer;
  }
  function getInputFiles(evt) {
    var files = isInput3(evt.target) ? evt.target.files ? fromList(evt.target.files) : [] : [];
    return files.map(function(file) {
      return toFileWithPath(file);
    });
  }
  function isInput3(value) {
    return value !== null;
  }
  function getDataTransferFiles(dt, type) {
    return __awaiter(this, void 0, void 0, function() {
      var items, files;
      return __generator(this, function(_a) {
        switch (_a.label) {
          case 0:
            if (!dt.items)
              return [3, 2];
            items = fromList(dt.items).filter(function(item) {
              return item.kind === "file";
            });
            if (type !== "drop") {
              return [2, items];
            }
            return [4, Promise.all(items.map(toFilePromises))];
          case 1:
            files = _a.sent();
            return [2, noIgnoredFiles(flatten(files))];
          case 2:
            return [2, noIgnoredFiles(fromList(dt.files).map(function(file) {
              return toFileWithPath(file);
            }))];
        }
      });
    });
  }
  function noIgnoredFiles(files) {
    return files.filter(function(file) {
      return FILES_TO_IGNORE.indexOf(file.name) === -1;
    });
  }
  function fromList(items) {
    var files = [];
    for (var i = 0; i < items.length; i++) {
      var file = items[i];
      files.push(file);
    }
    return files;
  }
  function toFilePromises(item) {
    if (typeof item.webkitGetAsEntry !== "function") {
      return fromDataTransferItem(item);
    }
    var entry = item.webkitGetAsEntry();
    if (entry && entry.isDirectory) {
      return fromDirEntry(entry);
    }
    return fromDataTransferItem(item);
  }
  function flatten(items) {
    return items.reduce(function(acc, files) {
      return __spread(acc, Array.isArray(files) ? flatten(files) : [files]);
    }, []);
  }
  function fromDataTransferItem(item) {
    var file = item.getAsFile();
    if (!file) {
      return Promise.reject(item + " is not a File");
    }
    var fwp = toFileWithPath(file);
    return Promise.resolve(fwp);
  }
  function fromEntry(entry) {
    return __awaiter(this, void 0, void 0, function() {
      return __generator(this, function(_a) {
        return [2, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];
      });
    });
  }
  function fromDirEntry(entry) {
    var reader = entry.createReader();
    return new Promise(function(resolve2, reject2) {
      var entries = [];
      function readEntries() {
        var _this = this;
        reader.readEntries(function(batch) {
          return __awaiter(_this, void 0, void 0, function() {
            var files, err_1, items;
            return __generator(this, function(_a) {
              switch (_a.label) {
                case 0:
                  if (!!batch.length)
                    return [3, 5];
                  _a.label = 1;
                case 1:
                  _a.trys.push([1, 3, , 4]);
                  return [4, Promise.all(entries)];
                case 2:
                  files = _a.sent();
                  resolve2(files);
                  return [3, 4];
                case 3:
                  err_1 = _a.sent();
                  reject2(err_1);
                  return [3, 4];
                case 4:
                  return [3, 6];
                case 5:
                  items = Promise.all(batch.map(fromEntry));
                  entries.push(items);
                  readEntries();
                  _a.label = 6;
                case 6:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        }, function(err) {
          reject2(err);
        });
      }
      readEntries();
    });
  }
  function fromFileEntry(entry) {
    return __awaiter(this, void 0, void 0, function() {
      return __generator(this, function(_a) {
        return [2, new Promise(function(resolve2, reject2) {
          entry.file(function(file) {
            var fwp = toFileWithPath(file, entry.fullPath);
            resolve2(fwp);
          }, function(err) {
            reject2(err);
          });
        })];
      });
    });
  }

  // node_modules/react-dropzone/dist/es/index.js
  var import_prop_types = __toESM(require_prop_types());

  // node_modules/react-dropzone/dist/es/utils/index.js
  var import_attr_accept = __toESM(require_dist());
  var supportMultiple = typeof document !== "undefined" && document && document.createElement ? "multiple" in document.createElement("input") : true;
  function fileAccepted(file, accept) {
    return file.type === "application/x-moz-file" || (0, import_attr_accept.default)(file, accept);
  }
  function fileMatchSize(file, maxSize, minSize) {
    return file.size <= maxSize && file.size >= minSize;
  }
  function allFilesAccepted(files, accept) {
    return files.every(function(file) {
      return fileAccepted(file, accept);
    });
  }
  function isPropagationStopped(evt) {
    if (typeof evt.isPropagationStopped === "function") {
      return evt.isPropagationStopped();
    } else if (typeof evt.cancelBubble !== "undefined") {
      return evt.cancelBubble;
    }
    return false;
  }
  function isDefaultPrevented(evt) {
    if (typeof evt.defaultPrevented !== "undefined") {
      return evt.defaultPrevented;
    } else if (typeof evt.isDefaultPrevented === "function") {
      return evt.isDefaultPrevented();
    }
    return false;
  }
  function isDragDataWithFiles(evt) {
    if (!evt.dataTransfer) {
      return true;
    }
    return Array.prototype.some.call(evt.dataTransfer.types, function(type) {
      return type === "Files" || type === "application/x-moz-file";
    });
  }
  function onDocumentDragOver(evt) {
    evt.preventDefault();
  }
  function isIe(userAgent2) {
    return userAgent2.indexOf("MSIE") !== -1 || userAgent2.indexOf("Trident/") !== -1;
  }
  function isEdge(userAgent2) {
    return userAgent2.indexOf("Edge/") !== -1;
  }
  function isIeOrEdge() {
    var userAgent2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
    return isIe(userAgent2) || isEdge(userAgent2);
  }
  function composeEventHandlers() {
    for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {
      fns[_key] = arguments[_key];
    }
    return function(event) {
      for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
        args[_key2 - 1] = arguments[_key2];
      }
      return fns.some(function(fn) {
        fn && fn.apply(void 0, [event].concat(args));
        return event.defaultPrevented;
      });
    };
  }

  // node_modules/react-dropzone/dist/es/index.js
  var _extends = Object.assign || function(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  var _createClass = function() {
    function defineProperties(target, props) {
      for (var i = 0; i < props.length; i++) {
        var descriptor = props[i];
        descriptor.enumerable = descriptor.enumerable || false;
        descriptor.configurable = true;
        if ("value" in descriptor)
          descriptor.writable = true;
        Object.defineProperty(target, descriptor.key, descriptor);
      }
    }
    return function(Constructor, protoProps, staticProps) {
      if (protoProps)
        defineProperties(Constructor.prototype, protoProps);
      if (staticProps)
        defineProperties(Constructor, staticProps);
      return Constructor;
    };
  }();
  function _defineProperty2(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _objectWithoutProperties(obj, keys) {
    var target = {};
    for (var i in obj) {
      if (keys.indexOf(i) >= 0)
        continue;
      if (!Object.prototype.hasOwnProperty.call(obj, i))
        continue;
      target[i] = obj[i];
    }
    return target;
  }
  function _toConsumableArray(arr) {
    if (Array.isArray(arr)) {
      for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
        arr2[i] = arr[i];
      }
      return arr2;
    } else {
      return Array.from(arr);
    }
  }
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _possibleConstructorReturn(self2, call) {
    if (!self2) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  }
  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
    if (superClass)
      Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  }
  var Dropzone = function(_React$Component) {
    _inherits(Dropzone2, _React$Component);
    function Dropzone2() {
      var _ref2;
      var _temp, _this, _ret;
      _classCallCheck(this, Dropzone2);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref2 = Dropzone2.__proto__ || Object.getPrototypeOf(Dropzone2)).call.apply(_ref2, [this].concat(args))), _this), _this.state = {
        draggedFiles: [],
        acceptedFiles: [],
        rejectedFiles: []
      }, _this.isFileDialogActive = false, _this.onDocumentDrop = function(evt) {
        if (_this.node && _this.node.contains(evt.target)) {
          return;
        }
        evt.preventDefault();
        _this.dragTargets = [];
      }, _this.onDragStart = function(evt) {
        evt.persist();
        if (_this.props.onDragStart && isDragDataWithFiles(evt)) {
          _this.props.onDragStart.call(_this, evt);
        }
      }, _this.onDragEnter = function(evt) {
        evt.preventDefault();
        if (_this.dragTargets.indexOf(evt.target) === -1) {
          _this.dragTargets.push(evt.target);
        }
        evt.persist();
        if (isDragDataWithFiles(evt)) {
          Promise.resolve(_this.props.getDataTransferItems(evt)).then(function(draggedFiles) {
            if (isPropagationStopped(evt)) {
              return;
            }
            _this.setState({
              draggedFiles,
              // Do not rely on files for the drag state. It doesn't work in Safari.
              isDragActive: true
            });
          });
          if (_this.props.onDragEnter) {
            _this.props.onDragEnter.call(_this, evt);
          }
        }
      }, _this.onDragOver = function(evt) {
        evt.preventDefault();
        evt.persist();
        if (evt.dataTransfer) {
          evt.dataTransfer.dropEffect = "copy";
        }
        if (_this.props.onDragOver && isDragDataWithFiles(evt)) {
          _this.props.onDragOver.call(_this, evt);
        }
        return false;
      }, _this.onDragLeave = function(evt) {
        evt.preventDefault();
        evt.persist();
        _this.dragTargets = _this.dragTargets.filter(function(el) {
          return el !== evt.target && _this.node.contains(el);
        });
        if (_this.dragTargets.length > 0) {
          return;
        }
        _this.setState({
          isDragActive: false,
          draggedFiles: []
        });
        if (_this.props.onDragLeave && isDragDataWithFiles(evt)) {
          _this.props.onDragLeave.call(_this, evt);
        }
      }, _this.onDrop = function(evt) {
        var _this$props = _this.props, onDrop = _this$props.onDrop, onDropAccepted = _this$props.onDropAccepted, onDropRejected = _this$props.onDropRejected, multiple = _this$props.multiple, accept = _this$props.accept, getDataTransferItems = _this$props.getDataTransferItems;
        evt.preventDefault();
        evt.persist();
        _this.dragTargets = [];
        _this.isFileDialogActive = false;
        _this.draggedFiles = null;
        _this.setState({
          isDragActive: false,
          draggedFiles: []
        });
        if (isDragDataWithFiles(evt)) {
          Promise.resolve(getDataTransferItems(evt)).then(function(fileList) {
            var acceptedFiles = [];
            var rejectedFiles = [];
            if (isPropagationStopped(evt)) {
              return;
            }
            fileList.forEach(function(file) {
              if (fileAccepted(file, accept) && fileMatchSize(file, _this.props.maxSize, _this.props.minSize)) {
                acceptedFiles.push(file);
              } else {
                rejectedFiles.push(file);
              }
            });
            if (!multiple && acceptedFiles.length > 1) {
              rejectedFiles.push.apply(rejectedFiles, _toConsumableArray(acceptedFiles.splice(0)));
            }
            _this.setState({ acceptedFiles, rejectedFiles }, function() {
              if (onDrop) {
                onDrop.call(_this, acceptedFiles, rejectedFiles, evt);
              }
              if (rejectedFiles.length > 0 && onDropRejected) {
                onDropRejected.call(_this, rejectedFiles, evt);
              }
              if (acceptedFiles.length > 0 && onDropAccepted) {
                onDropAccepted.call(_this, acceptedFiles, evt);
              }
            });
          });
        }
      }, _this.onClick = function(evt) {
        var onClick = _this.props.onClick;
        if (onClick) {
          onClick.call(_this, evt);
        }
        if (!isDefaultPrevented(evt)) {
          evt.stopPropagation();
          if (isIeOrEdge()) {
            setTimeout(_this.open, 0);
          } else {
            _this.open();
          }
        }
      }, _this.onInputElementClick = function(evt) {
        evt.stopPropagation();
      }, _this.onFileDialogCancel = function() {
        var onFileDialogCancel = _this.props.onFileDialogCancel;
        if (_this.isFileDialogActive) {
          setTimeout(function() {
            if (_this.input != null) {
              var files = _this.input.files;
              if (!files.length) {
                _this.isFileDialogActive = false;
                if (typeof onFileDialogCancel === "function") {
                  onFileDialogCancel();
                }
              }
            }
          }, 300);
        }
      }, _this.onFocus = function(evt) {
        var onFocus = _this.props.onFocus;
        if (onFocus) {
          onFocus.call(_this, evt);
        }
        if (!isDefaultPrevented(evt)) {
          _this.setState({ isFocused: true });
        }
      }, _this.onBlur = function(evt) {
        var onBlur = _this.props.onBlur;
        if (onBlur) {
          onBlur.call(_this, evt);
        }
        if (!isDefaultPrevented(evt)) {
          _this.setState({ isFocused: false });
        }
      }, _this.onKeyDown = function(evt) {
        var onKeyDown = _this.props.onKeyDown;
        if (!_this.node.isEqualNode(evt.target)) {
          return;
        }
        if (onKeyDown) {
          onKeyDown.call(_this, evt);
        }
        if (!isDefaultPrevented(evt) && (evt.keyCode === 32 || evt.keyCode === 13)) {
          evt.preventDefault();
          _this.open();
        }
      }, _this.composeHandler = function(handler) {
        if (_this.props.disabled) {
          return null;
        }
        return handler;
      }, _this.getRootProps = function() {
        var _extends22;
        var _ref22 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        var _ref2$refKey = _ref22.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, onKeyDown = _ref22.onKeyDown, onFocus = _ref22.onFocus, onBlur = _ref22.onBlur, onClick = _ref22.onClick, onDragStart = _ref22.onDragStart, onDragEnter = _ref22.onDragEnter, onDragOver = _ref22.onDragOver, onDragLeave = _ref22.onDragLeave, onDrop = _ref22.onDrop, rest = _objectWithoutProperties(_ref22, ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragStart", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"]);
        return _extends((_extends22 = {
          onKeyDown: _this.composeHandler(onKeyDown ? composeEventHandlers(onKeyDown, _this.onKeyDown) : _this.onKeyDown),
          onFocus: _this.composeHandler(onFocus ? composeEventHandlers(onFocus, _this.onFocus) : _this.onFocus),
          onBlur: _this.composeHandler(onBlur ? composeEventHandlers(onBlur, _this.onBlur) : _this.onBlur),
          onClick: _this.composeHandler(onClick ? composeEventHandlers(onClick, _this.onClick) : _this.onClick),
          onDragStart: _this.composeHandler(onDragStart ? composeEventHandlers(onDragStart, _this.onDragStart) : _this.onDragStart),
          onDragEnter: _this.composeHandler(onDragEnter ? composeEventHandlers(onDragEnter, _this.onDragEnter) : _this.onDragEnter),
          onDragOver: _this.composeHandler(onDragOver ? composeEventHandlers(onDragOver, _this.onDragOver) : _this.onDragOver),
          onDragLeave: _this.composeHandler(onDragLeave ? composeEventHandlers(onDragLeave, _this.onDragLeave) : _this.onDragLeave),
          onDrop: _this.composeHandler(onDrop ? composeEventHandlers(onDrop, _this.onDrop) : _this.onDrop)
        }, _defineProperty2(_extends22, refKey, _this.setNodeRef), _defineProperty2(_extends22, "tabIndex", _this.props.disabled ? -1 : 0), _extends22), rest);
      }, _this.getInputProps = function() {
        var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
        var _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, ["refKey", "onChange", "onClick"]);
        var _this$props2 = _this.props, accept = _this$props2.accept, multiple = _this$props2.multiple, name2 = _this$props2.name;
        var inputProps = _defineProperty2({
          accept,
          type: "file",
          style: { display: "none" },
          multiple: supportMultiple && multiple,
          onChange: composeEventHandlers(onChange, _this.onDrop),
          onClick: composeEventHandlers(onClick, _this.onInputElementClick),
          autoComplete: "off",
          tabIndex: -1
        }, refKey, _this.setInputRef);
        if (name2 && name2.length) {
          inputProps.name = name2;
        }
        return _extends({}, inputProps, rest);
      }, _this.setNodeRef = function(node) {
        _this.node = node;
      }, _this.setInputRef = function(input) {
        _this.input = input;
      }, _this.open = function() {
        _this.isFileDialogActive = true;
        if (_this.input) {
          _this.input.value = null;
          _this.input.click();
        }
      }, _temp), _possibleConstructorReturn(_this, _ret);
    }
    _createClass(Dropzone2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        var preventDropOnDocument = this.props.preventDropOnDocument;
        this.dragTargets = [];
        if (preventDropOnDocument) {
          document.addEventListener("dragover", onDocumentDragOver, false);
          document.addEventListener("drop", this.onDocumentDrop, false);
        }
        window.addEventListener("focus", this.onFileDialogCancel, false);
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        var preventDropOnDocument = this.props.preventDropOnDocument;
        if (preventDropOnDocument) {
          document.removeEventListener("dragover", onDocumentDragOver);
          document.removeEventListener("drop", this.onDocumentDrop);
        }
        window.removeEventListener("focus", this.onFileDialogCancel, false);
      }
      /**
       * Open system file upload dialog.
       *
       * @public
       */
    }, {
      key: "render",
      value: function render() {
        var _props = this.props, children = _props.children, multiple = _props.multiple, disabled = _props.disabled;
        var _state = this.state, isDragActive = _state.isDragActive, isFocused = _state.isFocused, draggedFiles = _state.draggedFiles, acceptedFiles = _state.acceptedFiles, rejectedFiles = _state.rejectedFiles;
        var filesCount = draggedFiles.length;
        var isMultipleAllowed = multiple || filesCount <= 1;
        var isDragAccept = filesCount > 0 && allFilesAccepted(draggedFiles, this.props.accept);
        var isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed);
        return children({
          isDragActive,
          isDragAccept,
          isDragReject,
          draggedFiles,
          acceptedFiles,
          rejectedFiles,
          isFocused: isFocused && !disabled,
          getRootProps: this.getRootProps,
          getInputProps: this.getInputProps,
          open: this.open
        });
      }
    }]);
    return Dropzone2;
  }(import_react3.default.Component);
  var es_default = Dropzone;
  Dropzone.propTypes = {
    /**
     * Allow specific types of files. See https://github.com/okonet/attr-accept for more information.
     * Keep in mind that mime type determination is not reliable across platforms. CSV files,
     * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
     * Windows. In some cases there might not be a mime type set at all.
     * See: https://github.com/react-dropzone/react-dropzone/issues/276
     */
    accept: import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.arrayOf(import_prop_types.default.string)]),
    /**
     * Render function that renders the actual component
     *
     * @param {Object} props
     * @param {Function} props.getRootProps Returns the props you should apply to the root drop container you render
     * @param {Function} props.getInputProps Returns the props you should apply to hidden file input you render
     * @param {Function} props.open Open the native file selection dialog
     * @param {Boolean} props.isFocused Dropzone area is in focus
     * @param {Boolean} props.isDragActive Active drag is in progress
     * @param {Boolean} props.isDragAccept Dragged files are accepted
     * @param {Boolean} props.isDragReject Some dragged files are rejected
     * @param {Array} props.draggedFiles Files in active drag
     * @param {Array} props.acceptedFiles Accepted files
     * @param {Array} props.rejectedFiles Rejected files
     */
    children: import_prop_types.default.func,
    /**
     * Enable/disable the dropzone entirely
     */
    disabled: import_prop_types.default.bool,
    /**
     * If false, allow dropped items to take over the current browser window
     */
    preventDropOnDocument: import_prop_types.default.bool,
    /**
     * Allow dropping multiple files
     */
    multiple: import_prop_types.default.bool,
    /**
     * `name` attribute for the input tag
     */
    name: import_prop_types.default.string,
    /**
     * Maximum file size (in bytes)
     */
    maxSize: import_prop_types.default.number,
    /**
     * Minimum file size (in bytes)
     */
    minSize: import_prop_types.default.number,
    /**
     * getDataTransferItems handler
     * @param {Event} event
     * @returns {Array} array of File objects
     */
    getDataTransferItems: import_prop_types.default.func,
    /**
     * onClick callback
     * @param {Event} event
     */
    onClick: import_prop_types.default.func,
    /**
     * onFocus callback
     */
    onFocus: import_prop_types.default.func,
    /**
     * onBlur callback
     */
    onBlur: import_prop_types.default.func,
    /**
     * onKeyDown callback
     */
    onKeyDown: import_prop_types.default.func,
    /**
     * The `onDrop` method that accepts two arguments.
     * The first argument represents the accepted files and the second argument the rejected files.
     *
     * ```javascript
     * function onDrop(acceptedFiles, rejectedFiles) {
     *   // do stuff with files...
     * }
     * ```
     *
     * Files are accepted or rejected based on the `accept` prop.
     * This must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
     *
     * Note that the `onDrop` callback will always be called regardless if the dropped files were accepted or rejected.
     * You can use the `onDropAccepted`/`onDropRejected` props if you'd like to react to a specific event instead of the `onDrop` prop.
     *
     * The `onDrop` callback will provide you with an array of [Files](https://developer.mozilla.org/en-US/docs/Web/API/File) which you can then process and send to a server.
     * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
     *
     * ```javascript
     * function onDrop(acceptedFiles) {
     *   const req = request.post('/upload')
     *   acceptedFiles.forEach(file => {
     *     req.attach(file.name, file)
     *   })
     *   req.end(callback)
     * }
     * ```
     */
    onDrop: import_prop_types.default.func,
    /**
     * onDropAccepted callback
     */
    onDropAccepted: import_prop_types.default.func,
    /**
     * onDropRejected callback
     */
    onDropRejected: import_prop_types.default.func,
    /**
     * onDragStart callback
     */
    onDragStart: import_prop_types.default.func,
    /**
     * onDragEnter callback
     */
    onDragEnter: import_prop_types.default.func,
    /**
     * onDragOver callback
     */
    onDragOver: import_prop_types.default.func,
    /**
     * onDragLeave callback
     */
    onDragLeave: import_prop_types.default.func,
    /**
     * Provide a callback on clicking the cancel button of the file dialog
     */
    onFileDialogCancel: import_prop_types.default.func
  };
  Dropzone.defaultProps = {
    preventDropOnDocument: true,
    disabled: false,
    multiple: true,
    maxSize: Infinity,
    minSize: 0,
    getDataTransferItems: fromEvent
  };

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUpload.js
  var FileUpload = (_a) => {
    var { id, type, value = type === fileReaderType.text || type === fileReaderType.dataURL ? "" : null, filename = "", children = null, onChange = () => {
    }, onFileInputChange = null, onReadStarted = () => {
    }, onReadFinished = () => {
    }, onReadFailed = () => {
    }, onClearClick, onClick = (event) => event.preventDefault(), onTextChange, onDataChange, dropzoneProps = {} } = _a, props = __rest(_a, ["id", "type", "value", "filename", "children", "onChange", "onFileInputChange", "onReadStarted", "onReadFinished", "onReadFailed", "onClearClick", "onClick", "onTextChange", "onDataChange", "dropzoneProps"]);
    const onDropAccepted = (acceptedFiles, event) => {
      if (acceptedFiles.length > 0) {
        const fileHandle = acceptedFiles[0];
        if (event.type === "drop") {
          onFileInputChange === null || onFileInputChange === void 0 ? void 0 : onFileInputChange(event, fileHandle);
        }
        if (type === fileReaderType.text || type === fileReaderType.dataURL) {
          onChange("", fileHandle.name, event);
          onReadStarted(fileHandle);
          readFile(fileHandle, type).then((data) => {
            onReadFinished(fileHandle);
            onChange(data, fileHandle.name, event);
            onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(data);
          }).catch((error) => {
            onReadFailed(error, fileHandle);
            onReadFinished(fileHandle);
            onChange("", "", event);
            onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange("");
          });
        } else {
          onChange(fileHandle, fileHandle.name, event);
        }
      }
      dropzoneProps.onDropAccepted && dropzoneProps.onDropAccepted(acceptedFiles, event);
    };
    const onDropRejected = (rejectedFiles, event) => {
      if (rejectedFiles.length > 0) {
        onChange("", rejectedFiles[0].name, event);
      }
      dropzoneProps.onDropRejected && dropzoneProps.onDropRejected(rejectedFiles, event);
    };
    const fileInputRef = React113.useRef();
    const setFileValue = (filename2) => {
      fileInputRef.current.value = filename2;
    };
    const onClearButtonClick = (event) => {
      onChange("", "", event);
      onClearClick === null || onClearClick === void 0 ? void 0 : onClearClick(event);
      setFileValue(null);
    };
    return React113.createElement(es_default, Object.assign({ multiple: false }, dropzoneProps, { onDropAccepted, onDropRejected }), ({ getRootProps, getInputProps, isDragActive, open }) => {
      const oldInputProps = getInputProps();
      const inputProps = Object.assign(Object.assign({}, oldInputProps), { onChange: (e) => __awaiter(void 0, void 0, void 0, function* () {
        var _a2;
        (_a2 = oldInputProps.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(oldInputProps, e);
        const files = yield fromEvent(e.nativeEvent);
        if (files.length === 1) {
          onFileInputChange === null || onFileInputChange === void 0 ? void 0 : onFileInputChange(e, files[0]);
        }
      }) });
      return React113.createElement(
        FileUploadField,
        Object.assign({}, getRootProps(Object.assign(Object.assign({}, props), { refKey: "containerRef", onClick: (event) => event.preventDefault() })), { tabIndex: null, id, type, filename, value, onChange, isDragActive, onBrowseButtonClick: open, onClearButtonClick, onTextAreaClick: onClick, onTextChange }),
        React113.createElement("input", Object.assign({}, inputProps, { ref: (input) => {
          fileInputRef.current = input;
          inputProps.ref(input);
        } })),
        children
      );
    });
  };
  FileUpload.displayName = "FileUpload";

  // node_modules/@patternfly/react-core/dist/esm/components/HelperText/HelperText.js
  init_tslib_es6();
  var React114 = __toESM(require_react());
  var import_helper_text = __toESM(require_helper_text());
  var HelperText = (_a) => {
    var { children, className, component = "div", id, isLiveRegion = false } = _a, props = __rest(_a, ["children", "className", "component", "id", "isLiveRegion"]);
    const Component50 = component;
    return React114.createElement(Component50, Object.assign({ id, className: css(import_helper_text.default.helperText, className) }, isLiveRegion && { "aria-live": "polite" }, props), children);
  };
  HelperText.displayName = "HelperText";

  // node_modules/@patternfly/react-core/dist/esm/components/HelperText/HelperTextItem.js
  init_tslib_es6();
  var React115 = __toESM(require_react());
  var import_helper_text2 = __toESM(require_helper_text());

  // node_modules/@patternfly/react-icons/dist/esm/icons/minus-icon.js
  var MinusIconConfig = {
    name: "MinusIcon",
    height: 512,
    width: 448,
    svgPath: "M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",
    yOffset: 0,
    xOffset: 0
  };
  var MinusIcon = createIcon(MinusIconConfig);
  var minus_icon_default = MinusIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/HelperText/HelperTextItem.js
  var variantStyle = {
    default: "",
    indeterminate: import_helper_text2.default.modifiers.indeterminate,
    warning: import_helper_text2.default.modifiers.warning,
    success: import_helper_text2.default.modifiers.success,
    error: import_helper_text2.default.modifiers.error
  };
  var HelperTextItem = (_a) => {
    var { children, className, component = "div", variant = "default", icon: icon2, isDynamic = false, hasIcon = isDynamic, id, screenReaderText = `${variant} status` } = _a, props = __rest(_a, ["children", "className", "component", "variant", "icon", "isDynamic", "hasIcon", "id", "screenReaderText"]);
    const Component50 = component;
    return React115.createElement(
      Component50,
      Object.assign({ className: css(import_helper_text2.default.helperTextItem, variantStyle[variant], isDynamic && import_helper_text2.default.modifiers.dynamic, className), id }, props),
      icon2 && React115.createElement("span", { className: css(import_helper_text2.default.helperTextItemIcon), "aria-hidden": true }, icon2),
      hasIcon && !icon2 && React115.createElement(
        "span",
        { className: css(import_helper_text2.default.helperTextItemIcon), "aria-hidden": true },
        (variant === "default" || variant === "indeterminate") && React115.createElement(minus_icon_default, null),
        variant === "warning" && React115.createElement(exclamation_triangle_icon_default, null),
        variant === "success" && React115.createElement(check_circle_icon_default, null),
        variant === "error" && React115.createElement(exclamation_circle_icon_default, null)
      ),
      React115.createElement(
        "span",
        { className: css(import_helper_text2.default.helperTextItemText) },
        children,
        isDynamic && React115.createElement(
          "span",
          { className: "pf-u-screen-reader" },
          ": ",
          screenReaderText,
          ";"
        )
      )
    );
  };
  HelperTextItem.displayName = "HelperTextItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Label/Label.js
  init_tslib_es6();
  var React116 = __toESM(require_react());
  var import_react4 = __toESM(require_react());
  var import_label = __toESM(require_label());
  var import_label_group = __toESM(require_label_group());
  var colorStyles = {
    blue: import_label.default.modifiers.blue,
    cyan: import_label.default.modifiers.cyan,
    green: import_label.default.modifiers.green,
    orange: import_label.default.modifiers.orange,
    purple: import_label.default.modifiers.purple,
    red: import_label.default.modifiers.red,
    gold: import_label.default.modifiers.gold,
    grey: ""
  };
  var Label = (_a) => {
    var { children, className = "", color: color2 = "grey", variant = "filled", isCompact = false, isEditable = false, editableProps, isTruncated = false, tooltipPosition, icon: icon2, onClose, onEditCancel, onEditComplete, closeBtn, closeBtnAriaLabel, closeBtnProps, href, isOverflowLabel, render } = _a, props = __rest(_a, ["children", "className", "color", "variant", "isCompact", "isEditable", "editableProps", "isTruncated", "tooltipPosition", "icon", "onClose", "onEditCancel", "onEditComplete", "closeBtn", "closeBtnAriaLabel", "closeBtnProps", "href", "isOverflowLabel", "render"]);
    const [isEditableActive, setIsEditableActive] = (0, import_react4.useState)(false);
    const [currValue, setCurrValue] = (0, import_react4.useState)(children);
    const editableButtonRef = React116.useRef();
    const editableInputRef = React116.useRef();
    React116.useEffect(() => {
      document.addEventListener("mousedown", onDocMouseDown);
      document.addEventListener("keydown", onKeyDown);
      return () => {
        document.removeEventListener("mousedown", onDocMouseDown);
        document.removeEventListener("keydown", onKeyDown);
      };
    });
    const onDocMouseDown = (event) => {
      if (isEditableActive && editableInputRef && editableInputRef.current && !editableInputRef.current.contains(event.target)) {
        if (editableInputRef.current.value) {
          onEditComplete && onEditComplete(event, editableInputRef.current.value);
        }
        setIsEditableActive(false);
      }
    };
    const onKeyDown = (event) => {
      var _a2, _b;
      const key = event.key;
      if (!isEditableActive && (!editableButtonRef || !editableButtonRef.current || !editableButtonRef.current.contains(event.target)) || isEditableActive && (!editableInputRef || !editableInputRef.current || !editableInputRef.current.contains(event.target))) {
        return;
      }
      if (isEditableActive && (key === "Enter" || key === "Tab")) {
        event.preventDefault();
        event.stopImmediatePropagation();
        if (editableInputRef.current.value) {
          onEditComplete && onEditComplete(event, editableInputRef.current.value);
        }
        setIsEditableActive(false);
        (_a2 = editableButtonRef === null || editableButtonRef === void 0 ? void 0 : editableButtonRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus();
      }
      if (isEditableActive && key === "Escape") {
        event.preventDefault();
        event.stopImmediatePropagation();
        if (editableInputRef.current.value) {
          editableInputRef.current.value = children;
          onEditCancel && onEditCancel(event, children);
        }
        setIsEditableActive(false);
        (_b = editableButtonRef === null || editableButtonRef === void 0 ? void 0 : editableButtonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
      }
      if (!isEditableActive && key === "Enter") {
        event.preventDefault();
        event.stopImmediatePropagation();
        setIsEditableActive(true);
        const el = event.target;
        const range2 = document.createRange();
        const sel = window.getSelection();
        range2.selectNodeContents(el);
        range2.collapse(false);
        sel.removeAllRanges();
        sel.addRange(range2);
      }
    };
    const LabelComponent = isOverflowLabel ? "button" : "span";
    const button = closeBtn ? closeBtn : React116.createElement(
      Button,
      Object.assign({ type: "button", variant: "plain", onClick: onClose, "aria-label": closeBtnAriaLabel || `Close ${children}` }, closeBtnProps),
      React116.createElement(times_icon_default, null)
    );
    const textRef = React116.createRef();
    const componentRef = React116.useRef();
    const [isTooltipVisible, setIsTooltipVisible] = React116.useState(false);
    useIsomorphicLayoutEffect(() => {
      const currTextRef = isEditable ? editableButtonRef : textRef;
      if (!isEditableActive) {
        setIsTooltipVisible(currTextRef.current && currTextRef.current.offsetWidth < currTextRef.current.scrollWidth);
      }
    }, [isEditableActive]);
    const content = React116.createElement(
      React116.Fragment,
      null,
      icon2 && React116.createElement("span", { className: css(import_label.default.labelIcon) }, icon2),
      isTruncated && React116.createElement("span", { ref: textRef, className: css(import_label.default.labelText) }, children),
      !isTruncated && children
    );
    React116.useEffect(() => {
      if (isEditableActive && editableInputRef) {
        editableInputRef.current && editableInputRef.current.focus();
      }
    }, [editableInputRef, isEditableActive]);
    const updateVal = () => {
      setCurrValue(editableInputRef.current.value);
    };
    let labelComponentChild = React116.createElement("span", { className: css(import_label.default.labelContent) }, content);
    if (href) {
      labelComponentChild = React116.createElement("a", { className: css(import_label.default.labelContent), href }, content);
    } else if (isEditable) {
      labelComponentChild = React116.createElement("button", Object.assign({ ref: editableButtonRef, className: css(import_label.default.labelContent), onClick: (e) => {
        setIsEditableActive(true);
        e.stopPropagation();
      } }, editableProps), content);
    }
    if (render) {
      labelComponentChild = React116.createElement(
        React116.Fragment,
        null,
        isTooltipVisible && React116.createElement(Tooltip, { reference: componentRef, content: children, position: tooltipPosition }),
        render({
          className: import_label.default.labelContent,
          content,
          componentRef
        })
      );
    } else if (isTooltipVisible) {
      labelComponentChild = React116.createElement(Tooltip, { content: children, position: tooltipPosition }, labelComponentChild);
    }
    return React116.createElement(
      LabelComponent,
      Object.assign({}, props, { className: css(import_label.default.label, colorStyles[color2], variant === "outline" && import_label.default.modifiers.outline, isOverflowLabel && import_label.default.modifiers.overflow, isCompact && import_label.default.modifiers.compact, isEditable && import_label_group.default.modifiers.editable, isEditableActive && import_label.default.modifiers.editableActive, className) }),
      !isEditableActive && labelComponentChild,
      !isEditableActive && onClose && button,
      isEditableActive && React116.createElement("input", Object.assign({ className: css(import_label.default.labelContent), type: "text", id: "editable-input", ref: editableInputRef, value: currValue, onChange: updateVal }, editableProps))
    );
  };
  Label.displayName = "Label";

  // node_modules/@patternfly/react-core/dist/esm/components/LabelGroup/LabelGroup.js
  init_tslib_es6();
  var React117 = __toESM(require_react());
  var import_label_group2 = __toESM(require_label_group());
  var import_label2 = __toESM(require_label());
  var LabelGroup = class extends React117.Component {
    constructor(props) {
      super(props);
      this.headingRef = React117.createRef();
      this.toggleCollapse = () => {
        this.setState((prevState) => ({
          isOpen: !prevState.isOpen,
          isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
        }));
      };
      this.state = {
        isOpen: this.props.defaultIsOpen,
        isTooltipVisible: false
      };
    }
    componentDidMount() {
      this.setState({
        isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
      });
    }
    renderLabel(id) {
      const { categoryName, tooltipPosition } = this.props;
      const { isTooltipVisible } = this.state;
      return isTooltipVisible ? React117.createElement(
        Tooltip,
        { position: tooltipPosition, content: categoryName },
        React117.createElement(
          "span",
          { tabIndex: 0, ref: this.headingRef, className: css(import_label_group2.default.labelGroupLabel) },
          React117.createElement("span", { "aria-hidden": "true", id }, categoryName)
        )
      ) : React117.createElement("span", { ref: this.headingRef, className: css(import_label_group2.default.labelGroupLabel), "aria-hidden": "true", id }, categoryName);
    }
    render() {
      const _a = this.props, {
        categoryName,
        children,
        className,
        isClosable,
        isCompact,
        closeBtnAriaLabel,
        "aria-label": ariaLabel,
        onClick,
        numLabels,
        expandedText,
        collapsedText,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        defaultIsOpen,
        tooltipPosition,
        isVertical: isVertical2,
        isEditable,
        hasEditableTextArea,
        editableTextAreaProps,
        addLabelControl
      } = _a, rest = __rest(_a, ["categoryName", "children", "className", "isClosable", "isCompact", "closeBtnAriaLabel", "aria-label", "onClick", "numLabels", "expandedText", "collapsedText", "defaultIsOpen", "tooltipPosition", "isVertical", "isEditable", "hasEditableTextArea", "editableTextAreaProps", "addLabelControl"]);
      const { isOpen } = this.state;
      const renderedChildren = React117.Children.toArray(children);
      const numChildren = renderedChildren.length;
      const collapsedTextResult = fillTemplate(collapsedText, {
        remaining: numChildren - numLabels
      });
      const renderLabelGroup = (id) => {
        const labelArray = !isOpen ? renderedChildren.slice(0, numLabels) : renderedChildren;
        const content = React117.createElement(
          React117.Fragment,
          null,
          categoryName && this.renderLabel(id),
          React117.createElement(
            "ul",
            Object.assign({ className: css(import_label_group2.default.labelGroupList) }, categoryName && { "aria-labelledby": id }, !categoryName && { "aria-label": ariaLabel }, { role: "list" }, rest),
            labelArray.map((child, i) => React117.createElement("li", { className: css(import_label_group2.default.labelGroupListItem), key: i }, child)),
            numChildren > numLabels && React117.createElement(
              "li",
              { className: css(import_label_group2.default.labelGroupListItem) },
              React117.createElement(Label, { isOverflowLabel: true, onClick: this.toggleCollapse, className: css(isCompact && import_label2.default.modifiers.compact) }, isOpen ? expandedText : collapsedTextResult)
            ),
            addLabelControl && React117.createElement("li", { className: css(import_label_group2.default.labelGroupListItem) }, addLabelControl),
            isEditable && hasEditableTextArea && React117.createElement(
              "li",
              { className: css(import_label_group2.default.labelGroupListItem, import_label_group2.default.modifiers.textarea) },
              React117.createElement("textarea", Object.assign({ className: css(import_label_group2.default.labelGroupTextarea), rows: 1, tabIndex: 0 }, editableTextAreaProps))
            )
          )
        );
        const close = React117.createElement(
          "div",
          { className: css(import_label_group2.default.labelGroupClose) },
          React117.createElement(
            Button,
            { variant: "plain", "aria-label": closeBtnAriaLabel, onClick, id: `remove_group_${id}`, "aria-labelledby": `remove_group_${id} ${id}` },
            React117.createElement(times_circle_icon_default, { "aria-hidden": "true" })
          )
        );
        return React117.createElement(
          "div",
          { className: css(import_label_group2.default.labelGroup, className, categoryName && import_label_group2.default.modifiers.category, isVertical2 && import_label_group2.default.modifiers.vertical, isEditable && import_label_group2.default.modifiers.editable) },
          React117.createElement("div", { className: css(import_label_group2.default.labelGroupMain) }, content),
          isClosable && close
        );
      };
      return numChildren === 0 && addLabelControl === void 0 ? null : React117.createElement(GenerateId, null, (randomId) => renderLabelGroup(this.props.id || randomId));
    }
  };
  LabelGroup.displayName = "LabelGroup";
  LabelGroup.defaultProps = {
    expandedText: "Show Less",
    collapsedText: "${remaining} more",
    categoryName: "",
    defaultIsOpen: false,
    numLabels: 3,
    isClosable: false,
    isCompact: false,
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onClick: (_e) => void 0,
    closeBtnAriaLabel: "Close label group",
    tooltipPosition: "top",
    "aria-label": "Label group category",
    isVertical: false,
    isEditable: false,
    hasEditableTextArea: false
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/eye-slash-icon.js
  var EyeSlashIconConfig = {
    name: "EyeSlashIcon",
    height: 512,
    width: 640,
    svgPath: "M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z",
    yOffset: 0,
    xOffset: 0
  };
  var EyeSlashIcon = createIcon(EyeSlashIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/eye-icon.js
  var EyeIconConfig = {
    name: "EyeIcon",
    height: 512,
    width: 576,
    svgPath: "M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z",
    yOffset: 0,
    xOffset: 0
  };
  var EyeIcon = createIcon(EyeIconConfig);

  // node_modules/@patternfly/react-core/dist/esm/components/Page/PageContext.js
  var React118 = __toESM(require_react());
  var pageContextDefaults = {
    isManagedSidebar: false,
    isNavOpen: false,
    onNavToggle: () => null,
    width: null,
    height: null,
    getBreakpoint,
    getVerticalBreakpoint
  };
  var PageContext = React118.createContext(pageContextDefaults);
  var PageContextProvider = PageContext.Provider;
  var PageContextConsumer = PageContext.Consumer;

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/Menu.js
  init_tslib_es6();
  var React120 = __toESM(require_react());
  var import_menu = __toESM(require_menu());

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuContext.js
  var React119 = __toESM(require_react());
  var MenuContext = React119.createContext({
    menuId: null,
    parentMenu: null,
    onActionClick: () => null,
    onSelect: () => null,
    activeItemId: null,
    selected: null,
    drilledInMenus: [],
    drilldownItemPath: [],
    onDrillIn: null,
    onDrillOut: null,
    onGetMenuHeight: () => null,
    flyoutRef: null,
    setFlyoutRef: () => null,
    disableHover: false,
    role: "menu"
  });
  var MenuItemContext = React119.createContext({
    itemId: null,
    isDisabled: false
  });

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/Menu.js
  var MenuBase = class extends React120.Component {
    constructor(props) {
      super(props);
      this.menuRef = React120.createRef();
      this.activeMenu = null;
      this.state = {
        ouiaStateId: getDefaultOUIAId(Menu.displayName),
        searchInputValue: "",
        transitionMoveTarget: null,
        flyoutRef: null,
        disableHover: false,
        currentDrilldownMenuId: this.props.id
      };
      this.handleDrilldownTransition = (event) => {
        const current = this.menuRef.current;
        if (!current || current !== event.target.closest(".pf-c-menu") && !Array.from(current.getElementsByClassName("pf-c-menu")).includes(event.target.closest(".pf-c-menu"))) {
          return;
        }
        if (this.state.transitionMoveTarget) {
          this.state.transitionMoveTarget.focus();
          this.setState({ transitionMoveTarget: null });
        } else {
          const nextMenu = current.querySelector("#" + this.props.activeMenu) || current || null;
          const nextMenuChildren = Array.from(nextMenu.getElementsByTagName("UL")[0].children);
          if (!this.state.currentDrilldownMenuId || nextMenu.id !== this.state.currentDrilldownMenuId) {
            this.setState({ currentDrilldownMenuId: nextMenu.id });
          } else {
            return;
          }
          const nextTarget = nextMenuChildren.filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains("pf-c-divider")))[0].firstChild;
          nextTarget.focus();
          nextTarget.tabIndex = 0;
        }
      };
      this.handleExtraKeys = (event) => {
        const isDrilldown = this.props.containsDrilldown;
        const activeElement = document.activeElement;
        if (event.target.closest(".pf-c-menu") !== this.activeMenu && !event.target.classList.contains("pf-c-breadcrumb__link")) {
          this.activeMenu = event.target.closest(".pf-c-menu");
          this.setState({ disableHover: true });
        }
        if (event.target.tagName === "INPUT") {
          return;
        }
        const parentMenu = this.activeMenu;
        const key = event.key;
        const isFromBreadcrumb = activeElement.classList.contains("pf-c-breadcrumb__link") || activeElement.classList.contains("pf-c-dropdown__toggle");
        if (key === " " || key === "Enter") {
          event.preventDefault();
          if (isDrilldown && !isFromBreadcrumb) {
            const isDrillingOut = activeElement.closest("li").classList.contains("pf-m-current-path");
            if (isDrillingOut && parentMenu.parentElement.tagName === "LI") {
              activeElement.tabIndex = -1;
              parentMenu.parentElement.firstChild.tabIndex = 0;
              this.setState({ transitionMoveTarget: parentMenu.parentElement.firstChild });
            } else {
              if (activeElement.nextElementSibling && activeElement.nextElementSibling.classList.contains("pf-c-menu")) {
                const childItems = Array.from(activeElement.nextElementSibling.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains("pf-c-divider")));
                activeElement.tabIndex = -1;
                childItems[0].firstChild.tabIndex = 0;
                this.setState({ transitionMoveTarget: childItems[0].firstChild });
              }
            }
          }
          document.activeElement.click();
        }
      };
      this.createNavigableElements = () => {
        const isDrilldown = this.props.containsDrilldown;
        if (isDrilldown) {
          return this.activeMenu ? Array.from(this.activeMenu.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains("pf-c-divider"))) : [];
        } else {
          return this.menuRef.current ? Array.from(this.menuRef.current.getElementsByTagName("LI")).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains("pf-c-divider"))) : [];
        }
      };
      if (props.innerRef) {
        this.menuRef = props.innerRef;
      }
    }
    allowTabFirstItem() {
      const current = this.menuRef.current;
      if (current) {
        const first = current.querySelector("ul button:not(:disabled), ul a:not(:disabled)");
        if (first) {
          first.tabIndex = 0;
        }
      }
    }
    componentDidMount() {
      if (this.context) {
        this.setState({ disableHover: this.context.disableHover });
      }
      if (canUseDOM) {
        window.addEventListener("transitionend", this.props.isRootMenu ? this.handleDrilldownTransition : null);
      }
      this.allowTabFirstItem();
    }
    componentWillUnmount() {
      if (canUseDOM) {
        window.removeEventListener("transitionend", this.handleDrilldownTransition);
      }
    }
    componentDidUpdate(prevProps) {
      if (prevProps.children !== this.props.children) {
        this.allowTabFirstItem();
      }
    }
    render() {
      const _a = this.props, {
        "aria-label": ariaLabel,
        id,
        children,
        className,
        onSelect,
        selected = null,
        onActionClick,
        ouiaId,
        ouiaSafe,
        containsFlyout,
        isNavFlyout,
        containsDrilldown,
        isMenuDrilledIn,
        isPlain,
        isScrollable,
        drilldownItemPath,
        drilledInMenus,
        onDrillIn,
        onDrillOut,
        onGetMenuHeight,
        parentMenu = null,
        activeItemId = null,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        innerRef,
        isRootMenu,
        activeMenu,
        role
      } = _a, props = __rest(_a, ["aria-label", "id", "children", "className", "onSelect", "selected", "onActionClick", "ouiaId", "ouiaSafe", "containsFlyout", "isNavFlyout", "containsDrilldown", "isMenuDrilledIn", "isPlain", "isScrollable", "drilldownItemPath", "drilledInMenus", "onDrillIn", "onDrillOut", "onGetMenuHeight", "parentMenu", "activeItemId", "innerRef", "isRootMenu", "activeMenu", "role"]);
      const _isMenuDrilledIn = isMenuDrilledIn || drilledInMenus && drilledInMenus.includes(id) || false;
      return React120.createElement(
        MenuContext.Provider,
        { value: {
          menuId: id,
          parentMenu: parentMenu || id,
          onSelect,
          onActionClick,
          activeItemId,
          selected,
          drilledInMenus,
          drilldownItemPath,
          onDrillIn,
          onDrillOut,
          onGetMenuHeight,
          flyoutRef: this.state.flyoutRef,
          setFlyoutRef: (flyoutRef) => this.setState({ flyoutRef }),
          disableHover: this.state.disableHover,
          role
        } },
        isRootMenu && React120.createElement(KeyboardHandler, { containerRef: this.menuRef || null, additionalKeyHandler: this.handleExtraKeys, createNavigableElements: this.createNavigableElements, isActiveElement: (element) => document.activeElement.closest("li") === element || // if element is a basic MenuItem
        document.activeElement.parentElement === element || document.activeElement.closest(".pf-c-menu__search") === element || // if element is a MenuInput
        document.activeElement.closest("ol") && document.activeElement.closest("ol").firstChild === element, getFocusableElement: (navigableElement) => navigableElement.tagName === "DIV" && navigableElement.querySelector("input") || // for MenuInput
        navigableElement.firstChild.tagName === "LABEL" && navigableElement.querySelector("input") || // for MenuItem checkboxes
        navigableElement.firstChild, noHorizontalArrowHandling: document.activeElement && (document.activeElement.classList.contains("pf-c-breadcrumb__link") || document.activeElement.classList.contains("pf-c-dropdown__toggle")), noEnterHandling: true, noSpaceHandling: true }),
        React120.createElement("div", Object.assign({ id, className: css(import_menu.default.menu, isPlain && import_menu.default.modifiers.plain, isScrollable && import_menu.default.modifiers.scrollable, containsFlyout && import_menu.default.modifiers.flyout, isNavFlyout && import_menu.default.modifiers.nav, containsDrilldown && import_menu.default.modifiers.drilldown, _isMenuDrilledIn && import_menu.default.modifiers.drilledIn, className), "aria-label": ariaLabel, ref: this.menuRef }, getOUIAProps(Menu.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), props), children)
      );
    }
  };
  MenuBase.displayName = "Menu";
  MenuBase.contextType = MenuContext;
  MenuBase.defaultProps = {
    ouiaSafe: true,
    isRootMenu: true,
    isPlain: false,
    isScrollable: false,
    role: "menu"
  };
  var Menu = React120.forwardRef((props, ref) => React120.createElement(MenuBase, Object.assign({}, props, { innerRef: ref })));
  Menu.displayName = "Menu";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuContent.js
  init_tslib_es6();
  var React121 = __toESM(require_react());
  var import_menu2 = __toESM(require_menu());
  var MenuContent = React121.forwardRef((props, ref) => {
    const { getHeight, children, menuHeight, maxMenuHeight } = props, rest = __rest(props, ["getHeight", "children", "menuHeight", "maxMenuHeight"]);
    const menuContentRef = React121.createRef();
    const refCallback = (el, menuId, onGetMenuHeight) => {
      if (el) {
        let clientHeight = el.clientHeight;
        let rootMenuList = null;
        let parentEl = el.closest(`.${import_menu2.default.menuList}`);
        while (parentEl !== null && parentEl.nodeType === 1) {
          if (parentEl.classList.contains(import_menu2.default.menuList)) {
            rootMenuList = parentEl;
          }
          parentEl = parentEl.parentElement;
        }
        if (rootMenuList) {
          const rootMenuListStyles = getComputedStyle(rootMenuList);
          const rootMenuListPaddingOffset = parseFloat(rootMenuListStyles.getPropertyValue("padding-top").replace(/px/g, "")) + parseFloat(rootMenuListStyles.getPropertyValue("padding-bottom").replace(/px/g, "")) + parseFloat(getComputedStyle(rootMenuList.parentElement).getPropertyValue("border-bottom-width").replace(/px/g, ""));
          clientHeight = clientHeight + rootMenuListPaddingOffset;
        }
        onGetMenuHeight && onGetMenuHeight(menuId, clientHeight);
        getHeight && getHeight(clientHeight.toString());
      }
      return ref || menuContentRef;
    };
    return React121.createElement(MenuContext.Consumer, null, ({ menuId, onGetMenuHeight }) => React121.createElement("div", Object.assign({}, rest, { className: css(import_menu2.default.menuContent, props.className), ref: (el) => refCallback(el, menuId, onGetMenuHeight), style: Object.assign(Object.assign({}, menuHeight && { "--pf-c-menu__content--Height": menuHeight }), maxMenuHeight && { "--pf-c-menu__content--MaxHeight": maxMenuHeight }) }), children));
  });
  MenuContent.displayName = "MenuContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuItem.js
  init_tslib_es6();
  var React123 = __toESM(require_react());
  var import_menu4 = __toESM(require_menu());

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu_m_flyout__menu_top_offset.js
  var c_menu_m_flyout__menu_top_offset = {
    "name": "--pf-c-menu--m-flyout__menu--top-offset",
    "value": "0px",
    "var": "var(--pf-c-menu--m-flyout__menu--top-offset)"
  };
  var c_menu_m_flyout_menu_top_offset_default = c_menu_m_flyout__menu_top_offset;

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu_m_flyout__menu_m_left_right_offset.js
  var c_menu_m_flyout__menu_m_left_right_offset = {
    "name": "--pf-c-menu--m-flyout__menu--m-left--right-offset",
    "value": "0px",
    "var": "var(--pf-c-menu--m-flyout__menu--m-left--right-offset)"
  };
  var c_menu_m_flyout_menu_m_left_right_offset_default = c_menu_m_flyout__menu_m_left_right_offset;

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu_m_flyout__menu_left_offset.js
  var c_menu_m_flyout__menu_left_offset = {
    "name": "--pf-c-menu--m-flyout__menu--left-offset",
    "value": "0px",
    "var": "var(--pf-c-menu--m-flyout__menu--left-offset)"
  };
  var c_menu_m_flyout_menu_left_offset_default = c_menu_m_flyout__menu_left_offset;

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuItemAction.js
  init_tslib_es6();
  var React122 = __toESM(require_react());
  var import_menu3 = __toESM(require_menu());
  var MenuItemActionBase = (_a) => {
    var { className = "", icon: icon2, onClick, "aria-label": ariaLabel, isFavorited = null, isDisabled, actionId, innerRef } = _a, props = __rest(_a, ["className", "icon", "onClick", "aria-label", "isFavorited", "isDisabled", "actionId", "innerRef"]);
    return React122.createElement(MenuContext.Consumer, null, ({ onActionClick }) => React122.createElement(MenuItemContext.Consumer, null, ({ itemId, isDisabled: isDisabledContext }) => {
      const onClickButton = (event) => {
        onClick && onClick(event);
        onActionClick && onActionClick(event, itemId, actionId);
      };
      return React122.createElement(
        "button",
        Object.assign({ className: css(import_menu3.default.menuItemAction, isFavorited !== null && import_menu3.default.modifiers.favorite, isFavorited && import_menu3.default.modifiers.favorited, className), "aria-label": ariaLabel, onClick: onClickButton }, (isDisabled === true || isDisabledContext === true) && { disabled: true }, { ref: innerRef, tabIndex: -1 }, props),
        React122.createElement("span", { className: css(import_menu3.default.menuItemActionIcon) }, icon2 === "favorites" || isFavorited !== null ? React122.createElement(star_icon_default, { "aria-hidden": true }) : icon2)
      );
    }));
  };
  var MenuItemAction = React122.forwardRef((props, ref) => React122.createElement(MenuItemActionBase, Object.assign({}, props, { innerRef: ref })));
  MenuItemAction.displayName = "MenuItemAction";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuItem.js
  var FlyoutContext = React123.createContext({
    direction: "right"
  });
  var MenuItemBase = (_a) => {
    var { children, className, itemId = null, to, hasCheck = false, isActive = null, isFavorited = null, isLoadButton = false, isLoading = false, flyoutMenu, direction, description = null, onClick = () => {
    }, component = "button", isDisabled = false, isExternalLink = false, isSelected = null, isFocused, isDanger = false, icon: icon2, actions, onShowFlyout, drilldownMenu, isOnPath, innerRef } = _a, props = __rest(_a, ["children", "className", "itemId", "to", "hasCheck", "isActive", "isFavorited", "isLoadButton", "isLoading", "flyoutMenu", "direction", "description", "onClick", "component", "isDisabled", "isExternalLink", "isSelected", "isFocused", "isDanger", "icon", "actions", "onShowFlyout", "drilldownMenu", "isOnPath", "innerRef"]);
    const { menuId, parentMenu, onSelect, onActionClick, activeItemId, selected, drilldownItemPath, onDrillIn, onDrillOut, flyoutRef, setFlyoutRef, disableHover, role: menuRole } = React123.useContext(MenuContext);
    let Component50 = to ? "a" : component;
    if (hasCheck && !to) {
      Component50 = "label";
    }
    const [flyoutTarget, setFlyoutTarget] = React123.useState(null);
    const flyoutContext = React123.useContext(FlyoutContext);
    const [flyoutXDirection, setFlyoutXDirection] = React123.useState(flyoutContext.direction);
    const ref = React123.useRef();
    const flyoutVisible = ref === flyoutRef;
    const hasFlyout = flyoutMenu !== void 0;
    const showFlyout = (show) => {
      if (!flyoutVisible && show) {
        setFlyoutRef(ref);
      } else if (flyoutVisible && !show) {
        setFlyoutRef(null);
      }
      onShowFlyout && show && onShowFlyout();
    };
    useIsomorphicLayoutEffect(() => {
      if (hasFlyout && ref.current && canUseDOM) {
        const flyoutMenu2 = ref.current.lastElementChild;
        if (flyoutMenu2 && flyoutMenu2.classList.contains(import_menu4.default.menu)) {
          const origin = ref.current.getClientRects()[0];
          const rect = flyoutMenu2.getClientRects()[0];
          if (origin && rect) {
            const spaceLeftLeft = origin.x - rect.width;
            const spaceLeftRight = window.innerWidth - origin.x - origin.width - rect.width;
            let xDir = flyoutXDirection;
            if (spaceLeftRight < 0 && xDir !== "left") {
              setFlyoutXDirection("left");
              xDir = "left";
            } else if (spaceLeftLeft < 0 && xDir !== "right") {
              setFlyoutXDirection("right");
              xDir = "right";
            }
            let xOffset = 0;
            if (spaceLeftLeft < 0 && spaceLeftRight < 0) {
              xOffset = xDir === "right" ? -spaceLeftRight : -spaceLeftLeft;
            }
            if (xDir === "left") {
              flyoutMenu2.classList.add(import_menu4.default.modifiers.left);
              flyoutMenu2.style.setProperty(c_menu_m_flyout_menu_m_left_right_offset_default.name, `-${xOffset}px`);
            } else {
              flyoutMenu2.style.setProperty(c_menu_m_flyout_menu_left_offset_default.name, `-${xOffset}px`);
            }
            const spaceLeftBot = window.innerHeight - origin.y - rect.height;
            const spaceLeftTop = window.innerHeight - rect.height;
            if (spaceLeftTop < 0 && spaceLeftBot < 0) {
            } else if (spaceLeftBot < 0) {
              flyoutMenu2.style.setProperty(c_menu_m_flyout_menu_top_offset_default.name, `${spaceLeftBot}px`);
            }
          }
        }
      }
    }, [flyoutVisible, flyoutMenu]);
    React123.useEffect(() => {
      setFlyoutXDirection(flyoutContext.direction);
    }, [flyoutContext]);
    React123.useEffect(() => {
      if (flyoutTarget) {
        if (flyoutVisible) {
          const flyoutMenu2 = flyoutTarget.nextElementSibling;
          const flyoutItems = Array.from(flyoutMenu2.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains("pf-c-divider")));
          flyoutItems[0].firstChild.focus();
        } else {
          flyoutTarget.focus();
        }
      }
    }, [flyoutVisible, flyoutTarget]);
    const handleFlyout = (event) => {
      const key = event.key;
      const target = event.target;
      const type = event.type;
      if (key === " " || key === "Enter" || key === "ArrowRight" || type === "click") {
        event.stopPropagation();
        event.preventDefault();
        if (!flyoutVisible) {
          showFlyout(true);
          setFlyoutTarget(target);
        }
      }
      if (key === "Escape" || key === "ArrowLeft") {
        if (flyoutVisible) {
          event.stopPropagation();
          showFlyout(false);
        }
      }
    };
    const onItemSelect = (event, onSelect2) => {
      onSelect2 && onSelect2(event, itemId);
      onClick && onClick(event);
    };
    const _isOnPath = isOnPath && isOnPath || drilldownItemPath && drilldownItemPath.includes(itemId) || false;
    let drill;
    if (direction) {
      if (direction === "down") {
        drill = (event) => onDrillIn && onDrillIn(event, menuId, typeof drilldownMenu === "function" ? drilldownMenu().props.id : drilldownMenu.props.id, itemId);
      } else {
        drill = (event) => onDrillOut && onDrillOut(event, parentMenu, itemId);
      }
    }
    let additionalProps = {};
    if (Component50 === "a") {
      additionalProps = {
        href: to,
        "aria-disabled": isDisabled ? true : null,
        // prevent invalid 'disabled' attribute on <a> tags
        disabled: null
      };
    } else if (Component50 === "button") {
      additionalProps = {
        type: "button"
      };
    }
    if (isOnPath) {
      additionalProps["aria-expanded"] = true;
    } else if (hasFlyout) {
      additionalProps["aria-haspopup"] = "menu";
      additionalProps["aria-expanded"] = flyoutVisible;
    }
    const getAriaCurrent = () => {
      if (isActive !== null) {
        if (isActive) {
          return "page";
        } else {
          return null;
        }
      } else if (itemId !== null && activeItemId !== null) {
        return itemId === activeItemId;
      }
      return null;
    };
    const getIsSelected = () => {
      if (isSelected !== null) {
        return isSelected;
      } else if (selected !== null && itemId !== null) {
        return Array.isArray(selected) && selected.includes(itemId) || itemId === selected;
      }
      return false;
    };
    const onMouseOver = () => {
      if (disableHover) {
        return;
      }
      if (hasFlyout) {
        showFlyout(true);
      } else {
        setFlyoutRef(null);
      }
    };
    const isSelectMenu = menuRole === "listbox";
    return React123.createElement(
      "li",
      Object.assign({ className: css(import_menu4.default.menuListItem, isDisabled && import_menu4.default.modifiers.disabled, _isOnPath && import_menu4.default.modifiers.currentPath, isLoadButton && import_menu4.default.modifiers.load, isLoading && import_menu4.default.modifiers.loading, isFocused && import_menu4.default.modifiers.focus, isDanger && import_menu4.default.modifiers.danger, className), onMouseOver }, flyoutMenu && { onKeyDown: handleFlyout }, { ref, role: !hasCheck ? "none" : "menuitem" }, props),
      React123.createElement(GenerateId, null, (randomId) => React123.createElement(
        Component50,
        Object.assign({ tabIndex: -1, className: css(import_menu4.default.menuItem, getIsSelected() && !hasCheck && import_menu4.default.modifiers.selected, className), "aria-current": getAriaCurrent() }, !hasCheck && { disabled: isDisabled }, !hasCheck && !flyoutMenu && { role: isSelectMenu ? "option" : "menuitem" }, !hasCheck && !flyoutMenu && isSelectMenu && { "aria-selected": getIsSelected() }, { ref: innerRef }, !hasCheck && {
          onClick: (event) => {
            onItemSelect(event, onSelect);
            drill && drill(event);
            flyoutMenu && handleFlyout(event);
          }
        }, hasCheck && { htmlFor: randomId }, additionalProps),
        React123.createElement(
          "span",
          { className: css(import_menu4.default.menuItemMain) },
          direction === "up" && React123.createElement(
            "span",
            { className: css(import_menu4.default.menuItemToggleIcon) },
            React123.createElement(angle_left_icon_default, { "aria-hidden": true })
          ),
          icon2 && React123.createElement("span", { className: css(import_menu4.default.menuItemIcon) }, icon2),
          hasCheck && React123.createElement(
            "span",
            { className: css("pf-c-menu__item-check") },
            React123.createElement(Checkbox, { id: randomId, component: "span", isChecked: isSelected || false, onChange: (event) => onItemSelect(event, onSelect), isDisabled })
          ),
          React123.createElement("span", { className: css(import_menu4.default.menuItemText) }, children),
          isExternalLink && React123.createElement(
            "span",
            { className: css(import_menu4.default.menuItemExternalIcon) },
            React123.createElement(external_link_alt_icon_default, { "aria-hidden": true })
          ),
          (flyoutMenu || direction === "down") && React123.createElement(
            "span",
            { className: css(import_menu4.default.menuItemToggleIcon) },
            React123.createElement(angle_right_icon_default, { "aria-hidden": true })
          ),
          getIsSelected() && React123.createElement(
            "span",
            { className: css(import_menu4.default.menuItemSelectIcon) },
            React123.createElement(check_icon_default, { "aria-hidden": true })
          )
        ),
        description && direction !== "up" && React123.createElement(
          "span",
          { className: css(import_menu4.default.menuItemDescription) },
          React123.createElement("span", null, description)
        )
      )),
      flyoutVisible && React123.createElement(
        MenuContext.Provider,
        { value: { disableHover } },
        React123.createElement(FlyoutContext.Provider, { value: { direction: flyoutXDirection } }, flyoutMenu)
      ),
      typeof drilldownMenu === "function" ? drilldownMenu() : drilldownMenu,
      React123.createElement(
        MenuItemContext.Provider,
        { value: { itemId, isDisabled } },
        actions,
        isFavorited !== null && React123.createElement(MenuItemAction, { icon: "favorites", isFavorited, "aria-label": isFavorited ? "starred" : "not starred", onClick: (event) => onActionClick(event, itemId), tabIndex: -1, actionId: "fav" })
      )
    );
  };
  var MenuItem = React123.forwardRef((props, ref) => React123.createElement(MenuItemBase, Object.assign({}, props, { innerRef: ref })));
  MenuItem.displayName = "MenuItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuList.js
  init_tslib_es6();
  var React124 = __toESM(require_react());
  var import_menu5 = __toESM(require_menu());
  var MenuList = (_a) => {
    var { children = null, className, isAriaMultiselectable = false } = _a, props = __rest(_a, ["children", "className", "isAriaMultiselectable"]);
    const { role } = React124.useContext(MenuContext);
    return React124.createElement("ul", Object.assign({ role }, role === "listbox" && { "aria-multiselectable": isAriaMultiselectable }, { className: css(import_menu5.default.menuList, className) }, props), children);
  };
  MenuList.displayName = "MenuList";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/Modal.js
  init_tslib_es6();
  var React133 = __toESM(require_react());
  var ReactDOM6 = __toESM(require_react_dom());
  var import_backdrop2 = __toESM(require_backdrop());

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalContent.js
  init_tslib_es6();
  var React132 = __toESM(require_react());
  var import_modal_box7 = __toESM(require_modal_box());
  var import_bullseye = __toESM(require_bullseye());

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxBody.js
  init_tslib_es6();
  var React125 = __toESM(require_react());
  var import_modal_box = __toESM(require_modal_box());
  var ModalBoxBody = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React125.createElement("div", Object.assign({}, props, { className: css(import_modal_box.default.modalBoxBody, className) }), children);
  };
  ModalBoxBody.displayName = "ModalBoxBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxCloseButton.js
  init_tslib_es6();
  var React126 = __toESM(require_react());
  var ModalBoxCloseButton = (_a) => {
    var { className = "", onClose = () => void 0, ouiaId } = _a, props = __rest(_a, ["className", "onClose", "ouiaId"]);
    return React126.createElement(
      Button,
      Object.assign({ className, variant: "plain", onClick: onClose, "aria-label": "Close" }, ouiaId && { ouiaId: `${ouiaId}-${ModalBoxCloseButton.displayName}` }, props),
      React126.createElement(times_icon_default, null)
    );
  };
  ModalBoxCloseButton.displayName = "ModalBoxCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBox.js
  init_tslib_es6();
  var React127 = __toESM(require_react());
  var import_modal_box2 = __toESM(require_modal_box());

  // node_modules/@patternfly/react-tokens/dist/esm/c_modal_box_m_align_top_spacer.js
  var c_modal_box_m_align_top_spacer = {
    "name": "--pf-c-modal-box--m-align-top--spacer",
    "value": "0.5rem",
    "var": "var(--pf-c-modal-box--m-align-top--spacer)"
  };
  var c_modal_box_m_align_top_spacer_default = c_modal_box_m_align_top_spacer;

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBox.js
  var ModalBox = (_a) => {
    var { children, className = "", variant = "default", position, positionOffset, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel = "", "aria-describedby": ariaDescribedby, style } = _a, props = __rest(_a, ["children", "className", "variant", "position", "positionOffset", "aria-labelledby", "aria-label", "aria-describedby", "style"]);
    if (positionOffset) {
      style = style || {};
      style[c_modal_box_m_align_top_spacer_default.name] = positionOffset;
    }
    return React127.createElement("div", Object.assign({}, props, { role: "dialog", "aria-label": ariaLabel || null, "aria-labelledby": ariaLabelledby || null, "aria-describedby": ariaDescribedby, "aria-modal": "true", className: css(import_modal_box2.default.modalBox, className, position === "top" && import_modal_box2.default.modifiers.alignTop, variant === "large" && import_modal_box2.default.modifiers.lg, variant === "small" && import_modal_box2.default.modifiers.sm, variant === "medium" && import_modal_box2.default.modifiers.md), style }), children);
  };
  ModalBox.displayName = "ModalBox";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxFooter.js
  init_tslib_es6();
  var React128 = __toESM(require_react());
  var import_modal_box3 = __toESM(require_modal_box());
  var ModalBoxFooter = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React128.createElement("footer", Object.assign({}, props, { className: css(import_modal_box3.default.modalBoxFooter, className) }), children);
  };
  ModalBoxFooter.displayName = "ModalBoxFooter";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxDescription.js
  init_tslib_es6();
  var React129 = __toESM(require_react());
  var import_modal_box4 = __toESM(require_modal_box());
  var ModalBoxDescription = (_a) => {
    var { children = null, className = "", id = "" } = _a, props = __rest(_a, ["children", "className", "id"]);
    return React129.createElement("div", Object.assign({}, props, { id, className: css(import_modal_box4.default.modalBoxDescription, className) }), children);
  };
  ModalBoxDescription.displayName = "ModalBoxDescription";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxHeader.js
  init_tslib_es6();
  var React130 = __toESM(require_react());
  var import_modal_box5 = __toESM(require_modal_box());
  var ModalBoxHeader = (_a) => {
    var { children = null, className = "", help = null } = _a, props = __rest(_a, ["children", "className", "help"]);
    return React130.createElement(
      "header",
      Object.assign({ className: css(import_modal_box5.default.modalBoxHeader, help && import_modal_box5.default.modifiers.help, className) }, props),
      help && React130.createElement(
        React130.Fragment,
        null,
        React130.createElement("div", { className: css(import_modal_box5.default.modalBoxHeaderMain) }, children),
        React130.createElement("div", { className: "pf-c-modal-box__header-help" }, help)
      ),
      !help && children
    );
  };
  ModalBoxHeader.displayName = "ModalBoxHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxTitle.js
  init_tslib_es6();
  var React131 = __toESM(require_react());
  var import_modal_box6 = __toESM(require_modal_box());
  var import_accessibility2 = __toESM(require_accessibility());
  var isVariantIcon = (icon2) => ["success", "danger", "warning", "info", "default"].includes(icon2);
  var ModalBoxTitle = (_a) => {
    var { className = "", id, title, titleIconVariant, titleLabel = "" } = _a, props = __rest(_a, ["className", "id", "title", "titleIconVariant", "titleLabel"]);
    const [hasTooltip, setHasTooltip] = React131.useState(false);
    const h1 = React131.useRef(null);
    const label = titleLabel || (isVariantIcon(titleIconVariant) ? `${capitalize(titleIconVariant)} alert:` : titleLabel);
    const variantIcons2 = {
      success: React131.createElement(check_circle_icon_default, null),
      danger: React131.createElement(exclamation_circle_icon_default, null),
      warning: React131.createElement(exclamation_triangle_icon_default, null),
      info: React131.createElement(info_circle_icon_default, null),
      default: React131.createElement(bell_icon_default, null)
    };
    const CustomIcon = !isVariantIcon(titleIconVariant) && titleIconVariant;
    useIsomorphicLayoutEffect(() => {
      setHasTooltip(h1.current && h1.current.offsetWidth < h1.current.scrollWidth);
    }, []);
    const content = React131.createElement(
      "h1",
      Object.assign({ id, ref: h1, className: css(import_modal_box6.default.modalBoxTitle, titleIconVariant && import_modal_box6.default.modifiers.icon, className) }, props),
      titleIconVariant && React131.createElement("span", { className: css(import_modal_box6.default.modalBoxTitleIcon) }, isVariantIcon(titleIconVariant) ? variantIcons2[titleIconVariant] : React131.createElement(CustomIcon, null)),
      label && React131.createElement("span", { className: css(import_accessibility2.default.screenReader) }, label),
      React131.createElement("span", { className: css(import_modal_box6.default.modalBoxTitleText) }, title)
    );
    return hasTooltip ? React131.createElement(Tooltip, { content: title }, content) : content;
  };
  ModalBoxTitle.displayName = "ModalBoxTitle";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalContent.js
  var ModalContent = (_a) => {
    var { children, className = "", isOpen = false, header = null, help = null, description = null, title = "", titleIconVariant = null, titleLabel = "", "aria-label": ariaLabel = "", "aria-describedby": ariaDescribedby, "aria-labelledby": ariaLabelledby, bodyAriaLabel, bodyAriaRole, showClose = true, footer = null, actions = [], onClose = () => void 0, variant = "default", position, positionOffset, width = -1, boxId, labelId, descriptorId, disableFocusTrap = false, hasNoBodyWrapper = false, ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["children", "className", "isOpen", "header", "help", "description", "title", "titleIconVariant", "titleLabel", "aria-label", "aria-describedby", "aria-labelledby", "bodyAriaLabel", "bodyAriaRole", "showClose", "footer", "actions", "onClose", "variant", "position", "positionOffset", "width", "boxId", "labelId", "descriptorId", "disableFocusTrap", "hasNoBodyWrapper", "ouiaId", "ouiaSafe"]);
    if (!isOpen) {
      return null;
    }
    const modalBoxHeader = header ? React132.createElement(ModalBoxHeader, { help }, header) : title && React132.createElement(
      ModalBoxHeader,
      { help },
      React132.createElement(ModalBoxTitle, { title, titleIconVariant, titleLabel, id: labelId }),
      description && React132.createElement(ModalBoxDescription, { id: descriptorId }, description)
    );
    const modalBoxFooter = footer ? React132.createElement(ModalBoxFooter, null, footer) : actions.length > 0 && React132.createElement(ModalBoxFooter, null, actions);
    const defaultModalBodyAriaRole = bodyAriaLabel ? "region" : void 0;
    const modalBody = hasNoBodyWrapper ? children : React132.createElement(ModalBoxBody, Object.assign({ "aria-label": bodyAriaLabel, role: bodyAriaRole || defaultModalBodyAriaRole }, props, !description && !ariaDescribedby && { id: descriptorId }), children);
    const boxStyle = width === -1 ? {} : { width };
    const ariaLabelledbyFormatted = () => {
      if (ariaLabelledby === null) {
        return null;
      }
      const idRefList = [];
      if ((ariaLabel && boxId) !== "") {
        idRefList.push(ariaLabel && boxId);
      }
      if (ariaLabelledby) {
        idRefList.push(ariaLabelledby);
      }
      if (title) {
        idRefList.push(labelId);
      }
      return idRefList.join(" ");
    };
    const modalBox = React132.createElement(
      ModalBox,
      Object.assign({ id: boxId, style: boxStyle, className: css(className, isVariantIcon(titleIconVariant) && import_modal_box7.default.modifiers[titleIconVariant]), variant, position, positionOffset, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledbyFormatted(), "aria-describedby": ariaDescribedby || (hasNoBodyWrapper ? null : descriptorId) }, getOUIAProps(ModalContent.displayName, ouiaId, ouiaSafe)),
      showClose && React132.createElement(ModalBoxCloseButton, { onClose, ouiaId }),
      modalBoxHeader,
      modalBody,
      modalBoxFooter
    );
    return React132.createElement(
      Backdrop,
      null,
      React132.createElement(FocusTrap, { active: !disableFocusTrap, focusTrapOptions: { clickOutsideDeactivates: true, tabbableOptions: { displayCheck: "none" } }, className: css(import_bullseye.default.bullseye) }, modalBox)
    );
  };
  ModalContent.displayName = "ModalContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/Modal.js
  var ModalVariant;
  (function(ModalVariant2) {
    ModalVariant2["small"] = "small";
    ModalVariant2["medium"] = "medium";
    ModalVariant2["large"] = "large";
    ModalVariant2["default"] = "default";
  })(ModalVariant || (ModalVariant = {}));
  var Modal = class extends React133.Component {
    constructor(props) {
      super(props);
      this.boxId = "";
      this.labelId = "";
      this.descriptorId = "";
      this.handleEscKeyClick = (event) => {
        var _a, _b;
        const { onEscapePress } = this.props;
        if (event.key === KeyTypes.Escape && this.props.isOpen) {
          onEscapePress ? onEscapePress(event) : (_b = (_a = this.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
        }
      };
      this.getElement = (appendTo) => {
        if (typeof appendTo === "function") {
          return appendTo();
        }
        return appendTo || document.body;
      };
      this.toggleSiblingsFromScreenReaders = (hide2) => {
        const { appendTo } = this.props;
        const target = this.getElement(appendTo);
        const bodyChildren = target.children;
        for (const child of Array.from(bodyChildren)) {
          if (child !== this.state.container) {
            hide2 ? child.setAttribute("aria-hidden", "" + hide2) : child.removeAttribute("aria-hidden");
          }
        }
      };
      this.isEmpty = (value) => value === null || value === void 0 || value === "";
      const boxIdNum = Modal.currentId++;
      const labelIdNum = boxIdNum + 1;
      const descriptorIdNum = boxIdNum + 2;
      this.boxId = props.id || `pf-modal-part-${boxIdNum}`;
      this.labelId = `pf-modal-part-${labelIdNum}`;
      this.descriptorId = `pf-modal-part-${descriptorIdNum}`;
      this.state = {
        container: void 0,
        ouiaStateId: getDefaultOUIAId(Modal.displayName, props.variant)
      };
    }
    componentDidMount() {
      const { appendTo, title, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, hasNoBodyWrapper, header } = this.props;
      const target = this.getElement(appendTo);
      const container = document.createElement("div");
      this.setState({ container });
      target.appendChild(container);
      target.addEventListener("keydown", this.handleEscKeyClick, false);
      if (this.props.isOpen) {
        target.classList.add(css(import_backdrop2.default.backdropOpen));
      } else {
        target.classList.remove(css(import_backdrop2.default.backdropOpen));
      }
      if (this.isEmpty(title) && this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby)) {
        console.error("Modal: Specify at least one of: title, aria-label, aria-labelledby.");
      }
      if (this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby) && (hasNoBodyWrapper || header)) {
        console.error("Modal: When using hasNoBodyWrapper or setting a custom header, ensure you assign an accessible name to the the modal container with aria-label or aria-labelledby.");
      }
    }
    componentDidUpdate() {
      const { appendTo } = this.props;
      const target = this.getElement(appendTo);
      if (this.props.isOpen) {
        target.classList.add(css(import_backdrop2.default.backdropOpen));
        this.toggleSiblingsFromScreenReaders(true);
      } else {
        target.classList.remove(css(import_backdrop2.default.backdropOpen));
        this.toggleSiblingsFromScreenReaders(false);
      }
    }
    componentWillUnmount() {
      const { appendTo } = this.props;
      const target = this.getElement(appendTo);
      if (this.state.container) {
        target.removeChild(this.state.container);
      }
      target.removeEventListener("keydown", this.handleEscKeyClick, false);
      target.classList.remove(css(import_backdrop2.default.backdropOpen));
    }
    render() {
      const _a = this.props, {
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        appendTo,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onEscapePress,
        "aria-labelledby": ariaLabelledby,
        "aria-label": ariaLabel,
        "aria-describedby": ariaDescribedby,
        bodyAriaLabel,
        bodyAriaRole,
        title,
        titleIconVariant,
        titleLabel,
        ouiaId,
        ouiaSafe
      } = _a, props = __rest(_a, ["appendTo", "onEscapePress", "aria-labelledby", "aria-label", "aria-describedby", "bodyAriaLabel", "bodyAriaRole", "title", "titleIconVariant", "titleLabel", "ouiaId", "ouiaSafe"]);
      const { container } = this.state;
      if (!canUseDOM || !container) {
        return null;
      }
      return ReactDOM6.createPortal(React133.createElement(ModalContent, Object.assign({}, props, { boxId: this.boxId, labelId: this.labelId, descriptorId: this.descriptorId, title, titleIconVariant, titleLabel, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-labelledby": ariaLabelledby, bodyAriaLabel, bodyAriaRole, ouiaId: ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe })), container);
    }
  };
  Modal.displayName = "Modal";
  Modal.currentId = 0;
  Modal.defaultProps = {
    className: "",
    isOpen: false,
    title: "",
    titleIconVariant: null,
    titleLabel: "",
    "aria-label": "",
    showClose: true,
    "aria-describedby": "",
    "aria-labelledby": "",
    id: void 0,
    actions: [],
    onClose: () => void 0,
    variant: "default",
    hasNoBodyWrapper: false,
    appendTo: () => document.body,
    ouiaSafe: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/Progress.js
  init_tslib_es6();
  var React137 = __toESM(require_react());
  var import_progress4 = __toESM(require_progress());

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressContainer.js
  var React136 = __toESM(require_react());
  var import_progress3 = __toESM(require_progress());

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressBar.js
  init_tslib_es6();
  var React134 = __toESM(require_react());
  var import_progress = __toESM(require_progress());
  var ProgressBar = (_a) => {
    var { progressBarAriaProps, className = "", children = null, value } = _a, props = __rest(_a, ["progressBarAriaProps", "className", "children", "value"]);
    return React134.createElement(
      "div",
      Object.assign({}, props, { className: css(import_progress.default.progressBar, className) }, progressBarAriaProps),
      React134.createElement(
        "div",
        { className: css(import_progress.default.progressIndicator), style: { width: `${value}%` } },
        React134.createElement("span", { className: css(import_progress.default.progressMeasure) }, children)
      )
    );
  };
  ProgressBar.displayName = "ProgressBar";

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressHelperText.js
  init_tslib_es6();
  var React135 = __toESM(require_react());
  var import_progress2 = __toESM(require_progress());
  var ProgressHelperText = (_a) => {
    var { children } = _a, props = __rest(_a, ["children"]);
    return React135.createElement("div", Object.assign({ className: import_progress2.default.progressHelperText }, props), children);
  };
  ProgressHelperText.displayName = "ProgressHelperText";

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressContainer.js
  var ProgressMeasureLocation;
  (function(ProgressMeasureLocation2) {
    ProgressMeasureLocation2["outside"] = "outside";
    ProgressMeasureLocation2["inside"] = "inside";
    ProgressMeasureLocation2["top"] = "top";
    ProgressMeasureLocation2["none"] = "none";
  })(ProgressMeasureLocation || (ProgressMeasureLocation = {}));
  var ProgressVariant;
  (function(ProgressVariant2) {
    ProgressVariant2["danger"] = "danger";
    ProgressVariant2["success"] = "success";
    ProgressVariant2["warning"] = "warning";
  })(ProgressVariant || (ProgressVariant = {}));
  var variantToIcon = {
    danger: times_circle_icon_default,
    success: check_circle_icon_default,
    warning: exclamation_triangle_icon_default
  };
  var ProgressContainer = ({ progressBarAriaProps, value, title = "", parentId: parentId2, label = null, variant = null, measureLocation = ProgressMeasureLocation.top, isTitleTruncated = false, tooltipPosition, helperText }) => {
    const StatusIcon = variantToIcon.hasOwnProperty(variant) && variantToIcon[variant];
    const [tooltip, setTooltip] = React136.useState("");
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        setTooltip(title || event.target.innerHTML);
      } else {
        setTooltip("");
      }
    };
    const Title2 = React136.createElement("div", { className: css(import_progress3.default.progressDescription, isTitleTruncated && typeof title === "string" && import_progress3.default.modifiers.truncate), id: `${parentId2}-description`, "aria-hidden": "true", onMouseEnter: isTitleTruncated && typeof title === "string" ? onMouseEnter : null }, title);
    return React136.createElement(
      React136.Fragment,
      null,
      tooltip ? React136.createElement(Tooltip, { position: tooltipPosition, content: tooltip, isVisible: true }, Title2) : Title2,
      React136.createElement(
        "div",
        { className: css(import_progress3.default.progressStatus), "aria-hidden": "true" },
        (measureLocation === ProgressMeasureLocation.top || measureLocation === ProgressMeasureLocation.outside) && React136.createElement("span", { className: css(import_progress3.default.progressMeasure) }, label || `${value}%`),
        variantToIcon.hasOwnProperty(variant) && React136.createElement(
          "span",
          { className: css(import_progress3.default.progressStatusIcon) },
          React136.createElement(StatusIcon, null)
        )
      ),
      React136.createElement(ProgressBar, { role: "progressbar", progressBarAriaProps, value }, measureLocation === ProgressMeasureLocation.inside && `${value}%`),
      helperText && React136.createElement(ProgressHelperText, null, helperText)
    );
  };
  ProgressContainer.displayName = "ProgressContainer";

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/Progress.js
  var ProgressSize;
  (function(ProgressSize2) {
    ProgressSize2["sm"] = "sm";
    ProgressSize2["md"] = "md";
    ProgressSize2["lg"] = "lg";
  })(ProgressSize || (ProgressSize = {}));
  var Progress = class extends React137.Component {
    constructor() {
      super(...arguments);
      this.id = this.props.id || getUniqueId();
    }
    render() {
      const _a = this.props, {
        /* eslint-disable @typescript-eslint/no-unused-vars */
        id,
        size,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        className,
        value,
        title,
        label,
        variant,
        measureLocation,
        min: min3,
        max: max3,
        valueText,
        isTitleTruncated,
        tooltipPosition,
        "aria-label": ariaLabel,
        "aria-labelledby": ariaLabelledBy,
        helperText
      } = _a, props = __rest(_a, ["id", "size", "className", "value", "title", "label", "variant", "measureLocation", "min", "max", "valueText", "isTitleTruncated", "tooltipPosition", "aria-label", "aria-labelledby", "helperText"]);
      const progressBarAriaProps = {
        "aria-valuemin": min3,
        "aria-valuenow": value,
        "aria-valuemax": max3
      };
      if (title || ariaLabelledBy) {
        progressBarAriaProps["aria-labelledby"] = title ? `${this.id}-description` : ariaLabelledBy;
      }
      if (ariaLabel) {
        progressBarAriaProps["aria-label"] = ariaLabel;
      }
      if (valueText) {
        progressBarAriaProps["aria-valuetext"] = valueText;
      }
      if (!title && !ariaLabelledBy && !ariaLabel) {
        console.warn("One of aria-label or aria-labelledby properties should be passed when using the progress component without a title.");
      }
      const scaledValue = Math.min(100, Math.max(0, Math.floor((value - min3) / (max3 - min3) * 100))) || 0;
      return React137.createElement(
        "div",
        Object.assign({}, props, { className: css(import_progress4.default.progress, import_progress4.default.modifiers[variant], ["inside", "outside"].includes(measureLocation) && import_progress4.default.modifiers[measureLocation], measureLocation === "inside" ? import_progress4.default.modifiers[ProgressSize.lg] : import_progress4.default.modifiers[size], !title && import_progress4.default.modifiers.singleline, className), id: this.id }),
        React137.createElement(ProgressContainer, { parentId: this.id, value: scaledValue, title, label, variant, measureLocation, progressBarAriaProps, isTitleTruncated, tooltipPosition, helperText })
      );
    }
  };
  Progress.displayName = "Progress";
  Progress.defaultProps = {
    className: "",
    measureLocation: ProgressMeasureLocation.top,
    variant: null,
    id: "",
    title: "",
    min: 0,
    max: 100,
    size: null,
    label: null,
    value: 0,
    valueText: null,
    isTitleTruncated: false,
    tooltipPosition: "top",
    "aria-label": null,
    "aria-labelledby": null
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/Nav.js
  init_tslib_es6();
  var React138 = __toESM(require_react());
  var import_nav = __toESM(require_nav());
  var navContextDefaults = {};
  var NavContext = React138.createContext(navContextDefaults);
  var Nav = class extends React138.Component {
    constructor() {
      super(...arguments);
      this.state = {
        isScrollable: false,
        ouiaStateId: getDefaultOUIAId(Nav.displayName, this.props.variant),
        flyoutRef: null
      };
    }
    // Callback from NavItem
    onSelect(event, groupId, itemId, to, preventDefault, onClick) {
      if (preventDefault) {
        event.preventDefault();
      }
      this.props.onSelect({ groupId, itemId, event, to });
      if (onClick) {
        onClick(event, itemId, groupId, to);
      }
    }
    // Callback from NavExpandable
    onToggle(event, groupId, toggleValue) {
      this.props.onToggle({
        event,
        groupId,
        isExpanded: toggleValue
      });
    }
    render() {
      const _a = this.props, {
        "aria-label": ariaLabel,
        children,
        className,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onSelect,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onToggle,
        theme,
        ouiaId,
        ouiaSafe,
        variant
      } = _a, props = __rest(_a, ["aria-label", "children", "className", "onSelect", "onToggle", "theme", "ouiaId", "ouiaSafe", "variant"]);
      const isHorizontal2 = ["horizontal", "tertiary"].includes(variant);
      return React138.createElement(
        NavContext.Provider,
        { value: {
          onSelect: (event, groupId, itemId, to, preventDefault, onClick) => this.onSelect(event, groupId, itemId, to, preventDefault, onClick),
          onToggle: (event, groupId, expanded) => this.onToggle(event, groupId, expanded),
          updateIsScrollable: (isScrollable) => this.setState({ isScrollable }),
          isHorizontal: ["horizontal", "tertiary", "horizontal-subnav"].includes(variant),
          flyoutRef: this.state.flyoutRef,
          setFlyoutRef: (flyoutRef) => this.setState({ flyoutRef })
        } },
        React138.createElement("nav", Object.assign({ className: css(import_nav.default.nav, theme === "light" && import_nav.default.modifiers.light, isHorizontal2 && import_nav.default.modifiers.horizontal, variant === "tertiary" && import_nav.default.modifiers.tertiary, variant === "horizontal-subnav" && import_nav.default.modifiers.horizontalSubnav, this.state.isScrollable && import_nav.default.modifiers.scrollable, className), "aria-label": ariaLabel || (variant === "tertiary" ? "Local" : "Global") }, getOUIAProps(Nav.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), props), children)
      );
    }
  };
  Nav.displayName = "Nav";
  Nav.defaultProps = {
    onSelect: () => void 0,
    onToggle: () => void 0,
    theme: "dark",
    ouiaSafe: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/NavList.js
  init_tslib_es6();
  var React140 = __toESM(require_react());
  var import_nav2 = __toESM(require_nav());

  // node_modules/@patternfly/react-core/dist/esm/components/Page/PageSidebar.js
  init_tslib_es6();
  var React139 = __toESM(require_react());
  var import_page = __toESM(require_page());
  var pageSidebarContextDefaults = {
    isNavOpen: true
  };
  var PageSidebarContext = React139.createContext(pageSidebarContextDefaults);
  var PageSidebar = (_a) => {
    var { className = "", nav, isNavOpen = true, theme = "dark", id = "page-sidebar" } = _a, props = __rest(_a, ["className", "nav", "isNavOpen", "theme", "id"]);
    return React139.createElement(PageContextConsumer, null, ({ isManagedSidebar, isNavOpen: managedIsNavOpen }) => {
      const navOpen = isManagedSidebar ? managedIsNavOpen : isNavOpen;
      return React139.createElement(
        "div",
        Object.assign({ id, className: css(import_page.default.pageSidebar, theme === "light" && import_page.default.modifiers.light, navOpen && import_page.default.modifiers.expanded, !navOpen && import_page.default.modifiers.collapsed, className), "aria-hidden": !navOpen }, props),
        React139.createElement(
          "div",
          { className: css(import_page.default.pageSidebarBody) },
          React139.createElement(PageSidebarContext.Provider, { value: { isNavOpen: navOpen } }, nav)
        )
      );
    });
  };
  PageSidebar.displayName = "PageSidebar";

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/NavList.js
  var NavList = class extends React140.Component {
    constructor() {
      super(...arguments);
      this.state = {
        scrollViewAtStart: false,
        scrollViewAtEnd: false
      };
      this.navList = React140.createRef();
      this.observer = () => {
      };
      this.handleScrollButtons = () => {
        const container = this.navList.current;
        if (container) {
          const scrollViewAtStart = isElementInView(container, container.firstChild, false);
          const scrollViewAtEnd = isElementInView(container, container.lastChild, false);
          this.setState({
            scrollViewAtStart,
            scrollViewAtEnd
          });
          this.context.updateIsScrollable(!scrollViewAtStart || !scrollViewAtEnd);
        }
      };
      this.scrollLeft = () => {
        const container = this.navList.current;
        if (container) {
          const childrenArr = Array.from(container.children);
          let firstElementInView;
          let lastElementOutOfView;
          for (let i = 0; i < childrenArr.length && !firstElementInView; i++) {
            if (isElementInView(container, childrenArr[i], false)) {
              firstElementInView = childrenArr[i];
              lastElementOutOfView = childrenArr[i - 1];
            }
          }
          if (lastElementOutOfView) {
            container.scrollLeft -= lastElementOutOfView.scrollWidth;
          }
          this.handleScrollButtons();
        }
      };
      this.scrollRight = () => {
        const container = this.navList.current;
        if (container) {
          const childrenArr = Array.from(container.children);
          let lastElementInView;
          let firstElementOutOfView;
          for (let i = childrenArr.length - 1; i >= 0 && !lastElementInView; i--) {
            if (isElementInView(container, childrenArr[i], false)) {
              lastElementInView = childrenArr[i];
              firstElementOutOfView = childrenArr[i + 1];
            }
          }
          if (firstElementOutOfView) {
            container.scrollLeft += firstElementOutOfView.scrollWidth;
          }
          this.handleScrollButtons();
        }
      };
    }
    componentDidMount() {
      this.observer = getResizeObserver(this.navList.current, this.handleScrollButtons);
      this.handleScrollButtons();
    }
    componentWillUnmount() {
      this.observer();
    }
    render() {
      const _a = this.props, { children, className, ariaLeftScroll, ariaRightScroll } = _a, props = __rest(_a, ["children", "className", "ariaLeftScroll", "ariaRightScroll"]);
      const { scrollViewAtStart, scrollViewAtEnd } = this.state;
      return React140.createElement(NavContext.Consumer, null, ({ isHorizontal: isHorizontal2 }) => React140.createElement(PageSidebarContext.Consumer, null, ({ isNavOpen }) => React140.createElement(
        React140.Fragment,
        null,
        isHorizontal2 && React140.createElement(
          "button",
          { className: css(import_nav2.default.navScrollButton), "aria-label": ariaLeftScroll, onClick: this.scrollLeft, disabled: scrollViewAtStart, tabIndex: isNavOpen ? null : -1 },
          React140.createElement(angle_left_icon_default, null)
        ),
        React140.createElement("ul", Object.assign({ ref: this.navList, className: css(import_nav2.default.navList, className), onScroll: this.handleScrollButtons }, props), children),
        isHorizontal2 && React140.createElement(
          "button",
          { className: css(import_nav2.default.navScrollButton), "aria-label": ariaRightScroll, onClick: this.scrollRight, disabled: scrollViewAtEnd, tabIndex: isNavOpen ? null : -1 },
          React140.createElement(angle_right_icon_default, null)
        )
      )));
    }
  };
  NavList.displayName = "NavList";
  NavList.contextType = NavContext;
  NavList.defaultProps = {
    ariaLeftScroll: "Scroll left",
    ariaRightScroll: "Scroll right"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/NavItem.js
  init_tslib_es6();
  var React141 = __toESM(require_react());
  var import_nav3 = __toESM(require_nav());
  var NavItem = (_a) => {
    var { children, styleChildren = true, className, to, isActive = false, groupId = null, itemId = null, preventDefault = false, onClick = null, component = "a", flyout, onShowFlyout, ouiaId, ouiaSafe, removeFindDomNode = false, zIndex = 9999 } = _a, props = __rest(_a, ["children", "styleChildren", "className", "to", "isActive", "groupId", "itemId", "preventDefault", "onClick", "component", "flyout", "onShowFlyout", "ouiaId", "ouiaSafe", "removeFindDomNode", "zIndex"]);
    const { flyoutRef, setFlyoutRef } = React141.useContext(NavContext);
    const { isNavOpen } = React141.useContext(PageSidebarContext);
    const [flyoutTarget, setFlyoutTarget] = React141.useState(null);
    const [isHovered, setIsHovered] = React141.useState(false);
    const ref = React141.useRef();
    const flyoutVisible = ref === flyoutRef;
    const popperRef = React141.useRef();
    const hasFlyout = flyout !== void 0;
    const Component50 = hasFlyout ? "button" : component;
    if (to && hasFlyout) {
      console.error('NavItem cannot have both "to" and "flyout" props.');
    }
    const showFlyout = (show, override) => {
      if ((!flyoutVisible || override) && show) {
        setFlyoutRef(ref);
      } else if ((flyoutVisible || override) && !show) {
        setFlyoutRef(null);
      }
      onShowFlyout && show && onShowFlyout();
    };
    const onMouseOver = (event) => {
      const evtContainedInFlyout = event.target.closest(".pf-c-nav__item.pf-m-flyout");
      if (hasFlyout && !flyoutVisible) {
        showFlyout(true);
      } else if (flyoutRef !== null && !evtContainedInFlyout) {
        setFlyoutRef(null);
      }
    };
    const onFlyoutClick = (event) => {
      const target = event.target;
      const closestItem = target.closest(".pf-m-flyout");
      if (!closestItem) {
        if (hasFlyout) {
          showFlyout(false, true);
        } else if (flyoutRef !== null) {
          setFlyoutRef(null);
        }
      }
    };
    const handleFlyout = (event) => {
      var _a2, _b;
      const key = event.key;
      const target = event.target;
      if ((key === " " || key === "Enter" || key === "ArrowRight") && hasFlyout && ((_a2 = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a2 === void 0 ? void 0 : _a2.contains(target))) {
        event.stopPropagation();
        event.preventDefault();
        if (!flyoutVisible) {
          showFlyout(true);
          setFlyoutTarget(target);
        }
      }
      if ((key === "Escape" || key === "ArrowLeft") && ((_b = popperRef === null || popperRef === void 0 ? void 0 : popperRef.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(".pf-c-menu").length) === 1) {
        if (flyoutVisible) {
          event.stopPropagation();
          event.preventDefault();
          showFlyout(false);
        }
      }
    };
    React141.useEffect(() => {
      if (hasFlyout) {
        window.addEventListener("click", onFlyoutClick);
      }
      return () => {
        if (hasFlyout) {
          window.removeEventListener("click", onFlyoutClick);
        }
      };
    }, []);
    React141.useEffect(() => {
      if (flyoutTarget) {
        if (flyoutVisible) {
          const flyoutItems = Array.from(popperRef.current.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains("pf-c-divider")));
          flyoutItems[0].firstChild.focus();
        } else {
          flyoutTarget.focus();
        }
      }
    }, [flyoutVisible, flyoutTarget]);
    const flyoutButton = React141.createElement(
      "span",
      { className: css(import_nav3.default.navToggle) },
      React141.createElement(
        "span",
        { className: css(import_nav3.default.navToggleIcon) },
        React141.createElement(angle_right_icon_default, { "aria-hidden": true })
      )
    );
    const ariaFlyoutProps = {
      "aria-haspopup": "menu",
      "aria-expanded": flyoutVisible
    };
    const tabIndex = isNavOpen ? null : -1;
    const renderDefaultLink = (context) => {
      const preventLinkDefault = preventDefault || !to;
      return React141.createElement(
        Component50,
        Object.assign({ href: to, onClick: (e) => context.onSelect(e, groupId, itemId, to, preventLinkDefault, onClick), className: css(import_nav3.default.navLink, isActive && import_nav3.default.modifiers.current, isHovered && import_nav3.default.modifiers.hover, className), "aria-current": isActive ? "page" : null, tabIndex }, hasFlyout && Object.assign({}, ariaFlyoutProps), props),
        children,
        flyout && flyoutButton
      );
    };
    const renderClonedChild = (context, child) => React141.cloneElement(child, Object.assign(Object.assign({ onClick: (e) => context.onSelect(e, groupId, itemId, to, preventDefault, onClick), "aria-current": isActive ? "page" : null }, styleChildren && {
      className: css(import_nav3.default.navLink, isActive && import_nav3.default.modifiers.current, child.props && child.props.className)
    }), { tabIndex: child.props.tabIndex || tabIndex, children: hasFlyout ? React141.createElement(
      React141.Fragment,
      null,
      child.props.children,
      flyoutButton
    ) : child.props.children }));
    const ouiaProps = useOUIAProps(NavItem.displayName, ouiaId, ouiaSafe);
    const handleMouseEnter = () => {
      setIsHovered(true);
    };
    const handleMouseLeave = () => {
      setIsHovered(false);
    };
    const flyoutPopper = React141.createElement(Popper, { reference: ref, popper: React141.createElement("div", { ref: popperRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, flyout), placement: "right-start", isVisible: flyoutVisible, onDocumentKeyDown: handleFlyout, removeFindDomNode, zIndex });
    const navItem = React141.createElement(
      React141.Fragment,
      null,
      React141.createElement(
        "li",
        Object.assign({ onMouseOver, className: css(import_nav3.default.navItem, hasFlyout && import_nav3.default.modifiers.flyout, className), ref }, ouiaProps),
        React141.createElement(NavContext.Consumer, null, (context) => React141.isValidElement(children) ? renderClonedChild(context, children) : renderDefaultLink(context))
      ),
      flyout && flyoutPopper
    );
    return navItem;
  };
  NavItem.displayName = "NavItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/TextContent.js
  init_tslib_es6();
  var React142 = __toESM(require_react());
  var import_content = __toESM(require_content());
  var TextContent = (_a) => {
    var { children, className = "", isVisited = false } = _a, props = __rest(_a, ["children", "className", "isVisited"]);
    return React142.createElement("div", Object.assign({}, props, { className: css(import_content.default.content, isVisited && import_content.default.modifiers.visited, className) }), children);
  };
  TextContent.displayName = "TextContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/Text.js
  init_tslib_es6();
  var React143 = __toESM(require_react());
  var import_content2 = __toESM(require_content());
  var TextVariants;
  (function(TextVariants2) {
    TextVariants2["h1"] = "h1";
    TextVariants2["h2"] = "h2";
    TextVariants2["h3"] = "h3";
    TextVariants2["h4"] = "h4";
    TextVariants2["h5"] = "h5";
    TextVariants2["h6"] = "h6";
    TextVariants2["p"] = "p";
    TextVariants2["a"] = "a";
    TextVariants2["small"] = "small";
    TextVariants2["blockquote"] = "blockquote";
    TextVariants2["pre"] = "pre";
  })(TextVariants || (TextVariants = {}));
  var Text = (_a) => {
    var { children = null, className = "", component = TextVariants.p, isVisitedLink = false, ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["children", "className", "component", "isVisitedLink", "ouiaId", "ouiaSafe"]);
    const Component50 = component;
    const ouiaProps = useOUIAProps(Text.displayName, ouiaId, ouiaSafe);
    return React143.createElement(Component50, Object.assign({}, ouiaProps, props, { "data-pf-content": true, className: css(isVisitedLink && component === TextVariants.a && import_content2.default.modifiers.visited, className) }), children);
  };
  Text.displayName = "Text";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/TextList.js
  init_tslib_es6();
  var React144 = __toESM(require_react());
  var import_content3 = __toESM(require_content());
  var TextListVariants;
  (function(TextListVariants2) {
    TextListVariants2["ul"] = "ul";
    TextListVariants2["ol"] = "ol";
    TextListVariants2["dl"] = "dl";
  })(TextListVariants || (TextListVariants = {}));
  var TextList = (_a) => {
    var { children = null, className = "", component = TextListVariants.ul, isPlain = false } = _a, props = __rest(_a, ["children", "className", "component", "isPlain"]);
    const Component50 = component;
    return React144.createElement(Component50, Object.assign({}, props, { className: css(isPlain && import_content3.default.modifiers.plain, className) }), children);
  };
  TextList.displayName = "TextList";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/TextListItem.js
  init_tslib_es6();
  var React145 = __toESM(require_react());
  var TextListItemVariants;
  (function(TextListItemVariants2) {
    TextListItemVariants2["li"] = "li";
    TextListItemVariants2["dt"] = "dt";
    TextListItemVariants2["dd"] = "dd";
  })(TextListItemVariants || (TextListItemVariants = {}));
  var TextListItem = (_a) => {
    var { children = null, className = "", component = TextListItemVariants.li } = _a, props = __rest(_a, ["children", "className", "component"]);
    const Component50 = component;
    return React145.createElement(Component50, Object.assign({}, props, { className: css(className) }), children);
  };
  TextListItem.displayName = "TextListItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Page/PageSection.js
  init_tslib_es6();
  var React146 = __toESM(require_react());
  var import_page2 = __toESM(require_page());
  var PageSectionVariants;
  (function(PageSectionVariants2) {
    PageSectionVariants2["default"] = "default";
    PageSectionVariants2["light"] = "light";
    PageSectionVariants2["dark"] = "dark";
    PageSectionVariants2["darker"] = "darker";
  })(PageSectionVariants || (PageSectionVariants = {}));
  var PageSectionTypes;
  (function(PageSectionTypes2) {
    PageSectionTypes2["default"] = "default";
    PageSectionTypes2["nav"] = "nav";
    PageSectionTypes2["subNav"] = "subnav";
    PageSectionTypes2["breadcrumb"] = "breadcrumb";
    PageSectionTypes2["tabs"] = "tabs";
    PageSectionTypes2["wizard"] = "wizard";
  })(PageSectionTypes || (PageSectionTypes = {}));
  var variantType = {
    [PageSectionTypes.default]: import_page2.default.pageMainSection,
    [PageSectionTypes.nav]: import_page2.default.pageMainNav,
    [PageSectionTypes.subNav]: import_page2.default.pageMainSubnav,
    [PageSectionTypes.breadcrumb]: import_page2.default.pageMainBreadcrumb,
    [PageSectionTypes.tabs]: import_page2.default.pageMainTabs,
    [PageSectionTypes.wizard]: import_page2.default.pageMainWizard
  };
  var variantStyle2 = {
    [PageSectionVariants.default]: "",
    [PageSectionVariants.light]: import_page2.default.modifiers.light,
    [PageSectionVariants.dark]: import_page2.default.modifiers.dark_200,
    [PageSectionVariants.darker]: import_page2.default.modifiers.dark_100
  };
  var PageSection = (_a) => {
    var { className = "", children, variant = "default", type = "default", padding: padding2, isFilled, isWidthLimited = false, isCenterAligned = false, sticky, stickyOnBreakpoint, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, "aria-label": ariaLabel, component = "section" } = _a, props = __rest(_a, ["className", "children", "variant", "type", "padding", "isFilled", "isWidthLimited", "isCenterAligned", "sticky", "stickyOnBreakpoint", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", "aria-label", "component"]);
    const { height, getVerticalBreakpoint: getVerticalBreakpoint2 } = React146.useContext(PageContext);
    React146.useEffect(() => {
      if (hasOverflowScroll && !ariaLabel) {
        console.warn("PageSection: An accessible aria-label is required when hasOverflowScroll is set to true.");
      }
    }, [hasOverflowScroll, ariaLabel]);
    const Component50 = component;
    return React146.createElement(
      Component50,
      Object.assign({}, props, { className: css(variantType[type], formatBreakpointMods(padding2, import_page2.default), formatBreakpointMods(stickyOnBreakpoint, import_page2.default, "sticky-", getVerticalBreakpoint2(height), true), variantStyle2[variant], isFilled === false && import_page2.default.modifiers.noFill, isFilled === true && import_page2.default.modifiers.fill, isWidthLimited && import_page2.default.modifiers.limitWidth, isWidthLimited && isCenterAligned && type !== PageSectionTypes.subNav && import_page2.default.modifiers.alignCenter, sticky === "top" && import_page2.default.modifiers.stickyTop, sticky === "bottom" && import_page2.default.modifiers.stickyBottom, hasShadowTop && import_page2.default.modifiers.shadowTop, hasShadowBottom && import_page2.default.modifiers.shadowBottom, hasOverflowScroll && import_page2.default.modifiers.overflowScroll, className) }, hasOverflowScroll && { tabIndex: 0 }, { "aria-label": ariaLabel }),
      isWidthLimited && React146.createElement("div", { className: css(import_page2.default.pageMainBody) }, children),
      !isWidthLimited && children
    );
  };
  PageSection.displayName = "PageSection";

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/Pagination.js
  init_tslib_es6();
  var React151 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/ToggleTemplate.js
  var React147 = __toESM(require_react());
  var ToggleTemplate = ({ firstIndex = 0, lastIndex = 0, itemCount = 0, itemsTitle = "items", ofWord = "of" }) => React147.createElement(
    React147.Fragment,
    null,
    React147.createElement(
      "b",
      null,
      firstIndex,
      " - ",
      lastIndex
    ),
    " ",
    ofWord,
    " ",
    React147.createElement("b", null, itemCount),
    " ",
    itemsTitle
  );
  ToggleTemplate.displayName = "ToggleTemplate";

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/Pagination.js
  var import_pagination2 = __toESM(require_pagination());

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/Navigation.js
  init_tslib_es6();
  var React148 = __toESM(require_react());
  var import_pagination = __toESM(require_pagination());
  var Navigation = class extends React148.Component {
    constructor(props) {
      super(props);
      this.handleNewPage = (_evt, newPage) => {
        const { perPage, onSetPage } = this.props;
        const startIdx = (newPage - 1) * perPage;
        const endIdx = newPage * perPage;
        return onSetPage(_evt, newPage, perPage, startIdx, endIdx);
      };
      this.state = { userInputPage: this.props.page };
    }
    static parseInteger(input, lastPage) {
      let inputPage = Number.parseInt(input, 10);
      if (!Number.isNaN(inputPage)) {
        inputPage = inputPage > lastPage ? lastPage : inputPage;
        inputPage = inputPage < 1 ? 1 : inputPage;
      }
      return inputPage;
    }
    onChange(event, lastPage) {
      const inputPage = Navigation.parseInteger(event.target.value, lastPage);
      this.setState({ userInputPage: Number.isNaN(inputPage) ? event.target.value : inputPage });
    }
    onKeyDown(event, page, lastPage, onPageInput) {
      if (event.key === KeyTypes.Enter) {
        const inputPage = Navigation.parseInteger(this.state.userInputPage, lastPage);
        onPageInput(event, Number.isNaN(inputPage) ? page : inputPage);
        this.handleNewPage(event, Number.isNaN(inputPage) ? page : inputPage);
      }
    }
    componentDidUpdate(lastState) {
      if (this.props.page !== lastState.page && this.props.page <= this.props.lastPage && this.state.userInputPage !== this.props.page) {
        this.setState({ userInputPage: this.props.page });
      }
    }
    render() {
      const _a = this.props, {
        page,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        perPage,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onSetPage,
        isDisabled,
        itemCount,
        lastPage,
        firstPage,
        pagesTitle,
        pagesTitlePlural,
        toLastPage,
        toNextPage,
        toFirstPage,
        toPreviousPage,
        currPage,
        paginationTitle,
        ofWord,
        onNextClick,
        onPreviousClick,
        onFirstClick,
        onLastClick,
        onPageInput,
        className,
        isCompact
      } = _a, props = __rest(_a, ["page", "perPage", "onSetPage", "isDisabled", "itemCount", "lastPage", "firstPage", "pagesTitle", "pagesTitlePlural", "toLastPage", "toNextPage", "toFirstPage", "toPreviousPage", "currPage", "paginationTitle", "ofWord", "onNextClick", "onPreviousClick", "onFirstClick", "onLastClick", "onPageInput", "className", "isCompact"]);
      const { userInputPage } = this.state;
      return React148.createElement(
        "nav",
        Object.assign({ className: css(import_pagination.default.paginationNav, className), "aria-label": paginationTitle }, props),
        !isCompact && React148.createElement(
          "div",
          { className: css(import_pagination.default.paginationNavControl, import_pagination.default.modifiers.first) },
          React148.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === firstPage || page === 0, "aria-label": toFirstPage, "data-action": "first", onClick: (event) => {
              onFirstClick(event, 1);
              this.handleNewPage(event, 1);
              this.setState({ userInputPage: 1 });
            } },
            React148.createElement(angle_double_left_icon_default, null)
          )
        ),
        React148.createElement(
          "div",
          { className: import_pagination.default.paginationNavControl },
          React148.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === firstPage || page === 0, "data-action": "previous", onClick: (event) => {
              const newPage = page - 1 >= 1 ? page - 1 : 1;
              onPreviousClick(event, newPage);
              this.handleNewPage(event, newPage);
              this.setState({ userInputPage: newPage });
            }, "aria-label": toPreviousPage },
            React148.createElement(angle_left_icon_default, null)
          )
        ),
        !isCompact && React148.createElement(
          "div",
          { className: import_pagination.default.paginationNavPageSelect },
          React148.createElement("input", { className: css(import_pagination.default.formControl), "aria-label": currPage, type: "number", disabled: isDisabled || itemCount && page === firstPage && page === lastPage && itemCount >= 0 || page === 0, min: lastPage <= 0 && firstPage <= 0 ? 0 : 1, max: lastPage, value: userInputPage, onKeyDown: (event) => this.onKeyDown(event, page, lastPage, onPageInput), onChange: (event) => this.onChange(event, lastPage) }),
          (itemCount || itemCount === 0) && React148.createElement(
            "span",
            { "aria-hidden": "true" },
            ofWord,
            " ",
            pagesTitle ? pluralize(lastPage, pagesTitle, pagesTitlePlural) : lastPage
          )
        ),
        React148.createElement(
          "div",
          { className: import_pagination.default.paginationNavControl },
          React148.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === lastPage, "aria-label": toNextPage, "data-action": "next", onClick: (event) => {
              const newPage = page + 1 <= lastPage ? page + 1 : lastPage;
              onNextClick(event, newPage);
              this.handleNewPage(event, newPage);
              this.setState({ userInputPage: newPage });
            } },
            React148.createElement(angle_right_icon_default, null)
          )
        ),
        !isCompact && React148.createElement(
          "div",
          { className: css(import_pagination.default.paginationNavControl, import_pagination.default.modifiers.last) },
          React148.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === lastPage, "aria-label": toLastPage, "data-action": "last", onClick: (event) => {
              onLastClick(event, lastPage);
              this.handleNewPage(event, lastPage);
              this.setState({ userInputPage: lastPage });
            } },
            React148.createElement(angle_double_right_icon_default, null)
          )
        )
      );
    }
  };
  Navigation.displayName = "Navigation";
  Navigation.defaultProps = {
    className: "",
    isDisabled: false,
    isCompact: false,
    lastPage: 0,
    firstPage: 0,
    pagesTitle: "",
    pagesTitlePlural: "",
    toLastPage: "Go to last page",
    toNextPage: "Go to next page",
    toFirstPage: "Go to first page",
    toPreviousPage: "Go to previous page",
    currPage: "Current page",
    paginationTitle: "Pagination",
    ofWord: "of",
    onNextClick: () => void 0,
    onPreviousClick: () => void 0,
    onFirstClick: () => void 0,
    onLastClick: () => void 0,
    onPageInput: () => void 0
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/PaginationOptionsMenu.js
  var React150 = __toESM(require_react());
  var import_options_menu2 = __toESM(require_options_menu());

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/OptionsToggle.js
  var React149 = __toESM(require_react());
  var import_options_menu = __toESM(require_options_menu());
  var OptionsToggle = ({
    itemsTitle = "items",
    optionsToggle,
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    itemsPerPageTitle = "Items per page",
    ofWord = "of",
    firstIndex = 0,
    lastIndex = 0,
    itemCount,
    widgetId = "",
    showToggle = true,
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onToggle = (_isOpen) => void 0,
    isOpen = false,
    isDisabled = false,
    parentRef = null,
    toggleTemplate: ToggleTemplate2,
    onEnter = null,
    perPageComponent = "div"
  }) => {
    const isDiv = perPageComponent === "div";
    const toggleClasses = css(import_options_menu.default.optionsMenuToggle, isDisabled && import_options_menu.default.modifiers.disabled, import_options_menu.default.modifiers.plain, import_options_menu.default.modifiers.text);
    const template = typeof ToggleTemplate2 === "string" ? fillTemplate(ToggleTemplate2, { firstIndex, lastIndex, ofWord, itemCount, itemsTitle }) : React149.createElement(ToggleTemplate2, { firstIndex, lastIndex, ofWord, itemCount, itemsTitle });
    const dropdown = showToggle && React149.createElement(
      React149.Fragment,
      null,
      isDiv && React149.createElement("span", { className: css(import_options_menu.default.optionsMenuToggleText) }, template),
      React149.createElement(DropdownToggle, Object.assign({ onEnter, "aria-label": isDiv ? optionsToggle || "Items per page" : optionsToggle, onToggle, isDisabled: isDisabled || itemCount && itemCount <= 0, isOpen }, widgetId && { id: `${widgetId}-toggle` }, { className: isDiv ? import_options_menu.default.optionsMenuToggleButton : toggleClasses, parentRef, "aria-haspopup": "listbox" }), !isDiv && template)
    );
    return isDiv ? React149.createElement("div", { className: toggleClasses }, dropdown) : dropdown;
  };
  OptionsToggle.displayName = "OptionsToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/PaginationOptionsMenu.js
  var PaginationOptionsMenu = class extends React150.Component {
    constructor(props) {
      super(props);
      this.parentRef = React150.createRef();
      this.onToggle = (isOpen) => {
        this.setState({ isOpen });
      };
      this.onSelect = () => {
        this.setState((prevState) => ({ isOpen: !prevState.isOpen }));
      };
      this.handleNewPerPage = (_evt, newPerPage) => {
        const { page, onPerPageSelect, itemCount, defaultToFullPage } = this.props;
        let newPage = page;
        while (Math.ceil(itemCount / newPerPage) < newPage) {
          newPage--;
        }
        if (defaultToFullPage) {
          if (itemCount / newPerPage !== newPage) {
            while (newPage > 1 && itemCount - newPerPage * newPage < 0) {
              newPage--;
            }
          }
        }
        const startIdx = (newPage - 1) * newPerPage;
        const endIdx = newPage * newPerPage;
        return onPerPageSelect(_evt, newPerPage, newPage, startIdx, endIdx);
      };
      this.renderItems = () => {
        const { perPageOptions, perPage, perPageSuffix } = this.props;
        return perPageOptions.map(({ value, title }) => React150.createElement(
          DropdownItem,
          { key: value, component: "button", "data-action": `per-page-${value}`, className: css(perPage === value && "pf-m-selected"), onClick: (event) => this.handleNewPerPage(event, value) },
          title,
          ` ${perPageSuffix}`,
          perPage === value && React150.createElement(
            "div",
            { className: css(import_options_menu2.default.optionsMenuMenuItemIcon) },
            React150.createElement(check_icon_default, null)
          )
        ));
      };
      this.state = {
        isOpen: false
      };
    }
    render() {
      const { widgetId, isDisabled, itemsPerPageTitle, dropDirection, optionsToggle, perPageOptions, toggleTemplate, firstIndex, lastIndex, itemCount, itemsTitle, ofWord, perPageComponent } = this.props;
      const { isOpen } = this.state;
      return React150.createElement(
        DropdownContext.Provider,
        { value: Object.assign(Object.assign({}, widgetId && { id: widgetId }), { onSelect: this.onSelect, toggleIndicatorClass: perPageComponent === "div" ? import_options_menu2.default.optionsMenuToggleButtonIcon : import_options_menu2.default.optionsMenuToggleIcon, toggleTextClass: import_options_menu2.default.optionsMenuToggleText, menuClass: import_options_menu2.default.optionsMenuMenu, itemClass: import_options_menu2.default.optionsMenuMenuItem, toggleClass: " ", baseClass: import_options_menu2.default.optionsMenu, disabledClass: import_options_menu2.default.modifiers.disabled, menuComponent: "ul", baseComponent: "div", ouiaComponentType: PaginationOptionsMenu.displayName }) },
        React150.createElement(DropdownWithContext, { direction: dropDirection, isOpen, toggle: React150.createElement(OptionsToggle, { optionsToggle, itemsPerPageTitle, showToggle: perPageOptions && perPageOptions.length > 0, onToggle: this.onToggle, isOpen, widgetId, firstIndex, lastIndex, itemCount, itemsTitle, ofWord, toggleTemplate, parentRef: this.parentRef.current, isDisabled, perPageComponent }), dropdownItems: this.renderItems(), isPlain: true })
      );
    }
  };
  PaginationOptionsMenu.displayName = "PaginationOptionsMenu";
  PaginationOptionsMenu.defaultProps = {
    className: "",
    widgetId: "",
    isDisabled: false,
    dropDirection: DropdownDirection.down,
    perPageOptions: [],
    itemsPerPageTitle: "Items per page",
    perPageSuffix: "per page",
    optionsToggle: "",
    ofWord: "of",
    perPage: 0,
    firstIndex: 0,
    lastIndex: 0,
    defaultToFullPage: false,
    itemsTitle: "items",
    toggleTemplate: ToggleTemplate,
    onPerPageSelect: () => null,
    perPageComponent: "div"
  };

  // node_modules/@patternfly/react-tokens/dist/esm/c_pagination__nav_page_select_c_form_control_width_chars.js
  var c_pagination__nav_page_select_c_form_control_width_chars = {
    "name": "--pf-c-pagination__nav-page-select--c-form-control--width-chars",
    "value": "2",
    "var": "var(--pf-c-pagination__nav-page-select--c-form-control--width-chars)"
  };
  var c_pagination_nav_page_select_c_form_control_width_chars_default = c_pagination__nav_page_select_c_form_control_width_chars;

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/Pagination.js
  var PaginationVariant;
  (function(PaginationVariant2) {
    PaginationVariant2["bottom"] = "bottom";
    PaginationVariant2["top"] = "top";
  })(PaginationVariant || (PaginationVariant = {}));
  var defaultPerPageOptions = [
    {
      title: "10",
      value: 10
    },
    {
      title: "20",
      value: 20
    },
    {
      title: "50",
      value: 50
    },
    {
      title: "100",
      value: 100
    }
  ];
  var handleInputWidth = (lastPage, node) => {
    if (!node) {
      return;
    }
    const len = String(lastPage).length;
    if (len >= 3) {
      node.style.setProperty(c_pagination_nav_page_select_c_form_control_width_chars_default.name, `${len}`);
    } else {
      node.style.setProperty(c_pagination_nav_page_select_c_form_control_width_chars_default.name, "2");
    }
  };
  var Pagination = class extends React151.Component {
    constructor() {
      super(...arguments);
      this.paginationRef = React151.createRef();
      this.state = {
        ouiaStateId: getDefaultOUIAId(Pagination.displayName, this.props.variant)
      };
    }
    getLastPage() {
      const { itemCount, perPage, page } = this.props;
      return itemCount || itemCount === 0 ? Math.ceil(itemCount / perPage) || 0 : page + 1;
    }
    componentDidMount() {
      const node = this.paginationRef.current;
      handleInputWidth(this.getLastPage(), node);
    }
    componentDidUpdate(prevProps) {
      const node = this.paginationRef.current;
      if (prevProps.perPage !== this.props.perPage || prevProps.itemCount !== this.props.itemCount) {
        handleInputWidth(this.getLastPage(), node);
      }
    }
    render() {
      const _a = this.props, { children, className, variant, isDisabled, isCompact, isStatic, isSticky, perPage, titles, firstPage, page: propPage, offset: offset2, defaultToFullPage, itemCount, itemsStart, itemsEnd, perPageOptions, dropDirection: dropDirectionProp, widgetId, toggleTemplate, onSetPage, onPerPageSelect, onFirstClick, onPreviousClick, onNextClick, onPageInput, onLastClick, ouiaId, ouiaSafe, perPageComponent, usePageInsets, inset } = _a, props = __rest(_a, ["children", "className", "variant", "isDisabled", "isCompact", "isStatic", "isSticky", "perPage", "titles", "firstPage", "page", "offset", "defaultToFullPage", "itemCount", "itemsStart", "itemsEnd", "perPageOptions", "dropDirection", "widgetId", "toggleTemplate", "onSetPage", "onPerPageSelect", "onFirstClick", "onPreviousClick", "onNextClick", "onPageInput", "onLastClick", "ouiaId", "ouiaSafe", "perPageComponent", "usePageInsets", "inset"]);
      const dropDirection = dropDirectionProp || (variant === "bottom" && !isStatic ? "up" : "down");
      let page = propPage;
      if (!page && offset2) {
        page = Math.ceil(offset2 / perPage);
      }
      if (page === 0 && !itemCount) {
        page = 1;
      }
      const lastPage = this.getLastPage();
      let firstIndex = (page - 1) * perPage + 1;
      let lastIndex = page * perPage;
      if (itemCount || itemCount === 0) {
        firstIndex = itemCount <= 0 ? 0 : (page - 1) * perPage + 1;
        if (page < firstPage && itemCount > 0) {
          page = firstPage;
        } else if (page > lastPage) {
          page = lastPage;
        }
        if (itemCount >= 0) {
          lastIndex = page === lastPage || itemCount === 0 ? itemCount : page * perPage;
        }
      }
      const toggleTemplateProps = { firstIndex, lastIndex, itemCount, itemsTitle: titles.items, ofWord: titles.ofWord };
      return React151.createElement(
        "div",
        Object.assign({ ref: this.paginationRef, className: css(import_pagination2.default.pagination, variant === PaginationVariant.bottom && import_pagination2.default.modifiers.bottom, usePageInsets && import_pagination2.default.modifiers.pageInsets, formatBreakpointMods(inset, import_pagination2.default), isCompact && import_pagination2.default.modifiers.compact, isStatic && import_pagination2.default.modifiers.static, isSticky && import_pagination2.default.modifiers.sticky, className) }, widgetId && { id: `${widgetId}-${variant}-pagination` }, getOUIAProps(Pagination.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), props),
        variant === PaginationVariant.top && React151.createElement(
          "div",
          { className: css(import_pagination2.default.paginationTotalItems) },
          toggleTemplate && typeof toggleTemplate === "string" && fillTemplate(toggleTemplate, toggleTemplateProps),
          toggleTemplate && typeof toggleTemplate !== "string" && toggleTemplate(toggleTemplateProps),
          !toggleTemplate && React151.createElement(ToggleTemplate, { firstIndex, lastIndex, itemCount, itemsTitle: titles.items, ofWord: titles.ofWord })
        ),
        React151.createElement(PaginationOptionsMenu, { itemsPerPageTitle: titles.itemsPerPage, perPageSuffix: titles.perPageSuffix, itemsTitle: isCompact ? "" : titles.items, optionsToggle: titles.optionsToggle, perPageOptions, firstIndex: itemsStart !== null ? itemsStart : firstIndex, lastIndex: itemsEnd !== null ? itemsEnd : lastIndex, ofWord: titles.ofWord, defaultToFullPage, itemCount, page, perPage, lastPage, onPerPageSelect, dropDirection, widgetId: `${widgetId}-${variant}`, toggleTemplate, isDisabled, perPageComponent }),
        React151.createElement(Navigation, { pagesTitle: titles.page, pagesTitlePlural: titles.pages, toLastPage: titles.toLastPage, toPreviousPage: titles.toPreviousPage, toNextPage: titles.toNextPage, toFirstPage: titles.toFirstPage, currPage: titles.currPage, paginationTitle: titles.paginationTitle, ofWord: titles.ofWord, page: itemCount && itemCount <= 0 ? 0 : page, perPage, itemCount, firstPage: itemsStart !== null ? itemsStart : 1, lastPage, onSetPage, onFirstClick, onPreviousClick, onNextClick, onLastClick, onPageInput, isDisabled, isCompact }),
        children
      );
    }
  };
  Pagination.displayName = "Pagination";
  Pagination.defaultProps = {
    children: null,
    className: "",
    variant: PaginationVariant.top,
    isDisabled: false,
    isCompact: false,
    isSticky: false,
    perPage: defaultPerPageOptions[0].value,
    titles: {
      items: "",
      page: "",
      pages: "",
      itemsPerPage: "Items per page",
      perPageSuffix: "per page",
      toFirstPage: "Go to first page",
      toPreviousPage: "Go to previous page",
      toLastPage: "Go to last page",
      toNextPage: "Go to next page",
      optionsToggle: "",
      currPage: "Current page",
      paginationTitle: "Pagination",
      ofWord: "of"
    },
    firstPage: 1,
    page: 0,
    offset: 0,
    defaultToFullPage: false,
    itemsStart: null,
    itemsEnd: null,
    perPageOptions: defaultPerPageOptions,
    widgetId: "options-menu",
    onSetPage: () => void 0,
    onPerPageSelect: () => void 0,
    onFirstClick: () => void 0,
    onPreviousClick: () => void 0,
    onNextClick: () => void 0,
    onPageInput: () => void 0,
    onLastClick: () => void 0,
    ouiaSafe: true,
    perPageComponent: "div"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Radio/Radio.js
  init_tslib_es6();
  var React152 = __toESM(require_react());
  var import_radio = __toESM(require_radio());
  var Radio = class extends React152.Component {
    constructor(props) {
      super(props);
      this.handleChange = (event) => {
        this.props.onChange(event.currentTarget.checked, event);
      };
      if (!props.label && !props["aria-label"]) {
        console.error("Radio:", "Radio requires an aria-label to be specified");
      }
      this.state = {
        ouiaStateId: getDefaultOUIAId(Radio.displayName)
      };
    }
    render() {
      const _a = this.props, {
        "aria-label": ariaLabel,
        checked,
        className,
        defaultChecked,
        isLabelWrapped,
        isLabelBeforeButton,
        isChecked,
        isDisabled,
        isValid,
        label,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onChange,
        description,
        body,
        ouiaId,
        ouiaSafe = true
      } = _a, props = __rest(_a, ["aria-label", "checked", "className", "defaultChecked", "isLabelWrapped", "isLabelBeforeButton", "isChecked", "isDisabled", "isValid", "label", "onChange", "description", "body", "ouiaId", "ouiaSafe"]);
      if (!props.id) {
        console.error("Radio:", "id is required to make input accessible");
      }
      const inputRendered = React152.createElement("input", Object.assign({}, props, { className: css(import_radio.default.radioInput), type: "radio", onChange: this.handleChange, "aria-invalid": !isValid, disabled: isDisabled, checked: checked || isChecked }, checked === void 0 && { defaultChecked }, !label && { "aria-label": ariaLabel }, getOUIAProps(Radio.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe)));
      let labelRendered = null;
      if (label && isLabelWrapped) {
        labelRendered = React152.createElement("span", { className: css(import_radio.default.radioLabel, isDisabled && import_radio.default.modifiers.disabled) }, label);
      } else if (label) {
        labelRendered = React152.createElement("label", { className: css(import_radio.default.radioLabel, isDisabled && import_radio.default.modifiers.disabled), htmlFor: props.id }, label);
      }
      const descRender = description ? React152.createElement("span", { className: css(import_radio.default.radioDescription) }, description) : null;
      const bodyRender = body ? React152.createElement("span", { className: css(import_radio.default.radioBody) }, body) : null;
      const childrenRendered = isLabelBeforeButton ? React152.createElement(
        React152.Fragment,
        null,
        labelRendered,
        inputRendered,
        descRender,
        bodyRender
      ) : React152.createElement(
        React152.Fragment,
        null,
        inputRendered,
        labelRendered,
        descRender,
        bodyRender
      );
      return isLabelWrapped ? React152.createElement("label", { className: css(import_radio.default.radio, className), htmlFor: props.id }, childrenRendered) : React152.createElement("div", { className: css(import_radio.default.radio, !label && import_radio.default.modifiers.standalone, className) }, childrenRendered);
    }
  };
  Radio.displayName = "Radio";
  Radio.defaultProps = {
    className: "",
    isDisabled: false,
    isValid: true,
    onChange: () => {
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleList.js
  init_tslib_es6();
  var React154 = __toESM(require_react());
  var import_simple_list2 = __toESM(require_simple_list());

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleListGroup.js
  init_tslib_es6();
  var React153 = __toESM(require_react());
  var import_simple_list = __toESM(require_simple_list());
  var SimpleListGroup = (_a) => {
    var { children = null, className = "", title = "", titleClassName = "", id = "" } = _a, props = __rest(_a, ["children", "className", "title", "titleClassName", "id"]);
    return React153.createElement(
      "section",
      Object.assign({ className: css(import_simple_list.default.simpleListSection) }, props),
      React153.createElement("h2", { id, className: css(import_simple_list.default.simpleListTitle, titleClassName), "aria-hidden": "true" }, title),
      React153.createElement("ul", { className: css(className), "aria-labelledby": id }, children)
    );
  };
  SimpleListGroup.displayName = "SimpleListGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleList.js
  var SimpleListContext = React154.createContext({});
  var SimpleList = class extends React154.Component {
    constructor() {
      super(...arguments);
      this.state = {
        currentRef: null
      };
      this.handleCurrentUpdate = (newCurrentRef, itemProps) => {
        this.setState({ currentRef: newCurrentRef });
        const { onSelect } = this.props;
        onSelect && onSelect(newCurrentRef, itemProps);
      };
    }
    render() {
      const _a = this.props, { children, className, onSelect, isControlled, "aria-label": ariaLabel } = _a, props = __rest(_a, ["children", "className", "onSelect", "isControlled", "aria-label"]);
      let isGrouped = false;
      if (children) {
        isGrouped = React154.Children.toArray(children)[0].type === SimpleListGroup;
      }
      return React154.createElement(
        SimpleListContext.Provider,
        { value: {
          currentRef: this.state.currentRef,
          updateCurrentRef: this.handleCurrentUpdate,
          isControlled
        } },
        React154.createElement(
          "div",
          Object.assign({ className: css(import_simple_list2.default.simpleList, className) }, props),
          isGrouped && children,
          !isGrouped && React154.createElement("ul", { "aria-label": ariaLabel }, children)
        )
      );
    }
  };
  SimpleList.displayName = "SimpleList";
  SimpleList.defaultProps = {
    children: null,
    className: "",
    isControlled: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleListItem.js
  init_tslib_es6();
  var React155 = __toESM(require_react());
  var import_simple_list3 = __toESM(require_simple_list());
  var SimpleListItem = class extends React155.Component {
    constructor() {
      super(...arguments);
      this.ref = React155.createRef();
    }
    render() {
      const _a = this.props, {
        children,
        isCurrent,
        isActive,
        className,
        component: Component50,
        componentClassName,
        componentProps,
        onClick,
        type,
        href,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        itemId
      } = _a, props = __rest(_a, ["children", "isCurrent", "isActive", "className", "component", "componentClassName", "componentProps", "onClick", "type", "href", "itemId"]);
      return React155.createElement(SimpleListContext.Consumer, null, ({ currentRef, updateCurrentRef, isControlled }) => {
        const isButton = Component50 === "button";
        const isCurrentItem = this.ref && currentRef && isControlled ? currentRef.current === this.ref.current : isActive || isCurrent;
        const additionalComponentProps = isButton ? {
          type
        } : {
          tabIndex: 0,
          href
        };
        return React155.createElement(
          "li",
          Object.assign({ className: css(className) }, props),
          React155.createElement(Component50, Object.assign({ className: css(import_simple_list3.default.simpleListItemLink, isCurrentItem && import_simple_list3.default.modifiers.current, componentClassName), onClick: (evt) => {
            onClick(evt);
            updateCurrentRef(this.ref, this.props);
          }, ref: this.ref }, componentProps, additionalComponentProps), children)
        );
      });
    }
  };
  SimpleListItem.displayName = "SimpleListItem";
  SimpleListItem.defaultProps = {
    children: null,
    className: "",
    isActive: false,
    isCurrent: false,
    component: "button",
    componentClassName: "",
    type: "button",
    href: "",
    onClick: () => {
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Switch/Switch.js
  init_tslib_es6();
  var React156 = __toESM(require_react());
  var import_switch = __toESM(require_switch());
  var Switch = class extends React156.Component {
    constructor(props) {
      super(props);
      if (!props.label && !props["aria-label"]) {
        console.error("Switch: Switch requires either a label or an aria-label to be specified");
      }
      this.id = props.id || getUniqueId();
      this.state = {
        ouiaStateId: getDefaultOUIAId(Switch.displayName)
      };
    }
    render() {
      const _a = this.props, {
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        id,
        className,
        label,
        labelOff,
        isChecked,
        defaultChecked,
        hasCheckIcon,
        isDisabled,
        onChange,
        isReversed,
        ouiaId,
        ouiaSafe
      } = _a, props = __rest(_a, ["id", "className", "label", "labelOff", "isChecked", "defaultChecked", "hasCheckIcon", "isDisabled", "onChange", "isReversed", "ouiaId", "ouiaSafe"]);
      const isAriaLabelledBy = props["aria-label"] === "";
      return React156.createElement(
        "label",
        Object.assign({ className: css(import_switch.default.switch, isReversed && import_switch.default.modifiers.reverse, className), htmlFor: this.id }, getOUIAProps(Switch.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe)),
        React156.createElement("input", Object.assign({ id: this.id, className: css(import_switch.default.switchInput), type: "checkbox", onChange: (event) => onChange(event.target.checked, event) }, defaultChecked !== void 0 ? { defaultChecked } : { checked: isChecked }, { disabled: isDisabled, "aria-labelledby": !isAriaLabelledBy ? null : `${this.id}-${isChecked !== true ? "off" : "on"}` }, props)),
        label !== void 0 ? React156.createElement(
          React156.Fragment,
          null,
          React156.createElement("span", { className: css(import_switch.default.switchToggle) }, hasCheckIcon && React156.createElement(
            "span",
            { className: css(import_switch.default.switchToggleIcon), "aria-hidden": "true" },
            React156.createElement(check_icon_default, { noVerticalAlign: true })
          )),
          React156.createElement("span", { className: css(import_switch.default.switchLabel, import_switch.default.modifiers.on), id: isAriaLabelledBy ? `${this.id}-on` : null, "aria-hidden": "true" }, label),
          React156.createElement("span", { className: css(import_switch.default.switchLabel, import_switch.default.modifiers.off), id: isAriaLabelledBy ? `${this.id}-off` : null, "aria-hidden": "true" }, labelOff !== void 0 ? labelOff : label)
        ) : React156.createElement(
          "span",
          { className: css(import_switch.default.switchToggle) },
          React156.createElement(
            "div",
            { className: css(import_switch.default.switchToggleIcon), "aria-hidden": "true" },
            React156.createElement(check_icon_default, { noVerticalAlign: true })
          )
        )
      );
    }
  };
  Switch.displayName = "Switch";
  Switch.defaultProps = {
    isChecked: true,
    isDisabled: false,
    isReversed: false,
    "aria-label": "",
    onChange: () => void 0
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tab.js
  init_tslib_es6();
  var React160 = __toESM(require_react());
  var import_tabs2 = __toESM(require_tabs());

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabButton.js
  init_tslib_es6();
  var React157 = __toESM(require_react());
  var TabButton = (_a) => {
    var {
      children,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      tabContentRef,
      ouiaId,
      parentInnerRef,
      ouiaSafe
    } = _a, props = __rest(_a, ["children", "tabContentRef", "ouiaId", "parentInnerRef", "ouiaSafe"]);
    const Component50 = props.href ? "a" : "button";
    return React157.createElement(Component50, Object.assign({}, !props.href && { type: "button" }, { ref: parentInnerRef }, getOUIAProps(TabButton.displayName, ouiaId, ouiaSafe), props), children);
  };
  TabButton.displayName = "TabButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabsContext.js
  var React158 = __toESM(require_react());
  var TabsContext = React158.createContext({
    variant: "default",
    mountOnEnter: false,
    unmountOnExit: false,
    localActiveKey: "",
    uniqueId: "",
    handleTabClick: () => null,
    handleTabClose: void 0
  });
  var TabsContextProvider = TabsContext.Provider;
  var TabsContextConsumer = TabsContext.Consumer;

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabAction.js
  init_tslib_es6();
  var React159 = __toESM(require_react());
  var import_tabs = __toESM(require_tabs());
  var TabActionBase = (_a) => {
    var {
      children,
      className,
      onClick,
      isDisabled,
      "aria-label": ariaLabel = "Tab action",
      innerRef,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ouiaId,
      ouiaSafe
    } = _a, props = __rest(_a, ["children", "className", "onClick", "isDisabled", "aria-label", "innerRef", "ouiaId", "ouiaSafe"]);
    return React159.createElement(
      "span",
      { className: css(import_tabs.default.tabsItemAction, className) },
      React159.createElement(
        Button,
        Object.assign({ ref: innerRef, type: "button", variant: "plain", "aria-label": ariaLabel, onClick, isDisabled }, getOUIAProps(TabAction.displayName, ouiaId, ouiaSafe), props),
        React159.createElement("span", { className: css(import_tabs.default.tabsItemActionIcon) }, children)
      )
    );
  };
  var TabAction = React159.forwardRef((props, ref) => React159.createElement(TabActionBase, Object.assign({}, props, { innerRef: ref })));
  TabAction.displayName = "TabAction";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tab.js
  var TabBase = (_a) => {
    var { title, eventKey, tabContentRef, id: childId, tabContentId, className: childClassName = "", ouiaId: childOuiaId, isDisabled, isAriaDisabled, inoperableEvents = ["onClick", "onKeyPress"], href, innerRef, tooltip, closeButtonAriaLabel, isCloseDisabled = false, actions } = _a, props = __rest(_a, ["title", "eventKey", "tabContentRef", "id", "tabContentId", "className", "ouiaId", "isDisabled", "isAriaDisabled", "inoperableEvents", "href", "innerRef", "tooltip", "closeButtonAriaLabel", "isCloseDisabled", "actions"]);
    const preventedEvents2 = inoperableEvents.reduce((handlers, eventToPrevent) => Object.assign(Object.assign({}, handlers), { [eventToPrevent]: (event) => {
      event.preventDefault();
    } }), {});
    const { mountOnEnter, localActiveKey, unmountOnExit, uniqueId: uniqueId2, handleTabClick, handleTabClose } = React160.useContext(TabsContext);
    let ariaControls = tabContentId ? `${tabContentId}` : `pf-tab-section-${eventKey}-${childId || uniqueId2}`;
    if ((mountOnEnter || unmountOnExit) && eventKey !== localActiveKey) {
      ariaControls = void 0;
    }
    const isButtonElement = Boolean(!href);
    const getDefaultTabIdx = () => {
      if (isDisabled) {
        return isButtonElement ? null : -1;
      } else if (isAriaDisabled) {
        return null;
      }
    };
    const tabButton = React160.createElement(TabButton, Object.assign({ parentInnerRef: innerRef, className: css(import_tabs2.default.tabsLink, isDisabled && href && import_tabs2.default.modifiers.disabled, isAriaDisabled && import_tabs2.default.modifiers.ariaDisabled), disabled: isButtonElement ? isDisabled : null, "aria-disabled": isDisabled || isAriaDisabled, tabIndex: getDefaultTabIdx(), onClick: (event) => handleTabClick(event, eventKey, tabContentRef) }, isAriaDisabled ? preventedEvents2 : null, { id: `pf-tab-${eventKey}-${childId || uniqueId2}`, "aria-controls": ariaControls, tabContentRef, ouiaId: childOuiaId, href, role: "tab", "aria-selected": eventKey === localActiveKey }, props), title);
    return React160.createElement(
      "li",
      { className: css(import_tabs2.default.tabsItem, eventKey === localActiveKey && import_tabs2.default.modifiers.current, (handleTabClose || actions) && import_tabs2.default.modifiers.action, (isDisabled || isAriaDisabled) && import_tabs2.default.modifiers.disabled, childClassName), role: "presentation" },
      tooltip ? React160.createElement(Tooltip, Object.assign({}, tooltip.props), tabButton) : tabButton,
      actions && actions,
      handleTabClose !== void 0 && React160.createElement(
        TabAction,
        { "aria-label": closeButtonAriaLabel || "Close tab", onClick: (event) => handleTabClose(event, eventKey, tabContentRef), isDisabled: isCloseDisabled },
        React160.createElement(times_icon_default, null)
      )
    );
  };
  var Tab = React160.forwardRef((props, ref) => React160.createElement(TabBase, Object.assign({ innerRef: ref }, props)));
  Tab.displayName = "Tab";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tabs.js
  init_tslib_es6();
  var React164 = __toESM(require_react());
  var import_tabs5 = __toESM(require_tabs());
  var import_button4 = __toESM(require_button());

  // node_modules/@patternfly/react-icons/dist/esm/icons/plus-icon.js
  var PlusIconConfig = {
    name: "PlusIcon",
    height: 512,
    width: 448,
    svgPath: "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",
    yOffset: 0,
    xOffset: 0
  };
  var PlusIcon = createIcon(PlusIconConfig);
  var plus_icon_default = PlusIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabContent.js
  init_tslib_es6();
  var React161 = __toESM(require_react());
  var import_tab_content = __toESM(require_tab_content());
  var variantStyle3 = {
    default: "",
    light300: import_tab_content.default.modifiers.light_300
  };
  var TabContentBase = (_a) => {
    var {
      id,
      activeKey,
      "aria-label": ariaLabel,
      child,
      children,
      className,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      eventKey,
      innerRef,
      ouiaId,
      ouiaSafe
    } = _a, props = __rest(_a, ["id", "activeKey", "aria-label", "child", "children", "className", "eventKey", "innerRef", "ouiaId", "ouiaSafe"]);
    if (children || child) {
      let labelledBy;
      if (ariaLabel) {
        labelledBy = null;
      } else {
        labelledBy = children ? `${id}` : `pf-tab-${child.props.eventKey}-${id}`;
      }
      return React161.createElement(TabsContextConsumer, null, ({ variant }) => React161.createElement("section", Object.assign({ ref: innerRef, hidden: children ? null : child.props.eventKey !== activeKey, className: children ? css("pf-c-tab-content", className, variantStyle3[variant]) : css("pf-c-tab-content", child.props.className, variantStyle3[variant]), id: children ? id : `pf-tab-section-${child.props.eventKey}-${id}`, "aria-label": ariaLabel, "aria-labelledby": labelledBy, role: "tabpanel", tabIndex: 0 }, getOUIAProps("TabContent", ouiaId, ouiaSafe), props), children || child.props.children));
    }
    return null;
  };
  var TabContent = React161.forwardRef((props, ref) => React161.createElement(TabContentBase, Object.assign({}, props, { innerRef: ref })));

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/OverflowTab.js
  init_tslib_es6();
  var import_react5 = __toESM(require_react());
  var import_tabs4 = __toESM(require_tabs());

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabTitleText.js
  init_tslib_es6();
  var React162 = __toESM(require_react());
  var import_tabs3 = __toESM(require_tabs());
  var TabTitleText = (_a) => {
    var { children, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React162.createElement("span", Object.assign({ className: css(import_tabs3.default.tabsItemText, className) }, props), children);
  };
  TabTitleText.displayName = "TabTitleText";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/OverflowTab.js
  var OverflowTab = (_a) => {
    var { className, overflowingTabs = [], showTabCount, defaultTitleText = "More", toggleAriaLabel, removeFindDomNode = false, zIndex = 9999 } = _a, props = __rest(_a, ["className", "overflowingTabs", "showTabCount", "defaultTitleText", "toggleAriaLabel", "removeFindDomNode", "zIndex"]);
    const menuRef = import_react5.default.useRef();
    const overflowTabRef = import_react5.default.useRef();
    const overflowLIRef = import_react5.default.useRef();
    const [isExpanded, setIsExpanded] = import_react5.default.useState(false);
    const { localActiveKey, handleTabClick } = import_react5.default.useContext(TabsContext);
    const closeMenu = () => {
      setIsExpanded(false);
      overflowTabRef.current.focus();
    };
    const handleMenuKeys = (ev) => {
      var _a2;
      const menuContainsEventTarget = (_a2 = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(ev.target);
      if (isExpanded && menuContainsEventTarget && ev.key === "Escape") {
        closeMenu();
      }
    };
    const handleClick = (ev) => {
      var _a2, _b;
      const clickIsOutsideMenu = !((_a2 = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(ev.target));
      const clickIsOutsideOverflowTab = !((_b = overflowTabRef === null || overflowTabRef === void 0 ? void 0 : overflowTabRef.current) === null || _b === void 0 ? void 0 : _b.contains(ev.target));
      if (isExpanded && clickIsOutsideMenu && clickIsOutsideOverflowTab) {
        closeMenu();
      }
    };
    import_react5.default.useEffect(() => {
      window.addEventListener("click", handleClick);
      window.addEventListener("keydown", handleMenuKeys);
      return () => {
        window.removeEventListener("click", handleClick);
        window.removeEventListener("keydown", handleMenuKeys);
      };
    }, [isExpanded, menuRef, overflowTabRef]);
    const selectedTab = overflowingTabs.find((tab) => tab.eventKey === localActiveKey);
    const tabTitle = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.title) ? selectedTab.title : defaultTitleText;
    const toggleMenu = () => {
      setIsExpanded((prevIsExpanded) => !prevIsExpanded);
      setTimeout(() => {
        if (menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) {
          const firstElement = menuRef.current.querySelector("li > button,input:not(:disabled)");
          firstElement && firstElement.focus();
        }
      }, 0);
    };
    const overflowTab = import_react5.default.createElement(
      "li",
      Object.assign({ className: css(import_tabs4.default.tabsItem, "pf-m-overflow", selectedTab && import_tabs4.default.modifiers.current, className), role: "presentation", ref: overflowLIRef }, props),
      import_react5.default.createElement(
        "button",
        { type: "button", className: css(import_tabs4.default.tabsLink, isExpanded && import_tabs4.default.modifiers.expanded), onClick: () => toggleMenu(), "aria-label": toggleAriaLabel, "aria-haspopup": "menu", "aria-expanded": isExpanded, role: "tab", ref: overflowTabRef },
        import_react5.default.createElement(
          TabTitleText,
          null,
          tabTitle,
          showTabCount && tabTitle === defaultTitleText && ` (${overflowingTabs.length})`
        ),
        import_react5.default.createElement(
          "span",
          { className: import_tabs4.default.tabsLinkToggleIcon },
          import_react5.default.createElement(angle_right_icon_default, null)
        )
      )
    );
    const tabs = overflowingTabs.map((tab) => import_react5.default.createElement(MenuItem, { key: tab.eventKey, itemId: tab.eventKey, isSelected: localActiveKey === tab.eventKey }, tab.title));
    const onTabSelect = (event, key) => {
      closeMenu();
      const selectedTabRef = overflowingTabs.find((tab) => tab.eventKey === key).tabContentRef;
      handleTabClick(event, key, selectedTabRef);
    };
    const overflowMenu = import_react5.default.createElement(
      Menu,
      { ref: menuRef, onSelect: (ev, itemId) => onTabSelect(ev, itemId) },
      import_react5.default.createElement(
        MenuContent,
        null,
        import_react5.default.createElement(MenuList, null, tabs)
      )
    );
    return import_react5.default.createElement(Popper, { trigger: overflowTab, popper: overflowMenu, isVisible: isExpanded, popperMatchesTriggerWidth: false, appendTo: overflowLIRef.current, removeFindDomNode, zIndex });
  };
  OverflowTab.displayName = "OverflowTab";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tabs.js
  var TabsComponent;
  (function(TabsComponent2) {
    TabsComponent2["div"] = "div";
    TabsComponent2["nav"] = "nav";
  })(TabsComponent || (TabsComponent = {}));
  var variantStyle4 = {
    default: "",
    light300: import_tabs5.default.modifiers.colorSchemeLight_300
  };
  var Tabs = class extends React164.Component {
    constructor(props) {
      super(props);
      this.tabList = React164.createRef();
      this.leftScrollButtonRef = React164.createRef();
      this.scrollTimeout = null;
      this.countOverflowingElements = (container) => {
        const elements = Array.from(container.children);
        return elements.filter((element) => !isElementInView(container, element, false)).length;
      };
      this.handleScrollButtons = () => {
        const { isOverflowHorizontal } = this.props;
        clearTimeout(this.scrollTimeout);
        this.scrollTimeout = setTimeout(() => {
          const container = this.tabList.current;
          let disableLeftScrollButton = true;
          let disableRightScrollButton = true;
          let enableScrollButtons = false;
          let overflowingTabCount = 0;
          if (container && !this.props.isVertical && !isOverflowHorizontal) {
            const overflowOnLeft = !isElementInView(container, container.firstChild, false);
            const overflowOnRight = !isElementInView(container, container.lastChild, false);
            enableScrollButtons = overflowOnLeft || overflowOnRight;
            disableLeftScrollButton = !overflowOnLeft;
            disableRightScrollButton = !overflowOnRight;
          }
          if (isOverflowHorizontal) {
            overflowingTabCount = this.countOverflowingElements(container);
          }
          this.setState({
            enableScrollButtons,
            disableLeftScrollButton,
            disableRightScrollButton,
            overflowingTabCount
          });
        }, 100);
      };
      this.scrollLeft = () => {
        if (this.tabList.current) {
          const container = this.tabList.current;
          const childrenArr = Array.from(container.children);
          let firstElementInView;
          let lastElementOutOfView;
          let i;
          for (i = 0; i < childrenArr.length && !firstElementInView; i++) {
            if (isElementInView(container, childrenArr[i], false)) {
              firstElementInView = childrenArr[i];
              lastElementOutOfView = childrenArr[i - 1];
            }
          }
          if (lastElementOutOfView) {
            container.scrollLeft -= lastElementOutOfView.scrollWidth;
          }
        }
      };
      this.scrollRight = () => {
        if (this.tabList.current) {
          const container = this.tabList.current;
          const childrenArr = Array.from(container.children);
          let lastElementInView;
          let firstElementOutOfView;
          for (let i = childrenArr.length - 1; i >= 0 && !lastElementInView; i--) {
            if (isElementInView(container, childrenArr[i], false)) {
              lastElementInView = childrenArr[i];
              firstElementOutOfView = childrenArr[i + 1];
            }
          }
          if (firstElementOutOfView) {
            container.scrollLeft += firstElementOutOfView.scrollWidth;
          }
        }
      };
      this.hideScrollButtons = () => {
        const { enableScrollButtons, renderScrollButtons, showScrollButtons } = this.state;
        if (!enableScrollButtons && !showScrollButtons && renderScrollButtons) {
          this.setState({ renderScrollButtons: false });
        }
      };
      this.state = {
        enableScrollButtons: false,
        showScrollButtons: false,
        renderScrollButtons: false,
        disableLeftScrollButton: true,
        disableRightScrollButton: true,
        shownKeys: this.props.defaultActiveKey !== void 0 ? [this.props.defaultActiveKey] : [this.props.activeKey],
        uncontrolledActiveKey: this.props.defaultActiveKey,
        uncontrolledIsExpandedLocal: this.props.defaultIsExpanded,
        ouiaStateId: getDefaultOUIAId(Tabs.displayName),
        overflowingTabCount: 0
      };
      if (this.props.isVertical && this.props.expandable !== void 0) {
        if (!this.props.toggleAriaLabel && !this.props.toggleText) {
          console.error("Tabs:", "toggleAriaLabel or the toggleText prop is required to make the toggle button accessible");
        }
      }
    }
    handleTabClick(event, eventKey, tabContentRef) {
      const { shownKeys } = this.state;
      const { onSelect, defaultActiveKey } = this.props;
      if (defaultActiveKey !== void 0) {
        this.setState({
          uncontrolledActiveKey: eventKey
        });
      } else {
        onSelect(event, eventKey);
      }
      if (tabContentRef) {
        React164.Children.toArray(this.props.children).map((child) => child).filter((child) => child.props && child.props.tabContentRef && child.props.tabContentRef.current).forEach((child) => child.props.tabContentRef.current.hidden = true);
        if (tabContentRef.current) {
          tabContentRef.current.hidden = false;
        }
      }
      if (this.props.mountOnEnter) {
        this.setState({
          shownKeys: shownKeys.concat(eventKey)
        });
      }
    }
    componentDidMount() {
      if (!this.props.isVertical) {
        if (canUseDOM) {
          window.addEventListener("resize", this.handleScrollButtons, false);
        }
        this.handleScrollButtons();
      }
    }
    componentWillUnmount() {
      var _a;
      if (!this.props.isVertical) {
        if (canUseDOM) {
          window.removeEventListener("resize", this.handleScrollButtons, false);
        }
      }
      clearTimeout(this.scrollTimeout);
      (_a = this.leftScrollButtonRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener("transitionend", this.hideScrollButtons);
    }
    componentDidUpdate(prevProps, prevState) {
      const { activeKey, mountOnEnter, isOverflowHorizontal, children } = this.props;
      const { shownKeys, overflowingTabCount, enableScrollButtons } = this.state;
      if (prevProps.activeKey !== activeKey && mountOnEnter && shownKeys.indexOf(activeKey) < 0) {
        this.setState({
          shownKeys: shownKeys.concat(activeKey)
        });
      }
      if (prevProps.children && children && React164.Children.toArray(prevProps.children).length !== React164.Children.toArray(children).length) {
        this.handleScrollButtons();
      }
      const currentOverflowingTabCount = this.countOverflowingElements(this.tabList.current);
      if (isOverflowHorizontal && currentOverflowingTabCount) {
        this.setState({ overflowingTabCount: currentOverflowingTabCount + overflowingTabCount });
      }
      if (!prevState.enableScrollButtons && enableScrollButtons) {
        this.setState({ renderScrollButtons: true });
        setTimeout(() => {
          var _a;
          (_a = this.leftScrollButtonRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener("transitionend", this.hideScrollButtons);
          this.setState({ showScrollButtons: true });
        }, 100);
      } else if (prevState.enableScrollButtons && !enableScrollButtons) {
        this.setState({ showScrollButtons: false });
      }
    }
    render() {
      const _a = this.props, { className, children, activeKey, defaultActiveKey, id, isFilled, isSecondary, isVertical: isVertical2, isBox, hasBorderBottom, hasSecondaryBorderBottom, leftScrollAriaLabel, rightScrollAriaLabel, "aria-label": ariaLabel, component, ouiaId, ouiaSafe, mountOnEnter, unmountOnExit, usePageInsets, inset, variant, expandable: expandable2, isExpanded, defaultIsExpanded, toggleText, toggleAriaLabel, addButtonAriaLabel, onToggle, onClose, onAdd, isOverflowHorizontal } = _a, props = __rest(_a, ["className", "children", "activeKey", "defaultActiveKey", "id", "isFilled", "isSecondary", "isVertical", "isBox", "hasBorderBottom", "hasSecondaryBorderBottom", "leftScrollAriaLabel", "rightScrollAriaLabel", "aria-label", "component", "ouiaId", "ouiaSafe", "mountOnEnter", "unmountOnExit", "usePageInsets", "inset", "variant", "expandable", "isExpanded", "defaultIsExpanded", "toggleText", "toggleAriaLabel", "addButtonAriaLabel", "onToggle", "onClose", "onAdd", "isOverflowHorizontal"]);
      const { showScrollButtons, renderScrollButtons, disableLeftScrollButton, disableRightScrollButton, shownKeys, uncontrolledActiveKey, uncontrolledIsExpandedLocal, overflowingTabCount } = this.state;
      const filteredChildren = React164.Children.toArray(children).filter(Boolean).filter((child) => !child.props.isHidden);
      const filteredChildrenWithoutOverflow = filteredChildren.slice(0, filteredChildren.length - overflowingTabCount);
      const filteredChildrenOverflowing = filteredChildren.slice(filteredChildren.length - overflowingTabCount);
      const overflowingTabProps = filteredChildrenOverflowing.map((child) => child.props);
      const uniqueId2 = id || getUniqueId();
      const Component50 = component === TabsComponent.nav ? "nav" : "div";
      const localActiveKey = defaultActiveKey !== void 0 ? uncontrolledActiveKey : activeKey;
      const isExpandedLocal = defaultIsExpanded !== void 0 ? uncontrolledIsExpandedLocal : isExpanded;
      const toggleTabs = (newValue) => {
        if (isExpanded === void 0) {
          this.setState({ uncontrolledIsExpandedLocal: newValue });
        } else {
          onToggle(newValue);
        }
      };
      const hasOverflowTab = isOverflowHorizontal && overflowingTabCount > 0;
      const overflowObjectProps = typeof isOverflowHorizontal === "object" ? Object.assign({}, isOverflowHorizontal) : {};
      return React164.createElement(
        TabsContextProvider,
        { value: {
          variant,
          mountOnEnter,
          unmountOnExit,
          localActiveKey,
          uniqueId: uniqueId2,
          handleTabClick: (...args) => this.handleTabClick(...args),
          handleTabClose: onClose
        } },
        React164.createElement(
          Component50,
          Object.assign({ "aria-label": ariaLabel, className: css(import_tabs5.default.tabs, isFilled && import_tabs5.default.modifiers.fill, isSecondary && import_tabs5.default.modifiers.secondary, isVertical2 && import_tabs5.default.modifiers.vertical, isVertical2 && expandable2 && formatBreakpointMods(expandable2, import_tabs5.default), isVertical2 && expandable2 && isExpandedLocal && import_tabs5.default.modifiers.expanded, isBox && import_tabs5.default.modifiers.box, showScrollButtons && import_tabs5.default.modifiers.scrollable, usePageInsets && import_tabs5.default.modifiers.pageInsets, !hasBorderBottom && import_tabs5.default.modifiers.noBorderBottom, hasSecondaryBorderBottom && import_tabs5.default.modifiers.borderBottom, formatBreakpointMods(inset, import_tabs5.default), variantStyle4[variant], hasOverflowTab && import_tabs5.default.modifiers.overflow, className) }, getOUIAProps(Tabs.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), { id: id && id }, props),
          expandable2 && isVertical2 && React164.createElement(GenerateId, null, (randomId) => React164.createElement(
            "div",
            { className: css(import_tabs5.default.tabsToggle) },
            React164.createElement(
              "div",
              { className: css(import_tabs5.default.tabsToggleButton) },
              React164.createElement(
                Button,
                { onClick: () => toggleTabs(!isExpandedLocal), variant: "plain", "aria-label": toggleAriaLabel, "aria-expanded": isExpandedLocal, id: `${randomId}-button`, "aria-labelledby": `${randomId}-text ${randomId}-button` },
                React164.createElement(
                  "span",
                  { className: css(import_tabs5.default.tabsToggleIcon) },
                  React164.createElement(angle_right_icon_default, { "arian-hidden": "true" })
                ),
                toggleText && React164.createElement("span", { className: css("pf-c-tabs__toggle-text"), id: `${randomId}-text` }, toggleText)
              )
            )
          )),
          renderScrollButtons && React164.createElement(
            "button",
            { type: "button", className: css(import_tabs5.default.tabsScrollButton, isSecondary && import_button4.default.modifiers.secondary), "aria-label": leftScrollAriaLabel, onClick: this.scrollLeft, disabled: disableLeftScrollButton, "aria-hidden": disableLeftScrollButton, ref: this.leftScrollButtonRef },
            React164.createElement(angle_left_icon_default, null)
          ),
          React164.createElement(
            "ul",
            { className: css(import_tabs5.default.tabsList), ref: this.tabList, onScroll: this.handleScrollButtons, role: "tablist" },
            isOverflowHorizontal ? filteredChildrenWithoutOverflow : filteredChildren,
            hasOverflowTab && React164.createElement(OverflowTab, Object.assign({ overflowingTabs: overflowingTabProps }, overflowObjectProps))
          ),
          renderScrollButtons && React164.createElement(
            "button",
            { type: "button", className: css(import_tabs5.default.tabsScrollButton, isSecondary && import_button4.default.modifiers.secondary), "aria-label": rightScrollAriaLabel, onClick: this.scrollRight, disabled: disableRightScrollButton, "aria-hidden": disableRightScrollButton },
            React164.createElement(angle_right_icon_default, null)
          ),
          onAdd !== void 0 && React164.createElement(
            "span",
            { className: css(import_tabs5.default.tabsAdd) },
            React164.createElement(
              Button,
              { variant: "plain", "aria-label": addButtonAriaLabel || "Add tab", onClick: onAdd },
              React164.createElement(plus_icon_default, null)
            )
          )
        ),
        filteredChildren.filter((child) => child.props.children && !(unmountOnExit && child.props.eventKey !== localActiveKey) && !(mountOnEnter && shownKeys.indexOf(child.props.eventKey) === -1)).map((child) => React164.createElement(TabContent, { key: child.props.eventKey, activeKey: localActiveKey, child, id: child.props.id || uniqueId2, ouiaId: child.props.ouiaId }))
      );
    }
  };
  Tabs.displayName = "Tabs";
  Tabs.defaultProps = {
    activeKey: 0,
    onSelect: () => void 0,
    isFilled: false,
    isSecondary: false,
    isVertical: false,
    isBox: false,
    hasBorderBottom: true,
    leftScrollAriaLabel: "Scroll left",
    rightScrollAriaLabel: "Scroll right",
    component: TabsComponent.div,
    mountOnEnter: false,
    unmountOnExit: false,
    ouiaSafe: true,
    variant: "default",
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onToggle: (isExpanded) => void 0
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabTitleIcon.js
  init_tslib_es6();
  var React165 = __toESM(require_react());
  var import_tabs6 = __toESM(require_tabs());
  var TabTitleIcon = (_a) => {
    var { children, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React165.createElement("span", Object.assign({ className: css(import_tabs6.default.tabsItemIcon, className) }, props), children);
  };
  TabTitleIcon.displayName = "TabTitleIcon";

  // node_modules/@patternfly/react-core/dist/esm/components/TimePicker/TimePicker.js
  init_tslib_es6();
  var React166 = __toESM(require_react());
  var import_date_picker = __toESM(require_date_picker());
  var import_form_control5 = __toESM(require_form_control());
  var import_menu6 = __toESM(require_menu());

  // node_modules/@patternfly/react-core/dist/esm/components/TimePicker/TimePickerUtils.js
  var amSuffix = " AM";
  var pmSuffix = " PM";
  var makeTimeOptions = (stepMinutes, hour12, delimiter, minTime, maxTime, includeSeconds) => {
    const res = [];
    const iter = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
    const iterDay = iter.getDay();
    while (iter.getDay() === iterDay) {
      let hour = iter.getHours();
      let suffix = amSuffix;
      if (hour12) {
        if (hour === 0) {
          hour = 12;
        } else if (hour >= 12) {
          suffix = pmSuffix;
        }
        if (hour > 12) {
          hour %= 12;
        }
      }
      hour = hour12 ? hour.toString() : hour.toString().padStart(2, "0");
      const minutes = iter.getMinutes().toString().padStart(2, "0");
      const timeOption = `${hour}${delimiter}${minutes}${hour12 ? suffix : ""}`;
      if (isWithinMinMax(minTime, maxTime, timeOption, delimiter, includeSeconds)) {
        res.push(timeOption);
      }
      iter.setMinutes(iter.getMinutes() + stepMinutes);
    }
    return res;
  };
  var parseTime = (time2, timeRegex, delimiter, is12Hour, includeSeconds) => {
    const date2 = new Date(time2);
    if (!isNaN(date2.getDate()) && (time2 instanceof Date || time2.includes("T"))) {
      const hours = is12Hour ? `${date2.getHours() > 12 ? date2.getHours() - 12 : date2.getHours()}` : `${date2.getHours()}`.padStart(2, "0");
      const minutes = `${date2.getMinutes()}`.padStart(2, "0");
      const seconds2 = includeSeconds ? `${date2.getSeconds()}`.padStart(2, "0") : "";
      const secondsWithDelimiter = seconds2 ? `${delimiter}${seconds2}` : "";
      let ampm = "";
      if (is12Hour && date2.getHours() > 11) {
        ampm = pmSuffix;
      } else if (is12Hour) {
        ampm = amSuffix;
      }
      return `${hours}${delimiter}${minutes}${secondsWithDelimiter}${ampm}`;
    } else if (typeof time2 === "string") {
      time2 = time2.trim();
      if (time2 !== "" && validateTime(time2, timeRegex, delimiter, is12Hour)) {
        const [, hours, minutes, seconds2, suffix = ""] = timeRegex.exec(time2);
        const secondsWithDelimiter = includeSeconds ? `${delimiter}${seconds2 !== null && seconds2 !== void 0 ? seconds2 : "00"}` : "";
        let ampm = "";
        if (is12Hour) {
          const uppercaseSuffix = suffix.toUpperCase();
          if (uppercaseSuffix === amSuffix.toUpperCase().trim()) {
            ampm = amSuffix;
          } else if (uppercaseSuffix === pmSuffix.toUpperCase().trim()) {
            ampm = pmSuffix;
          } else {
            ampm = (/* @__PURE__ */ new Date()).getHours() > 11 ? pmSuffix : amSuffix;
          }
        }
        return `${hours}${delimiter}${minutes}${secondsWithDelimiter}${ampm}`;
      }
    }
    return time2.toString();
  };
  var validateTime = (time2, timeRegex, delimiter, is12Hour) => {
    const date2 = new Date(time2);
    if (!isNaN(date2.getDate()) && time2.includes("T")) {
      return true;
    }
    const hours = parseInt(time2.split(delimiter)[0]);
    const validHours = hours >= (is12Hour ? 1 : 0) && hours <= (is12Hour ? 12 : 23);
    return time2 === "" || timeRegex.test(time2) && validHours;
  };
  var getHours = (time2, timeRegex) => {
    const parts = time2.match(timeRegex);
    if (parts && parts.length) {
      if (/pm/i.test(parts[4])) {
        return parseInt(parts[1]) === 12 ? parseInt(parts[1]) : parseInt(parts[1]) + 12;
      }
      if (/am/i.test(parts[4])) {
        return parseInt(parts[1]) === 12 ? 0 : parseInt(parts[1]);
      }
      return parseInt(parts[1]);
    }
    return null;
  };
  var getMinutes = (time2, timeRegex) => {
    const parts = time2.match(timeRegex);
    return parts && parts.length ? parseInt(parts[2]) : null;
  };
  var getSeconds = (time2, timeRegex) => {
    var _a;
    const seconds2 = (_a = time2.match(timeRegex)) === null || _a === void 0 ? void 0 : _a[3];
    return seconds2 ? parseInt(seconds2) : null;
  };
  var isWithinMinMax = (minTime, maxTime, time2, delimiter, includeSeconds) => {
    if (time2.trim() === "") {
      return true;
    }
    const min24HourTime = convertTo24Hour(minTime, delimiter, includeSeconds);
    const selected24HourTime = convertTo24Hour(time2, delimiter, includeSeconds);
    const max24HourTime = convertTo24Hour(maxTime, delimiter, includeSeconds);
    return min24HourTime <= selected24HourTime && selected24HourTime <= max24HourTime;
  };
  var convertTo24Hour = (time2, delimiter, includeSeconds) => {
    const timeReg = new RegExp(`^\\s*(\\d\\d?)${delimiter}([0-5]\\d)${delimiter}?([0-5]\\d)?\\s*([AaPp][Mm])?\\s*$`);
    const regMatches = timeReg.exec(time2);
    if (!regMatches || !regMatches.length) {
      return;
    }
    let hours = regMatches[1].padStart(2, "0");
    const minutes = regMatches[2];
    let seconds2 = regMatches[3] ? `${delimiter}${regMatches[3]}` : "";
    if (!seconds2 && includeSeconds) {
      seconds2 = `${delimiter}00`;
    }
    const suffix = regMatches[4] || "";
    if (suffix.toUpperCase() === "PM" && hours !== "12") {
      hours = `${parseInt(hours) + 12}`;
    } else if (suffix.toUpperCase() === "AM" && hours === "12") {
      hours = "00";
    }
    return `${hours}${delimiter}${minutes}${seconds2}`;
  };

  // node_modules/@patternfly/react-core/dist/esm/components/TimePicker/TimePicker.js
  var TimePicker = class extends React166.Component {
    constructor(props) {
      super(props);
      this.baseComponentRef = React166.createRef();
      this.toggleRef = React166.createRef();
      this.inputRef = React166.createRef();
      this.menuRef = React166.createRef();
      this.onDocClick = (event) => {
        var _a, _b, _c, _d;
        const clickedOnToggle = (_b = (_a = this.toggleRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.contains(event.target);
        const clickedWithinMenu = (_d = (_c = this.menuRef) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.contains(event.target);
        if (this.state.isTimeOptionsOpen && !(clickedOnToggle || clickedWithinMenu)) {
          this.onToggle(false);
        }
      };
      this.handleGlobalKeys = (event) => {
        var _a, _b, _c, _d;
        const { isTimeOptionsOpen, focusedIndex, scrollIndex } = this.state;
        if ((_b = (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)) {
          if (!isTimeOptionsOpen && event.key !== KeyTypes.Tab && event.key !== KeyTypes.Escape) {
            this.onToggle(true);
          } else if (isTimeOptionsOpen) {
            if (event.key === KeyTypes.Escape || event.key === KeyTypes.Tab) {
              this.onToggle(false);
            } else if (event.key === KeyTypes.Enter) {
              if (focusedIndex !== null) {
                this.focusSelection(focusedIndex);
                event.stopPropagation();
              } else {
                this.onToggle(false);
              }
            } else if (event.key === KeyTypes.ArrowDown || event.key === KeyTypes.ArrowUp) {
              this.focusSelection(scrollIndex);
              this.updateFocusedIndex(0);
              event.preventDefault();
            }
          }
        } else if ((_d = (_c = this.menuRef) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.contains(event.target)) {
          if (event.key === KeyTypes.ArrowDown) {
            this.updateFocusedIndex(1);
            event.preventDefault();
          } else if (event.key === KeyTypes.ArrowUp) {
            this.updateFocusedIndex(-1);
            event.preventDefault();
          } else if (event.key === KeyTypes.Escape || event.key === KeyTypes.Tab) {
            this.inputRef.current.focus();
            this.onToggle(false);
          }
        }
      };
      this.updateFocusedIndex = (increment) => {
        this.setState((prevState) => {
          const maxIndex = this.getOptions().length - 1;
          let nextIndex = prevState.focusedIndex !== null ? prevState.focusedIndex + increment : prevState.scrollIndex + increment;
          if (nextIndex < 0) {
            nextIndex = maxIndex;
          } else if (nextIndex > maxIndex) {
            nextIndex = 0;
          }
          this.scrollToIndex(nextIndex);
          return {
            focusedIndex: nextIndex
          };
        });
      };
      this.getIndexToScroll = (index) => {
        if (this.props.menuAppendTo === "inline") {
          return index > 0 ? index - 1 : 0;
        }
        return index;
      };
      this.scrollToIndex = (index) => {
        this.getOptions()[index].closest(`.${import_menu6.default.menuContent}`).scrollTop = this.getOptions()[this.getIndexToScroll(index)].offsetTop;
      };
      this.focusSelection = (index) => {
        var _a;
        const indexToFocus = index !== -1 ? index : 0;
        if ((_a = this.menuRef) === null || _a === void 0 ? void 0 : _a.current) {
          this.getOptions()[indexToFocus].querySelector(`.${import_menu6.default.menuItem}`).focus();
        }
      };
      this.scrollToSelection = (time3) => {
        const { delimiter: delimiter2, is24Hour: is24Hour2 } = this.props;
        let splitTime = time3.split(this.props.delimiter);
        let focusedIndex = null;
        if (splitTime.length < 2) {
          time3 = `${time3}${delimiter2}00`;
          splitTime = time3.split(delimiter2);
        } else if (splitTime.length > 2) {
          time3 = parseTime(time3, this.state.timeRegex, delimiter2, !is24Hour2, false);
          splitTime = time3.split(delimiter2);
        }
        if (!is24Hour2 && splitTime.length > 1 && splitTime[1].length < 2) {
          const minutes = splitTime[1].length === 0 ? "00" : splitTime[1] + "0";
          time3 = `${splitTime[0]}${delimiter2}${minutes}${(/* @__PURE__ */ new Date()).getHours() > 11 ? pmSuffix : amSuffix}`;
        } else if (!is24Hour2 && splitTime.length > 1 && splitTime[1].length === 2 && !time3.toUpperCase().includes(amSuffix.toUpperCase().trim()) && !time3.toUpperCase().includes(pmSuffix.toUpperCase().trim())) {
          time3 = `${time3}${(/* @__PURE__ */ new Date()).getHours() > 11 ? pmSuffix : amSuffix}`;
        }
        let scrollIndex = this.getOptions().findIndex((option) => option.textContent === time3);
        if (scrollIndex !== -1) {
          this.scrollToIndex(scrollIndex);
          focusedIndex = scrollIndex;
        } else if (splitTime.length === 2) {
          let amPm = "";
          if (!is24Hour2) {
            if (splitTime[1].toUpperCase().includes("P")) {
              amPm = pmSuffix;
            } else if (splitTime[1].toUpperCase().includes("A")) {
              amPm = amSuffix;
            }
          }
          time3 = `${splitTime[0]}${delimiter2}00${amPm}`;
          scrollIndex = this.getOptions().findIndex((option) => option.textContent === time3);
          if (scrollIndex !== -1) {
            this.scrollToIndex(scrollIndex);
          }
        }
        this.setState({
          focusedIndex,
          scrollIndex
        });
      };
      this.getRegExp = (includeSeconds2 = true) => {
        const { is24Hour: is24Hour2, delimiter: delimiter2 } = this.props;
        let baseRegex = `\\s*(\\d\\d?)${delimiter2}([0-5]\\d)`;
        if (includeSeconds2) {
          baseRegex += `${delimiter2}?([0-5]\\d)?`;
        }
        return new RegExp(`^${baseRegex}${is24Hour2 ? "" : "\\s*([AaPp][Mm])?"}\\s*$`);
      };
      this.getOptions = () => {
        var _a;
        return ((_a = this.menuRef) === null || _a === void 0 ? void 0 : _a.current) ? Array.from(this.menuRef.current.querySelectorAll(`.${import_menu6.default.menuListItem}`)) : [];
      };
      this.isValidFormat = (time3) => {
        if (this.props.validateTime) {
          return this.props.validateTime(time3);
        }
        const { delimiter: delimiter2, is24Hour: is24Hour2, includeSeconds: includeSeconds2 } = this.props;
        return validateTime(time3, this.getRegExp(includeSeconds2), delimiter2, !is24Hour2);
      };
      this.isValidTime = (time3) => {
        const { delimiter: delimiter2, includeSeconds: includeSeconds2 } = this.props;
        const { minTimeState, maxTimeState } = this.state;
        return isWithinMinMax(minTimeState, maxTimeState, time3, delimiter2, includeSeconds2);
      };
      this.isValid = (time3) => this.isValidFormat(time3) && this.isValidTime(time3);
      this.onToggle = (isOpen2) => {
        this.setState((prevState) => {
          const { timeRegex: timeRegex2, isInvalid, timeState } = prevState;
          const { delimiter: delimiter2, is24Hour: is24Hour2, includeSeconds: includeSeconds2, onChange } = this.props;
          const time3 = parseTime(timeState, timeRegex2, delimiter2, !is24Hour2, includeSeconds2);
          if (onChange && !isOpen2 && time3 !== timeState) {
            onChange(null, time3, getHours(time3, timeRegex2), getMinutes(time3, timeRegex2), getSeconds(time3, timeRegex2), this.isValid(time3));
          }
          return {
            isTimeOptionsOpen: isOpen2,
            timeState: time3,
            isInvalid: isOpen2 ? isInvalid : !this.isValid(time3)
          };
        });
        this.props.setIsOpen(isOpen2);
        if (!isOpen2) {
          this.inputRef.current.focus();
        }
      };
      this.onSelect = (e) => {
        const { timeRegex: timeRegex2, timeState } = this.state;
        const { delimiter: delimiter2, is24Hour: is24Hour2, includeSeconds: includeSeconds2, setIsOpen } = this.props;
        const time3 = parseTime(e.target.textContent, timeRegex2, delimiter2, !is24Hour2, includeSeconds2);
        if (time3 !== timeState) {
          this.onInputChange(time3, e);
        }
        this.inputRef.current.focus();
        this.setState({
          isTimeOptionsOpen: false,
          isInvalid: false
        });
        setIsOpen(false);
      };
      this.onInputClick = (e) => {
        if (!this.state.isTimeOptionsOpen) {
          this.onToggle(true);
        }
        e.stopPropagation();
      };
      this.onInputChange = (newTime, event) => {
        const { onChange } = this.props;
        const { timeRegex: timeRegex2 } = this.state;
        if (onChange) {
          onChange(event, newTime, getHours(newTime, timeRegex2), getMinutes(newTime, timeRegex2), getSeconds(newTime, timeRegex2), this.isValid(newTime));
        }
        this.scrollToSelection(newTime);
        this.setState({
          timeState: newTime
        });
      };
      const { is24Hour, delimiter, time: time2, includeSeconds, isOpen } = this.props;
      let { minTime, maxTime } = this.props;
      if (minTime === "") {
        const minSeconds = includeSeconds ? `${delimiter}00` : "";
        minTime = is24Hour ? `00${delimiter}00${minSeconds}` : `12${delimiter}00${minSeconds} AM`;
      }
      if (maxTime === "") {
        const maxSeconds = includeSeconds ? `${delimiter}59` : "";
        maxTime = is24Hour ? `23${delimiter}59${maxSeconds}` : `11${delimiter}59${maxSeconds} PM`;
      }
      const timeRegex = this.getRegExp();
      this.state = {
        isInvalid: false,
        isTimeOptionsOpen: isOpen,
        timeState: parseTime(time2, timeRegex, delimiter, !is24Hour, includeSeconds),
        focusedIndex: null,
        scrollIndex: 0,
        timeRegex,
        minTimeState: parseTime(minTime, timeRegex, delimiter, !is24Hour, includeSeconds),
        maxTimeState: parseTime(maxTime, timeRegex, delimiter, !is24Hour, includeSeconds)
      };
    }
    componentDidMount() {
      document.addEventListener("mousedown", this.onDocClick);
      document.addEventListener("touchstart", this.onDocClick);
      document.addEventListener("keydown", this.handleGlobalKeys);
      this.setState({ isInvalid: !this.isValid(this.state.timeState) });
    }
    componentWillUnmount() {
      document.removeEventListener("mousedown", this.onDocClick);
      document.removeEventListener("touchstart", this.onDocClick);
      document.removeEventListener("keydown", this.handleGlobalKeys);
    }
    componentDidUpdate(prevProps, prevState) {
      const { timeState, isTimeOptionsOpen, isInvalid, timeRegex } = this.state;
      const { time: time2, is24Hour, delimiter, includeSeconds, isOpen, minTime, maxTime } = this.props;
      if (prevProps.isOpen !== isOpen) {
        this.onToggle(isOpen);
      }
      if (isTimeOptionsOpen && !prevState.isTimeOptionsOpen && timeState && !isInvalid) {
        this.scrollToSelection(timeState);
      }
      if (delimiter !== prevProps.delimiter) {
        this.setState({
          timeRegex: this.getRegExp()
        });
      }
      if (time2 !== "" && time2 !== prevProps.time) {
        const parsedTime = parseTime(time2, timeRegex, delimiter, !is24Hour, includeSeconds);
        this.setState({
          timeState: parsedTime,
          isInvalid: !this.isValid(parsedTime)
        });
      }
      if (minTime !== "" && minTime !== prevProps.minTime) {
        this.setState({
          minTimeState: parseTime(minTime, timeRegex, delimiter, !is24Hour, includeSeconds)
        });
      }
      if (maxTime !== "" && maxTime !== prevProps.maxTime) {
        this.setState({
          maxTimeState: parseTime(maxTime, timeRegex, delimiter, !is24Hour, includeSeconds)
        });
      }
    }
    render() {
      const _a = this.props, {
        "aria-label": ariaLabel,
        isDisabled,
        className,
        placeholder,
        id,
        menuAppendTo,
        is24Hour,
        invalidFormatErrorMessage,
        invalidMinMaxErrorMessage,
        stepMinutes,
        width,
        delimiter,
        inputProps,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        onChange,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        setIsOpen,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        isOpen,
        time: time2,
        validateTime: validateTime2,
        minTime,
        maxTime,
        includeSeconds,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        removeFindDomNode,
        zIndex
      } = _a, props = __rest(_a, ["aria-label", "isDisabled", "className", "placeholder", "id", "menuAppendTo", "is24Hour", "invalidFormatErrorMessage", "invalidMinMaxErrorMessage", "stepMinutes", "width", "delimiter", "inputProps", "onChange", "setIsOpen", "isOpen", "time", "validateTime", "minTime", "maxTime", "includeSeconds", "removeFindDomNode", "zIndex"]);
      const { timeState, isTimeOptionsOpen, isInvalid, minTimeState, maxTimeState } = this.state;
      const style = { "--pf-c-date-picker__input--c-form-control--Width": width };
      const options4 = makeTimeOptions(stepMinutes, !is24Hour, delimiter, minTimeState, maxTimeState, includeSeconds);
      const isValidFormat = this.isValidFormat(timeState);
      const randomId = id || getUniqueId("time-picker");
      const getParentElement = () => {
        if (this.baseComponentRef && this.baseComponentRef.current) {
          return this.baseComponentRef.current.parentElement;
        }
        return null;
      };
      const menuContainer = React166.createElement(
        Menu,
        { ref: this.menuRef, isScrollable: true },
        React166.createElement(
          MenuContent,
          { maxMenuHeight: "200px" },
          React166.createElement(MenuList, { "aria-label": ariaLabel }, options4.map((option, index) => React166.createElement(MenuItem, { onClick: this.onSelect, key: option, id: `${randomId}-option-${index}` }, option)))
        )
      );
      const textInput = React166.createElement(TextInput, Object.assign({ "aria-haspopup": "menu", className: css(import_form_control5.default.formControl), id: `${randomId}-input`, "aria-label": ariaLabel, validated: isInvalid ? "error" : "default", placeholder, value: timeState || "", type: "text", iconVariant: "clock", onClick: this.onInputClick, onChange: this.onInputChange, autoComplete: "off", isDisabled, ref: this.inputRef }, inputProps));
      let calculatedAppendTo;
      switch (menuAppendTo) {
        case "inline":
          calculatedAppendTo = () => this.toggleRef.current;
          break;
        case "parent":
          calculatedAppendTo = getParentElement;
          break;
        default:
          calculatedAppendTo = menuAppendTo;
      }
      return React166.createElement(
        "div",
        { ref: this.baseComponentRef, className: css(import_date_picker.default.datePicker, className) },
        React166.createElement(
          "div",
          Object.assign({ className: css(import_date_picker.default.datePickerInput), style }, props),
          React166.createElement(
            InputGroup,
            null,
            React166.createElement(
              "div",
              { id: randomId },
              React166.createElement(
                "div",
                { ref: this.toggleRef, style: { paddingLeft: "0" } },
                React166.createElement(Popper, { appendTo: calculatedAppendTo, trigger: textInput, popper: menuContainer, isVisible: isTimeOptionsOpen, removeFindDomNode, zIndex })
              )
            )
          ),
          isInvalid && React166.createElement("div", { className: css(import_date_picker.default.datePickerHelperText, import_date_picker.default.modifiers.error) }, !isValidFormat ? invalidFormatErrorMessage : invalidMinMaxErrorMessage)
        )
      );
    }
  };
  TimePicker.displayName = "TimePicker";
  TimePicker.defaultProps = {
    className: "",
    isDisabled: false,
    time: "",
    is24Hour: false,
    invalidFormatErrorMessage: "Invalid time format",
    invalidMinMaxErrorMessage: "Invalid time entered",
    placeholder: "hh:mm",
    delimiter: ":",
    "aria-label": "Time picker",
    width: "150px",
    menuAppendTo: "inline",
    stepMinutes: 30,
    inputProps: {},
    minTime: "",
    maxTime: "",
    isOpen: false,
    setIsOpen: () => {
    },
    removeFindDomNode: false,
    zIndex: 9999
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroup.js
  init_tslib_es6();
  var React169 = __toESM(require_react());
  var import_toggle_group3 = __toESM(require_toggle_group());

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroupItem.js
  init_tslib_es6();
  var React168 = __toESM(require_react());
  var import_toggle_group2 = __toESM(require_toggle_group());

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroupItemElement.js
  var React167 = __toESM(require_react());
  var import_toggle_group = __toESM(require_toggle_group());
  var ToggleGroupItemVariant;
  (function(ToggleGroupItemVariant2) {
    ToggleGroupItemVariant2["icon"] = "icon";
    ToggleGroupItemVariant2["text"] = "text";
  })(ToggleGroupItemVariant || (ToggleGroupItemVariant = {}));
  var ToggleGroupItemElement = ({ variant, children }) => React167.createElement("span", { className: css(variant === "icon" && import_toggle_group.default.toggleGroupIcon, variant === "text" && import_toggle_group.default.toggleGroupText) }, children);
  ToggleGroupItemElement.displayName = "ToggleGroupItemElement";

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroupItem.js
  var ToggleGroupItem = (_a) => {
    var { text, icon: icon2, className, isDisabled = false, isSelected = false, "aria-label": ariaLabel = "", onChange = () => {
    }, buttonId = "" } = _a, props = __rest(_a, ["text", "icon", "className", "isDisabled", "isSelected", "aria-label", "onChange", "buttonId"]);
    const handleChange = (event) => {
      onChange(!isSelected, event);
    };
    if (!ariaLabel && icon2 && !text) {
      console.warn("An accessible aria-label is required when using the toggle group item icon variant.");
    }
    return React168.createElement(
      "div",
      Object.assign({ className: css(import_toggle_group2.default.toggleGroupItem, className) }, props),
      React168.createElement(
        "button",
        Object.assign({ type: "button", className: css(import_toggle_group2.default.toggleGroupButton, isSelected && import_toggle_group2.default.modifiers.selected), "aria-pressed": isSelected, onClick: handleChange }, ariaLabel && { "aria-label": ariaLabel }, isDisabled && { disabled: true }, buttonId && { id: buttonId }),
        icon2 ? React168.createElement(ToggleGroupItemElement, { variant: ToggleGroupItemVariant.icon }, icon2) : null,
        text ? React168.createElement(ToggleGroupItemElement, { variant: ToggleGroupItemVariant.text }, text) : null
      )
    );
  };
  ToggleGroupItem.displayName = "ToggleGroupItem";

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroup.js
  var ToggleGroup = (_a) => {
    var { className, children, isCompact = false, areAllGroupsDisabled = false, "aria-label": ariaLabel } = _a, props = __rest(_a, ["className", "children", "isCompact", "areAllGroupsDisabled", "aria-label"]);
    const toggleGroupItemList = React169.Children.map(children, (child) => {
      const childCompName = child.type.name;
      return childCompName !== ToggleGroupItem.name ? child : React169.cloneElement(child, areAllGroupsDisabled ? { isDisabled: true } : {});
    });
    return React169.createElement("div", Object.assign({ className: css(import_toggle_group3.default.toggleGroup, isCompact && import_toggle_group3.default.modifiers.compact, className), role: "group", "aria-label": ariaLabel }, props), toggleGroupItemList);
  };
  ToggleGroup.displayName = "ToggleGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/NumberInput/NumberInput.js
  init_tslib_es6();
  var React170 = __toESM(require_react());
  var import_number_input = __toESM(require_number_input());
  var defaultKeyDownHandler = (args) => (event) => {
    if (KeyTypes.ArrowUp === event.key && args.onPlus) {
      event.preventDefault();
      args.onPlus(null, args.inputName);
    }
    if (KeyTypes.ArrowDown === event.key && args.onMinus) {
      event.preventDefault();
      args.onMinus(null, args.inputName);
    }
  };
  var NumberInput = (_a) => {
    var { value = 0, className, widthChars, isDisabled = false, validated = ValidatedOptions.default, onMinus = () => {
    }, onChange, onBlur, onPlus = () => {
    }, unit: unit2, unitPosition = "after", min: min3, max: max3, inputName, inputAriaLabel = "Input", minusBtnAriaLabel = "Minus", plusBtnAriaLabel = "Plus", inputProps, minusBtnProps, plusBtnProps, allowEmptyInput = false } = _a, props = __rest(_a, ["value", "className", "widthChars", "isDisabled", "validated", "onMinus", "onChange", "onBlur", "onPlus", "unit", "unitPosition", "min", "max", "inputName", "inputAriaLabel", "minusBtnAriaLabel", "plusBtnAriaLabel", "inputProps", "minusBtnProps", "plusBtnProps", "allowEmptyInput"]);
    if (!allowEmptyInput) {
      value = value || 0;
    }
    const numberInputUnit = React170.createElement("div", { className: css(import_number_input.default.numberInputUnit) }, unit2);
    const keyDownHandler = inputProps && inputProps.onKeyDown ? inputProps.onKeyDown : defaultKeyDownHandler({ inputName, onMinus, onPlus });
    const handleBlur = (event) => {
      event.target.value = Number(event.target.value).toString();
      if (onChange) {
        onChange(event);
      }
      if (onBlur) {
        onBlur(event);
      }
    };
    return React170.createElement(
      "div",
      Object.assign({ className: css(import_number_input.default.numberInput, validated !== "default" && import_number_input.default.modifiers.status, className) }, widthChars && {
        style: Object.assign({ "--pf-c-number-input--c-form-control--width-chars": widthChars }, props.style)
      }, props),
      unit2 && unitPosition === "before" && numberInputUnit,
      React170.createElement(
        InputGroup,
        null,
        React170.createElement(
          Button,
          Object.assign({ variant: "control", "aria-label": minusBtnAriaLabel, isDisabled: isDisabled || value <= min3, onClick: (evt) => onMinus(evt, inputName) }, minusBtnProps),
          React170.createElement(
            "span",
            { className: css(import_number_input.default.numberInputIcon) },
            React170.createElement(minus_icon_default, { "aria-hidden": "true" })
          )
        ),
        React170.createElement(TextInput, Object.assign({}, inputProps, { type: "number", value, name: inputName, "aria-label": inputAriaLabel }, isDisabled && { isDisabled }, onChange && { onChange: (value2, event) => onChange(event) }, { onBlur: handleBlur }, !onChange && { isReadOnly: true }, { onKeyDown: keyDownHandler, validated })),
        React170.createElement(
          Button,
          Object.assign({ variant: "control", "aria-label": plusBtnAriaLabel, isDisabled: isDisabled || value >= max3, onClick: (evt) => onPlus(evt, inputName) }, plusBtnProps),
          React170.createElement(
            "span",
            { className: css(import_number_input.default.numberInputIcon) },
            React170.createElement(plus_icon_default, { "aria-hidden": "true" })
          )
        )
      ),
      unit2 && unitPosition === "after" && numberInputUnit
    );
  };
  NumberInput.displayName = "NumberInput";

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeView.js
  init_tslib_es6();
  var React174 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeViewList.js
  init_tslib_es6();
  var React171 = __toESM(require_react());
  var TreeViewList = (_a) => {
    var { isNested = false, toolbar, children } = _a, props = __rest(_a, ["isNested", "toolbar", "children"]);
    return React171.createElement(
      React171.Fragment,
      null,
      toolbar && React171.createElement(
        React171.Fragment,
        null,
        toolbar,
        React171.createElement(Divider, null)
      ),
      React171.createElement("ul", Object.assign({ className: css("pf-c-tree-view__list"), role: isNested ? "group" : "tree" }, props), children)
    );
  };
  TreeViewList.displayName = "TreeViewList";

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeViewListItem.js
  var import_react6 = __toESM(require_react());
  var import_tree_view = __toESM(require_tree_view());
  var TreeViewListItemBase = ({
    name: name2,
    title,
    id,
    isExpanded,
    defaultExpanded = false,
    children = null,
    onSelect,
    onCheck,
    hasCheck = false,
    checkProps = {
      checked: false
    },
    hasBadge = false,
    customBadgeContent,
    badgeProps = { isRead: true },
    isSelectable = false,
    isCompact,
    activeItems = [],
    itemData,
    parentItem,
    icon: icon2,
    expandedIcon,
    action,
    compareItems,
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    useMemo: useMemo5
  }) => {
    const [internalIsExpanded, setIsExpanded] = (0, import_react6.useState)(defaultExpanded);
    (0, import_react6.useEffect)(() => {
      if (isExpanded !== void 0 && isExpanded !== null) {
        setIsExpanded(isExpanded);
      } else if (defaultExpanded !== void 0 && defaultExpanded !== null) {
        setIsExpanded(internalIsExpanded || defaultExpanded);
      }
    }, [isExpanded, defaultExpanded]);
    let Component50 = "button";
    if (hasCheck) {
      Component50 = "label";
    } else if (isSelectable) {
      Component50 = "div";
    }
    const ToggleComponent = hasCheck || isSelectable ? "button" : "span";
    const renderToggle = (randomId) => import_react6.default.createElement(
      ToggleComponent,
      Object.assign({ className: css(import_tree_view.default.treeViewNodeToggle), onClick: (evt) => {
        if (isSelectable || hasCheck) {
          setIsExpanded(!internalIsExpanded);
        }
        if (isSelectable) {
          evt.stopPropagation();
        }
      } }, (hasCheck || isSelectable) && { "aria-labelledby": `label-${randomId}` }, { tabIndex: -1 }),
      import_react6.default.createElement(
        "span",
        { className: css(import_tree_view.default.treeViewNodeToggleIcon) },
        import_react6.default.createElement(angle_right_icon_default, { "aria-hidden": "true" })
      )
    );
    const renderCheck = (randomId) => import_react6.default.createElement(
      "span",
      { className: css(import_tree_view.default.treeViewNodeCheck) },
      import_react6.default.createElement("input", Object.assign({ type: "checkbox", onChange: (evt) => onCheck && onCheck(evt, itemData, parentItem), onClick: (evt) => evt.stopPropagation(), ref: (elem) => elem && (elem.indeterminate = checkProps.checked === null) }, checkProps, { checked: checkProps.checked === null ? false : checkProps.checked, id: randomId, tabIndex: -1 }))
    );
    const iconRendered = import_react6.default.createElement(
      "span",
      { className: css(import_tree_view.default.treeViewNodeIcon) },
      !internalIsExpanded && icon2,
      internalIsExpanded && (expandedIcon || icon2)
    );
    const renderNodeContent = () => {
      const content = import_react6.default.createElement(
        import_react6.default.Fragment,
        null,
        isCompact && title && import_react6.default.createElement("span", { className: css(import_tree_view.default.treeViewNodeTitle) }, title),
        isSelectable ? import_react6.default.createElement("button", { tabIndex: -1, className: css(import_tree_view.default.treeViewNodeText) }, name2) : import_react6.default.createElement("span", { className: css(import_tree_view.default.treeViewNodeText) }, name2)
      );
      return isCompact ? import_react6.default.createElement("span", { className: css(import_tree_view.default.treeViewNodeContent) }, content) : content;
    };
    const badgeRendered = import_react6.default.createElement(
      import_react6.default.Fragment,
      null,
      hasBadge && children && import_react6.default.createElement(
        "span",
        { className: css(import_tree_view.default.treeViewNodeCount) },
        import_react6.default.createElement(Badge, Object.assign({}, badgeProps), customBadgeContent ? customBadgeContent : children.props.data.length)
      ),
      hasBadge && !children && customBadgeContent !== void 0 && import_react6.default.createElement(
        "span",
        { className: css(import_tree_view.default.treeViewNodeCount) },
        import_react6.default.createElement(Badge, Object.assign({}, badgeProps), customBadgeContent)
      )
    );
    return import_react6.default.createElement(
      "li",
      Object.assign({ id, className: css(import_tree_view.default.treeViewListItem, internalIsExpanded && import_tree_view.default.modifiers.expanded) }, internalIsExpanded && { "aria-expanded": "true" }, { role: "treeitem", tabIndex: -1 }),
      import_react6.default.createElement(
        "div",
        { className: css(import_tree_view.default.treeViewContent) },
        import_react6.default.createElement(GenerateId, { prefix: isSelectable ? "selectable-id" : "checkbox-id" }, (randomId) => import_react6.default.createElement(
          Component50,
          Object.assign({ className: css(import_tree_view.default.treeViewNode, children && (isSelectable || hasCheck) && import_tree_view.default.modifiers.selectable, (!children || isSelectable) && activeItems && activeItems.length > 0 && activeItems.some((item) => compareItems && item && compareItems(item, itemData)) ? import_tree_view.default.modifiers.current : ""), onClick: (evt) => {
            if (!hasCheck) {
              onSelect && onSelect(evt, itemData, parentItem);
              if (!isSelectable && children && evt.isDefaultPrevented() !== true) {
                setIsExpanded(!internalIsExpanded);
              }
            }
          } }, hasCheck && { htmlFor: randomId }, (hasCheck || isSelectable && children) && { id: `label-${randomId}` }),
          import_react6.default.createElement(
            "span",
            { className: css(import_tree_view.default.treeViewNodeContainer) },
            children && renderToggle(randomId),
            hasCheck && renderCheck(randomId),
            icon2 && iconRendered,
            renderNodeContent(),
            badgeRendered
          )
        )),
        action && import_react6.default.createElement("div", { className: css(import_tree_view.default.treeViewAction) }, action)
      ),
      internalIsExpanded && children
    );
  };
  var TreeViewListItem = import_react6.default.memo(TreeViewListItemBase, (prevProps, nextProps) => {
    if (!nextProps.useMemo) {
      return false;
    }
    const prevIncludes = prevProps.activeItems && prevProps.activeItems.length > 0 && prevProps.activeItems.some((item) => prevProps.compareItems && item && prevProps.compareItems(item, prevProps.itemData));
    const nextIncludes = nextProps.activeItems && nextProps.activeItems.length > 0 && nextProps.activeItems.some((item) => nextProps.compareItems && item && nextProps.compareItems(item, nextProps.itemData));
    if (prevIncludes || nextIncludes) {
      return false;
    }
    if (prevProps.name !== nextProps.name || prevProps.title !== nextProps.title || prevProps.id !== nextProps.id || prevProps.isExpanded !== nextProps.isExpanded || prevProps.defaultExpanded !== nextProps.defaultExpanded || prevProps.onSelect !== nextProps.onSelect || prevProps.onCheck !== nextProps.onCheck || prevProps.hasCheck !== nextProps.hasCheck || prevProps.checkProps !== nextProps.checkProps || prevProps.hasBadge !== nextProps.hasBadge || prevProps.customBadgeContent !== nextProps.customBadgeContent || prevProps.badgeProps !== nextProps.badgeProps || prevProps.isCompact !== nextProps.isCompact || prevProps.icon !== nextProps.icon || prevProps.expandedIcon !== nextProps.expandedIcon || prevProps.action !== nextProps.action || prevProps.parentItem !== nextProps.parentItem || prevProps.itemData !== nextProps.itemData) {
      return false;
    }
    return true;
  });
  TreeViewListItem.displayName = "TreeViewListItem";

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeViewRoot.js
  init_tslib_es6();
  var React173 = __toESM(require_react());
  var import_tree_view2 = __toESM(require_tree_view());
  var TreeViewRoot = class extends React173.Component {
    constructor() {
      super(...arguments);
      this.displayName = "TreeViewRoot";
      this.treeRef = React173.createRef();
      this.handleKeys = (event) => {
        var _a, _b, _c, _d, _e, _f, _g;
        if (!this.treeRef.current.contains(event.target)) {
          return;
        }
        const activeElement = document.activeElement;
        const key = event.key;
        const treeItems = Array.from((_a = this.treeRef.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName("pf-c-tree-view__node")).filter((el) => !el.classList.contains("pf-m-disabled"));
        if (key === KeyTypes.Space) {
          activeElement.click();
          event.preventDefault();
        }
        handleArrows(event, treeItems, (element) => activeElement === element, void 0, [], void 0, true, true);
        if (["ArrowLeft", "ArrowRight"].includes(key)) {
          const isExpandable = (_c = (_b = activeElement === null || activeElement === void 0 ? void 0 : activeElement.firstElementChild) === null || _b === void 0 ? void 0 : _b.firstElementChild) === null || _c === void 0 ? void 0 : _c.classList.contains("pf-c-tree-view__node-toggle");
          const isExpanded = (_d = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest("li")) === null || _d === void 0 ? void 0 : _d.classList.contains("pf-m-expanded");
          if (key === "ArrowLeft") {
            if (isExpandable && isExpanded) {
              activeElement.click();
            } else {
              const parentList = (_e = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest("ul")) === null || _e === void 0 ? void 0 : _e.parentElement;
              if ((parentList === null || parentList === void 0 ? void 0 : parentList.tagName) !== "DIV") {
                const parentButton = parentList === null || parentList === void 0 ? void 0 : parentList.querySelector("button");
                activeElement.tabIndex = -1;
                if (parentButton) {
                  parentButton.tabIndex = 0;
                  parentButton.focus();
                }
              }
            }
          } else {
            if (isExpandable && !isExpanded) {
              activeElement.tabIndex = -1;
              activeElement.click();
              const childElement = (_g = (_f = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest("li")) === null || _f === void 0 ? void 0 : _f.querySelector("ul > li")) === null || _g === void 0 ? void 0 : _g.querySelector("button");
              if (childElement) {
                childElement.tabIndex = 0;
                childElement.focus();
              }
            }
          }
          event.preventDefault();
        }
      };
      this.handleKeysCheckbox = (event) => {
        var _a, _b, _c, _d, _e;
        if (!this.treeRef.current.contains(event.target)) {
          return;
        }
        const activeElement = document.activeElement;
        const key = event.key;
        if (key === KeyTypes.Space) {
          activeElement.click();
          event.preventDefault();
        }
        const treeNodes = Array.from((_a = this.treeRef.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName("pf-c-tree-view__node"));
        handleArrows(event, treeNodes, (element) => element.contains(activeElement), (element) => element.querySelector("button,input"), [], void 0, true, true);
        if (["ArrowLeft", "ArrowRight"].includes(key)) {
          if (key === "ArrowLeft") {
            if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "INPUT") {
              ((_b = activeElement === null || activeElement === void 0 ? void 0 : activeElement.parentElement) === null || _b === void 0 ? void 0 : _b.previousSibling) && activeElement.parentElement.previousSibling.focus();
            } else if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.previousSibling) {
              if (((_c = activeElement.previousElementSibling) === null || _c === void 0 ? void 0 : _c.tagName) === "SPAN") {
                activeElement.previousSibling.firstChild.focus();
              } else {
                activeElement.previousSibling.focus();
              }
            }
          } else {
            if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "INPUT") {
              ((_d = activeElement.parentElement) === null || _d === void 0 ? void 0 : _d.nextSibling) && activeElement.parentElement.nextSibling.focus();
            } else if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.nextSibling) {
              if (((_e = activeElement.nextElementSibling) === null || _e === void 0 ? void 0 : _e.tagName) === "SPAN") {
                activeElement.nextSibling.firstChild.focus();
              } else {
                activeElement.nextSibling.focus();
              }
            }
          }
          event.preventDefault();
        }
      };
      this.variantStyleModifiers = {
        default: "",
        compact: import_tree_view2.default.modifiers.compact,
        compactNoBackground: [import_tree_view2.default.modifiers.compact, import_tree_view2.default.modifiers.noBackground]
      };
    }
    componentDidMount() {
      var _a;
      if (canUseDOM) {
        window.addEventListener("keydown", this.props.hasChecks || this.props.hasSelectableNodes ? this.handleKeysCheckbox : this.handleKeys);
      }
      if (this.props.hasChecks || this.props.hasSelectableNodes) {
        const firstToggle = this.treeRef.current.getElementsByClassName("pf-c-tree-view__node-toggle")[0];
        if (firstToggle) {
          firstToggle.tabIndex = 0;
        }
        if (this.props.hasChecks) {
          const firstInput = this.treeRef.current.getElementsByTagName("INPUT")[0];
          if (firstInput) {
            firstInput.tabIndex = 0;
          }
        }
        if (this.props.hasSelectableNodes) {
          const firstTextButton = this.treeRef.current.getElementsByClassName("pf-c-tree-view__node-text")[0];
          if (firstTextButton) {
            firstTextButton.tabIndex = 0;
          }
        }
      } else {
        ((_a = this.treeRef.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName("pf-c-tree-view__node")[0]).tabIndex = 0;
      }
    }
    componentWillUnmount() {
      if (canUseDOM) {
        window.removeEventListener("keydown", this.props.hasChecks || this.props.hasSelectableNodes ? this.handleKeysCheckbox : this.handleKeys);
      }
    }
    render() {
      const _a = this.props, { children, hasChecks, hasGuides, variant, className, hasSelectableNodes } = _a, props = __rest(_a, ["children", "hasChecks", "hasGuides", "variant", "className", "hasSelectableNodes"]);
      return React173.createElement("div", Object.assign({ className: css(import_tree_view2.default.treeView, hasGuides && import_tree_view2.default.modifiers.guides, this.variantStyleModifiers[variant], className), ref: this.treeRef }, props), children);
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeView.js
  var TreeView = (_a) => {
    var { data, isNested = false, hasChecks = false, hasBadges = false, hasGuides = false, hasSelectableNodes = false, variant = "default", defaultAllExpanded = false, allExpanded, icon: icon2, expandedIcon, parentItem, onSelect, onCheck, toolbar, activeItems, compareItems = (item, itemToCheck) => item.id === itemToCheck.id, className, useMemo: useMemo5 } = _a, props = __rest(_a, ["data", "isNested", "hasChecks", "hasBadges", "hasGuides", "hasSelectableNodes", "variant", "defaultAllExpanded", "allExpanded", "icon", "expandedIcon", "parentItem", "onSelect", "onCheck", "toolbar", "activeItems", "compareItems", "className", "useMemo"]);
    const treeViewList = React174.createElement(TreeViewList, { isNested, toolbar }, data.map((item) => {
      var _a2, _b;
      return React174.createElement(TreeViewListItem, Object.assign({ key: ((_a2 = item.id) === null || _a2 === void 0 ? void 0 : _a2.toString()) || ((_b = item.name) === null || _b === void 0 ? void 0 : _b.toString()), name: item.name, title: item.title, id: item.id, isExpanded: allExpanded, isSelectable: hasSelectableNodes, defaultExpanded: item.defaultExpanded !== void 0 ? item.defaultExpanded : defaultAllExpanded, onSelect, onCheck, hasCheck: item.hasCheck !== void 0 ? item.hasCheck : hasChecks, checkProps: item.checkProps, hasBadge: item.hasBadge !== void 0 ? item.hasBadge : hasBadges, customBadgeContent: item.customBadgeContent, badgeProps: item.badgeProps, activeItems, parentItem, itemData: item, icon: item.icon !== void 0 ? item.icon : icon2, expandedIcon: item.expandedIcon !== void 0 ? item.expandedIcon : expandedIcon, action: item.action, compareItems, isCompact: variant === "compact" || variant === "compactNoBackground", useMemo: useMemo5 }, item.children && {
        children: React174.createElement(TreeView, { data: item.children, isNested: true, parentItem: item, hasChecks, hasBadges, hasGuides, hasSelectableNodes, variant, allExpanded, defaultAllExpanded, onSelect, onCheck, activeItems, icon: icon2, expandedIcon })
      }));
    }));
    return React174.createElement(React174.Fragment, null, parentItem ? treeViewList : React174.createElement(TreeViewRoot, Object.assign({ hasSelectableNodes, hasChecks, hasGuides, variant, className }, props), treeViewList));
  };
  TreeView.displayName = "TreeView";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/Wizard.js
  init_tslib_es6();
  var React182 = __toESM(require_react());
  var import_wizard7 = __toESM(require_wizard());

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardFooterInternal.js
  var React175 = __toESM(require_react());
  var import_wizard = __toESM(require_wizard());
  var WizardFooterInternal = ({ onNext, onBack, onClose, isValid, firstStep, activeStep, nextButtonText, backButtonText, cancelButtonText }) => React175.createElement(
    "footer",
    { className: css(import_wizard.default.wizardFooter) },
    React175.createElement(Button, { variant: ButtonVariant.primary, type: "submit", onClick: onNext, isDisabled: !isValid }, nextButtonText),
    !activeStep.hideBackButton && React175.createElement(Button, { variant: ButtonVariant.secondary, onClick: onBack, isDisabled: firstStep }, backButtonText),
    !activeStep.hideCancelButton && React175.createElement(
      "div",
      { className: import_wizard.default.wizardFooterCancel },
      React175.createElement(Button, { variant: ButtonVariant.link, onClick: onClose }, cancelButtonText)
    )
  );
  WizardFooterInternal.displayName = "WizardFooterInternal";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardToggle.js
  var React177 = __toESM(require_react());
  var import_wizard3 = __toESM(require_wizard());

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardBody.js
  var React176 = __toESM(require_react());
  var import_wizard2 = __toESM(require_wizard());

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardDrawerWrapper.js
  var WizardDrawerWrapper = ({ hasDrawer, wrapper, children }) => hasDrawer ? wrapper(children) : children;
  WizardDrawerWrapper.displayName = "WizardDrawerWrapper";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardBody.js
  var WizardBody = ({ children, hasNoBodyPadding = false, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, mainComponent = "div", hasDrawer, isDrawerExpanded, onExpandDrawer, activeStep }) => {
    const MainComponent = mainComponent;
    return React176.createElement(
      MainComponent,
      { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: css(import_wizard2.default.wizardMain) },
      React176.createElement(
        WizardDrawerWrapper,
        { hasDrawer: hasDrawer && activeStep.drawerPanelContent, wrapper: (children2) => React176.createElement(
          Drawer,
          { isInline: true, isExpanded: isDrawerExpanded, onExpand: onExpandDrawer },
          React176.createElement(DrawerContent, { panelContent: activeStep.drawerPanelContent }, children2)
        ) },
        React176.createElement("div", { className: css(import_wizard2.default.wizardMainBody, hasNoBodyPadding && import_wizard2.default.modifiers.noPadding) }, children)
      )
    );
  };
  WizardBody.displayName = "WizardBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardToggle.js
  var WizardToggle = ({ isNavOpen, onNavToggle, nav, steps, activeStep, children, hasNoBodyPadding = false, "aria-label": ariaLabel = "Wizard Toggle", mainAriaLabelledBy = null, mainAriaLabel = null, isInPage = true, hasDrawer, isDrawerExpanded, onExpandDrawer }) => {
    let activeStepIndex;
    let activeStepName;
    let activeStepSubName;
    for (let i = 0; i < steps.length; i++) {
      if (activeStep.id && steps[i].id === activeStep.id || steps[i].name === activeStep.name) {
        activeStepIndex = i + 1;
        activeStepName = steps[i].name;
        break;
      } else if (steps[i].steps) {
        for (const step of steps[i].steps) {
          if (activeStep.id && step.id === activeStep.id || step.name === activeStep.name) {
            activeStepIndex = i + 1;
            activeStepName = steps[i].name;
            activeStepSubName = step.name;
            break;
          }
        }
      }
    }
    return React177.createElement(
      React177.Fragment,
      null,
      React177.createElement(
        "button",
        { onClick: () => onNavToggle(!isNavOpen), className: css(import_wizard3.default.wizardToggle, isNavOpen && "pf-m-expanded"), "aria-label": ariaLabel, "aria-expanded": isNavOpen },
        React177.createElement(
          "span",
          { className: css(import_wizard3.default.wizardToggleList) },
          React177.createElement(
            "span",
            { className: css(import_wizard3.default.wizardToggleListItem) },
            React177.createElement("span", { className: css(import_wizard3.default.wizardToggleNum) }, activeStepIndex),
            " ",
            activeStepName,
            activeStepSubName && React177.createElement(angle_right_icon_default, { className: css(import_wizard3.default.wizardToggleSeparator), "aria-hidden": "true" })
          ),
          activeStepSubName && React177.createElement("span", { className: css(import_wizard3.default.wizardToggleListItem) }, activeStepSubName)
        ),
        React177.createElement(
          "span",
          { className: css(import_wizard3.default.wizardToggleIcon) },
          React177.createElement(caret_down_icon_default, { "aria-hidden": "true" })
        )
      ),
      React177.createElement(
        "div",
        { className: css(import_wizard3.default.wizardOuterWrap) },
        React177.createElement(
          "div",
          { className: css(import_wizard3.default.wizardInnerWrap) },
          nav(isNavOpen),
          React177.createElement(
            WizardBody,
            { mainComponent: isInPage ? "div" : "main", "aria-label": mainAriaLabel, "aria-labelledby": mainAriaLabelledBy, hasNoBodyPadding, activeStep, isDrawerExpanded, onExpandDrawer, hasDrawer },
            hasDrawer && !isDrawerExpanded && activeStep.drawerToggleButton,
            activeStep.component
          )
        ),
        children
      )
    );
  };
  WizardToggle.displayName = "WizardToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardNav.js
  var React178 = __toESM(require_react());
  var import_wizard4 = __toESM(require_wizard());
  var WizardNav = ({ children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, isOpen = false, returnList = false, ouiaId, ouiaSafe = true }) => {
    const ouiaProps = useOUIAProps(WizardNav.displayName, ouiaId, ouiaSafe);
    const innerList = React178.createElement("ol", { className: css(import_wizard4.default.wizardNavList) }, children);
    if (returnList) {
      return innerList;
    }
    return React178.createElement(
      "nav",
      Object.assign({ className: css(import_wizard4.default.wizardNav, isOpen && import_wizard4.default.modifiers.expanded), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }, ouiaProps),
      React178.createElement("ol", { className: css(import_wizard4.default.wizardNavList) }, children)
    );
  };
  WizardNav.displayName = "WizardNav";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardNavItem.js
  init_tslib_es6();
  var React179 = __toESM(require_react());
  var import_wizard5 = __toESM(require_wizard());
  var WizardNavItem = (_a) => {
    var { children = null, content = "", isCurrent = false, isDisabled = false, step, onNavItemClick = () => void 0, navItemComponent = "button", href = null, isExpandable = false, id, ouiaId, ouiaSafe = true } = _a, rest = __rest(_a, ["children", "content", "isCurrent", "isDisabled", "step", "onNavItemClick", "navItemComponent", "href", "isExpandable", "id", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(WizardNavItem.displayName, ouiaId, ouiaSafe);
    const NavItemComponent = navItemComponent;
    const [isExpanded, setIsExpanded] = React179.useState(false);
    React179.useEffect(() => {
      setIsExpanded(isCurrent);
    }, [isCurrent]);
    if (navItemComponent === "a" && !href && true) {
      console.error("WizardNavItem: When using an anchor, please provide an href");
    }
    const btnProps = {
      disabled: isDisabled
    };
    const linkProps = {
      tabIndex: isDisabled ? -1 : void 0,
      href
    };
    return React179.createElement(
      "li",
      { className: css(import_wizard5.default.wizardNavItem, isExpandable && import_wizard5.default.modifiers.expandable, isExpandable && isExpanded && import_wizard5.default.modifiers.expanded) },
      React179.createElement(NavItemComponent, Object.assign({}, rest, navItemComponent === "a" ? Object.assign({}, linkProps) : Object.assign({}, btnProps), id && { id: id.toString() }, { onClick: () => isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(step), className: css(import_wizard5.default.wizardNavLink, isCurrent && import_wizard5.default.modifiers.current, isDisabled && import_wizard5.default.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? "step" : false }, isExpandable && { "aria-expanded": isExpanded }, ouiaProps), isExpandable ? React179.createElement(
        React179.Fragment,
        null,
        React179.createElement("span", { className: css(import_wizard5.default.wizardNavLinkText) }, content),
        React179.createElement(
          "span",
          { className: css(import_wizard5.default.wizardNavLinkToggle) },
          React179.createElement(
            "span",
            { className: css(import_wizard5.default.wizardNavLinkToggleIcon) },
            React179.createElement(angle_right_icon_default, null)
          )
        )
      ) : content),
      children
    );
  };
  WizardNavItem.displayName = "WizardNavItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardContext.js
  var React180 = __toESM(require_react());
  var WizardContext = React180.createContext({
    goToStepById: () => null,
    goToStepByName: () => null,
    onNext: () => null,
    onBack: () => null,
    onClose: () => null,
    activeStep: { name: null }
  });
  var WizardContextProvider = WizardContext.Provider;
  var WizardContextConsumer = WizardContext.Consumer;

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/WizardHeader.js
  var React181 = __toESM(require_react());
  var import_wizard6 = __toESM(require_wizard());
  var WizardHeader = ({ onClose = () => void 0, title, description, hideClose, closeButtonAriaLabel, titleId, descriptionComponent: Component50 = "p", descriptionId }) => React181.createElement(
    "div",
    { className: css(import_wizard6.default.wizardHeader) },
    !hideClose && React181.createElement(
      Button,
      { variant: "plain", className: css(import_wizard6.default.wizardClose), "aria-label": closeButtonAriaLabel, onClick: onClose },
      React181.createElement(times_icon_default, { "aria-hidden": "true" })
    ),
    React181.createElement(Title, { headingLevel: "h2", size: "3xl", className: css(import_wizard6.default.wizardTitle), "aria-label": title, id: titleId }, title || React181.createElement(React181.Fragment, null, "\xA0")),
    description && React181.createElement(Component50, { className: css(import_wizard6.default.wizardDescription), id: descriptionId }, description)
  );
  WizardHeader.displayName = "WizardHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/Wizard/Wizard.js
  var Wizard = class extends React182.Component {
    constructor(props) {
      super(props);
      this.handleKeyClicks = (event) => {
        if (event.key === KeyTypes.Escape) {
          if (this.state.isNavOpen) {
            this.setState({ isNavOpen: !this.state.isNavOpen });
          } else if (this.props.isOpen) {
            this.props.onClose();
          }
        }
      };
      this.onNext = () => {
        const { onNext, onClose, onSave } = this.props;
        const { currentStep } = this.state;
        const flattenedSteps = this.getFlattenedSteps();
        const maxSteps = flattenedSteps.length;
        if (currentStep >= maxSteps) {
          if (onSave) {
            return onSave();
          }
          return onClose();
        } else {
          let newStep = currentStep;
          for (let nextStep = currentStep; nextStep <= maxSteps; nextStep++) {
            if (!flattenedSteps[nextStep]) {
              return;
            }
            if (!flattenedSteps[nextStep].isDisabled) {
              newStep = nextStep + 1;
              break;
            }
          }
          this.setCurrentStep(newStep, flattenedSteps[newStep - 1]);
          const { id: prevId, name: prevName } = flattenedSteps[currentStep - 1];
          const { id, name: name2 } = flattenedSteps[newStep - 1];
          return onNext && onNext({ id, name: name2 }, { prevId, prevName });
        }
      };
      this.onBack = () => {
        const { onBack } = this.props;
        const { currentStep } = this.state;
        const flattenedSteps = this.getFlattenedSteps();
        if (flattenedSteps.length < currentStep) {
          const adjustedStep = flattenedSteps.length;
          this.setCurrentStep(adjustedStep, flattenedSteps[adjustedStep - 1]);
        } else {
          let newStep = currentStep;
          for (let prevStep = currentStep; prevStep >= 0; prevStep--) {
            if (!flattenedSteps[prevStep - 2]) {
              return;
            }
            if (!flattenedSteps[prevStep - 2].isDisabled) {
              newStep = prevStep - 1 <= 1 ? 1 : prevStep - 1;
              break;
            }
          }
          this.setCurrentStep(newStep, flattenedSteps[newStep - 1]);
          const { id: prevId, name: prevName } = flattenedSteps[newStep];
          const { id, name: name2 } = flattenedSteps[newStep - 1];
          return onBack && onBack({ id, name: name2 }, { prevId, prevName });
        }
      };
      this.goToStep = (step) => {
        const flattenedSteps = this.getFlattenedSteps();
        if (flattenedSteps[step - 1].isDisabled) {
          return;
        }
        const { onGoToStep } = this.props;
        const { currentStep } = this.state;
        const maxSteps = flattenedSteps.length;
        if (step < 1) {
          step = 1;
        } else if (step > maxSteps) {
          step = maxSteps;
        }
        this.setCurrentStep(step, flattenedSteps[step - 1]);
        this.setState({ isNavOpen: false });
        const { id: prevId, name: prevName } = flattenedSteps[currentStep - 1];
        const { id, name: name2 } = flattenedSteps[step - 1];
        return onGoToStep && onGoToStep({ id, name: name2 }, { prevId, prevName });
      };
      this.goToStepById = (stepId) => {
        const flattenedSteps = this.getFlattenedSteps();
        let step;
        for (let i = 0; i < flattenedSteps.length; i++) {
          if (flattenedSteps[i].id === stepId) {
            step = i + 1;
            break;
          }
        }
        if (step) {
          this.setCurrentStep(step, flattenedSteps[step - 1]);
        }
      };
      this.goToStepByName = (stepName) => {
        const flattenedSteps = this.getFlattenedSteps();
        let step;
        for (let i = 0; i < flattenedSteps.length; i++) {
          if (flattenedSteps[i].name === stepName) {
            step = i + 1;
            break;
          }
        }
        if (step) {
          this.setCurrentStep(step, flattenedSteps[step - 1]);
        }
      };
      this.getFlattenedSteps = () => {
        const { steps } = this.props;
        const flattenedSteps = [];
        for (const step of steps) {
          if (step.steps) {
            for (const childStep of step.steps) {
              flattenedSteps.push(childStep);
            }
          } else {
            flattenedSteps.push(step);
          }
        }
        return flattenedSteps;
      };
      this.getFlattenedStepsIndex = (flattenedSteps, stepName) => {
        for (let i = 0; i < flattenedSteps.length; i++) {
          if (flattenedSteps[i].name === stepName) {
            return i + 1;
          }
        }
        return 0;
      };
      this.initSteps = (steps) => {
        for (let i = 0; i < steps.length; i++) {
          if (steps[i].steps) {
            for (let j = 0; j < steps[i].steps.length; j++) {
              steps[i].steps[j] = Object.assign({ canJumpTo: true }, steps[i].steps[j]);
            }
          }
          steps[i] = Object.assign({ canJumpTo: true }, steps[i]);
        }
        return steps;
      };
      this.getElement = (appendTo) => {
        if (typeof appendTo === "function") {
          return appendTo();
        }
        return appendTo || document.body;
      };
      const newId = Wizard.currentId++;
      this.titleId = props.titleId || `pf-wizard-title-${newId}`;
      this.descriptionId = props.descriptionId || `pf-wizard-description-${newId}`;
      this.state = {
        currentStep: this.props.startAtStep && Number.isInteger(this.props.startAtStep) ? this.props.startAtStep : 1,
        isNavOpen: false
      };
      if (props.onCurrentStepChanged) {
        const flattenedSteps = this.getFlattenedSteps();
        if (flattenedSteps.length >= this.state.currentStep) {
          const currentStep = flattenedSteps[this.state.currentStep - 1];
          props.onCurrentStepChanged(currentStep);
        }
      }
      this.drawerRef = React182.createRef();
    }
    setCurrentStep(currentStep, currentStepObject) {
      this.setState({
        currentStep
      });
      if (this.props.onCurrentStepChanged) {
        this.props.onCurrentStepChanged(currentStepObject);
      }
    }
    componentDidMount() {
      const target = typeof document !== "undefined" ? document.body : null;
      if (target) {
        target.addEventListener("keydown", this.handleKeyClicks, false);
      }
    }
    componentWillUnmount() {
      const target = typeof document !== "undefined" && document.body || null;
      if (target) {
        target.removeEventListener("keydown", this.handleKeyClicks, false);
      }
    }
    componentDidUpdate(prevProps) {
      if (prevProps.startAtStep !== this.props.startAtStep) {
        this.setState({ currentStep: this.props.startAtStep });
      }
    }
    render() {
      const _a = this.props, {
        /* eslint-disable @typescript-eslint/no-unused-vars */
        width,
        height,
        title,
        description,
        descriptionComponent,
        onClose,
        onSave,
        onBack,
        onNext,
        onGoToStep,
        className,
        steps,
        startAtStep,
        nextButtonText = "Next",
        backButtonText = "Back",
        cancelButtonText = "Cancel",
        hideClose,
        closeButtonAriaLabel = "Close",
        navAriaLabel,
        navAriaLabelledBy,
        mainAriaLabel,
        mainAriaLabelledBy,
        hasNoBodyPadding,
        footer,
        appendTo,
        isOpen,
        titleId,
        descriptionId,
        isNavExpandable,
        onCurrentStepChanged,
        hasDrawer,
        isDrawerExpanded,
        onExpandDrawer
      } = _a, rest = __rest(_a, ["width", "height", "title", "description", "descriptionComponent", "onClose", "onSave", "onBack", "onNext", "onGoToStep", "className", "steps", "startAtStep", "nextButtonText", "backButtonText", "cancelButtonText", "hideClose", "closeButtonAriaLabel", "navAriaLabel", "navAriaLabelledBy", "mainAriaLabel", "mainAriaLabelledBy", "hasNoBodyPadding", "footer", "appendTo", "isOpen", "titleId", "descriptionId", "isNavExpandable", "onCurrentStepChanged", "hasDrawer", "isDrawerExpanded", "onExpandDrawer"]);
      const { currentStep } = this.state;
      const flattenedSteps = this.getFlattenedSteps();
      const adjustedStep = flattenedSteps.length < currentStep ? flattenedSteps.length : currentStep;
      const activeStep = flattenedSteps[adjustedStep - 1];
      const computedSteps = this.initSteps(steps);
      const firstStep = activeStep === flattenedSteps[0];
      const isValid = activeStep && activeStep.enableNext !== void 0 ? activeStep.enableNext : true;
      const nav = (isWizardNavOpen) => {
        const wizNavAProps = {
          isOpen: isWizardNavOpen,
          "aria-label": navAriaLabel,
          "aria-labelledby": (title || navAriaLabelledBy) && (navAriaLabelledBy || this.titleId)
        };
        return React182.createElement(WizardNav, Object.assign({}, wizNavAProps), computedSteps.map((step, index) => {
          if (step.isFinishedStep) {
            return;
          }
          let enabled;
          let navItemStep;
          if (step.steps) {
            let hasActiveChild = false;
            let canJumpToParent = false;
            for (const subStep of step.steps) {
              if (activeStep.name === subStep.name) {
                hasActiveChild = true;
              }
              if (subStep.canJumpTo) {
                canJumpToParent = true;
              }
            }
            navItemStep = this.getFlattenedStepsIndex(flattenedSteps, step.steps[0].name);
            return React182.createElement(
              WizardNavItem,
              { key: index, id: step.id, content: step.name, isExpandable: isNavExpandable, isCurrent: hasActiveChild, isDisabled: !canJumpToParent, step: navItemStep, onNavItemClick: this.goToStep },
              React182.createElement(WizardNav, Object.assign({}, wizNavAProps, { returnList: true }), step.steps.map((childStep, indexChild) => {
                if (childStep.isFinishedStep) {
                  return;
                }
                navItemStep = this.getFlattenedStepsIndex(flattenedSteps, childStep.name);
                enabled = childStep.canJumpTo && !childStep.isDisabled;
                return React182.createElement(WizardNavItem, { key: `child_${indexChild}`, id: childStep.id, content: childStep.name, isCurrent: activeStep.name === childStep.name, isDisabled: !enabled, step: navItemStep, onNavItemClick: this.goToStep });
              }))
            );
          }
          navItemStep = this.getFlattenedStepsIndex(flattenedSteps, step.name);
          enabled = step.canJumpTo && !step.isDisabled;
          return React182.createElement(WizardNavItem, Object.assign({}, step.stepNavItemProps, { key: index, id: step.id, content: step.name, isCurrent: activeStep.name === step.name, isDisabled: !enabled, step: navItemStep, onNavItemClick: this.goToStep }));
        }));
      };
      const context = {
        goToStepById: this.goToStepById,
        goToStepByName: this.goToStepByName,
        onNext: this.onNext,
        onBack: this.onBack,
        onClose,
        activeStep
      };
      const divStyles = Object.assign(Object.assign({}, height ? { height } : {}), width ? { width } : {});
      const wizard = React182.createElement(
        WizardContextProvider,
        { value: context },
        React182.createElement(
          "div",
          Object.assign({}, rest, { className: css(import_wizard7.default.wizard, activeStep && activeStep.isFinishedStep && "pf-m-finished", className), style: Object.keys(divStyles).length ? divStyles : void 0 }),
          title && React182.createElement(WizardHeader, { titleId: this.titleId, descriptionId: this.descriptionId, onClose, title, description, descriptionComponent, closeButtonAriaLabel, hideClose }),
          React182.createElement(WizardToggle, { hasDrawer, isDrawerExpanded, onExpandDrawer, mainAriaLabel, isInPage: isOpen === void 0, mainAriaLabelledBy: (title || mainAriaLabelledBy) && (mainAriaLabelledBy || this.titleId), isNavOpen: this.state.isNavOpen, onNavToggle: (isNavOpen) => this.setState({ isNavOpen }), nav, steps, activeStep, hasNoBodyPadding }, footer || React182.createElement(WizardFooterInternal, { onNext: this.onNext, onBack: this.onBack, onClose, isValid, firstStep, activeStep, nextButtonText: activeStep && activeStep.nextButtonText || nextButtonText, backButtonText, cancelButtonText }))
        )
      );
      if (isOpen !== void 0) {
        return React182.createElement(Modal, { width: width !== null ? width : void 0, isOpen, variant: ModalVariant.large, "aria-labelledby": this.titleId, "aria-describedby": this.descriptionId, showClose: false, hasNoBodyWrapper: true }, wizard);
      }
      return wizard;
    }
  };
  Wizard.displayName = "Wizard";
  Wizard.currentId = 0;
  Wizard.defaultProps = {
    title: null,
    description: "",
    descriptionComponent: "p",
    className: "",
    startAtStep: 1,
    nextButtonText: "Next",
    backButtonText: "Back",
    cancelButtonText: "Cancel",
    hideClose: false,
    closeButtonAriaLabel: "Close",
    navAriaLabel: null,
    navAriaLabelledBy: null,
    mainAriaLabel: null,
    mainAriaLabelledBy: null,
    hasNoBodyPadding: false,
    onBack: null,
    onNext: null,
    onGoToStep: null,
    width: null,
    height: null,
    footer: null,
    onClose: () => void 0,
    appendTo: null,
    isOpen: void 0,
    isNavExpandable: false,
    hasDrawer: false,
    isDrawerExpanded: false,
    onExpandDrawer: () => void 0
  };

  // node_modules/@patternfly/react-core/dist/esm/layouts/Bullseye/Bullseye.js
  init_tslib_es6();
  var React183 = __toESM(require_react());
  var import_bullseye2 = __toESM(require_bullseye());
  var Bullseye = (_a) => {
    var { children = null, className = "", component = "div" } = _a, props = __rest(_a, ["children", "className", "component"]);
    const Component50 = component;
    return React183.createElement(Component50, Object.assign({ className: css(import_bullseye2.default.bullseye, className) }, props), children);
  };
  Bullseye.displayName = "Bullseye";

  // node_modules/@patternfly/react-core/dist/esm/layouts/Grid/Grid.js
  init_tslib_es6();
  var React184 = __toESM(require_react());
  var import_grid = __toESM(require_grid());

  // node_modules/@patternfly/react-core/dist/esm/styles/sizes.js
  var BaseSizes;
  (function(BaseSizes2) {
    BaseSizes2["xs"] = "xs";
    BaseSizes2["sm"] = "sm";
    BaseSizes2["md"] = "md";
    BaseSizes2["lg"] = "lg";
    BaseSizes2["xl"] = "xl";
    BaseSizes2["2xl"] = "2xl";
    BaseSizes2["3xl"] = "3xl";
    BaseSizes2["4xl"] = "4xl";
  })(BaseSizes || (BaseSizes = {}));
  var DeviceSizes;
  (function(DeviceSizes2) {
    DeviceSizes2["sm"] = "Sm";
    DeviceSizes2["md"] = "Md";
    DeviceSizes2["lg"] = "Lg";
    DeviceSizes2["xl"] = "Xl";
    DeviceSizes2["xl2"] = "_2xl";
  })(DeviceSizes || (DeviceSizes = {}));

  // node_modules/@patternfly/react-tokens/dist/esm/l_grid_item_Order.js
  var l_grid_item_Order = {
    "name": "--pf-l-grid--item--Order",
    "value": "0",
    "var": "var(--pf-l-grid--item--Order)"
  };

  // node_modules/@patternfly/react-core/dist/esm/layouts/Grid/Grid.js
  var Grid = (_a) => {
    var { children = null, className = "", component = "div", hasGutter, span = null, order: order2, style } = _a, props = __rest(_a, ["children", "className", "component", "hasGutter", "span", "order", "style"]);
    const classes = [import_grid.default.grid, span && import_grid.default.modifiers[`all_${span}Col`]];
    const Component50 = component;
    Object.entries(DeviceSizes).forEach(([propKey, gridSpanModifier]) => {
      const key = propKey;
      const propValue = props[key];
      if (propValue) {
        classes.push(import_grid.default.modifiers[`all_${propValue}ColOn${gridSpanModifier}`]);
      }
      delete props[key];
    });
    return React184.createElement(Component50, Object.assign({ className: css(...classes, hasGutter && import_grid.default.modifiers.gutter, className), style: style || order2 ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order2, l_grid_item_Order.name)) : void 0 }, props), children);
  };
  Grid.displayName = "Grid";

  // node_modules/@patternfly/react-core/dist/esm/layouts/Grid/GridItem.js
  init_tslib_es6();
  var React185 = __toESM(require_react());
  var import_grid2 = __toESM(require_grid());
  var GridItem = (_a) => {
    var { children = null, className = "", component = "div", span = null, rowSpan = null, offset: offset2 = null, order: order2, style } = _a, props = __rest(_a, ["children", "className", "component", "span", "rowSpan", "offset", "order", "style"]);
    const classes = [
      import_grid2.default.gridItem,
      span && import_grid2.default.modifiers[`${span}Col`],
      rowSpan && import_grid2.default.modifiers[`${rowSpan}Row`],
      offset2 && import_grid2.default.modifiers[`offset_${offset2}Col`]
    ];
    const Component50 = component;
    Object.entries(DeviceSizes).forEach(([propKey, classModifier]) => {
      const key = propKey;
      const rowSpanKey = `${key}RowSpan`;
      const offsetKey = `${key}Offset`;
      const spanValue = props[key];
      const rowSpanValue = props[rowSpanKey];
      const offsetValue = props[offsetKey];
      if (spanValue) {
        classes.push(import_grid2.default.modifiers[`${spanValue}ColOn${classModifier}`]);
      }
      if (rowSpanValue) {
        classes.push(import_grid2.default.modifiers[`${rowSpanValue}RowOn${classModifier}`]);
      }
      if (offsetValue) {
        classes.push(import_grid2.default.modifiers[`offset_${offsetValue}ColOn${classModifier}`]);
      }
      delete props[key];
      delete props[rowSpanKey];
      delete props[offsetKey];
    });
    return React185.createElement(Component50, Object.assign({ className: css(...classes, className), style: style || order2 ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order2, l_grid_item_Order.name)) : void 0 }, props), children);
  };
  GridItem.displayName = "GridItem";

  // src/lib/notifications.jsx
  var DoubleConfirmModal = class extends import_react7.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        actionHandler,
        checked,
        spinning,
        item,
        mTitle,
        mMsg,
        mSpinningMsg,
        mBtnName
      } = this.props;
      let saveDisabled = true;
      let btnName = mBtnName;
      const extraPrimaryProps = {};
      if (checked) {
        saveDisabled = false;
      }
      if (spinning) {
        btnName = mSpinningMsg;
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      return /* @__PURE__ */ import_react7.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: mTitle,
          titleIconVariant: "warning",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react7.default.createElement(
              Button,
              {
                key: "confirm",
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Loading" : void 0,
                variant: "primary",
                onClick: actionHandler,
                isDisabled: saveDisabled || spinning,
                ...extraPrimaryProps
              },
              btnName
            ),
            /* @__PURE__ */ import_react7.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react7.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react7.default.createElement(TextContent, null, /* @__PURE__ */ import_react7.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h3 }, mMsg)), /* @__PURE__ */ import_react7.default.createElement(TextContent, null, /* @__PURE__ */ import_react7.default.createElement(Text, { className: "ds-center ds-margin-top", component: TextVariants.h4 }, /* @__PURE__ */ import_react7.default.createElement("i", null, item))), /* @__PURE__ */ import_react7.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react7.default.createElement(GridItem, { sm: 12, className: "ds-center" }, /* @__PURE__ */ import_react7.default.createElement(
          Checkbox,
          {
            id: "modalChecked",
            isChecked: checked,
            onChange: (checked2, e) => {
              handleChange(e);
            },
            label: /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement("b", null, "Yes"), ", I am sure.")
          }
        ))))
      );
    }
  };
  DoubleConfirmModal.propTypes = {
    showModal: import_prop_types2.default.bool,
    closeHandler: import_prop_types2.default.func,
    handleChange: import_prop_types2.default.func,
    actionHandler: import_prop_types2.default.func,
    spinning: import_prop_types2.default.bool,
    checked: import_prop_types2.default.bool,
    mTitle: import_prop_types2.default.string,
    mMsg: import_prop_types2.default.string,
    mSpinningMsg: import_prop_types2.default.string,
    mBtnName: import_prop_types2.default.string
  };
  DoubleConfirmModal.defaultProps = {
    showModal: false,
    spinning: false,
    item: "",
    checked: false,
    mTitle: "",
    mMsg: "",
    mSpinningMsg: "",
    mBtnName: ""
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/arrows-alt-v-icon.js
  var ArrowsAltVIconConfig = {
    name: "ArrowsAltVIcon",
    height: 512,
    width: 256,
    svgPath: "M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z",
    yOffset: 0,
    xOffset: 0
  };
  var ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
  var arrows_alt_v_icon_default = ArrowsAltVIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/ban-icon.js
  var BanIconConfig = {
    name: "BanIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119.034 8 8 119.033 8 256s111.034 248 248 248 248-111.034 248-248S392.967 8 256 8zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676zM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676z",
    yOffset: 0,
    xOffset: 0
  };
  var BanIcon = createIcon(BanIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/catalog-icon.js
  var CatalogIconConfig = {
    name: "CatalogIcon",
    height: 1024,
    width: 1088,
    svgPath: "M576,160 C687.3,88.6 874.6,32 960,32 L960,800 C898.8,783.1 738,760.5 576,864 L576,160 Z M1024,96 C1088,96 1088,162.8 1088,162.8 L1088,928 C1088,992 985.7,989.9 985.7,989.9 C863.1,804.7 576,992 576,992 L576,925.4 C863,728.7 1024,928 1024,928 L1024,96 Z M128,800 L128,32 C212.9,32 400.6,88.3 512,160 L512,864 C352,760.5 189.3,783.2 128,800 Z M512,925.4 L512,992 C512,992 227.9,805.8 102.5,989.9 C102.5,989.9 0,992 0,928 L0,162.8 C0,162.8 0,96 64,96 L64,928 C64,927.9 226,728.7 512,925.4 Z",
    yOffset: 0,
    xOffset: 0
  };
  var CatalogIcon = createIcon(CatalogIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/cluster-icon.js
  var ClusterIconConfig = {
    name: "ClusterIcon",
    height: 1024,
    width: 1024,
    svgPath: "M1013.1,330.877049 C1005.8,323.577049 997.2,319.977049 987.4,319.977049 L36.6,319.977049 C26.6,319.977049 18.2,323.577049 10.9,330.877049 C3.6,338.177049 0,346.777049 0,356.577049 L0,475.277049 C0,485.277049 3.6,493.677049 10.7,501.077049 C18,508.377049 26.4,511.977049 36.4,511.977049 L987.4,511.977049 C997.4,511.977049 1005.8,508.377049 1013.1,501.077049 C1020.4,493.777049 1024,485.377049 1024,475.377049 L1024,356.577049 C1024,346.577049 1020.4,338.177049 1013.1,330.877049 Z M128,447.977049 L64,447.977049 L64,383.977049 L128,383.977049 L128,447.977049 Z M256,447.977049 L192,447.977049 L192,383.977049 L256,383.977049 L256,447.977049 Z M384,447.977049 L320,447.977049 L320,383.977049 L384,383.977049 L384,447.977049 Z M512,447.977049 L448,447.977049 L448,383.977049 L512,383.977049 L512,447.977049 Z M960,447.977049 L896,447.977049 L896,383.977049 L960,383.977049 L960,447.977049 Z M0,245.177049 C0,235.977049 1.2,234.677049 9.6,226.477049 C9.6,226.477049 151.09,86.2970491 161.6,74.0070491 C172.11,61.7170491 185.5,64.2070491 185.5,64.2070491 L840.62,64.2070491 C840.62,64.2070491 852.42,62.8070491 863.11,74.4070491 C873.61,85.9970491 1013.5,226.407049 1013.5,226.407049 C1021.9,234.807049 1024,236.107049 1024,245.207049 C1024,254.807049 1012.3,256.007049 1000.7,256.007049 L22.1,256.007049 C10.8,256.077049 0,254.377049 0,245.177049 Z M1013.1,842.877049 C1005.8,835.577049 997.2,831.977049 987.4,831.977049 L36.6,831.977049 C26.6,831.977049 18.2,835.577049 10.9,842.877049 C3.6,850.177049 0,858.777049 0,868.577049 L0,987.277049 C0,997.277049 3.6,1005.67705 10.7,1013.07705 C18,1020.37705 26.4,1023.97705 36.4,1023.97705 L987.4,1023.97705 C997.4,1023.97705 1005.8,1020.37705 1013.1,1013.07705 C1020.4,1005.77705 1024,997.377049 1024,987.377049 L1024,868.577049 C1024,858.577049 1020.4,850.177049 1013.1,842.877049 Z M128,959.977049 L64,959.977049 L64,895.977049 L128,895.977049 L128,959.977049 Z M256,959.977049 L192,959.977049 L192,895.977049 L256,895.977049 L256,959.977049 Z M384,959.977049 L320,959.977049 L320,895.977049 L384,895.977049 L384,959.977049 Z M512,959.977049 L448,959.977049 L448,895.977049 L512,895.977049 L512,959.977049 Z M960,959.977049 L896,959.977049 L896,895.977049 L960,895.977049 L960,959.977049 Z M1013.1,586.877049 C1005.8,579.577049 997.2,575.977049 987.4,575.977049 L36.6,575.977049 C26.6,575.977049 18.2,579.577049 10.9,586.877049 C3.6,594.177049 0,602.777049 0,612.577049 L0,731.277049 C0,741.277049 3.6,749.677049 10.7,757.077049 C18,764.377049 26.4,767.977049 36.4,767.977049 L987.4,767.977049 C997.4,767.977049 1005.8,764.377049 1013.1,757.077049 C1020.4,749.777049 1024,741.377049 1024,731.377049 L1024,612.577049 C1024,602.577049 1020.4,594.177049 1013.1,586.877049 Z M128,703.977049 L64,703.977049 L64,639.977049 L128,639.977049 L128,703.977049 Z M256,703.977049 L192,703.977049 L192,639.977049 L256,639.977049 L256,703.977049 Z M384,703.977049 L320,703.977049 L320,639.977049 L384,639.977049 L384,703.977049 Z M512,703.977049 L448,703.977049 L448,639.977049 L512,639.977049 L512,703.977049 Z M960,703.977049 L896,703.977049 L896,639.977049 L960,639.977049 L960,703.977049 Z",
    yOffset: 0,
    xOffset: 0
  };
  var ClusterIcon = createIcon(ClusterIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/cog-icon.js
  var CogIconConfig = {
    name: "CogIcon",
    height: 512,
    width: 512,
    svgPath: "M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z",
    yOffset: 0,
    xOffset: 0
  };
  var CogIcon = createIcon(CogIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/cube-icon.js
  var CubeIconConfig = {
    name: "CubeIcon",
    height: 512,
    width: 512,
    svgPath: "M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z",
    yOffset: 0,
    xOffset: 0
  };
  var CubeIcon = createIcon(CubeIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/database-icon.js
  var DatabaseIconConfig = {
    name: "DatabaseIcon",
    height: 512,
    width: 448,
    svgPath: "M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z",
    yOffset: 0,
    xOffset: 0
  };
  var DatabaseIcon = createIcon(DatabaseIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/domain-icon.js
  var DomainIconConfig = {
    name: "DomainIcon",
    height: 1024,
    width: 1024,
    svgPath: "M544,511.9 C561.476067,511.948945 575.664266,525.962873 575.994253,543.371439 L576,543.9 L576,991.9 C575.951055,1009.37607 561.937127,1023.56427 544.528561,1023.89425 L544,1023.9 L352,1023.9 C334.523933,1023.85105 320.335734,1009.83713 320.005747,992.428561 L320,991.9 L320,543.9 C320.048945,526.423933 334.062873,512.235734 351.471439,511.905747 L352,511.9 L544,511.9 Z M704,576 L704,960 L640,960 L640,576 L704,576 Z M512,896 L384,896 L384,960 L512,960 L512,896 Z M960,513.1 L960,513.2 C960,665.4 884.1,799.9 768,880.9 L768,880.9 L768,799.4 C773.3,794.6 778.4,789.8 783.5,784.7 C855.624209,712.728348 896.108133,614.991161 896,513.1 L896,513.1 L960,513.1 Z M149.8,385 C100.714385,524.561202 135.973879,679.905126 240.5,784.6 C245.5,789.7 250.7,794.6 256,799.3 L256,799.3 L256,880.8 C139.9,799.8 63.9999013,665.3 63.9999013,513.1 C63.9712238,469.725105 70.236499,426.575548 82.6,385 L82.6,385 Z M512.1,704 L384,704 L384,832 L512.1,832 L512.1,704 Z M512,576 L448,576 L448,640 L512,640 L512,576 Z M864,-1.13686838e-13 C881.496381,-1.13686838e-13 895.713128,14.0417829 895.995713,31.4708215 L896,32 L896,406 C896,423.496381 881.958217,437.713128 864.529179,437.995713 L864,438 L608,438 C590.503619,438 576.286872,423.958217 576.004287,406.529179 L576,406 L576,32 C576,14.5036191 590.041783,0.286872383 607.470821,0.00428708574 L608,-1.13686838e-13 L864,-1.13686838e-13 Z M1024,64 L1024,384 L960,384 L960,64 L1024,64 Z M832,256 L640,256 L640,352 L832,352 L832,256 Z M224,-5.68434189e-14 C241.476067,0.0489452394 255.664266,14.0628726 255.994253,31.4714395 L256,32 L256,288 C255.951055,305.476067 241.937127,319.664266 224.528561,319.994253 L224,320 L32,320 C14.5239331,319.951055 0.335734448,305.937127 0.00574685353,288.528561 L0,288 L0,32 C0.0489452394,14.5239331 14.0628726,0.335734448 31.4714395,0.00574685353 L32,-5.68434189e-14 L224,-5.68434189e-14 Z M192,192 L64,192 L64,256 L192,256 L192,192 Z M512,65 L512,129 C460.642759,128.90985 409.795141,139.181409 362.5,159.2 C347.917219,165.399771 333.724426,172.47947 320,180.4 L320,180.4 L320,108.2 C380.012207,79.7623165 445.590913,65.0071076 512,65 L512,65 Z M832,64 L736,64 L736,160 L832,160 L832,64 Z M192,64 L128,64 L128,128 L192,128 L192,64 Z",
    yOffset: 0,
    xOffset: 0
  };
  var DomainIcon = createIcon(DomainIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/ellipsis-h-icon.js
  var EllipsisHIconConfig = {
    name: "EllipsisHIcon",
    height: 512,
    width: 512,
    svgPath: "M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z",
    yOffset: 0,
    xOffset: 0
  };
  var EllipsisHIcon = createIcon(EllipsisHIconConfig);
  var ellipsis_h_icon_default = EllipsisHIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/folder-icon.js
  var FolderIconConfig = {
    name: "FolderIcon",
    height: 512,
    width: 512,
    svgPath: "M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z",
    yOffset: 0,
    xOffset: 0
  };
  var FolderIcon = createIcon(FolderIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/folder-open-icon.js
  var FolderOpenIconConfig = {
    name: "FolderOpenIcon",
    height: 512,
    width: 576,
    svgPath: "M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",
    yOffset: 0,
    xOffset: 0
  };
  var FolderOpenIcon = createIcon(FolderOpenIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/help-icon.js
  var HelpIconConfig = {
    name: "HelpIcon",
    height: 1024,
    width: 1024,
    svgPath: "M521.3,576 C627.5,576 713.7,502 713.7,413.7 C713.7,325.4 627.6,253.6 521.3,253.6 C366,253.6 334.5,337.7 329.2,407.2 C329.2,414.3 335.2,416 343.5,416 L445,416 C450.5,416 458,415.5 460.8,406.5 C460.8,362.6 582.9,357.1 582.9,413.6 C582.9,441.9 556.2,470.9 521.3,473 C486.4,475.1 447.3,479.8 447.3,521.7 L447.3,553.8 C447.3,570.8 456.1,576 472,576 C487.9,576 521.3,576 521.3,576 M575.3,751.3 L575.3,655.3 C575.313862,651.055109 573.620137,646.982962 570.6,644 C567.638831,640.947672 563.552355,639.247987 559.3,639.29884 L463.3,639.29884 C459.055109,639.286138 454.982962,640.979863 452,644 C448.947672,646.961169 447.247987,651.047645 447.29884,655.3 L447.29884,751.3 C447.286138,755.544891 448.979863,759.617038 452,762.6 C454.961169,765.652328 459.047645,767.352013 463.3,767.30116 L559.3,767.30116 C563.544891,767.313862 567.617038,765.620137 570.6,762.6 C573.659349,759.643612 575.360354,755.553963 575.3,751.3 M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.8,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 M512.1,0 C229.7,0 0,229.8 0,512 C0,794.2 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0",
    yOffset: 0,
    xOffset: 0
  };
  var HelpIcon = createIcon(HelpIconConfig);
  var help_icon_default = HelpIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/home-icon.js
  var HomeIconConfig = {
    name: "HomeIcon",
    height: 512,
    width: 576,
    svgPath: "M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z",
    yOffset: 0,
    xOffset: 0
  };
  var HomeIcon = createIcon(HomeIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/key-icon.js
  var KeyIconConfig = {
    name: "KeyIcon",
    height: 1024,
    width: 1024,
    svgPath: "M802,320 C748.980664,320 706,277.019336 706,224 C706,170.980664 748.980664,128 802,128 C855.019336,128 898,170.980664 898,224 C898,277.019336 855.019336,320 802,320 M704,0 C527.3,0 384,143.3 384,320 C383.937788,357.490503 390.505571,394.696657 403.4,429.9 L0,824.1 L0,1024 L192,1024 L192,896 L320,896 L320,768 L448,768 L597,622 C596.906403,621.881923 596.838304,621.745723 596.8,621.6 C631.220126,633.811107 667.47802,640.034477 704,640 C880.7,640 1024,496.7 1024,320 C1024,143.3 880.7,0 704,0",
    yOffset: 0,
    xOffset: 0
  };
  var KeyIcon = createIcon(KeyIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/list-icon.js
  var ListIconConfig = {
    name: "ListIcon",
    height: 512,
    width: 512,
    svgPath: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z",
    yOffset: 0,
    xOffset: 0
  };
  var ListIcon = createIcon(ListIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/lock-icon.js
  var LockIconConfig = {
    name: "LockIcon",
    height: 512,
    width: 448,
    svgPath: "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z",
    yOffset: 0,
    xOffset: 0
  };
  var LockIcon = createIcon(LockIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/long-arrow-alt-down-icon.js
  var LongArrowAltDownIconConfig = {
    name: "LongArrowAltDownIcon",
    height: 512,
    width: 256,
    svgPath: "M168 345.941V44c0-6.627-5.373-12-12-12h-56c-6.627 0-12 5.373-12 12v301.941H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.569 9.373 33.941 0l86.059-86.059c15.119-15.119 4.411-40.971-16.971-40.971H168z",
    yOffset: 0,
    xOffset: 0
  };
  var LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
  var long_arrow_alt_down_icon_default = LongArrowAltDownIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/long-arrow-alt-up-icon.js
  var LongArrowAltUpIconConfig = {
    name: "LongArrowAltUpIcon",
    height: 512,
    width: 256,
    svgPath: "M88 166.059V468c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12V166.059h46.059c21.382 0 32.09-25.851 16.971-40.971l-86.059-86.059c-9.373-9.373-24.569-9.373-33.941 0l-86.059 86.059c-15.119 15.119-4.411 40.971 16.971 40.971H88z",
    yOffset: 0,
    xOffset: 0
  };
  var LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
  var long_arrow_alt_up_icon_default = LongArrowAltUpIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/monitoring-icon.js
  var MonitoringIconConfig = {
    name: "MonitoringIcon",
    height: 1024,
    width: 1088,
    svgPath: "M1088,64 L1088,831.91 L640,831.91 L640,896 L832,896.56 L832,960 L256,960 L256,896.56 L448,896 L448,831.91 L0,831.91 L0,64 L1088,64 Z M960,192 L128,192 L128,704 L960,704 L960,192 Z M848.33,301.46 C869.02,322.16 867.08,350.6 848.33,369.34 L658,559.7 C639.255091,578.443665 608.864909,578.443665 590.12,559.7 L465.65,435.24 L305.94,595 C287.151529,613.484918 256.972593,613.362033 238.33528,594.72472 C219.697967,576.087407 219.575082,545.908471 238.06,527.12 L431.71,333.42 L432.41,332.71 C441.412061,323.705883 453.62271,318.647251 466.355,318.647251 C479.08729,318.647251 491.297939,323.705883 500.3,332.71 L624,457.87 L780.45,301.46 C799.2,282.71 827.64,280.76 848.33,301.46 Z",
    yOffset: 0,
    xOffset: 0
  };
  var MonitoringIcon = createIcon(MonitoringIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/pencil-alt-icon.js
  var PencilAltIconConfig = {
    name: "PencilAltIcon",
    height: 512,
    width: 512,
    svgPath: "M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z",
    yOffset: 0,
    xOffset: 0
  };
  var PencilAltIcon = createIcon(PencilAltIconConfig);
  var pencil_alt_icon_default = PencilAltIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/resources-empty-icon.js
  var ResourcesEmptyIconConfig = {
    name: "ResourcesEmptyIcon",
    height: 1024,
    width: 1024,
    svgPath: "M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.7,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 L512,896 Z M512.1,0 C229.7,0 0,229.8 0,512 C0,794.3 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0 L512.1,0 Z",
    yOffset: 0,
    xOffset: 0
  };
  var ResourcesEmptyIcon = createIcon(ResourcesEmptyIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/route-icon.js
  var RouteIconConfig = {
    name: "RouteIcon",
    height: 512,
    width: 512,
    svgPath: "M416 320h-96c-17.6 0-32-14.4-32-32s14.4-32 32-32h96s96-107 96-160-43-96-96-96-96 43-96 96c0 25.5 22.2 63.4 45.3 96H320c-52.9 0-96 43.1-96 96s43.1 96 96 96h96c17.6 0 32 14.4 32 32s-14.4 32-32 32H185.5c-16 24.8-33.8 47.7-47.3 64H416c52.9 0 96-43.1 96-96s-43.1-96-96-96zm0-256c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zM96 256c-53 0-96 43-96 96s96 160 96 160 96-107 96-160-43-96-96-96zm0 128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z",
    yOffset: 0,
    xOffset: 0
  };
  var RouteIcon = createIcon(RouteIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/sync-alt-icon.js
  var SyncAltIconConfig = {
    name: "SyncAltIcon",
    height: 512,
    width: 512,
    svgPath: "M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z",
    yOffset: 0,
    xOffset: 0
  };
  var SyncAltIcon = createIcon(SyncAltIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/tachometer-alt-icon.js
  var TachometerAltIconConfig = {
    name: "TachometerAltIcon",
    height: 512,
    width: 576,
    svgPath: "M288 32C128.94 32 0 160.94 0 320c0 52.8 14.25 102.26 39.06 144.8 5.61 9.62 16.3 15.2 27.44 15.2h443c11.14 0 21.83-5.58 27.44-15.2C561.75 422.26 576 372.8 576 320c0-159.06-128.94-288-288-288zm0 64c14.71 0 26.58 10.13 30.32 23.65-1.11 2.26-2.64 4.23-3.45 6.67l-9.22 27.67c-5.13 3.49-10.97 6.01-17.64 6.01-17.67 0-32-14.33-32-32S270.33 96 288 96zM96 384c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm48-160c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm246.77-72.41l-61.33 184C343.13 347.33 352 364.54 352 384c0 11.72-3.38 22.55-8.88 32H232.88c-5.5-9.45-8.88-20.28-8.88-32 0-33.94 26.5-61.43 59.9-63.59l61.34-184.01c4.17-12.56 17.73-19.45 30.36-15.17 12.57 4.19 19.35 17.79 15.17 30.36zm14.66 57.2l15.52-46.55c3.47-1.29 7.13-2.23 11.05-2.23 17.67 0 32 14.33 32 32s-14.33 32-32 32c-11.38-.01-20.89-6.28-26.57-15.22zM480 384c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z",
    yOffset: 0,
    xOffset: 0
  };
  var TachometerAltIcon = createIcon(TachometerAltIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/topology-icon.js
  var TopologyIconConfig = {
    name: "TopologyIcon",
    height: 1024,
    width: 1088,
    svgPath: "M877.8,0 C797.1,0 731.5,65.6 731.5,146.3 C731.5,175.1 739.7,201.8 754.1,224.5 L670,310.5 C626.5,276.4 571.7,256 512,256 C477.8,256 445.1,262.7 415.3,274.9 L388.6,239.6 C375.1,221.3 350.9,216.1 334.9,228.2 C318.7,240.1 316.4,264.8 329.6,283.1 L351.9,312.3 C293.4,359.2 256,431.2 256,512 C256,534.7 259,556.7 264.5,577.7 L239,590.9 C219.8,600.3 210.7,622.9 218.4,641.2 C226.1,659.5 248.3,666.8 267.3,657.7 L292.9,644.4 C329.1,704.2 389.1,748 459.8,762.6 L453.8,835.6 C413.5,847.1 384,884.1 384,928 C384,981 427,1024 480,1024 C533,1024 576,981 576,928 C576,888.3 551.9,854.3 517.6,839.7 L523.5,767.8 C605.3,764.2 677.2,722.1 721.4,659.2 L789.8,705.8 C808.1,718.4 832.1,714.9 842.8,698 C853.5,680.9 847.3,656.9 828.8,644.6 L754.6,594.1 C763.3,568.3 768,540.7 768,512 C768,456.6 750.4,405.3 720.5,363.5 L807.4,274.8 C828.2,286.2 852.2,292.9 877.8,292.9 C958.5,292.9 1024.1,227.3 1024.1,146.6 C1024.1,65.9 958.5,0 877.8,0 Z M528,928 C528,954.5 506.5,976 480,976 C453.5,976 432,954.5 432,928 C432,901.5 453.5,880 480,880 C506.5,880 528,901.5 528,928 Z M512,640 C441.3,640 384,582.7 384,512 C384,441.3 441.3,384 512,384 C582.7,384 640,441.3 640,512 C640,582.7 582.8,640 512,640 Z M877.8,224 C834.8,224 800.1,189.3 800.1,146.3 C800.1,103.3 834.8,68.6 877.8,68.6 C920.8,68.6 955.5,103.3 955.5,146.3 C955.5,189.3 920.8,224 877.8,224 Z M900.8,712.3 C943.6,669.5 1013.1,669.5 1055.9,712.3 C1077.3,733.7 1088,761.8 1088,789.9 C1088,818 1077.3,846 1055.9,867.5 C1013.1,910.3 943.6,910.3 900.8,867.5 C858,824.6 858,755.2 900.8,712.3 M256,2.3 C316.6,2.3 365.7,51.4 365.7,112 C365.7,172.6 316.6,221.7 256,221.7 C195.4,221.7 146.3,172.6 146.3,112 C146.3,51.4 195.4,2.3 256,2.3 M96,608 C149,608 192,651 192,704 C192,757 149,800 96,800 C43,800 0,757 0,704 C0,651 43,608 96,608",
    yOffset: 0,
    xOffset: 0
  };
  var TopologyIcon = createIcon(TopologyIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/user-icon.js
  var UserIconConfig = {
    name: "UserIcon",
    height: 512,
    width: 448,
    svgPath: "M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z",
    yOffset: 0,
    xOffset: 0
  };
  var UserIcon = createIcon(UserIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/users-icon.js
  var UsersIconConfig = {
    name: "UsersIcon",
    height: 512,
    width: 640,
    svgPath: "M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z",
    yOffset: 0,
    xOffset: 0
  };
  var UsersIcon = createIcon(UsersIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/wrench-icon.js
  var WrenchIconConfig = {
    name: "WrenchIcon",
    height: 512,
    width: 512,
    svgPath: "M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z",
    yOffset: 0,
    xOffset: 0
  };
  var WrenchIcon = createIcon(WrenchIconConfig);

  // src/lib/plugins/pluginTables.jsx
  var import_react8 = __toESM(require_react(), 1);

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Table.js
  init_tslib_es6();
  var React226 = __toESM(require_react());
  var import_inline_edit3 = __toESM(require_inline_edit());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/provider.js
  init_tslib_es6();
  var React212 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/TableComposable.js
  init_tslib_es6();
  var React187 = __toESM(require_react());
  var import_table = __toESM(require_table());
  var import_table_grid = __toESM(require_table_grid());
  var import_table_tree_view = __toESM(require_table_tree_view());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/utils.js
  var hasCompoundParentsExpanded = (parentId2, compoundParent, rows) => {
    for (const i of rows) {
      if (rows[parentId2].hasOwnProperty("parent")) {
        parentId2 = rows[parentId2].parent;
      } else {
        return rows[parentId2].cells[compoundParent].props.isOpen;
      }
    }
    return false;
  };
  var hasParentsExpanded = (parentId2, rows) => {
    for (const i of rows) {
      if (rows[parentId2].hasOwnProperty("parent")) {
        parentId2 = rows[parentId2].parent;
      } else {
        return rows[parentId2].isOpen;
      }
    }
    return false;
  };
  var isRowExpanded = (row, rows) => {
    if (row.parent !== void 0) {
      if (row.hasOwnProperty("compoundParent")) {
        return hasCompoundParentsExpanded(row.parent, row.compoundParent, rows);
      }
      return hasParentsExpanded(row.parent, rows) && rows[row.parent].isOpen;
    }
    return void 0;
  };
  var getErrorTextByValidator = (validatorName, validators) => {
    const result = validators.filter((validator) => validator.name === validatorName);
    return result[0].errorText;
  };
  var cancelCellEdits = (row) => {
    row.cells.forEach((cell) => {
      delete cell.props.errorText;
      delete cell.props.editableValue;
      cell.props.isValid = true;
      if (cell.props.selected) {
        cell.props.selected = cell.props.value;
      }
    });
    row.isEditable = !row.isEditable;
    row.isValid = true;
    return row;
  };
  var validateCellEdits = (row, type, validationErrors, missingPropErrorTxt = "Validation requires unique name property for row cells") => {
    row.isValid = Object.keys(validationErrors).length ? false : true;
    row.cells.forEach((cell) => {
      delete cell.props.errorText;
      const hasValue = cell.props.value !== void 0 && cell.props.value !== null;
      const hasEditableValue = cell.props.editableValue !== void 0 && cell.props.editableValue !== null;
      if (cell.props && hasValue && hasEditableValue) {
        if (type === "save") {
          const errorMsg = Object.keys(validationErrors).filter((validatorName) => validationErrors[validatorName].includes(cell.props.name)).map((validatorName) => getErrorTextByValidator(validatorName, row.rowEditValidationRules));
          if (errorMsg.length) {
            cell.props.errorText = cell.props.name ? errorMsg.join(", ") : missingPropErrorTxt;
            if (cell.props.name === void 0) {
              console.warn("Row edit validation reporting requires cell definitions to have a unique name property.");
            }
          } else {
            delete cell.props.errorText;
            cell.props.isValid = true;
          }
        }
      }
    });
    return row;
  };
  var applyCellEdits = (row, type) => {
    row.cells.forEach((cell) => {
      delete cell.props.errorText;
      const hasValue = cell.props.value !== void 0 && cell.props.value !== null;
      const hasEditableValue = cell.props.editableValue !== void 0 && cell.props.editableValue !== null;
      if (hasValue && !hasEditableValue) {
        cell.props.editableValue = cell.props.value;
      }
      if (cell.props && hasValue && hasEditableValue) {
        if (type === "save") {
          cell.props.value = cell.props.editableValue;
          cell.props.isValid = true;
          delete cell.props.errorText;
        }
        delete cell.props.editableValue;
      }
    });
    row.isEditable = !row.isEditable;
    row.isValid = true;
    return row;
  };
  var camelize2 = (s2) => s2.toUpperCase().replace("-", "").replace("_", "");
  var toCamel2 = (s2) => s2.replace(/([-_][a-z])/gi, camelize2);
  function capitalize2(input) {
    return input[0].toUpperCase() + input.substring(1);
  }

  // node_modules/@patternfly/react-table/dist/esm/components/Table/TableTypes.js
  var TableGridBreakpoint;
  (function(TableGridBreakpoint2) {
    TableGridBreakpoint2["none"] = "";
    TableGridBreakpoint2["grid"] = "grid";
    TableGridBreakpoint2["gridMd"] = "grid-md";
    TableGridBreakpoint2["gridLg"] = "grid-lg";
    TableGridBreakpoint2["gridXl"] = "grid-xl";
    TableGridBreakpoint2["grid2xl"] = "grid-2xl";
  })(TableGridBreakpoint || (TableGridBreakpoint = {}));
  var TableVariant;
  (function(TableVariant2) {
    TableVariant2["compact"] = "compact";
  })(TableVariant || (TableVariant = {}));

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/TableComposable.js
  var TableComposableContext = React187.createContext({
    registerSelectableRow: () => {
    }
  });
  var TableComposableBase = (_a) => {
    var _b, _c;
    var {
      children,
      className,
      variant,
      borders = true,
      isStickyHeader = false,
      gridBreakPoint = TableGridBreakpoint.gridMd,
      "aria-label": ariaLabel,
      role = "grid",
      innerRef,
      ouiaId,
      ouiaSafe = true,
      isTreeTable = false,
      isNested = false,
      isStriped = false,
      isExpandable = false,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      nestedHeaderColumnSpans,
      hasSelectableRowCaption,
      selectableRowCaptionText
    } = _a, props = __rest(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", "aria-label", "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "nestedHeaderColumnSpans", "hasSelectableRowCaption", "selectableRowCaptionText"]);
    const ref = React187.useRef(null);
    const tableRef = innerRef || ref;
    const [hasSelectableRows, setHasSelectableRows] = React187.useState(false);
    const [tableCaption, setTableCaption] = React187.useState();
    React187.useEffect(() => {
      document.addEventListener("keydown", handleKeys);
      if (tableRef && tableRef.current && tableRef.current.classList.contains("pf-m-tree-view")) {
        const tbody = tableRef.current.querySelector("tbody");
        tbody && setTabIndex(Array.from(tbody.querySelectorAll("button, a, input")));
      }
      return function cleanup() {
        document.removeEventListener("keydown", handleKeys);
      };
    }, [tableRef, tableRef.current]);
    React187.useEffect(() => {
      if (selectableRowCaptionText) {
        setTableCaption(React187.createElement(
          "caption",
          null,
          selectableRowCaptionText,
          React187.createElement("div", { className: "pf-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")
        ));
      } else {
        setTableCaption(React187.createElement("caption", { className: "pf-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
      }
    }, [selectableRowCaptionText]);
    const ouiaProps = useOUIAProps("Table", ouiaId, ouiaSafe);
    const grid = (_b = import_table_grid.default.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel2(gridBreakPoint || "").replace(/-?2xl/, "_2xl")];
    const breakPointPrefix = `treeView${gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1)}`;
    const treeGrid = (_c = import_table_tree_view.default.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel2(breakPointPrefix || "").replace(/-?2xl/, "_2xl")];
    const handleKeys = (event) => {
      if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains("pf-m-tree-view")) || // implements roving tab-index to tree tables only
      tableRef && tableRef.current !== event.target.closest(".pf-c-table:not(.pf-m-nested)")) {
        return;
      }
      const activeElement = document.activeElement;
      const key = event.key;
      const rows = Array.from(tableRef.current.querySelectorAll("tbody tr")).filter((el) => !el.classList.contains("pf-m-disabled") && !el.hidden);
      if (key === "Space" || key === "Enter") {
        activeElement.click();
        event.preventDefault();
      }
      const getFocusableElement = (element) => element.querySelectorAll("button:not(:disabled), input:not(:disabled), a:not(:disabled)")[0];
      handleArrows(event, rows, (element) => element === activeElement.closest("tr"), getFocusableElement, ["button", "input", "a"], void 0, false, true, false);
    };
    const registerSelectableRow = () => {
      !hasSelectableRows && setHasSelectableRows(true);
    };
    return React187.createElement(
      TableComposableContext.Provider,
      { value: { registerSelectableRow } },
      React187.createElement(
        "table",
        Object.assign({ "aria-label": ariaLabel, role, className: css(className, import_table.default.table, isTreeTable ? treeGrid : grid, import_table.default.modifiers[variant], !borders && import_table.default.modifiers.noBorderRows, isStickyHeader && import_table.default.modifiers.stickyHeader, isTreeTable && import_table_tree_view.default.modifiers.treeView, isStriped && import_table.default.modifiers.striped, isExpandable && import_table.default.modifiers.expandable, isNested && "pf-m-nested"), ref: tableRef }, isTreeTable && { role: "treegrid" }, ouiaProps, props),
        hasSelectableRowCaption && hasSelectableRows && tableCaption,
        children
      )
    );
  };
  var TableComposable = React187.forwardRef((props, ref) => React187.createElement(TableComposableBase, Object.assign({}, props, { innerRef: ref })));
  TableComposable.displayName = "TableComposable";

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/Thead.js
  init_tslib_es6();
  var React188 = __toESM(require_react());
  var import_table2 = __toESM(require_table());
  var TheadBase = (_a) => {
    var { children, className, noWrap = false, innerRef, hasNestedHeader } = _a, props = __rest(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
    return React188.createElement("thead", Object.assign({ className: css(className, noWrap && import_table2.default.modifiers.nowrap, hasNestedHeader && import_table2.default.modifiers.nestedColumnHeader), ref: innerRef }, props), children);
  };
  var Thead = React188.forwardRef((props, ref) => React188.createElement(TheadBase, Object.assign({}, props, { innerRef: ref })));
  Thead.displayName = "Thead";

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/Tbody.js
  init_tslib_es6();
  var React189 = __toESM(require_react());
  var import_table3 = __toESM(require_table());
  var TbodyBase = (_a) => {
    var { children, className, isExpanded, innerRef, isEvenStriped = false, isOddStriped = false } = _a, props = __rest(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
    return React189.createElement("tbody", Object.assign({ role: "rowgroup", className: css(className, isExpanded && import_table3.default.modifiers.expanded, isOddStriped && import_table3.default.modifiers.striped, isEvenStriped && import_table3.default.modifiers.stripedEven), ref: innerRef }, props), children);
  };
  var Tbody = React189.forwardRef((props, ref) => React189.createElement(TbodyBase, Object.assign({}, props, { innerRef: ref })));
  Tbody.displayName = "Tbody";

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/Tr.js
  init_tslib_es6();
  var React190 = __toESM(require_react());
  var import_table4 = __toESM(require_table());
  var import_inline_edit = __toESM(require_inline_edit());
  var TrBase = (_a) => {
    var { children, className, isExpanded, isEditable, isHidden: isHidden3 = false, isHoverable = false, isRowSelected = false, isStriped = false, isBorderRow = false, innerRef, ouiaId, ouiaSafe = true, resetOffset = false, onRowClick, isSelectable, "aria-label": passedAriaLabel } = _a, props = __rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isHoverable", "isRowSelected", "isStriped", "isBorderRow", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", "aria-label"]);
    const ouiaProps = useOUIAProps("TableRow", ouiaId, ouiaSafe);
    const [computedAriaLabel, setComputedAriaLabel] = React190.useState("");
    let onKeyDown = null;
    if (onRowClick) {
      onKeyDown = (e) => {
        if (e.key === "Enter" || e.key === " ") {
          onRowClick(e);
          e.preventDefault();
        }
      };
    }
    const rowIsHidden = isHidden3 || isExpanded !== void 0 && !isExpanded;
    const { registerSelectableRow } = React190.useContext(TableComposableContext);
    React190.useEffect(() => {
      if (isSelectable && !rowIsHidden) {
        setComputedAriaLabel(`${isRowSelected ? "Row selected" : ""}`);
        registerSelectableRow();
      } else {
        setComputedAriaLabel(void 0);
      }
    }, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
    const ariaLabel = passedAriaLabel || computedAriaLabel;
    return React190.createElement(
      React190.Fragment,
      null,
      isSelectable && React190.createElement("output", { className: "pf-screen-reader" }, ariaLabel),
      React190.createElement("tr", Object.assign({ className: css(className, isExpanded !== void 0 && import_table4.default.tableExpandableRow, isExpanded && import_table4.default.modifiers.expanded, isEditable && import_inline_edit.default.modifiers.inlineEditable, isHoverable && import_table4.default.modifiers.hoverable, isRowSelected && import_table4.default.modifiers.selected, isStriped && import_table4.default.modifiers.striped, isBorderRow && import_table4.default.modifiers.borderRow, resetOffset && import_table4.default.modifiers.firstCellOffsetReset), hidden: rowIsHidden }, isHoverable && { tabIndex: 0 }, { "aria-label": ariaLabel, ref: innerRef }, onRowClick && { onClick: onRowClick, onKeyDown }, ouiaProps, props), children)
    );
  };
  var Tr = React190.forwardRef((props, ref) => React190.createElement(TrBase, Object.assign({}, props, { innerRef: ref })));
  Tr.displayName = "Tr";

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/Th.js
  init_tslib_es6();
  var React202 = __toESM(require_react());
  var import_table16 = __toESM(require_table());
  var import_table_scrollable = __toESM(require_table_scrollable());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/info.js
  var React193 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/HeaderCellInfoWrapper.js
  var React192 = __toESM(require_react());
  var import_table6 = __toESM(require_table());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/TableText.js
  init_tslib_es6();
  var React191 = __toESM(require_react());
  var import_table5 = __toESM(require_table());
  var TableTextVariant;
  (function(TableTextVariant2) {
    TableTextVariant2["div"] = "div";
    TableTextVariant2["nav"] = "nav";
  })(TableTextVariant || (TableTextVariant = {}));
  var WrapModifier;
  (function(WrapModifier2) {
    WrapModifier2["wrap"] = "wrap";
    WrapModifier2["nowrap"] = "nowrap";
    WrapModifier2["truncate"] = "truncate";
    WrapModifier2["breakWord"] = "breakWord";
    WrapModifier2["fitContent"] = "fitContent";
  })(WrapModifier || (WrapModifier = {}));
  var TableText = (_a) => {
    var { children = null, className = "", variant = "span", wrapModifier = null, tooltip: tooltipProp = "", tooltipProps = {}, onMouseEnter: onMouseEnterProp = () => {
    } } = _a, props = __rest(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter"]);
    const Component50 = variant;
    const [tooltip, setTooltip] = React191.useState("");
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        setTooltip(tooltipProp || event.target.innerText);
      } else {
        setTooltip("");
      }
      onMouseEnterProp(event);
    };
    const text = React191.createElement(Component50, Object.assign({ onMouseEnter, className: css(className, wrapModifier && import_table5.default.modifiers[wrapModifier], import_table5.default.tableText) }, props), children);
    return tooltip !== "" ? React191.createElement(Tooltip, Object.assign({ content: tooltip, isVisible: true }, tooltipProps), text) : text;
  };
  TableText.displayName = "TableText";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/HeaderCellInfoWrapper.js
  var HeaderCellInfoWrapper = ({ children, info: info2, className, variant = "tooltip", popoverProps, tooltipProps, ariaLabel }) => React192.createElement(
    "div",
    { className: css(import_table6.default.tableColumnHelp, className) },
    typeof children === "string" ? React192.createElement(TableText, null, children) : children,
    React192.createElement("span", { className: css(import_table6.default.tableColumnHelpAction) }, variant === "tooltip" ? React192.createElement(
      Tooltip,
      Object.assign({ content: info2 }, tooltipProps),
      React192.createElement(
        Button,
        { variant: "plain", "aria-label": ariaLabel || typeof info2 === "string" && info2 || "More info" },
        React192.createElement(help_icon_default, { noVerticalAlign: true })
      )
    ) : React192.createElement(
      Popover,
      Object.assign({ bodyContent: info2 }, popoverProps),
      React192.createElement(
        Button,
        { variant: "plain", "aria-label": ariaLabel || typeof info2 === "string" && info2 || "More info" },
        React192.createElement(help_icon_default, { noVerticalAlign: true })
      )
    ))
  );
  HeaderCellInfoWrapper.displayName = "HeaderCellInfoWrapper";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/info.js
  var import_table7 = __toESM(require_table());
  var info = ({ tooltip, tooltipProps, popover, popoverProps, className, ariaLabel }) => {
    const infoObj = (value) => ({
      className: import_table7.default.modifiers.help,
      children: tooltip ? React193.createElement(HeaderCellInfoWrapper, { variant: "tooltip", info: tooltip, tooltipProps, ariaLabel, className }, value) : React193.createElement(HeaderCellInfoWrapper, { variant: "popover", info: popover, popoverProps, ariaLabel, className }, value)
    });
    return infoObj;
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/sortable.js
  var React195 = __toESM(require_react());
  var import_table9 = __toESM(require_table());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/SortColumn.js
  init_tslib_es6();
  var React194 = __toESM(require_react());
  var import_table8 = __toESM(require_table());
  var SortByDirection;
  (function(SortByDirection2) {
    SortByDirection2["asc"] = "asc";
    SortByDirection2["desc"] = "desc";
  })(SortByDirection || (SortByDirection = {}));
  var SortColumn = (_a) => {
    var { children = null, className = "", isSortedBy = false, onSort = null, sortDirection = "", type = "button" } = _a, props = __rest(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type"]);
    let SortedByIcon;
    if (isSortedBy) {
      SortedByIcon = sortDirection === SortByDirection.asc ? long_arrow_alt_up_icon_default : long_arrow_alt_down_icon_default;
    } else {
      SortedByIcon = arrows_alt_v_icon_default;
    }
    return React194.createElement(
      "button",
      Object.assign({}, props, { type, className: css(className, import_table8.default.tableButton), onClick: (event) => onSort && onSort(event) }),
      React194.createElement(
        "div",
        { className: css(className, import_table8.default.tableButtonContent) },
        React194.createElement(TableText, null, children),
        React194.createElement(
          "span",
          { className: css(import_table8.default.tableSortIndicator) },
          React194.createElement(SortedByIcon, null)
        )
      )
    );
  };
  SortColumn.displayName = "SortColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/sortable.js
  var sortableFavorites = (sort) => () => sortable(React195.createElement(star_icon_default, { "aria-hidden": true }), {
    columnIndex: sort.columnIndex,
    className: import_table9.default.modifiers.favorite,
    ariaLabel: "Sort favorites",
    column: {
      extraParams: {
        sortBy: sort.sortBy,
        onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
      }
    }
  });
  var sortable = (label, { columnIndex, column, property, className, ariaLabel }) => {
    const { extraParams: { sortBy, onSort } } = column;
    const extraData = {
      columnIndex,
      column,
      property
    };
    const isSortedBy = sortBy && columnIndex === sortBy.index;
    function sortClicked(event) {
      let reversedDirection;
      if (!isSortedBy) {
        reversedDirection = sortBy.defaultDirection ? sortBy.defaultDirection : SortByDirection.asc;
      } else {
        reversedDirection = sortBy.direction === SortByDirection.asc ? SortByDirection.desc : SortByDirection.asc;
      }
      onSort && onSort(event, columnIndex, reversedDirection, extraData);
    }
    return {
      className: css(import_table9.default.tableSort, isSortedBy && import_table9.default.modifiers.selected, className),
      "aria-sort": isSortedBy ? `${sortBy.direction}ending` : "none",
      children: React195.createElement(SortColumn, { isSortedBy, sortDirection: isSortedBy ? sortBy.direction : "", onSort: sortClicked, "aria-label": ariaLabel }, label)
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/selectable.js
  var React197 = __toESM(require_react());
  var import_table10 = __toESM(require_table());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/SelectColumn.js
  init_tslib_es6();
  var React196 = __toESM(require_react());
  var RowSelectVariant;
  (function(RowSelectVariant2) {
    RowSelectVariant2["radio"] = "radio";
    RowSelectVariant2["checkbox"] = "checkbox";
  })(RowSelectVariant || (RowSelectVariant = {}));
  var SelectColumn = (_a) => {
    var {
      children = null,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className,
      onSelect = null,
      selectVariant
    } = _a, props = __rest(_a, ["children", "className", "onSelect", "selectVariant"]);
    return React196.createElement(
      React196.Fragment,
      null,
      React196.createElement(
        "label",
        null,
        React196.createElement("input", Object.assign({}, props, { type: selectVariant, onChange: onSelect }))
      ),
      children
    );
  };
  SelectColumn.displayName = "SelectColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/selectable.js
  var import_check3 = __toESM(require_check());
  var selectable = (label, { rowIndex, columnIndex, rowData, column, property }) => {
    const { extraParams: { onSelect, selectVariant, allRowsSelected, isHeaderSelectDisabled } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property
    };
    if (rowData && rowData.hasOwnProperty("parent") && !rowData.showSelect && !rowData.fullWidth) {
      return {
        component: "td",
        isVisible: true
      };
    }
    const rowId = rowIndex !== void 0 ? rowIndex : -1;
    function selectClick(event) {
      const selected = rowIndex === void 0 ? event.currentTarget.checked : rowData && !rowData.selected;
      onSelect && onSelect(event, selected, rowId, rowData, extraData);
    }
    const customProps = Object.assign(Object.assign(Object.assign({}, rowId !== -1 ? {
      checked: rowData && !!rowData.selected,
      "aria-label": `Select row ${rowIndex}`
    } : {
      checked: allRowsSelected,
      "aria-label": "Select all rows"
    }), rowData && (rowData.disableCheckbox || rowData.disableSelection) && {
      disabled: true,
      className: import_check3.default.checkInput
    }), !rowData && isHeaderSelectDisabled && { disabled: true });
    let selectName = "check-all";
    if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
      selectName = `checkrow${rowIndex}`;
    } else if (rowId !== -1) {
      selectName = "radioGroup";
    }
    return {
      className: css(import_table10.default.tableCheck),
      component: "td",
      isVisible: !rowData || !rowData.fullWidth,
      children: React197.createElement(SelectColumn, Object.assign({}, customProps, { selectVariant, onSelect: selectClick, name: selectName }), label)
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/collapsible.js
  var React200 = __toESM(require_react());
  var import_table13 = __toESM(require_table());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/CollapseColumn.js
  init_tslib_es6();
  var React198 = __toESM(require_react());
  var import_table11 = __toESM(require_table());
  var CollapseColumn = (_a) => {
    var { className = "", children = null, isOpen, onToggle } = _a, props = __rest(_a, ["className", "children", "isOpen", "onToggle"]);
    return React198.createElement(
      React198.Fragment,
      null,
      isOpen !== void 0 && React198.createElement(
        Button,
        Object.assign({ className: css(className, isOpen && import_table11.default.modifiers.expanded) }, props, { variant: "plain", "aria-label": props["aria-label"] || "Details", onClick: onToggle, "aria-expanded": isOpen }),
        React198.createElement(
          "div",
          { className: css(import_table11.default.tableToggleIcon) },
          React198.createElement(angle_down_icon_default, null)
        )
      ),
      children
    );
  };
  CollapseColumn.displayName = "CollapseColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/ExpandableRowContent.js
  init_tslib_es6();
  var React199 = __toESM(require_react());
  var import_table12 = __toESM(require_table());
  var ExpandableRowContent = (_a) => {
    var { children = null } = _a, props = __rest(_a, ["children"]);
    return React199.createElement("div", Object.assign({}, props, { className: css(import_table12.default.tableExpandableRowContent) }), children);
  };
  ExpandableRowContent.displayName = "ExpandableRowContent";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/collapsible.js
  var collapsible = (value, { rowIndex, columnIndex, rowData, column, property }) => {
    const { extraParams: { onCollapse, rowLabeledBy = "simple-node", expandId = "expand-toggle", allRowsExpanded, collapseAllAriaLabel } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property
    };
    const rowId = rowIndex !== void 0 ? rowIndex : -1;
    const customProps = Object.assign({}, rowId !== -1 ? {
      isOpen: rowData === null || rowData === void 0 ? void 0 : rowData.isOpen,
      "aria-labelledby": `${rowLabeledBy}${rowId} ${expandId}${rowId}`
    } : {
      isOpen: allRowsExpanded,
      "aria-label": collapseAllAriaLabel || "Expand all rows"
    });
    function onToggle(event) {
      const open = rowData ? !rowData.isOpen : !allRowsExpanded;
      onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
    }
    return {
      className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== void 0 || rowId === -1) && css(import_table13.default.tableToggle),
      isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
      children: React200.createElement(CollapseColumn, Object.assign({ "aria-labelledby": `${rowLabeledBy}${rowId} ${expandId}${rowId}`, onToggle, id: expandId + rowId }, customProps), value)
    };
  };
  var expandable = (value, { rowData }) => rowData && rowData.hasOwnProperty("parent") ? React200.createElement(ExpandableRowContent, null, value) : value;
  var expandedRow = (colSpan, additionalColSpan = 0) => {
    const expandedRowFormatter = (value, { columnIndex, rowIndex, rowData, column: { extraParams: { contentId = "expanded-content" } } }) => value && rowData.hasOwnProperty("parent") && {
      colSpan: !rowData.cells || rowData.cells.length === 1 ? colSpan + (rowData.fullWidth ? additionalColSpan + 1 : 0) : 1,
      id: contentId + rowIndex + (columnIndex ? "-" + columnIndex : ""),
      className: rowData.noPadding && css(import_table13.default.modifiers.noPadding)
    };
    return expandedRowFormatter;
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/cellWidth.js
  var import_table14 = __toESM(require_table());
  var cellWidth = (width) => () => ({
    className: css(import_table14.default.modifiers[typeof width === "number" ? `width_${width}` : `width${capitalize2(width)}`])
  });

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/classNames.js
  var import_table15 = __toESM(require_table());
  var visibilityModifiers = [
    "hidden",
    "hiddenOnSm",
    "hiddenOnMd",
    "hiddenOnLg",
    "hiddenOnXl",
    "hiddenOn_2xl",
    "visibleOnSm",
    "visibleOnMd",
    "visibleOnLg",
    "visibleOnXl",
    "visibleOn_2xl"
  ];
  var Visibility = visibilityModifiers.filter((key) => import_table15.default.modifiers[key]).reduce((acc, curr) => {
    const key2 = curr.replace("_2xl", "2Xl");
    acc[key2] = import_table15.default.modifiers[curr];
    return acc;
  }, {});
  var classNames = (...classes) => () => ({
    className: css(...classes)
  });

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/merge-props.js
  var React201 = __toESM(require_react());
  var import_mergeWith = __toESM(require_mergeWith());
  function mergeProps(...props) {
    const firstProps = props[0];
    const restProps = props.slice(1);
    if (!restProps.length) {
      return (0, import_mergeWith.default)({}, firstProps);
    }
    return (0, import_mergeWith.default)((0, import_mergeWith.default)({}, firstProps), ...restProps, (a2, b, key) => {
      if (key === "children") {
        if (a2 && b) {
          return React201.cloneElement(a2, {
            children: b
          });
        }
        return Object.assign(Object.assign({}, b), a2);
      }
      if (key === "className") {
        return css(a2, b);
      }
      return void 0;
    });
  }

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/Th.js
  var ThBase = (_a) => {
    var { children, className, component = "th", dataLabel, scope = "col", textCenter = false, sort = null, modifier, select = null, expand: collapse = null, tooltip = "", onMouseEnter: onMouseEnterProp = () => {
    }, width, visibility, innerRef, info: infoProps, isStickyColumn = false, hasRightBorder = false, hasLeftBorder = false, stickyMinWidth = "120px", stickyLeftOffset, stickyRightOffset, isSubheader = false } = _a, props = __rest(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset", "isSubheader"]);
    const [showTooltip, setShowTooltip] = React202.useState(false);
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        !showTooltip && setShowTooltip(true);
      } else {
        showTooltip && setShowTooltip(false);
      }
      onMouseEnterProp(event);
    };
    let sortParams = null;
    if (sort) {
      if (sort.isFavorites) {
        sortParams = sortableFavorites({
          onSort: sort === null || sort === void 0 ? void 0 : sort.onSort,
          columnIndex: sort.columnIndex,
          sortBy: sort.sortBy
        })();
      } else {
        sortParams = sortable(children, {
          columnIndex: sort.columnIndex,
          column: {
            extraParams: {
              sortBy: sort.sortBy,
              onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
            }
          }
        });
      }
    }
    const selectParams = select ? selectable(children, {
      rowData: {
        selected: select.isSelected,
        disableSelection: select === null || select === void 0 ? void 0 : select.isDisabled,
        props: select === null || select === void 0 ? void 0 : select.props
      },
      column: {
        extraParams: {
          onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
          selectVariant: "checkbox",
          allRowsSelected: select.isSelected,
          isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
        }
      }
    }) : null;
    const collapseParams = collapse ? collapsible(children, {
      column: {
        extraParams: {
          onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
          allRowsExpanded: !collapse.areAllExpanded,
          collapseAllAriaLabel: ""
        }
      }
    }) : null;
    const widthParams = width ? cellWidth(width)() : null;
    const visibilityParams = visibility ? classNames(...visibility.map((vis) => Visibility[vis]))() : null;
    let transformedChildren = (sortParams === null || sortParams === void 0 ? void 0 : sortParams.children) || (selectParams === null || selectParams === void 0 ? void 0 : selectParams.children) || (collapseParams === null || collapseParams === void 0 ? void 0 : collapseParams.children) || children;
    let infoParams = null;
    if (infoProps) {
      infoParams = info(infoProps)(transformedChildren);
      transformedChildren = infoParams.children;
    }
    const merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
    const {
      // ignore the merged children since we transform them ourselves so we can wrap it with info
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      children: mergedChildren = null,
      // selectable adds this but we don't want it
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      isVisible = null,
      className: mergedClassName = "",
      component: MergedComponent = component
    } = merged, mergedProps = __rest(merged, ["children", "isVisible", "className", "component"]);
    const cell = React202.createElement(MergedComponent, Object.assign({ "data-label": dataLabel, onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp, scope: component === "th" && children ? scope : null, ref: innerRef, className: css(className, textCenter && import_table16.default.modifiers.center, isSubheader && import_table16.default.tableSubhead, isStickyColumn && import_table_scrollable.default.tableStickyColumn, hasRightBorder && import_table_scrollable.default.modifiers.borderRight, hasLeftBorder && import_table_scrollable.default.modifiers.borderLeft, modifier && import_table16.default.modifiers[modifier], mergedClassName) }, mergedProps, props, isStickyColumn && {
      style: Object.assign({ "--pf-c-table__sticky-column--MinWidth": stickyMinWidth ? stickyMinWidth : void 0, "--pf-c-table__sticky-column--Left": stickyLeftOffset ? stickyLeftOffset : void 0, right: stickyRightOffset ? stickyRightOffset : 0 }, props.style)
    }), transformedChildren);
    const canMakeDefaultTooltip = tooltip === "" ? typeof transformedChildren === "string" : true;
    return tooltip !== null && canMakeDefaultTooltip && showTooltip ? React202.createElement(Tooltip, { content: tooltip || tooltip === "" && children, isVisible: true }, cell) : cell;
  };
  var Th = React202.forwardRef((props, ref) => React202.createElement(ThBase, Object.assign({}, props, { innerRef: ref })));
  Th.displayName = "Th";

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/Td.js
  init_tslib_es6();
  var React211 = __toESM(require_react());
  var import_table21 = __toESM(require_table());
  var import_table_scrollable2 = __toESM(require_table_scrollable());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/cellActions.js
  var React204 = __toESM(require_react());
  var import_table17 = __toESM(require_table());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/ActionsColumn.js
  init_tslib_es6();
  var React203 = __toESM(require_react());
  var ActionsColumn = class extends React203.Component {
    constructor(props) {
      super(props);
      this.toggleRef = React203.createRef();
      this.onToggle = (isOpen) => {
        this.setState({
          isOpen
        });
      };
      this.onClick = (event, onClick) => {
        const { rowData, extraData } = this.props;
        if (onClick) {
          event.preventDefault();
          onClick(event, extraData && extraData.rowIndex, rowData, extraData);
        }
      };
      this.state = {
        isOpen: false
      };
    }
    render() {
      const { isOpen } = this.state;
      const { items, children, dropdownPosition, dropdownDirection, menuAppendTo, isDisabled, rowData, actionsToggle } = this.props;
      const actionsToggleClone = actionsToggle ? actionsToggle({ onToggle: this.onToggle, isOpen, isDisabled }) : React203.createElement(KebabToggle, { isDisabled, onToggle: this.onToggle });
      return React203.createElement(
        React203.Fragment,
        null,
        items.filter((item) => item.isOutsideDropdown).map((_a, key) => {
          var { title, itemKey, onClick, isOutsideDropdown } = _a, props = __rest(_a, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
          return typeof title === "string" ? React203.createElement(Button, Object.assign({ onClick: (event) => this.onClick(event, onClick) }, props, { isDisabled, key: itemKey || `outside_dropdown_${key}`, "data-key": itemKey || `outside_dropdown_${key}` }), title) : React203.cloneElement(title, Object.assign({ onClick, isDisabled }, props));
        }),
        React203.createElement(Dropdown, Object.assign({ toggle: actionsToggleClone, position: dropdownPosition, direction: dropdownDirection, menuAppendTo, isOpen, dropdownItems: items.filter((item) => !item.isOutsideDropdown).map((_a, key) => {
          var { title, itemKey, onClick, isSeparator } = _a, props = __rest(_a, ["title", "itemKey", "onClick", "isSeparator"]);
          return isSeparator ? React203.createElement(DropdownSeparator, Object.assign({}, props, { key: itemKey || key, "data-key": itemKey || key })) : React203.createElement(DropdownItem, Object.assign({ component: "button", onClick: (event) => {
            this.onClick(event, onClick);
            this.onToggle(!isOpen);
          } }, props, { key: itemKey || key, "data-key": itemKey || key }), title);
        }), isPlain: true }, rowData && rowData.actionProps)),
        children
      );
    }
  };
  ActionsColumn.displayName = "ActionsColumn";
  ActionsColumn.defaultProps = {
    children: null,
    items: [],
    dropdownPosition: DropdownPosition.right,
    dropdownDirection: DropdownDirection.down,
    menuAppendTo: "inline",
    rowData: {},
    extraData: {}
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/cellActions.js
  var resolveOrDefault = (resolver, defaultValue, rowData, extraData) => typeof resolver === "function" ? resolver(rowData, extraData) : defaultValue;
  var cellActions = (actions, actionResolver, areActionsDisabled) => (label, { rowData, column, rowIndex, columnIndex, column: { extraParams: { dropdownPosition, dropdownDirection, actionsToggle, menuAppendTo } }, property }) => {
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property
    };
    const resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
    const resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
    const renderProps = resolvedActions && resolvedActions.length > 0 ? {
      children: React204.createElement(ActionsColumn, { items: resolvedActions, dropdownPosition, dropdownDirection, menuAppendTo, isDisabled: resolvedIsDisabled, rowData, extraData, actionsToggle }, label)
    } : {};
    return Object.assign({ className: css(import_table17.default.tableAction), style: { paddingRight: 0 }, isVisible: true }, renderProps);
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/compoundExpand.js
  var React205 = __toESM(require_react());
  var import_table18 = __toESM(require_table());
  var compoundExpand = (value, { rowIndex, columnIndex, rowData, column, property }) => {
    if (!value) {
      return null;
    }
    const { title, props } = value;
    const { extraParams: { onExpand, expandId = "expand-toggle" } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property
    };
    function onToggle(event) {
      onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
    }
    return {
      className: css(import_table18.default.tableCompoundExpansionToggle, props.isOpen && import_table18.default.modifiers.expanded),
      children: props.isOpen !== void 0 && React205.createElement(
        "button",
        { type: "button", className: css(import_table18.default.tableButton), onClick: onToggle, "aria-expanded": props.isOpen, "aria-controls": props.ariaControls, id: `${expandId}-${rowIndex}-${columnIndex}` },
        React205.createElement(TableText, null, title)
      )
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/favoritable.js
  var React207 = __toESM(require_react());
  var import_table19 = __toESM(require_table());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/FavoritesCell.js
  init_tslib_es6();
  var React206 = __toESM(require_react());
  var FavoritesCell = (_a) => {
    var { className = "", onFavorite, isFavorited, rowIndex } = _a, props = __rest(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
    const ariaProps = rowIndex === void 0 ? {} : {
      id: `favorites-button-${rowIndex}`,
      "aria-labelledby": `favorites-button-${rowIndex}`
    };
    return React206.createElement(
      Button,
      Object.assign({ variant: "plain", className, type: "button", "aria-label": isFavorited ? "Starred" : "Not starred", onClick: onFavorite }, ariaProps, props),
      React206.createElement(star_icon_default, { "aria-hidden": true })
    );
  };
  FavoritesCell.displayName = "FavoritesCell";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/favoritable.js
  var favoritable = (value, { rowIndex, columnIndex, rowData, column, property }) => {
    const { extraParams: { onFavorite } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property
    };
    if (rowData && rowData.hasOwnProperty("parent") && !rowData.fullWidth) {
      return {
        component: "td",
        isVisible: true
      };
    }
    function favoritesClick(event) {
      onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
    }
    const additionalProps = rowData.favoritesProps || {};
    return {
      className: css(import_table19.default.tableFavorite, rowData && rowData.favorited && import_table19.default.modifiers.favorited),
      isVisible: !rowData || !rowData.fullWidth,
      children: React207.createElement(FavoritesCell, Object.assign({ rowIndex, onFavorite: favoritesClick, isFavorited: rowData && rowData.favorited }, additionalProps))
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/draggable.js
  var React209 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/DraggableCell.js
  init_tslib_es6();
  var React208 = __toESM(require_react());
  var DraggableCell = (_a) => {
    var { className, onClick, "aria-label": ariaLabel, id } = _a, props = __rest(_a, ["className", "onClick", "aria-label", "id"]);
    return React208.createElement(
      Button,
      Object.assign({ id, variant: "plain", className, type: "button", "aria-label": ariaLabel || `Draggable row draggable button`, onClick }, props),
      React208.createElement(grip_vertical_icon_default, { "aria-hidden": true })
    );
  };
  DraggableCell.displayName = "DraggableCell";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/draggable.js
  var draggable = (value, { rowData }) => {
    const { id } = rowData;
    return {
      className: "",
      children: React209.createElement(DraggableCell, { id })
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/treeRow.js
  var React210 = __toESM(require_react());
  var import_table20 = __toESM(require_table());
  var import_table_tree_view2 = __toESM(require_table_tree_view());
  var treeRow = (onCollapse, onCheckChange, onToggleRowDetails) => (value, { rowIndex, rowData }) => {
    const { isExpanded, isDetailsExpanded, "aria-level": level, "aria-setsize": setsize, toggleAriaLabel, checkAriaLabel, showDetailsAriaLabel, isChecked, checkboxId, icon: icon2 } = rowData.props;
    const content = value.title || value;
    const text = React210.createElement(
      "div",
      { className: css(import_table_tree_view2.default.tableTreeViewText), key: "tree-view-text" },
      icon2 && React210.createElement("span", { className: css(import_table_tree_view2.default.tableTreeViewIcon), key: "tree-view-text-icon" }, icon2),
      React210.createElement("span", { className: "pf-c-table__text", key: "table-text" }, content)
    );
    const onChange = (isChecked2, event) => {
      onCheckChange(event, isChecked2, rowIndex, content, rowData);
    };
    return {
      component: "th",
      className: "pf-c-table__tree-view-title-cell",
      children: level !== void 0 ? React210.createElement(
        "div",
        { className: css(import_table_tree_view2.default.tableTreeViewMain) },
        setsize > 0 && React210.createElement(
          "span",
          { className: css(import_table_tree_view2.default.tableToggle), key: "table-toggle" },
          React210.createElement(
            Button,
            { variant: "plain", onClick: (event) => onCollapse && onCollapse(event, rowIndex, content, rowData), className: css(isExpanded && import_table20.default.modifiers.expanded), "aria-expanded": isExpanded, "aria-label": toggleAriaLabel || `${isExpanded ? "Collapse" : "Expand"} row ${rowIndex}` },
            React210.createElement(
              "div",
              { className: css(import_table_tree_view2.default.tableToggleIcon) },
              React210.createElement(angle_down_icon_default, { "aria-hidden": "true" })
            )
          )
        ),
        !!onCheckChange && React210.createElement(
          "span",
          { className: css(import_table_tree_view2.default.tableCheck), key: "table-check" },
          React210.createElement(
            "label",
            { htmlFor: checkboxId || `checkbox_${rowIndex}` },
            React210.createElement(Checkbox, { id: checkboxId || `checkbox_${rowIndex}`, "aria-label": checkAriaLabel || `Row ${rowIndex} checkbox`, isChecked, onChange })
          )
        ),
        text,
        !!onToggleRowDetails && React210.createElement(
          "span",
          { className: css(import_table_tree_view2.default.tableTreeViewDetailsToggle), key: "view-details-toggle" },
          React210.createElement(
            Button,
            { variant: "plain", "aria-expanded": isDetailsExpanded, "aria-label": showDetailsAriaLabel || "Show row details", onClick: (event) => onToggleRowDetails && onToggleRowDetails(event, rowIndex, content, rowData) },
            React210.createElement(
              "span",
              { className: "pf-c-table__details-toggle-icon" },
              React210.createElement(ellipsis_h_icon_default, { "aria-hidden": true })
            )
          )
        )
      ) : text
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/TableComposable/Td.js
  var TdBase = (_a) => {
    var { children, className, isActionCell = false, component = "td", dataLabel, textCenter = false, modifier, select = null, actions = null, expand = null, treeRow: treeRowProp = null, compoundExpand: compoundExpandProp = null, noPadding, width, visibility, innerRef, favorites = null, draggableRow: draggableRowProp = null, tooltip = "", onMouseEnter: onMouseEnterProp = () => {
    }, isStickyColumn = false, hasRightBorder = false, hasLeftBorder = false, stickyMinWidth = "120px", stickyLeftOffset, stickyRightOffset } = _a, props = __rest(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow", "tooltip", "onMouseEnter", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset"]);
    const [showTooltip, setShowTooltip] = React211.useState(false);
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        !showTooltip && setShowTooltip(true);
      } else {
        showTooltip && setShowTooltip(false);
      }
      onMouseEnterProp(event);
    };
    const selectParams = select ? selectable(children, {
      rowIndex: select.rowIndex,
      rowData: {
        selected: select.isSelected,
        disableSelection: select === null || select === void 0 ? void 0 : select.disable,
        props: select === null || select === void 0 ? void 0 : select.props
      },
      column: {
        extraParams: {
          onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
          selectVariant: select.variant || "checkbox"
        }
      }
    }) : null;
    const favoriteParams = favorites ? favoritable(null, {
      rowIndex: favorites === null || favorites === void 0 ? void 0 : favorites.rowIndex,
      rowData: {
        favorited: favorites.isFavorited,
        favoritesProps: favorites === null || favorites === void 0 ? void 0 : favorites.props
      },
      column: {
        extraParams: {
          onFavorite: favorites === null || favorites === void 0 ? void 0 : favorites.onFavorite
        }
      }
    }) : null;
    const draggableParams = draggableRowProp !== null ? draggable(null, {
      rowData: {
        id: draggableRowProp.id
      }
    }) : null;
    const actionParamsFunc = actions ? cellActions(actions.items, null, null) : null;
    const actionParams = actionParamsFunc ? actionParamsFunc(null, {
      rowIndex: actions === null || actions === void 0 ? void 0 : actions.rowIndex,
      rowData: {
        disableActions: actions === null || actions === void 0 ? void 0 : actions.disable
      },
      column: {
        extraParams: {
          dropdownPosition: actions === null || actions === void 0 ? void 0 : actions.dropdownPosition,
          dropdownDirection: actions === null || actions === void 0 ? void 0 : actions.dropdownDirection,
          menuAppendTo: actions === null || actions === void 0 ? void 0 : actions.menuAppendTo,
          actionsToggle: actions === null || actions === void 0 ? void 0 : actions.actionsToggle
        }
      }
    }) : null;
    const expandableParams = expand !== null ? collapsible(null, {
      rowIndex: expand.rowIndex,
      columnIndex: expand === null || expand === void 0 ? void 0 : expand.columnIndex,
      rowData: {
        isOpen: expand.isExpanded
      },
      column: {
        extraParams: {
          onCollapse: expand === null || expand === void 0 ? void 0 : expand.onToggle,
          expandId: expand === null || expand === void 0 ? void 0 : expand.expandId
        }
      }
    }) : null;
    const compoundParams = compoundExpandProp !== null ? compoundExpand({
      title: children,
      props: {
        isOpen: compoundExpandProp.isExpanded
      }
    }, {
      rowIndex: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.rowIndex,
      columnIndex: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.columnIndex,
      column: {
        extraParams: {
          onExpand: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.onToggle,
          expandId: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.expandId
        }
      }
    }) : null;
    const widthParams = width ? cellWidth(width)() : null;
    const visibilityParams = visibility ? classNames(...visibility.map((vis) => Visibility[vis]))() : null;
    const treeRowParams = treeRowProp !== null ? treeRow(treeRowProp.onCollapse, treeRowProp.onCheckChange, treeRowProp.onToggleRowDetails)({
      title: children
    }, {
      rowIndex: treeRowProp.rowIndex,
      rowData: {
        props: treeRowProp.props
      }
    }) : null;
    const merged = mergeProps(selectParams, actionParams, expandableParams, compoundParams, widthParams, visibilityParams, favoriteParams, treeRowParams, draggableParams);
    const {
      // selectable adds this but we don't want it
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      isVisible = null,
      children: mergedChildren = null,
      className: mergedClassName = "",
      component: MergedComponent = component
    } = merged, mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
    const treeTableTitleCell = className && className.includes("pf-c-table__tree-view-title-cell") || mergedClassName && mergedClassName.includes("pf-c-table__tree-view-title-cell");
    const cell = React211.createElement(MergedComponent, Object.assign({}, !treeTableTitleCell && { "data-label": dataLabel }, { onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp, className: css(className, isActionCell && import_table21.default.tableAction, textCenter && import_table21.default.modifiers.center, noPadding && import_table21.default.modifiers.noPadding, isStickyColumn && import_table_scrollable2.default.tableStickyColumn, hasRightBorder && import_table_scrollable2.default.modifiers.borderRight, hasLeftBorder && import_table_scrollable2.default.modifiers.borderLeft, import_table21.default.modifiers[modifier], draggableParams && import_table21.default.tableDraggable, mergedClassName), ref: innerRef }, mergedProps, props, isStickyColumn && {
      style: Object.assign({ "--pf-c-table__sticky-column--MinWidth": stickyMinWidth ? stickyMinWidth : void 0, "--pf-c-table__sticky-column--Left": stickyLeftOffset ? stickyLeftOffset : void 0, right: stickyRightOffset ? stickyRightOffset : 0 }, props.style)
    }), mergedChildren || children);
    const canMakeDefaultTooltip = tooltip === "" ? typeof children === "string" : true;
    return tooltip !== null && canMakeDefaultTooltip && showTooltip ? React211.createElement(Tooltip, { content: tooltip || tooltip === "" && children, isVisible: true }, cell) : cell;
  };
  var Td = React211.forwardRef((props, ref) => React211.createElement(TdBase, Object.assign({}, props, { innerRef: ref })));
  Td.displayName = "Td";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/types.js
  var TableDefaults = {
    renderers: {
      table: TableComposable,
      header: {
        wrapper: Thead,
        row: Tr,
        cell: Th
      },
      body: {
        wrapper: Tbody,
        row: Tr,
        cell: Td
      }
    }
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/provider.js
  var ProviderContext = React212.createContext({
    columns: null,
    renderers: null
  });
  var Provider = class extends React212.Component {
    render() {
      const _a = this.props, { columns, renderers, components, children } = _a, props = __rest(_a, ["columns", "renderers", "components", "children"]);
      let finalRenderers = renderers;
      if (components) {
        console.warn("`components` have been deprecated in favor of `renderers` and will be removed in the next major version, please rename!");
        finalRenderers = components;
      }
      const provider = React212.createElement(renderers.table || TableDefaults.renderers.table, props, children);
      return React212.createElement(ProviderContext.Provider, { value: {
        columns,
        renderers: {
          table: finalRenderers.table || TableDefaults.renderers.table,
          header: Object.assign(Object.assign({}, TableDefaults.renderers.header), finalRenderers.header),
          body: Object.assign(Object.assign({}, TableDefaults.renderers.body), finalRenderers.body)
        }
      } }, provider);
    }
  };
  Provider.displayName = "Provider";
  Provider.defaultProps = {
    renderers: TableDefaults.renderers
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/header.js
  init_tslib_es6();
  var React214 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/header-row.js
  var React213 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/evaluate-formatters.js
  function evaluateFormatters(formatters) {
    return (value, extra) => formatters.reduce((parameters, formatter) => ({
      value: formatter(parameters.value, parameters.extra),
      extra
    }), { value, extra }).value;
  }

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/evaluate-transforms.js
  function evaluateTransforms(transforms = [], value, extraParameters = {}) {
    if (true) {
      if (!transforms.every((f) => typeof f === "function")) {
        throw new Error("All transforms weren't functions!");
      }
    }
    if (transforms.length === 0) {
      return {};
    }
    return mergeProps(...transforms.map((transform2) => transform2(value, extraParameters)));
  }

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/header-row.js
  var HeaderRow = ({ rowData, rowIndex, renderers, onRow = () => ({}) }) => React213.createElement(renderers.row, onRow(rowData, { rowIndex }), rowData.map((column, columnIndex) => {
    const { property, header = {}, props = {} } = column;
    const evaluatedProperty = property || header && header.property;
    const { label, transforms = [], formatters = [], info: info2 = {} } = header;
    const extraParameters = {
      columnIndex,
      property: evaluatedProperty,
      column
    };
    const transformedProps = evaluateTransforms(transforms, label, extraParameters);
    if (!transformedProps) {
      console.warn("Table.Header - Failed to receive a transformed result");
    }
    let cellNode;
    const { tooltip, tooltipProps, popover, popoverProps, ariaLabel, className } = info2;
    if (tooltip) {
      cellNode = React213.createElement(HeaderCellInfoWrapper, { variant: "tooltip", info: tooltip, tooltipProps, ariaLabel, className }, transformedProps.children || evaluateFormatters(formatters)(label, extraParameters));
    } else if (popover) {
      cellNode = React213.createElement(HeaderCellInfoWrapper, { variant: "popover", info: popover, popoverProps, ariaLabel, className }, transformedProps.children || evaluateFormatters(formatters)(label, extraParameters));
    } else {
      cellNode = transformedProps.children || evaluateFormatters(formatters)(label, extraParameters);
    }
    return React213.createElement(renderers.cell, Object.assign({ key: `${columnIndex}-header` }, mergeProps(props, header && header.props, transformedProps)), cellNode);
  }));
  HeaderRow.displayName = "HeaderRow";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/header.js
  var BaseHeader = class extends React214.Component {
    render() {
      const _a = this.props, { children, headerRows, onRow, renderers, columns } = _a, props = __rest(_a, ["children", "headerRows", "onRow", "renderers", "columns"]);
      return React214.createElement(renderers.header.wrapper, props, [
        (headerRows || [columns]).map((rowData, rowIndex) => React214.createElement(HeaderRow, {
          key: `${rowIndex}-header-row`,
          renderers: renderers.header,
          onRow,
          rowData,
          rowIndex
        }))
      ].concat(children));
    }
  };
  var Header = (props) => React214.createElement(ProviderContext.Consumer, null, ({ columns, renderers }) => React214.createElement(BaseHeader, Object.assign({ columns, renderers }, props)));

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/body.js
  init_tslib_es6();
  var React216 = __toESM(require_react());
  var import_isEqual2 = __toESM(require_isEqual());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/resolve-row-key.js
  function resolveRowKey({ rowData, rowIndex, rowKey }) {
    if (typeof rowKey === "function") {
      return `${rowKey({ rowData, rowIndex })}-row`;
    } else if (true) {
      if (!Array.isArray(rowData) && rowData[rowKey] === void 0) {
        console.warn("Table.Body - Missing valid rowKey!", rowData, rowKey);
      }
    }
    if (rowData[rowKey] === 0) {
      return `${rowData[rowKey]}-row`;
    }
    return `${rowData[rowKey] || rowIndex}-row`;
  }

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/body-row.js
  var import_isEqual = __toESM(require_isEqual());
  var React215 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/columns-are-equal.js
  var import_isEqualWith = __toESM(require_isEqualWith());
  function columnsAreEqual(oldColumns, newColumns) {
    return (0, import_isEqualWith.default)(oldColumns, newColumns, (a2, b) => {
      if (typeof a2 === "function" && typeof b === "function") {
        return a2 === b;
      }
      return void 0;
    });
  }

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/body-row.js
  var BodyRow = class extends React215.Component {
    shouldComponentUpdate(nextProps) {
      const { columns, rowData } = this.props;
      const { renderers } = nextProps;
      if (renderers && renderers.row && renderers.row.shouldComponentUpdate) {
        if (typeof renderers.row.shouldComponentUpdate === "function") {
          return renderers.row.shouldComponentUpdate.call(this, nextProps, {}, {});
        }
        return true;
      }
      return !(columnsAreEqual(columns, nextProps.columns) && (0, import_isEqual.default)(rowData, nextProps.rowData));
    }
    render() {
      const { columns, renderers, onRow, rowKey, rowIndex, rowData } = this.props;
      return React215.createElement(renderers.row, onRow(rowData, { rowIndex, rowKey }), columns.map((column, columnIndex) => {
        const { property, cell, props } = column;
        const evaluatedProperty = property || cell && cell.property;
        const { transforms = [], formatters = [] } = cell || {};
        const extraParameters = {
          columnIndex,
          property: evaluatedProperty,
          column,
          rowData,
          rowIndex,
          rowKey
        };
        const transformed = evaluateTransforms(transforms, rowData[evaluatedProperty], extraParameters);
        if (!transformed) {
          console.warn("Table.Body - Failed to receive a transformed result");
        }
        let additionalFormaters = [];
        if (rowData[evaluatedProperty]) {
          additionalFormaters = rowData[evaluatedProperty].formatters;
        }
        return React215.createElement(renderers.cell, Object.assign({ key: `col-${columnIndex}-row-${rowIndex}` }, mergeProps(props, cell && cell.props, transformed)), !rowData.fullWidth && transformed.children || evaluateFormatters([...formatters, ...additionalFormaters])(rowData[`_${evaluatedProperty}`] || rowData[evaluatedProperty], extraParameters));
      }));
    }
  };
  BodyRow.displayName = "BodyRow";
  BodyRow.defaultProps = {
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onRow: (...args) => ({})
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/body.js
  var BaseBody = class extends React216.Component {
    constructor() {
      super(...arguments);
      this.omitOnRow = (props) => {
        const { onRow } = props, ret = __rest(props, ["onRow"]);
        return ret;
      };
    }
    shouldComponentUpdate(nextProps) {
      const { renderers } = nextProps;
      if (renderers && renderers.body && renderers.body.wrapper && renderers.body.wrapper.shouldComponentUpdate) {
        if (typeof renderers.body.wrapper.shouldComponentUpdate === "function") {
          return renderers.body.wrapper.shouldComponentUpdate.call(this, nextProps, {}, {});
        }
        return true;
      }
      return !(0, import_isEqual2.default)(this.omitOnRow(this.props), this.omitOnRow(nextProps));
    }
    render() {
      const _a = this.props, { onRow, rows, rowKey, columns, renderers } = _a, props = __rest(_a, ["onRow", "rows", "rowKey", "columns", "renderers"]);
      const children = rows.map((rowData, index) => {
        const key = resolveRowKey({ rowData, rowIndex: index, rowKey });
        return React216.createElement(BodyRow, {
          key,
          renderers: renderers.body,
          onRow,
          rowKey: key,
          rowIndex: index,
          rowData,
          columns
        });
      });
      return React216.createElement(renderers.body.wrapper, props, children);
    }
  };
  BaseBody.defaultProps = {
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onRow: (...args) => ({})
  };
  var Body = (props) => React216.createElement(ProviderContext.Consumer, null, ({ columns, renderers }) => React216.createElement(BaseBody, Object.assign({ columns, renderers }, props)));

  // node_modules/@patternfly/react-table/dist/esm/components/Table/BodyCell.js
  init_tslib_es6();
  var React217 = __toESM(require_react());
  var BodyCell = (_a) => {
    var {
      "data-label": dataLabel = "",
      className = "",
      colSpan,
      component = "td",
      isVisible,
      parentId: parentId2,
      textCenter = false,
      tooltip: tooltipProp = "",
      onMouseEnter: onMouseEnterProp = () => {
      },
      children,
      /* eslint-disable @typescript-eslint/no-unused-vars */
      errorText,
      isValid,
      isOpen,
      ariaControls,
      editableValue,
      editableSelectProps,
      options: options4,
      isSelectOpen,
      value,
      name: name2
    } = _a, props = __rest(_a, ["data-label", "className", "colSpan", "component", "isVisible", "parentId", "textCenter", "tooltip", "onMouseEnter", "children", "errorText", "isValid", "isOpen", "ariaControls", "editableValue", "editableSelectProps", "options", "isSelectOpen", "value", "name"]);
    const [tooltip, setTooltip] = React217.useState("");
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        if (tooltipProp) {
          setTooltip(tooltipProp);
        } else if (typeof children === "string") {
          setTooltip(children);
        }
      } else {
        setTooltip("");
      }
      onMouseEnterProp(event);
    };
    let isEmptyStateCell = false;
    if (children) {
      isEmptyStateCell = children.type === Bullseye && children.props.children && children.props.children.type === EmptyState || children.type === EmptyState;
    }
    const cell = React217.createElement(Td, Object.assign({ className, component, dataLabel: dataLabel && parentId2 == null && !isEmptyStateCell ? dataLabel : null, onMouseEnter, textCenter, colSpan }, props), children);
    const bodyCell = tooltip !== "" ? React217.createElement(Tooltip, { content: tooltip, isVisible: true }, cell) : cell;
    return parentId2 !== void 0 && colSpan === void 0 || !isVisible ? null : bodyCell;
  };
  BodyCell.displayName = "BodyCell";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/HeaderCell.js
  init_tslib_es6();
  var React218 = __toESM(require_react());
  var HeaderCell = (_a) => {
    var {
      className = "",
      component = "th",
      scope = "",
      textCenter = false,
      tooltip = "",
      onMouseEnter = () => {
      },
      children,
      /* eslint-disable @typescript-eslint/no-unused-vars */
      isVisible,
      dataLabel = ""
    } = _a, props = __rest(_a, ["className", "component", "scope", "textCenter", "tooltip", "onMouseEnter", "children", "isVisible", "dataLabel"]);
    return React218.createElement(Th, Object.assign({}, props, { scope, tooltip, onMouseEnter, textCenter, component, className }), children);
  };
  HeaderCell.displayName = "HeaderCell";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/RowWrapper.js
  init_tslib_es6();
  var React219 = __toESM(require_react());
  var RowWrapper = class extends React219.Component {
    constructor(props) {
      super(props);
      this.handleScroll = (event) => {
        if (!this._unmounted) {
          this.props.onScroll(event);
        }
      };
      this.handleResize = (event) => {
        if (!this._unmounted) {
          this.props.onResize(event);
        }
      };
      if (props.onScroll) {
        this.handleScroll = debounce(this.handleScroll, 100);
      }
      if (props.onResize) {
        this.handleResize = debounce(this.handleResize, 100);
      }
    }
    componentDidMount() {
      this._unmounted = false;
      if (canUseDOM) {
        if (this.props.onScroll) {
          window.addEventListener("scroll", this.handleScroll);
        }
        if (this.props.onResize) {
          window.addEventListener("resize", this.handleResize);
        }
      }
    }
    componentWillUnmount() {
      this._unmounted = true;
      if (canUseDOM) {
        if (this.props.onScroll) {
          window.removeEventListener("scroll", this.handleScroll);
        }
        if (this.props.onResize) {
          window.removeEventListener("resize", this.handleResize);
        }
      }
    }
    render() {
      const _a = this.props, {
        /* eslint-disable @typescript-eslint/no-unused-vars */
        onScroll,
        onResize,
        row: { isExpanded, isEditable, isHoverable, isRowSelected },
        rowProps,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        trRef,
        className,
        ouiaId
      } = _a, props = __rest(_a, ["onScroll", "onResize", "row", "rowProps", "trRef", "className", "ouiaId"]);
      return React219.createElement(Tr, Object.assign({}, props, { ref: trRef, isExpanded, isEditable, className, ouiaId, isHoverable, isRowSelected }));
    }
  };
  RowWrapper.displayName = "RowWrapper";
  RowWrapper.defaultProps = {
    className: "",
    row: {
      isOpen: void 0,
      isExpanded: void 0,
      isHeightAuto: void 0,
      isEditable: void 0
    },
    rowProps: null
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/BodyWrapper.js
  init_tslib_es6();
  var React223 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/transformers.js
  var emptyTD = () => ({
    component: "td"
  });
  var scopeColTransformer = () => ({
    scope: "col"
  });
  var emptyCol = (label) => Object.assign({}, label ? {} : { scope: "" });
  var parentId = (_value, { rowData }) => ({
    parentId: rowData.parent
  });
  var mapProps = (_label, { property, rowData }) => Object.assign({}, rowData[property] && rowData[property].props);

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/editable.js
  var React221 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/EditColumn.js
  init_tslib_es6();
  var React220 = __toESM(require_react());
  var import_inline_edit2 = __toESM(require_inline_edit());
  var EditColumn = (_a) => {
    var {
      onClick = null,
      /* eslint-disable @typescript-eslint/no-unused-vars */
      className = "",
      editing,
      valid,
      /* eslint-enable @typescript-eslint/no-unused-vars */
      saveAriaLabel,
      cancelAriaLabel,
      editAriaLabel
    } = _a, props = __rest(_a, ["onClick", "className", "editing", "valid", "saveAriaLabel", "cancelAriaLabel", "editAriaLabel"]);
    return React220.createElement(
      React220.Fragment,
      null,
      React220.createElement(
        "div",
        { className: css(import_inline_edit2.default.inlineEditGroup, import_inline_edit2.default.modifiers.iconGroup, "pf-m-action-group") },
        React220.createElement(
          "div",
          { className: css(import_inline_edit2.default.inlineEditAction) },
          React220.createElement(
            Button,
            Object.assign({ "aria-label": saveAriaLabel }, props, { onClick: (e) => onClick(e, "save"), variant: "plain" }),
            React220.createElement(check_icon_default, null)
          )
        ),
        React220.createElement(
          "div",
          { className: css(import_inline_edit2.default.inlineEditAction) },
          React220.createElement(
            Button,
            Object.assign({ "aria-label": cancelAriaLabel }, props, { onClick: (e) => onClick(e, "cancel"), variant: "plain" }),
            React220.createElement(times_icon_default, null)
          )
        )
      ),
      React220.createElement(
        "div",
        { className: css(import_inline_edit2.default.inlineEditAction, import_inline_edit2.default.modifiers.enableEditable) },
        React220.createElement(
          Button,
          Object.assign({ "aria-label": editAriaLabel }, props, { onClick: (e) => onClick(e, "edit"), variant: "plain" }),
          React220.createElement(pencil_alt_icon_default, null)
        )
      )
    );
  };
  EditColumn.displayName = "EditColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/editable.js
  var import_table22 = __toESM(require_table());
  var editable = (label, { rowIndex, rowData, column }) => {
    const { extraParams: { onRowEdit } } = column;
    const toggleEditMode = (event, type) => {
      let validationErrors = {};
      if (type === "save") {
        validationErrors = rowData.rowEditValidationRules && rowData.rowEditValidationRules.reduce((acc, rule) => {
          const invalidCells = rowData.cells.filter((cellData) => {
            const testValue = cellData.props.editableValue === "" ? "" : cellData.props.editableValue || cellData.props.value;
            let failedValidation = false;
            if (Array.isArray(testValue) && testValue.length) {
              failedValidation = testValue.reduce((hasInvalidSelection, el) => {
                if (hasInvalidSelection === true) {
                  return true;
                }
                return !rule.validator(el);
              }, failedValidation);
            } else if (Array.isArray(testValue) && !testValue.length) {
              failedValidation = !rule.validator("");
            } else {
              failedValidation = !rule.validator(testValue);
            }
            if (failedValidation) {
              cellData.props.isValid = false;
            }
            return failedValidation;
          });
          if (invalidCells.length) {
            acc[rule.name] = invalidCells.map((cell) => cell.props.name);
          }
          return acc;
        }, {});
      }
      onRowEdit(event, type, rowData && rowData.isEditable, rowIndex, validationErrors);
    };
    function getAriaLabelTxt(identifier, actionType) {
      let result;
      switch (actionType) {
        case "cancel":
          result = `Cancel row edits for row ${identifier}`;
          break;
        case "save":
          result = `Save row edits for row ${identifier}`;
          break;
        default:
          result = `Place row ${identifier} in edit mode`;
      }
      return result;
    }
    return {
      className: import_table22.default.tableInlineEditAction,
      component: "td",
      isVisible: true,
      children: React221.createElement(EditColumn, { saveAriaLabel: rowData && rowData.rowSaveBtnAriaLabel && rowData.rowSaveBtnAriaLabel(rowIndex) || getAriaLabelTxt(rowIndex, "save"), cancelAriaLabel: rowData && rowData.rowCancelBtnAriaLabel && rowData.rowCancelBtnAriaLabel(rowIndex) || getAriaLabelTxt(rowIndex, "cancel"), editAriaLabel: rowData && rowData.rowEditBtnAriaLabel && rowData.rowEditBtnAriaLabel(rowIndex) || getAriaLabelTxt(rowIndex, "edit"), valid: rowData && rowData.isValid, editing: rowData && rowData.isEditable, onClick: toggleEditMode })
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/wrappable.js
  var import_table23 = __toESM(require_table());
  var breakWord = () => ({
    className: import_table23.default.modifiers.breakWord
  });

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/headerCol.js
  var React222 = __toESM(require_react());
  var headerCol = (id = "simple-node") => {
    const headerColObj = (value, { rowIndex } = {}) => {
      const result = typeof value === "object" ? value.title : value;
      return {
        component: "th",
        children: React222.createElement("div", { id: `${id}${rowIndex}` }, result)
      };
    };
    return headerColObj;
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/formatters.js
  var defaultTitle = (data) => data && data.hasOwnProperty("title") ? data.title : data;

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/headerUtils.js
  var generateHeader = ({ transforms: origTransforms, formatters: origFormatters, columnTransforms, header }, title) => Object.assign(Object.assign({}, header), { label: title, transforms: [
    scopeColTransformer,
    emptyCol,
    ...origTransforms || [],
    ...columnTransforms || [],
    ...header && header.hasOwnProperty("transforms") ? header.transforms : []
  ], formatters: [...origFormatters || [], ...header && header.hasOwnProperty("formatters") ? header.formatters : []] });
  var generateCell = ({ cellFormatters, cellTransforms, columnTransforms, cell }, extra) => Object.assign(Object.assign({}, cell), { transforms: [
    ...cellTransforms || [],
    ...columnTransforms || [],
    ...cell && cell.hasOwnProperty("transforms") ? cell.transforms : [],
    mapProps
    // This transform should be applied last so that props that are manually defined at the cell level will override all other transforms.
  ], formatters: [
    defaultTitle,
    ...cellFormatters || [],
    ...cell && cell.hasOwnProperty("formatters") ? cell.formatters : []
  ] });
  var mapHeader = (column, extra, key, ...props) => {
    const title = column.hasOwnProperty("title") ? column.title : column;
    let dataLabel = `column-${key}`;
    if (column.hasOwnProperty("dataLabel")) {
      dataLabel = column.dataLabel;
    } else if (typeof title === "string") {
      dataLabel = title;
    }
    return {
      property: typeof title === "string" && title.toLowerCase().trim().replace(/\s/g, "-") || `column-${key}`,
      extraParams: extra,
      data: column.data,
      header: generateHeader(column, title),
      cell: generateCell(column, extra),
      props: Object.assign(Object.assign({ "data-label": dataLabel, "data-key": key }, column.hasOwnProperty("props") ? column.props : {}), props)
    };
  };
  var selectableTransforms = ({ onSelect, canSelectAll }) => [
    ...onSelect ? [
      {
        title: "",
        transforms: canSelectAll && [selectable] || null,
        cellTransforms: [selectable]
      }
    ] : []
  ];
  var favoritesTransforms = ({ onFavorite, onSort, sortBy, canSortFavorites, firstUserColumnIndex }) => [
    ...onFavorite ? [
      {
        title: "",
        transforms: onSort && canSortFavorites ? [
          scopeColTransformer,
          sortableFavorites({
            onSort,
            // favorites should be just before the first user-defined column
            columnIndex: firstUserColumnIndex - 1,
            sortBy
          })
        ] : [emptyTD],
        cellTransforms: [favoritable]
      }
    ] : []
  ];
  var actionsTransforms = ({ actions, actionResolver, areActionsDisabled }) => [
    ...actionResolver || actions ? [
      {
        title: "",
        transforms: [emptyTD],
        cellTransforms: [cellActions(actions, actionResolver, areActionsDisabled)]
      }
    ] : []
  ];
  var collapsibleTransforms = (header, { onCollapse, canCollapseAll, firstUserColumnIndex }) => [
    ...onCollapse ? [
      {
        title: "",
        transforms: canCollapseAll && [collapsible] || null,
        cellTransforms: [collapsible, expandedRow(header.length, firstUserColumnIndex)]
      }
    ] : []
  ];
  var addAdditionalCellTranforms = (cell, additional) => Object.assign(Object.assign({}, cell.hasOwnProperty("title") ? cell : { title: cell }), { cellTransforms: [...cell.hasOwnProperty("cellTransforms") ? cell.cellTransforms : [], additional] });
  var expandContent = (header, extra) => {
    if (!extra.onCollapse && !extra.onExpand) {
      return header;
    }
    return header.map((cell) => {
      const parentIdCell = addAdditionalCellTranforms(cell, parentId);
      return addAdditionalCellTranforms(parentIdCell, expandedRow(header.length));
    });
  };
  var mapOpenedRows = (rows, children) => rows.reduce((acc, curr, key) => {
    if (curr.hasOwnProperty("parent")) {
      const parent = acc.length > 0 && acc[acc.length - 1];
      if (parent) {
        acc[acc.length - 1].rows = [...acc[acc.length - 1].rows, children[key]];
        if (curr.hasOwnProperty("compoundParent")) {
          acc[acc.length - 1].isOpen = acc[acc.length - 1].rows.some((oneRow) => oneRow.props.rowData.cells.some((oneCell) => oneCell.props && oneCell.props.isOpen));
        }
      }
    } else {
      acc = [...acc, Object.assign(Object.assign({}, curr), { rows: [children[key]] })];
    }
    return acc;
  }, []);
  var rowEditTransforms = ({ onRowEdit }) => [
    ...onRowEdit ? [
      {
        title: "",
        cellTransforms: [editable]
      }
    ] : []
  ];
  var calculateColumns = (headerRows, extra) => headerRows && [
    ...collapsibleTransforms(headerRows, extra),
    ...selectableTransforms(extra),
    ...favoritesTransforms(extra),
    ...expandContent(headerRows, extra),
    ...rowEditTransforms(extra),
    ...actionsTransforms(extra)
  ].map((oneCol, key) => Object.assign({}, mapHeader(oneCol, extra, key)));

  // node_modules/@patternfly/react-table/dist/esm/components/Table/BodyWrapper.js
  var BodyWrapper = (_a) => {
    var {
      mappedRows,
      tbodyRef,
      /* eslint-disable @typescript-eslint/no-unused-vars */
      rows = [],
      onCollapse,
      headerRows
    } = _a, props = __rest(_a, ["mappedRows", "tbodyRef", "rows", "onCollapse", "headerRows"]);
    if (mappedRows && mappedRows.some((row) => row.hasOwnProperty("parent"))) {
      return React223.createElement(React223.Fragment, null, mapOpenedRows(mappedRows, props.children).map((oneRow, key) => React223.createElement(Tbody, Object.assign({}, props, { isExpanded: oneRow.isOpen, key: `tbody-${key}`, ref: tbodyRef }), oneRow.rows)));
    }
    return React223.createElement(Tbody, Object.assign({}, props, { ref: tbodyRef }));
  };
  BodyWrapper.displayName = "BodyWrapper";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/TableContext.js
  var React224 = __toESM(require_react());
  var TableContext = React224.createContext({
    headerData: null,
    headerRows: null,
    rows: []
  });

  // node_modules/@patternfly/react-table/dist/esm/components/Table/TreeRowWrapper.js
  init_tslib_es6();
  var React225 = __toESM(require_react());
  var import_table24 = __toESM(require_table());
  var import_table_tree_view3 = __toESM(require_table_tree_view());
  var TreeRowWrapper = (_a) => {
    var {
      className,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      rowProps,
      row
    } = _a, props = __rest(_a, ["className", "rowProps", "row"]);
    const { "aria-level": level, "aria-posinset": posinset, "aria-setsize": setsize, isExpanded, isDetailsExpanded, isHidden: isHidden3 } = row.props;
    return React225.createElement(Tr, Object.assign({ "aria-level": level, "aria-posinset": posinset, "aria-setsize": setsize, "aria-expanded": !!isExpanded, isHidden: isHidden3, className: css(className, isExpanded && import_table24.default.modifiers.expanded, isDetailsExpanded && import_table_tree_view3.default.modifiers.treeViewDetailsExpanded) }, props));
  };
  TreeRowWrapper.displayName = "TreeRowWrapper";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Table.js
  var Table = class extends React226.Component {
    constructor() {
      super(...arguments);
      this.state = {
        ouiaStateId: getDefaultOUIAId(Table.displayName)
      };
      this.isSelected = (row) => row.selected === true;
      this.areAllRowsSelected = (rows) => {
        if (rows === void 0 || rows.length === 0) {
          return false;
        }
        return rows.every((row) => this.isSelected(row) || row.disableSelection || row.hasOwnProperty("parent") && !row.showSelect);
      };
      this.areAllExpanded = (rows) => {
        if (rows === void 0 || rows.length === 0) {
          return false;
        }
        return rows.every((row) => row.isOpen === void 0 || row.isOpen);
      };
    }
    render() {
      const _a = this.props, { "aria-label": ariaLabel, caption, header, onSort, onSelect, canSelectAll, canCollapseAll, isHeaderSelectDisabled, selectVariant, collapseAllAriaLabel, sortBy, children, actions, actionResolver, areActionsDisabled, onCollapse, onExpand, onRowEdit, rowLabeledBy, dropdownPosition, dropdownDirection, actionsMenuAppendTo: menuAppendTo, actionsToggle, contentId, expandId, variant, rows, cells, bodyWrapper, rowWrapper, role, borders, onFavorite, canSortFavorites } = _a, props = __rest(_a, ["aria-label", "caption", "header", "onSort", "onSelect", "canSelectAll", "canCollapseAll", "isHeaderSelectDisabled", "selectVariant", "collapseAllAriaLabel", "sortBy", "children", "actions", "actionResolver", "areActionsDisabled", "onCollapse", "onExpand", "onRowEdit", "rowLabeledBy", "dropdownPosition", "dropdownDirection", "actionsMenuAppendTo", "actionsToggle", "contentId", "expandId", "variant", "rows", "cells", "bodyWrapper", "rowWrapper", "role", "borders", "onFavorite", "canSortFavorites"]);
      if (!ariaLabel && !caption && !header && role !== "presentation") {
        console.error("Table: Specify at least one of: header, caption, aria-label");
      }
      const headerData = calculateColumns(cells, {
        sortBy,
        onSort,
        onSelect,
        canSelectAll: selectVariant === RowSelectVariant.radio ? false : canSelectAll,
        canCollapseAll,
        isHeaderSelectDisabled,
        selectVariant,
        collapseAllAriaLabel,
        allRowsSelected: onSelect ? this.areAllRowsSelected(rows) : false,
        allRowsExpanded: onCollapse ? this.areAllExpanded(rows) : false,
        actions,
        actionResolver,
        areActionsDisabled,
        onCollapse,
        onRowEdit,
        onExpand,
        rowLabeledBy,
        expandId,
        contentId,
        dropdownPosition,
        dropdownDirection,
        menuAppendTo,
        actionsToggle,
        onFavorite,
        canSortFavorites,
        // order of columns: Collapsible | Selectable | Favoritable
        firstUserColumnIndex: [onCollapse, onSelect, onFavorite].filter((callback) => callback).length
      });
      const table = React226.createElement(
        TableContext.Provider,
        { value: {
          headerData,
          headerRows: null,
          rows
        } },
        header,
        React226.createElement(
          Provider,
          Object.assign({}, props, { "aria-label": ariaLabel, renderers: {
            body: {
              wrapper: bodyWrapper || BodyWrapper,
              row: rowWrapper || (this.props.isTreeTable ? TreeRowWrapper : RowWrapper),
              cell: BodyCell
            },
            header: {
              cell: HeaderCell
            }
          }, columns: headerData, role, variant, borders }),
          caption && React226.createElement("caption", null, caption),
          children
        )
      );
      if (onRowEdit) {
        return React226.createElement("form", { className: css(import_inline_edit3.default.inlineEdit) }, table);
      }
      return table;
    }
  };
  Table.displayName = "Table";
  Table.hasWarnBeta = false;
  Table.defaultProps = {
    children: null,
    className: "",
    variant: null,
    borders: true,
    rowLabeledBy: "simple-node",
    expandId: "expandable-toggle",
    contentId: "expanded-content",
    dropdownPosition: DropdownPosition.right,
    dropdownDirection: DropdownDirection.down,
    actionsMenuAppendTo: "inline",
    header: void 0,
    caption: void 0,
    "aria-label": void 0,
    gridBreakPoint: TableGridBreakpoint.gridMd,
    role: "grid",
    canSelectAll: true,
    canCollapseAll: false,
    isHeaderSelectDisabled: false,
    selectVariant: "checkbox",
    collapseAllAriaLabel: "",
    ouiaSafe: true,
    isStickyHeader: false,
    canSortFavorites: true,
    isTreeTable: false,
    isNested: false
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Body.js
  init_tslib_es6();
  var React227 = __toESM(require_react());
  var flagVisibility = (rows) => {
    const visibleRows = rows.filter((oneRow) => !oneRow.parent || oneRow.isExpanded);
    if (visibleRows.length > 0) {
      visibleRows[0].isFirstVisible = true;
      visibleRows[visibleRows.length - 1].isLastVisible = true;
    }
  };
  var ContextBody = class extends React227.Component {
    constructor() {
      super(...arguments);
      this.onRow = (row, rowProps) => {
        const { onRowClick, onRow } = this.props;
        const extendedRowProps = Object.assign(Object.assign({}, rowProps), onRow ? onRow(row, rowProps) : {});
        return {
          row,
          rowProps: extendedRowProps,
          onClick: (event) => {
            const tagName = event.target.tagName;
            const computedData = {
              isInput: tagName === "INPUT",
              isButton: tagName === "BUTTON"
            };
            onRowClick(event, row, rowProps, computedData);
          },
          onKeyDown: (event) => {
            const targetElement = event.target;
            const tagName = targetElement.tagName;
            const computedData = {
              isInput: tagName === "INPUT",
              isButton: tagName === "BUTTON"
            };
            if (event.key === "Enter" || event.key === " ") {
              onRowClick(event, row, rowProps, computedData);
              if (event.key === " " && !!targetElement.closest(".pf-m-hoverable")) {
                event.preventDefault();
              }
            }
          }
        };
      };
      this.mapCells = (headerData, row, rowKey) => {
        const { firstUserColumnIndex } = headerData[0].extraParams;
        const isFullWidth = row && row.fullWidth;
        let additionalColsIndexShift = isFullWidth ? 0 : firstUserColumnIndex;
        return Object.assign({}, row && (row.cells || row).reduce((acc, cell, cellIndex) => {
          const isCellObject = cell === Object(cell);
          const isCellFunction = cell && typeof cell.title === "function";
          let formatters = [];
          if (isCellObject && cell.formatters) {
            formatters = cell.formatters;
          } else if (isFullWidth && cellIndex < firstUserColumnIndex) {
            formatters = headerData[firstUserColumnIndex].cell.formatters;
          }
          let mappedCellTitle = cell;
          if (isCellObject && isCellFunction) {
            mappedCellTitle = cell.title(cell.props.value, rowKey, cellIndex, cell.props);
          } else if (isCellObject) {
            mappedCellTitle = cell.title;
          }
          const mappedCell = {
            [headerData[cellIndex + additionalColsIndexShift].property]: {
              title: mappedCellTitle,
              formatters,
              props: Object.assign({ isVisible: true }, isCellObject ? cell.props : null)
            }
          };
          if (isCellObject && cell.props && cell.props.colSpan) {
            additionalColsIndexShift += cell.props.colSpan - 1;
          }
          return Object.assign(Object.assign({}, acc), mappedCell);
        }, { secretTableRowKeyId: row.id !== void 0 ? row.id : rowKey }));
      };
    }
    render() {
      const _a = this.props, { className, headerData, rows, rowKey, children, onRowClick } = _a, props = __rest(_a, ["className", "headerData", "rows", "rowKey", "children", "onRowClick"]);
      let mappedRows;
      if (headerData.length > 0) {
        mappedRows = rows.map((oneRow, oneRowKey) => Object.assign(Object.assign(Object.assign({}, oneRow), this.mapCells(headerData, oneRow, oneRowKey)), { isExpanded: isRowExpanded(oneRow, rows), isHeightAuto: oneRow.heightAuto || false, isFirst: oneRowKey === 0, isLast: oneRowKey === rows.length - 1, isFirstVisible: false, isLastVisible: false }));
        flagVisibility(mappedRows);
      }
      return React227.createElement(React227.Fragment, null, mappedRows && React227.createElement(Body, Object.assign({}, props, { mappedRows, rows: mappedRows, onRow: this.onRow, rowKey, className })));
    }
  };
  var TableBody = (_a) => {
    var {
      className = "",
      children = null,
      rowKey = "secretTableRowKeyId",
      /* eslint-disable @typescript-eslint/no-unused-vars */
      onRow = (...args) => ({}),
      onRowClick = (event, row, rowProps, computedData) => (
        /* eslint-enable @typescript-eslint/no-unused-vars */
        void 0
      )
    } = _a, props = __rest(_a, ["className", "children", "rowKey", "onRow", "onRowClick"]);
    return React227.createElement(TableContext.Consumer, null, (_a2) => {
      var { headerData = [], rows = [] } = _a2, rest = __rest(_a2, ["headerData", "rows"]);
      return React227.createElement(ContextBody, Object.assign({ headerData, rows, onRow, className, rowKey, onRowClick }, props, rest), children);
    });
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/EditableTextCell.js
  var React228 = __toESM(require_react());
  var import_inline_edit4 = __toESM(require_inline_edit());
  var import_form6 = __toESM(require_form());
  var EditableTextCell = ({ value, rowIndex, cellIndex, props, handleTextInputChange, inputAriaLabel, isDisabled = false }) => React228.createElement(
    React228.Fragment,
    null,
    React228.createElement("div", { className: import_inline_edit4.default.inlineEditValue }, value),
    React228.createElement(
      "div",
      { className: import_inline_edit4.default.inlineEditInput },
      React228.createElement(TextInput, { isDisabled, value: props.editableValue !== void 0 ? props.editableValue : value, validated: props.isValid !== false ? "default" : "error", type: "text", onChange: (newValue, event) => {
        handleTextInputChange(newValue, event, rowIndex, cellIndex);
      }, "aria-label": inputAriaLabel }),
      React228.createElement("div", { className: css(import_form6.default.formHelperText, import_form6.default.modifiers.error), "aria-live": "polite" }, props.errorText)
    )
  );
  EditableTextCell.displayName = "EditableTextCell";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Header.js
  init_tslib_es6();
  var React229 = __toESM(require_react());
  var ContextHeader = (_a) => {
    var { className = "", headerRows = void 0 } = _a, props = __rest(_a, ["className", "headerRows"]);
    return React229.createElement(Header, Object.assign({}, props, { headerRows, className }));
  };
  var TableHeader = (_a) => {
    var props = __rest(_a, []);
    return React229.createElement(TableContext.Consumer, null, ({ headerRows }) => React229.createElement(ContextHeader, Object.assign({}, props, { headerRows })));
  };
  TableHeader.displayName = "TableHeader";

  // src/lib/plugins/pluginTables.jsx
  var import_prop_types3 = __toESM(require_prop_types(), 1);
  var PluginTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        dropdownIsOpen: false,
        columns: [
          {
            title: "Plugin Name",
            transforms: [sortable],
            cellFormatters: [expandable]
          },
          { title: "Plugin Type", transforms: [sortable] },
          { title: "Enabled", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          3: this.state.rows[idx].cells[2]
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2],
            srow[3]
          ]
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        const val = value.toLowerCase();
        if (val !== "" && row.cn[0].toLowerCase().indexOf(val) === -1 && row["nsslapd-pluginType"][0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              row.cn[0],
              row["nsslapd-pluginType"][0],
              row["nsslapd-pluginEnabled"][0]
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    getExpandedRow(rowData) {
      const dependsType = rowData["nsslapd-plugin-depends-on-type"] === void 0 ? "" : rowData["nsslapd-plugin-depends-on-type"].join(", ");
      const dependsNamed = rowData["nsslapd-plugin-depends-on-named"] === void 0 ? "" : rowData["nsslapd-plugin-depends-on-named"].join(", ");
      const precedence = rowData["nsslapd-pluginprecedence"] === void 0 ? "" : rowData["nsslapd-pluginprecedence"][0];
      const plugin_enabled = rowData["nsslapd-pluginEnabled"][0] === "on";
      const plugin_name = rowData.cn[0];
      const enabled = /* @__PURE__ */ import_react8.default.createElement("i", null, "Plugin is enabled");
      const disabled = /* @__PURE__ */ import_react8.default.createElement("i", null, "Plugin is disabled");
      return /* @__PURE__ */ import_react8.default.createElement(Grid, { className: "ds-left-indent-xlg" }, /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Description:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, rowData["nsslapd-pluginDescription"][0])), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Path:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, rowData["nsslapd-pluginPath"][0])), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Init Function:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, rowData["nsslapd-pluginInitfunc"][0])), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin ID:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, rowData["nsslapd-pluginId"][0])), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Vendor:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, rowData["nsslapd-pluginVendor"][0])), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Version:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, rowData["nsslapd-pluginVersion"][0])), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Depends On Named:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, dependsNamed)), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Depends On Type:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, dependsType)), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react8.default.createElement("b", null, "Plugin Precedence:")), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react8.default.createElement("i", null, precedence)), /* @__PURE__ */ import_react8.default.createElement(GridItem, { span: 12, className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react8.default.createElement(
        Switch,
        {
          id: plugin_name,
          key: plugin_name,
          label: enabled,
          labelOff: disabled,
          isChecked: plugin_enabled,
          onChange: () => {
            this.props.showConfirmToggle(plugin_name, plugin_enabled);
          }
        }
      )));
    }
    componentDidMount() {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        rows.push(
          {
            isOpen: false,
            cells: [
              row.cn[0],
              row["nsslapd-pluginType"][0],
              row["nsslapd-pluginEnabled"][0]
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", { className: this.state.toggleSpinning ? "ds-disabled" : "" }, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search Plugins",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "all plugins table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          onCollapse: this.handleCollapse
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.state.rows.length / 2,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  PluginTable.propTypes = {
    rows: import_prop_types3.default.array
  };
  PluginTable.defaultProps = {
    rows: []
  };
  var AttrUniqConfigTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Config Name", transforms: [sortable] },
          { title: "Attribute", transforms: [sortable] },
          { title: "Enabled", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        rows.push([row.cn[0], row["uniqueness-attribute-name"].join(", "), row["nsslapd-pluginenabled"][0]]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          rows.push([row.cn[0], row["uniqueness-attribute-name"].join(", "), row["nsslapd-pluginenabled"][0]]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Attribute Uniqueness Configurations" }];
        tableRows = [{ cells: ["No Configurations"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search Configurations",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "glue table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  AttrUniqConfigTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  AttrUniqConfigTable.defaultProps = {
    rows: []
  };
  var LinkedAttributesTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Config Name", transforms: [sortable] },
          { title: "Link Type", transforms: [sortable] },
          { title: "Managed Type", transforms: [sortable] },
          { title: "Link Scope", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        const configName = row.cn === void 0 ? "" : row.cn[0];
        const linkType = row.linktype === void 0 ? "" : row.linktype[0];
        const managedType = row.managedtype === void 0 ? "" : row.managedtype[0];
        const linkScope = row.linkscope === void 0 ? "" : row.linkscope[0];
        rows.push([configName, linkType, managedType, linkScope]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1 && row[3].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          const configName = row.cn === void 0 ? "" : row.cn[0];
          const linkType = row.linktype === void 0 ? "" : row.linktype[0];
          const managedType = row.managedtype === void 0 ? "" : row.managedtype[0];
          const linkScope = row.linkscope === void 0 ? "" : row.linkscope[0];
          rows.push([configName, linkType, managedType, linkScope]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Linked Attributes Configurations" }];
        tableRows = [{ cells: ["No Configurations"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search Configurations",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "linked table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  LinkedAttributesTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  LinkedAttributesTable.defaultProps = {
    rows: []
  };
  var DNATable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Config Name", transforms: [sortable] },
          { title: "Scope", transforms: [sortable] },
          { title: "Filter", transforms: [sortable] },
          { title: "Next Value", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        const configName = row.cn === void 0 ? "" : row.cn[0];
        const nextValue = row.dnanextvalue === void 0 ? "" : row.dnanextvalue[0];
        const filter = row.dnafilter === void 0 ? "" : row.dnafilter[0];
        const scope = row.dnascope === void 0 ? "" : row.dnascope[0];
        rows.push([configName, scope, filter, nextValue]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1 && row[3].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          const configName = row.cn === void 0 ? "" : row.cn[0];
          const nextValue = row.dnanextvalue === void 0 ? "" : row.dnanextvalue[0];
          const filter = row.dnafilter === void 0 ? "" : row.dnafilter[0];
          const scope = row.scope === void 0 ? "" : row.scope[0];
          rows.push([configName, scope, filter, nextValue]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "DNA Configurations" }];
        tableRows = [{ cells: ["No Configurations"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search Configurations",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "dna table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  DNATable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  DNATable.defaultProps = {
    rows: []
  };
  var DNASharedTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Hostname", transforms: [sortable] },
          { title: "Port", transforms: [sortable] },
          { title: "Remaining Values", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        rows.push([
          row.dnahostname[0],
          row.dnaportnum[0],
          row.dnaremainingvalues[0]
        ]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          rows.push([
            row.dnahostname[0],
            row.dnaportnum[0],
            row.dnaremainingvalues[0]
          ]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0] + ":" + rowData[1])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0] + ":" + rowData[1])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "DNA Shared Configurations" }];
        tableRows = [{ cells: ["No Configurations"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search Shared Configurations",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "dna shared table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  DNASharedTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  DNASharedTable.defaultProps = {
    rows: []
  };
  var AutoMembershipDefinitionTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Definition Name", transforms: [sortable] },
          { title: "Default Group", transforms: [sortable] },
          { title: "Scope", transforms: [sortable] },
          { title: "Filter", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        rows.push([
          row.cn[0],
          "automemberdefaultgroup" in row ? row.automemberdefaultgroup[0] : "",
          row.automemberscope[0],
          row.automemberfilter[0]
        ]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1 && row[3].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          rows.push([
            row.cn[0],
            row.automemberdefaultgroup[0],
            row.automemberscope[0],
            row.automemberfilter[0]
          ]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Automembership Definitions" }];
        tableRows = [{ cells: ["No Definitions"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          className: "ds-margin-top-lg",
          placeholder: "Search Definitions",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "automember def table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  AutoMembershipDefinitionTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  AutoMembershipDefinitionTable.defaultProps = {
    rows: []
  };
  var AutoMembershipRegexTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Config Name", transforms: [sortable] },
          { title: "Exclusive Regex", transforms: [sortable] },
          { title: "Inclusive Regex", transforms: [sortable] },
          { title: "Target Group", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        const includeReg = row.automemberinclusiveregex === void 0 ? "" : row.automemberinclusiveregex.join(", ");
        const excludeReg = row.automemberexclusiveregex === void 0 ? "" : row.automemberexclusiveregex.join(", ");
        const targetGrp = row.automembertargetgroup === void 0 ? "" : row.automembertargetgroup[0];
        rows.push([row.cn[0], excludeReg, includeReg, targetGrp]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1 && row[3].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          const includeReg = row.automemberinclusiveregex === void 0 ? "" : row.automemberinclusiveregex[0];
          const excludeReg = row.automemberexclusiveregex === void 0 ? "" : row.automemberexclusiveregex[0];
          const targetGrp = row.automembertargetgroup === void 0 ? "" : row.automembertargetgroup[0];
          rows.push([
            row.cn[0],
            excludeReg.join(", "),
            includeReg.join(", "),
            targetGrp
          ]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Automembership Regular Expressions" }];
        tableRows = [{ cells: ["No regular expressions"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          className: "ds-margin-top-lg",
          placeholder: "Search Regular Expressions",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "automember regex table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  AutoMembershipRegexTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  AutoMembershipRegexTable.defaultProps = {
    rows: []
  };
  var ManagedDefinitionTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Config Name", transforms: [sortable] },
          { title: "Scope", transforms: [sortable] },
          { title: "Filter", transforms: [sortable] },
          { title: "Managed Base", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        const managedBase = row.managedbase === void 0 ? "" : row.managedbase[0];
        const scope = row.originscope === void 0 ? "" : row.originscope[0];
        const filter = row.originfilter === void 0 ? "" : row.originfilter[0];
        rows.push([row.cn[0], scope, filter, managedBase]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1 && row[3].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          const managedBase = row.managedbase === void 0 ? "" : row.managedbase[0];
          const scope = row.originscope === void 0 ? "" : row.originscope[0];
          const filter = row.originfilter === void 0 ? "" : row.originfilter[0];
          rows.push([row.cn[0], scope, filter, managedBase]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Managed Entry Definitions" }];
        tableRows = [{ cells: ["No definitions"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          className: "ds-margin-top-lg",
          placeholder: "Search Definitions",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "managed def table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  ManagedDefinitionTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  ManagedDefinitionTable.defaultProps = {
    rows: []
  };
  var ManagedTemplateTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Template DN", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        rows.push([row.entrydn[0]]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          rows.push([row.entrydn[0]]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Managed Entry Templates" }];
        tableRows = [{ cells: ["No templates"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search Templates",
          className: "ds-margin-top-lg",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "managed template table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  ManagedTemplateTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  ManagedTemplateTable.defaultProps = {
    rows: []
  };
  var PassthroughAuthURLsTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "URL", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        rows.push([row.url]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          rows.push([row.url]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit URL",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete URL",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Pass-Through Authentication URLs" }];
        tableRows = [{ cells: ["No URLs"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search",
          className: "ds-margin-top-lg",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "passthru url table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  PassthroughAuthURLsTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  PassthroughAuthURLsTable.defaultProps = {
    rows: []
  };
  var PassthroughAuthConfigsTable = class extends import_react8.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Config Name", transforms: [sortable] },
          { title: "Attribute", transforms: [sortable] },
          { title: "Map Method", transforms: [sortable] },
          { title: "Filter", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        const attr = row.pamidattr === void 0 ? "" : row.pamidattr[0];
        const mapMethod = row.pamidmapmethod === void 0 ? "" : row.pamidmapmethod[0];
        const filter = row.pamfilter === void 0 ? "" : row.pamfilter[0];
        rows.push([row.cn[0], attr, mapMethod, filter]);
      }
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1 && row[3].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3]]);
      }
      if (val === "") {
        for (const row of this.props.rows) {
          const attr = row.pamidattr === void 0 ? "" : row.pamidattr[0];
          const mapMethod = row.pamidmapmethod === void 0 ? "" : row.pamidmapmethod[0];
          const filter = row.pamfilter === void 0 ? "" : row.pamfilter[0];
          rows.push([row.cn[0], attr, mapMethod, filter]);
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Config",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Config",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "PAM Configurations" }];
        tableRows = [{ cells: ["No PAM configurations"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react8.default.createElement("div", null, /* @__PURE__ */ import_react8.default.createElement(
        SearchInput,
        {
          placeholder: "Search",
          className: "ds-margin-top-lg",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react8.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "pass config table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react8.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react8.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react8.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  PassthroughAuthConfigsTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  PassthroughAuthConfigsTable.defaultProps = {
    rows: []
  };

  // src/lib/plugins/accountPolicy.jsx
  var import_react10 = __toESM(require_react(), 1);
  var import_prop_types5 = __toESM(require_prop_types(), 1);

  // src/lib/plugins/pluginBasicConfig.jsx
  var import_react9 = __toESM(require_react(), 1);
  var import_prop_types4 = __toESM(require_prop_types(), 1);
  var PluginBasicConfig = class extends import_react9.default.Component {
    constructor(props) {
      super(props);
      this.updateFields = this.updateFields.bind(this);
      this.updateSwitch = this.updateSwitch.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.state = {
        disableSwitch: false,
        currentPluginEnabled: true,
        currentPluginType: "",
        currentPluginPath: "",
        currentPluginInitfunc: "",
        currentPluginId: "",
        currentPluginVendor: "",
        currentPluginVersion: "",
        currentPluginDescription: "",
        currentPluginDependsOnType: "",
        currentPluginDependsOnNamed: "",
        currentPluginPrecedence: "",
        isExpanded: false
      };
      this.handleToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
    }
    componentDidMount(prevProps) {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    handleFieldChange(e) {
      e.preventDefault();
      this.setState({
        [e.target.id]: e.target.value
      });
    }
    handleSwitchChange() {
      const {
        pluginName,
        cmdName,
        serverId,
        pluginListHandler,
        addNotification,
        toggleLoadingHandler
      } = this.props;
      const new_status = this.state.currentPluginEnabled ? "disable" : "enable";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "plugin",
        cmdName,
        new_status
      ];
      toggleLoadingHandler();
      this.setState({ disableSwitch: true });
      log_cmd("handleSwitchChange", "Switch plugin states from the plugin tab", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        pluginListHandler();
        const successCheckCMD = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
          "config",
          "get",
          "nsslapd-dynamic-plugins"
        ];
        log_cmd("handleSwitchChange", "Get Dynamic Plugins attribute", successCheckCMD);
        cockpit_default.spawn(successCheckCMD, { superuser: true, err: "message" }).done((content2) => {
          const config2 = JSON.parse(content2);
          let dynamicPluginEnabled;
          if (config2.attrs["nsslapd-dynamic-plugins"][0] === "on") {
            dynamicPluginEnabled = true;
          } else if (config2.attrs["nsslapd-dynamic-plugins"][0] === "off") {
            dynamicPluginEnabled = false;
          } else {
            console.error(
              "handleSwitchChange failed",
              "wrong nsslapd-dynamic-pluginc attribute value",
              config2.attrs["nsslapd-dynamic-plugins"][0]
            );
          }
          addNotification(
            `${!dynamicPluginEnabled ? "warning" : "success"}`,
            `${pluginName} plugin was successfully ${new_status}d.
                                    ${!dynamicPluginEnabled ? "Please, restart the instance." : ""}`
          );
          toggleLoadingHandler();
        }).fail(() => {
          console.error(
            "handleSwitchChange failed",
            "Failed to get nsslapd-dynamic-pluginc attribute value"
          );
          addNotification(
            "warning",
            `${pluginName} plugin was successfully ${new_status}d.
                                    Please, restart the instance.`
          );
          toggleLoadingHandler();
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        addNotification(
          "error",
          `Error during ${pluginName} plugin modification - ${errMsg.desc}`
        );
        toggleLoadingHandler();
        this.setState({ disableSwitch: false });
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === this.props.cn);
        if (pluginRow) {
          this.setState({
            currentPluginType: pluginRow["nsslapd-pluginType"][0],
            currentPluginPath: pluginRow["nsslapd-pluginPath"][0],
            currentPluginInitfunc: pluginRow["nsslapd-pluginInitfunc"][0],
            currentPluginId: pluginRow["nsslapd-pluginId"][0],
            currentPluginVendor: pluginRow["nsslapd-pluginVendor"][0],
            currentPluginVersion: pluginRow["nsslapd-pluginVersion"][0],
            currentPluginDescription: pluginRow["nsslapd-pluginDescription"][0],
            currentPluginDependsOnType: pluginRow["nsslapd-plugin-depends-on-type"] === void 0 ? "" : pluginRow["nsslapd-plugin-depends-on-type"][0],
            currentPluginDependsOnNamed: pluginRow["nsslapd-plugin-depends-on-named"] === void 0 ? "" : pluginRow["nsslapd-plugin-depends-on-named"][0],
            currentPluginPrecedence: pluginRow["nsslapd-pluginprecedence"] === void 0 ? "" : pluginRow["nsslapd-pluginprecedence"][0]
          });
        }
      }
      this.updateSwitch();
    }
    updateSwitch() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === this.props.cn);
        if (pluginRow) {
          let pluginEnabled = false;
          if (pluginRow["nsslapd-pluginEnabled"][0] === "on") {
            pluginEnabled = true;
          } else if (pluginRow["nsslapd-pluginEnabled"][0] === "off") {
            pluginEnabled = false;
          } else {
            console.error(
              "openPluginModal failed",
              "wrong nsslapd-pluginenabled attribute value",
              pluginRow["nsslapd-pluginEnabled"][0]
            );
          }
          this.setState({
            currentPluginEnabled: pluginEnabled,
            disableSwitch: false
          });
        }
      }
    }
    render() {
      const {
        disableSwitch
      } = this.state;
      const enabled = /* @__PURE__ */ import_react9.default.createElement("i", null, "Plugin is enabled");
      const disabled = /* @__PURE__ */ import_react9.default.createElement("i", null, "Plugin is disabled");
      return /* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 9, className: "ds-margin-top" }, /* @__PURE__ */ import_react9.default.createElement(TextContent, null, /* @__PURE__ */ import_react9.default.createElement(Text, { component: TextVariants.h2 }, this.props.pluginName, " Plugin"))), this.props.removeSwitch || /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3, className: "ds-float-right ds-margin-top" }, /* @__PURE__ */ import_react9.default.createElement(
        Switch,
        {
          id: "this.props.pluginName",
          label: enabled,
          labelOff: disabled,
          isChecked: this.state.currentPluginEnabled,
          onChange: this.handleSwitchChange,
          isDisabled: disableSwitch
        }
      )), /* @__PURE__ */ import_react9.default.createElement("hr", null))), /* @__PURE__ */ import_react9.default.createElement("div", { className: "ds-indent" }, this.props.children), this.state.currentPluginPath !== "" && /* @__PURE__ */ import_react9.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-top-lg",
          toggleText: this.state.isExpanded ? "Hide Plugin Details" : "Show Plugin Details",
          onToggle: this.handleToggle,
          isExpanded: this.state.isExpanded
        },
        /* @__PURE__ */ import_react9.default.createElement(Grid, { className: "ds-margin-left" }, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react9.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Type")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginType))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Path")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginPath))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Initfunc")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginInitfunc))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Depends On Type")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginDependsOnType))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Depends On Named")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginDependsOnNamed))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Vendor")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginVendor))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Version")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginVersion))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Description")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginDescription))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin ID")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginId))), /* @__PURE__ */ import_react9.default.createElement(Grid, null, /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react9.default.createElement("b", null, "Plugin Precedence")), /* @__PURE__ */ import_react9.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react9.default.createElement("i", null, this.state.currentPluginPrecedence))), /* @__PURE__ */ import_react9.default.createElement("hr", null))))
      ));
    }
  };
  PluginBasicConfig.propTypes = {
    children: import_prop_types4.default.any.isRequired,
    rows: import_prop_types4.default.array,
    serverId: import_prop_types4.default.string,
    cn: import_prop_types4.default.string,
    pluginName: import_prop_types4.default.string,
    cmdName: import_prop_types4.default.string,
    removeSwitch: import_prop_types4.default.bool,
    pluginListHandler: import_prop_types4.default.func,
    addNotification: import_prop_types4.default.func,
    toggleLoadingHandler: import_prop_types4.default.func
  };
  PluginBasicConfig.defaultProps = {
    rows: [],
    serverId: "",
    cn: "",
    pluginName: "",
    cmdName: "",
    removeSwitch: false
  };
  var pluginBasicConfig_default = PluginBasicConfig;

  // src/lib/plugins/accountPolicy.jsx
  var AccountPolicy = class extends import_react10.default.Component {
    componentDidMount() {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.updateFields = this.updateFields.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.handleCheckboxChange = this.handleCheckboxChange.bind(this);
      this.handleOpenModal = this.handleOpenModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.handleAddConfig = this.handleAddConfig.bind(this);
      this.handleEditConfig = this.handleEditConfig.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.handleShowConfirmDelete = this.handleShowConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.sharedConfigExists = this.sharedConfigExists.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.state = {
        attributes: [],
        // Main config
        configArea: "",
        _configArea: "",
        error: [],
        saveBtnDisabled: true,
        saving: false,
        addingModal: false,
        savingModal: false,
        sharedConfigExists: false,
        // Modal Config
        configDN: "",
        altStateAttrName: "",
        alwaysRecordLogin: false,
        alwaysRecordLoginAttr: "",
        limitAttrName: "",
        specAttrName: "",
        stateAttrName: "",
        checkAllStateAttrs: false,
        _configDN: "",
        _altStateAttrName: [],
        _alwaysRecordLogin: false,
        _alwaysRecordLoginAttr: "",
        _limitAttrName: "",
        _specAttrName: "",
        _stateAttrName: "",
        _checkAllStateAttrs: false,
        errorModal: {},
        saveBtnDisabledModal: true,
        modalChecked: false,
        modalSpinning: false,
        configEntryModalShow: false,
        fixupModalShow: false,
        newEntry: false,
        isRecordLoginOpen: false,
        isSpecificAttrOpen: false,
        isStateAttrOpen: false,
        isAltStateAttrOpen: false,
        isLimitAttrOpen: false,
        showConfirmDelete: false
      };
      this.handleRecordLoginSelect = (event, selection) => {
        if (selection === this.state.alwaysRecordLoginAttr) {
          this.handleRecordLoginClear();
        } else {
          this.setState({
            alwaysRecordLoginAttr: selection,
            isRecordLoginOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleRecordLoginToggle = (isRecordLoginOpen) => {
        this.setState({
          isRecordLoginOpen
        });
      };
      this.handleRecordLoginClear = () => {
        this.setState({
          alwaysRecordLoginAttr: "",
          isRecordLoginOpen: false
        });
      };
      this.handleSpecificAttrSelect = (event, selection) => {
        if (selection === this.state.specAttrName) {
          this.handleSpecificAttrClear();
        } else {
          this.setState({
            specAttrName: selection,
            isSpecificAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleSpecificAttrToggle = (isSpecificAttrOpen) => {
        this.setState({
          isSpecificAttrOpen
        });
      };
      this.handleSpecificAttrClear = () => {
        this.setState({
          specAttrName: [],
          isSpecificAttrOpen: false
        });
      };
      this.handleStateAttrSelect = (event, selection) => {
        if (selection === this.state.stateAttrName) {
          this.handleStateAttrClear();
        } else {
          this.setState({
            stateAttrName: selection,
            isStateAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleStateAttrToggle = (isStateAttrOpen) => {
        this.setState({
          isStateAttrOpen
        });
      };
      this.handleStateAttrClear = () => {
        this.setState({
          stateAttrName: [],
          isStateAttrOpen: false
        });
      };
      this.handleAlternativeStateSelect = (event, selection) => {
        if (selection === this.state.altStateAttrName) {
          this.handleAlternativeStateClear();
        } else {
          this.setState({
            altStateAttrName: selection,
            isAltStateAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleAlternativeStateToggle = (isAltStateAttrOpen) => {
        this.setState({
          isAltStateAttrOpen
        });
      };
      this.handleAlternativeStateClear = () => {
        this.setState({
          altStateAttrName: [],
          isAltStateAttrOpen: false
        });
      };
      this.handleLimitAttrSelect = (event, selection) => {
        if (selection === this.state.limitAttrName) {
          this.handleLimitAttrClear();
        } else {
          this.setState({
            limitAttrName: selection,
            isLimitAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleLimitAttrToggle = (isLimitAttrOpen) => {
        this.setState({
          isLimitAttrOpen
        });
      };
      this.handleLimitAttrClear = () => {
        this.setState({
          limitAttrName: [],
          isLimitAttrOpen: false
        });
      };
    }
    handleShowConfirmDelete() {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    sharedConfigExists() {
      if (this.state.configArea) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "account-policy",
          "config-entry",
          "show",
          this.state.configArea
        ];
        log_cmd("sharedConfigExists", "Check if Account Policy config entry exists", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          this.setState({
            sharedConfigExists: true
          });
        }).fail((_) => {
          this.props.addNotification(
            "warning",
            `Warning! Account Policy config entry "${this.state.configArea}" doesn't exist!`
          );
          this.setState({
            sharedConfigExists: false
          });
        });
      }
    }
    handleOpenModal() {
      if (!this.state.configArea) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configDN: "",
          altStateAttrName: "createTimestamp",
          alwaysRecordLogin: false,
          alwaysRecordLoginAttr: "lastLoginTime",
          limitAttrName: "accountInactivityLimit",
          specAttrName: "acctPolicySubentry",
          stateAttrName: "lastLoginTime",
          checkAllStateAttrs: "checkAllStateAttrs",
          _configDN: "",
          _altStateAttrName: "createTimestamp",
          _alwaysRecordLogin: false,
          _alwaysRecordLoginAttr: "lastLoginTime",
          _limitAttrName: "accountInactivityLimit",
          _specAttrName: "acctPolicySubentry",
          _stateAttrName: "lastLoginTime",
          _checkAllStateAttrs: "checkAllStateAttrs",
          savingModal: false,
          saveBtnDisabledModal: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "account-policy",
          "config-entry",
          "show",
          this.state.configArea
        ];
        log_cmd("handleOpenModal", "Fetch the Account Policy Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            savingModal: false,
            saveBtnDisabledModal: true,
            configDN: this.state.configArea,
            _configDN: this.state.configArea,
            altStateAttrName: configEntry.altstateattrname === void 0 ? "createTimestamp" : configEntry.altstateattrname[0],
            alwaysRecordLogin: !(configEntry.alwaysrecordlogin === void 0 || configEntry.alwaysrecordlogin[0] === "no"),
            alwaysRecordLoginAttr: configEntry.alwaysrecordloginattr === void 0 ? "lastLoginTime" : configEntry.alwaysrecordloginattr[0],
            limitAttrName: configEntry.limitattrname === void 0 ? "accountInactivityLimit" : configEntry.limitattrname[0],
            specAttrName: configEntry.specattrname === void 0 ? "acctPolicySubentry" : configEntry.specattrname[0],
            stateAttrName: configEntry.stateattrname === void 0 ? "lastLoginTime" : configEntry.stateattrname[0],
            checkAllStateAttrs: !(configEntry.checkallstateattrs === void 0 || configEntry.checkallstateattrs[0] === "no"),
            // original values
            _altStateAttrName: configEntry.altstateattrname === void 0 ? "createTimestamp" : configEntry.altstateattrname[0],
            _alwaysRecordLogin: !(configEntry.alwaysrecordlogin === void 0 || configEntry.alwaysrecordlogin[0] === "no"),
            _alwaysRecordLoginAttr: configEntry.alwaysrecordloginattr === void 0 ? "lastLoginTime" : configEntry.alwaysrecordloginattr[0],
            _limitAttrName: configEntry.limitattrname === void 0 ? "accountInactivityLimit" : configEntry.limitattrname[0],
            _specAttrName: configEntry.specattrname === void 0 ? "acctPolicySubentry" : configEntry.specattrname[0],
            _stateAttrName: configEntry.stateattrname === void 0 ? "lastLoginTime" : configEntry.stateattrname[0],
            _checkAllStateAttrs: !(configEntry.checkallstateattrs === void 0 || configEntry.checkallstateattrs[0] === "no")
          });
        }).fail((_) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configDN: this.state.configArea,
            altStateAttrName: "createTimestamp",
            alwaysRecordLogin: false,
            alwaysRecordLoginAttr: "lastLoginTime",
            limitAttrName: "accountInactivityLimit",
            specAttrName: "acctPolicySubentry",
            stateAttrName: "lastLoginTime",
            checkAllStateAttrs: false,
            _altStateAttrName: "createTimestamp",
            _alwaysRecordLogin: false,
            _alwaysRecordLoginAttr: "lastLoginTime",
            _limitAttrName: "accountInactivityLimit",
            _specAttrName: "acctPolicySubentry",
            _stateAttrName: "lastLoginTime",
            _checkAllStateAttrs: false,
            saveBtnDisabledModal: false
            // We preset the form so it's ready to save
          });
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    cmdOperation(action) {
      const {
        configDN,
        altStateAttrName,
        alwaysRecordLogin,
        alwaysRecordLoginAttr,
        limitAttrName,
        specAttrName,
        stateAttrName,
        checkAllStateAttrs
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "account-policy",
        "config-entry",
        action,
        configDN,
        "--always-record-login",
        alwaysRecordLogin ? "yes" : "no",
        "--check-all-state-attrs",
        checkAllStateAttrs ? "yes" : "no"
      ];
      cmd = [...cmd, "--alt-state-attr"];
      if (altStateAttrName !== "") {
        cmd = [...cmd, altStateAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--always-record-login-attr"];
      if (alwaysRecordLoginAttr !== "") {
        cmd = [...cmd, alwaysRecordLoginAttr];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--limit-attr"];
      if (limitAttrName !== "") {
        cmd = [...cmd, limitAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--spec-attr"];
      if (specAttrName !== "") {
        cmd = [...cmd, specAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--state-attr"];
      if (stateAttrName !== "") {
        cmd = [...cmd, stateAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      if (action === "add") {
        this.setState({
          addingModal: true
        });
      } else {
        this.setState({
          savingModal: true
        });
      }
      log_cmd(
        "accountPolicyOperation",
        `Do the ${action} operation on the Account Policy Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("accountPolicyOperation", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${configDN} was successfully ${action}ed`
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        if (action === "add") {
          this.setState({
            addingModal: false
          });
        } else {
          this.setState({
            savingModal: false
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry ${action} operation - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        if (action === "add") {
          this.setState({
            addingModal: false
          });
        } else {
          this.setState({
            savingModal: false
          });
        }
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "account-policy",
        "config-entry",
        "delete",
        this.state.configDN
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Account Policy Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${this.state.configDN} was successfully deleted`
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry removal operation - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      });
    }
    handleAddConfig() {
      this.cmdOperation("add");
    }
    handleEditConfig() {
      this.cmdOperation("set");
    }
    handleCheckboxChange(checked, e) {
      this.setState({
        [e.target.id]: checked
      }, () => {
        this.validateConfig();
      });
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "configDN"
      ];
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "configDN",
          "altStateAttrName",
          "alwaysRecordLogin",
          "alwaysRecordLoginAttr",
          "limitAttrName",
          "stateAttrName",
          "checkAllStateAttrs"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        errorModal: errObj
      });
    }
    handleFieldChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let saveBtnDisabled = true;
      const errObj = {};
      errObj[attr] = false;
      if (value !== "") {
        if (!valid_dn(value)) {
          errObj[attr] = true;
        } else if (value !== this.state["_" + attr]) {
          saveBtnDisabled = false;
        }
      } else if (value !== this.state["_" + attr]) {
        saveBtnDisabled = false;
      }
      this.setState({
        [attr]: value,
        error: errObj,
        saveBtnDisabled
      });
    }
    handleModalChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateConfig();
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Account Policy Plugin");
        this.setState({
          configArea: pluginRow.nsslapd_pluginconfigarea === void 0 ? "" : pluginRow.nsslapd_pluginconfigarea[0]
        }, () => {
          this.sharedConfigExists();
        });
      }
    }
    handleSaveConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "account-policy",
        "set",
        "--config-entry",
        this.state.configArea || "delete"
      ];
      this.setState({
        saving: true
      });
      log_cmd(
        "handleSaveConfig",
        `Save Account Policy Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          `Successfully updated Account Policy Plugin`
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      }).fail((err) => {
        let errMsg = JSON.parse(err);
        if ("info" in errMsg) {
          errMsg = errMsg.desc + " " + errMsg.info;
        } else {
          errMsg = errMsg.desc;
        }
        this.props.addNotification(
          "error",
          `Error during update - ${errMsg}`
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      });
    }
    render() {
      const {
        configArea,
        configDN,
        altStateAttrName,
        alwaysRecordLogin,
        alwaysRecordLoginAttr,
        limitAttrName,
        specAttrName,
        stateAttrName,
        checkAllStateAttrs,
        newEntry,
        configEntryModalShow,
        error,
        errorModal,
        saveBtnDisabled,
        saveBtnDisabledModal,
        saving,
        savingModal,
        addingModal
      } = this.state;
      const extraPrimaryProps = {};
      let saveBtnText = "Save Config";
      if (saving) {
        saveBtnText = "Saving ...";
      }
      let modalButtons = [];
      if (!newEntry) {
        modalButtons = [
          /* @__PURE__ */ import_react10.default.createElement(Button, { key: "del", variant: "primary", onClick: this.handleShowConfirmDelete }, "Delete Config"),
          /* @__PURE__ */ import_react10.default.createElement(
            Button,
            {
              key: "save",
              variant: "primary",
              onClick: this.handleEditConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? "Saving" : void 0,
              ...extraPrimaryProps
            },
            savingModal ? "Saving ..." : "Save Config"
          ),
          /* @__PURE__ */ import_react10.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
        ];
      } else {
        modalButtons = [
          /* @__PURE__ */ import_react10.default.createElement(
            Button,
            {
              key: "add",
              variant: "primary",
              onClick: this.handleAddConfig,
              isDisabled: saveBtnDisabledModal || addingModal,
              isLoading: addingModal,
              spinnerAriaValueText: addingModal ? "Saving" : void 0,
              ...extraPrimaryProps
            },
            addingModal ? "Adding ..." : "Add Config"
          ),
          /* @__PURE__ */ import_react10.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
        ];
      }
      return /* @__PURE__ */ import_react10.default.createElement("div", { className: this.state.saving || this.state.savingModal || this.state.addingModal ? "ds-disabled" : "" }, /* @__PURE__ */ import_react10.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Manage Account Policy Plugin Shared Config Entry",
          isOpen: configEntryModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleCloseModal,
          actions: modalButtons
        },
        /* @__PURE__ */ import_react10.default.createElement(Form, { isHorizontal: true, autoComplete: "no" }, /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "DN of the config entry" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4, className: "ds-label" }, "Config DN"), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react10.default.createElement(
          TextInput,
          {
            value: configDN,
            type: "text",
            id: "configDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configDN",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: errorModal.configDN ? ValidatedOptions.error : ValidatedOptions.default,
            isDisabled: newEntry
          }
        ), /* @__PURE__ */ import_react10.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configDN }, "Value must be a valid DN"))), /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "Specifies the attribute to store the time of the last successful login in this attribute in the users directory entry (alwaysRecordLoginAttr)" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4, className: "ds-label" }, "Always Record Login Attribute"), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react10.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: this.handleRecordLoginToggle,
            onSelect: this.handleRecordLoginSelect,
            onClear: this.handleRecordLoginClear,
            selections: alwaysRecordLoginAttr,
            isOpen: this.state.isRecordLoginOpen,
            "aria-labelledby": "typeAhead-record-login",
            placeholderText: "Type an attribute name ...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react10.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        )), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react10.default.createElement(
          Checkbox,
          {
            id: "alwaysRecordLogin",
            className: "ds-left-margin ds-lower-field",
            isChecked: alwaysRecordLogin,
            title: "Sets that every entry records its last login time (alwaysRecordLogin)",
            onChange: this.handleCheckboxChange,
            label: "Always Record Login"
          }
        ))), /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "Specifies the attribute to identify which entries are account policy configuration entries (specAttrName)" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4, className: "ds-label" }, "Specific Attribute"), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react10.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: this.handleSpecificAttrToggle,
            onSelect: this.handleSpecificAttrSelect,
            onClear: this.handleSpecificAttrClear,
            selections: specAttrName,
            isOpen: this.state.isSpecificAttrOpen,
            "aria-labelledby": "typeAhead-specific-attr",
            placeholderText: "Type an attribute name ...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attributes.map((attr) => /* @__PURE__ */ import_react10.default.createElement(
            SelectOption,
            {
              key: attr,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "Specifies the attribute within the policy to use for the account inactivation limit (limitAttrName)" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4, className: "ds-label" }, "Limit Attribute"), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react10.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: this.handleLimitAttrToggle,
            onSelect: this.handleLimitAttrSelect,
            onClear: this.handleLimitAttrClear,
            selections: limitAttrName,
            isOpen: this.state.isLimitAttrOpen,
            "aria-labelledby": "typeAhead-limit-attr",
            placeholderText: "Type an attribute name ...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react10.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "Specifies the primary time attribute used to evaluate an account policy (stateAttrName)" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4, className: "ds-label" }, "State Attribute"), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react10.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: this.handleStateAttrToggle,
            onSelect: this.handleStateAttrSelect,
            onClear: this.handleStateAttrClear,
            selections: stateAttrName,
            isOpen: this.state.isStateAttrOpen,
            "aria-labelledby": "typeAhead-state-attr",
            placeholderText: "Type an attribute name ...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react10.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "Provides a backup attribute to evaluate the expiration time if the main state attribute is not present (altStateAttrName)" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4, className: "ds-label" }, "Alternative State Attribute"), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react10.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: this.handleAlternativeStateToggle,
            onSelect: this.handleAlternativeStateSelect,
            onClear: this.handleAlternativeStateClear,
            selections: altStateAttrName,
            isOpen: this.state.isAltStateAttrOpen,
            "aria-labelledby": "typeAhead-alt-state-attr",
            placeholderText: "Type an attribute name ...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react10.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "Check both the 'state attribute', and the 'alternate state attribute' regaredless if the main state attribute is present" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react10.default.createElement(
          Checkbox,
          {
            id: "checkAllStateAttrs",
            className: "ds-left-margin",
            isChecked: checkAllStateAttrs,
            onChange: this.handleCheckboxChange,
            label: "Check All State Attributes"
          }
        ))))
      ), /* @__PURE__ */ import_react10.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "Account Policy Plugin",
          pluginName: "Account Policy",
          cmdName: "account-policy",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react10.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react10.default.createElement(Grid, { title: "DN of the shared config entry (nsslapd-pluginConfigArea)" }, /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Shared Config Entry"), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react10.default.createElement(
          TextInput,
          {
            value: configArea,
            type: "text",
            id: "configArea",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configArea",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: error.configArea ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react10.default.createElement(FormHelperText, { isError: true, isHidden: !error.configArea }, "Value must be a valid DN")), /* @__PURE__ */ import_react10.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react10.default.createElement(
          Button,
          {
            className: "ds-left-margin",
            key: "manage",
            variant: "primary",
            onClick: this.handleOpenModal,
            isDisabled: !this.state.sharedConfigExists && saveBtnDisabled
          },
          this.state.sharedConfigExists ? "Manage Config" : "Create Config"
        )))),
        /* @__PURE__ */ import_react10.default.createElement(
          Button,
          {
            className: "ds-margin-top-lg",
            key: "at",
            isLoading: saving,
            spinnerAriaValueText: saving ? "Loading" : void 0,
            variant: "primary",
            onClick: this.handleSaveConfig,
            ...extraPrimaryProps,
            isDisabled: saveBtnDisabled || saving
          },
          saveBtnText
        )
      ), /* @__PURE__ */ import_react10.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.deleteConfig,
          spinning: this.state.modalSpinning,
          item: this.state.configDN,
          checked: this.state.modalChecked,
          mTitle: "Delete Account Policy Config Entry",
          mMsg: "Are you sure you want to delete this config entry?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ));
    }
  };
  AccountPolicy.propTypes = {
    rows: import_prop_types5.default.array,
    serverId: import_prop_types5.default.string,
    savePluginHandler: import_prop_types5.default.func,
    pluginListHandler: import_prop_types5.default.func,
    addNotification: import_prop_types5.default.func,
    toggleLoadingHandler: import_prop_types5.default.func
  };
  AccountPolicy.defaultProps = {
    rows: [],
    serverId: ""
  };
  var accountPolicy_default = AccountPolicy;

  // src/lib/plugins/attributeUniqueness.jsx
  var import_react11 = __toESM(require_react(), 1);
  var import_prop_types6 = __toESM(require_prop_types(), 1);
  var AttributeUniqueness = class extends import_react11.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadConfigs();
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        configRows: [],
        modalChecked: false,
        modalSpinning: false,
        tableKey: 0,
        saveBtnDisabled: true,
        error: {},
        configName: "",
        configEnabled: false,
        attrNames: [],
        subtrees: [],
        subtreesOptions: [],
        acrossAllSubtrees: false,
        topEntryOc: "",
        subtreeEnriesOc: "",
        _configName: "",
        _configEnabled: false,
        _attrNames: [],
        _subtrees: [],
        _subtreesOptions: [],
        _acrossAllSubtrees: false,
        _topEntryOc: "",
        _subtreeEnriesOc: "",
        newEntry: false,
        showConfigModal: false,
        showConfirmDelete: false,
        isAttributeNameOpen: false,
        isSubtreesOpen: false
      };
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleTypeaheadChange = this.handleTypeaheadChange.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.showEditConfigModal = this.showEditConfigModal.bind(this);
      this.handleShowAddConfigModal = this.handleShowAddConfigModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.openModal = this.openModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.addConfig = this.addConfig.bind(this);
      this.editConfig = this.editConfig.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.handleAttributeNameSelect = (event, selection) => {
        if (this.state.attrNames.includes(selection)) {
          this.setState(
            (prevState) => ({
              attrNames: prevState.attrNames.filter((item) => item !== selection),
              isAttributeNameOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              attrNames: [...prevState.attrNames, selection],
              isAttributeNameOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        }
      };
      this.handleAttributeNameToggle = (isAttributeNameOpen) => {
        this.setState({
          isAttributeNameOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleAttributeNameClear = () => {
        this.setState({
          attrNames: [],
          isAttributeNameOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreesSelect = (event, selection) => {
        if (this.state.subtrees.includes(selection)) {
          this.setState(
            (prevState) => ({
              subtrees: prevState.subtrees.filter((item) => item !== selection),
              isAttributeNameOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              subtrees: [...prevState.subtrees, selection],
              isAttributeNameOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        }
      };
      this.handleSubtreesToggle = (isSubtreesOpen) => {
        this.setState({
          isSubtreesOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreesClear = () => {
        this.setState({
          subtrees: [],
          isSubtreesOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreesCreateOption = (newValue) => {
        if (!this.state.subtreesOptions.includes(newValue)) {
          this.setState({
            subtreesOptions: [...this.state.subtreesOptions, newValue],
            isSubtreesOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      for (const attrList of ["attrNames", "subtrees"]) {
        if (this.state[attrList].length === 0) {
          errObj[attrList] = true;
          all_good = false;
        }
      }
      for (const dn of this.state.subtrees) {
        if (!valid_dn(dn)) {
          errObj.subtrees = true;
          all_good = false;
          break;
        }
      }
      if (this.state.configName === "") {
        errObj.configName = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrLists = [
          "subtrees",
          "attrNames"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "acrossAllSubtrees",
          "topEntryOc",
          "subtreeEnriesOc",
          "configEnabled"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    handleSwitchChange(value) {
      this.setState({
        configEnabled: value
      }, () => {
        this.validateConfig();
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateConfig();
      });
    }
    handleTypeaheadChange(values) {
      const new_values = [];
      for (let val of values) {
        if (val !== "") {
          if (typeof val === "object") {
            val = val.label;
          }
          new_values.push(val);
        }
      }
      this.setState({
        subtrees: new_values
      });
    }
    loadConfigs() {
      this.setState({
        firstLoad: false
      });
      this.props.pluginListHandler();
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "attr-uniq",
        "list"
      ];
      log_cmd("loadConfigs", "Get Attribute Uniqueness Plugin configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          configRows: myObject.items.map((item) => item.attrs),
          tableKey
        });
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = JSON.parse(err);
          console.log("loadConfigs failed", errMsg.desc);
        }
      });
    }
    showEditConfigModal(name2) {
      this.openModal(name2);
    }
    handleShowAddConfigModal(rowData) {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configEnabled: false,
          configName: "",
          attrNames: [],
          subtrees: [],
          acrossAllSubtrees: false,
          topEntryOc: "",
          subtreeEnriesOc: ""
        });
      } else {
        let configAttrNamesList = [];
        let configSubtreesList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "attr-uniq",
          "show",
          name2
        ];
        log_cmd("openModal", "Fetch the Attribute Uniqueness Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            configName: configEntry.cn === void 0 ? "" : configEntry.cn[0],
            configEnabled: !(configEntry["nsslapd-pluginenabled"] === void 0 || configEntry["nsslapd-pluginenabled"][0] === "off"),
            acrossAllSubtrees: !(configEntry["uniqueness-across-all-subtrees"] === void 0 || configEntry["uniqueness-across-all-subtrees"][0] === "off"),
            topEntryOc: configEntry["uniqueness-top-entry-oc"] === void 0 ? "" : configEntry["uniqueness-top-entry-oc"][0],
            subtreeEnriesOc: configEntry["uniqueness-subtree-entries-oc"] === void 0 ? "" : configEntry["uniqueness-subtree-entries-oc"][0],
            _configEnabled: !(configEntry["nsslapd-pluginenabled"] === void 0 || configEntry["nsslapd-pluginenabled"][0] === "off"),
            _acrossAllSubtrees: !(configEntry["uniqueness-across-all-subtrees"] === void 0 || configEntry["uniqueness-across-all-subtrees"][0] === "off"),
            _topEntryOc: configEntry["uniqueness-top-entry-oc"] === void 0 ? "" : configEntry["uniqueness-top-entry-oc"][0],
            _subtreeEnriesOc: configEntry["uniqueness-subtree-entries-oc"] === void 0 ? "" : configEntry["uniqueness-subtree-entries-oc"][0]
          });
          if (configEntry["uniqueness-attribute-name"] === void 0) {
            this.setState({ attrNames: [], _attrNames: [] });
          } else {
            for (const value of configEntry["uniqueness-attribute-name"]) {
              configAttrNamesList = [...configAttrNamesList, value];
            }
            this.setState({ attrNames: configAttrNamesList, _attrNames: [...configAttrNamesList] });
          }
          if (configEntry["uniqueness-subtrees"] === void 0) {
            this.setState({ subtrees: [], _subtrees: [] });
          } else {
            for (const value of configEntry["uniqueness-subtrees"]) {
              configSubtreesList = [...configSubtreesList, value];
            }
            this.setState({ subtrees: configSubtreesList, _subtrees: [...configSubtreesList] });
          }
        }).fail((_) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configName: "",
            attrNames: [],
            subtrees: [],
            acrossAllSubtrees: false,
            topEntryOc: "",
            subtreeEnriesOc: "",
            configEnabled: false
          });
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    cmdOperation(action) {
      const {
        configName,
        configEnabled,
        attrNames,
        subtrees,
        acrossAllSubtrees,
        topEntryOc,
        subtreeEnriesOc
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "attr-uniq",
        action,
        configName,
        "--enabled",
        configEnabled ? "on" : "off",
        "--across-all-subtrees",
        acrossAllSubtrees ? "on" : "off"
      ];
      if (subtrees.length === 0 && subtreeEnriesOc.length === 0) {
        this.props.addNotification(
          "error",
          `There must be at least one Subtree or Subtree Entries OC set`
        );
        return;
      }
      this.setState({
        saving: true
      });
      if (!(action === "add" && attrNames.length === 0)) {
        cmd = [...cmd, "--attr-name"];
        if (attrNames.length !== 0) {
          for (const value of attrNames) {
            cmd = [...cmd, value];
          }
        } else if (action === "add") {
          cmd = [...cmd, ""];
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      if (!(action === "add" && subtrees.length === 0)) {
        cmd = [...cmd, "--subtree"];
        if (subtrees.length !== 0) {
          for (const value of subtrees) {
            cmd = [...cmd, value];
          }
        } else if (action === "add") {
          cmd = [...cmd, ""];
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      cmd = [...cmd, "--top-entry-oc"];
      if (topEntryOc.length !== 0) {
        cmd = [...cmd, topEntryOc];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--subtree-entries-oc"];
      if (subtreeEnriesOc.length !== 0) {
        cmd = [...cmd, subtreeEnriesOc];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      log_cmd(
        "attrUniqOperation",
        `Do the ${action} operation on the Attribute Uniqueness Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("attrUniqOperation", "Result", content);
        this.props.addNotification(
          "success",
          `The ${action} operation was successfully done on "${configName}" entry`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry ${action} operation - ${errMsg.desc}`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      });
    }
    showConfirmDelete(name2) {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "attr-uniq",
        "delete",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Attribute Uniqueness Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${this.state.deleteName} was successfully deleted`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.closeConfirmDelete();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry removal operation - ${errMsg.desc}`
        );
        this.loadConfigs();
        this.closeConfirmDelete();
        this.handleCloseModal();
      });
    }
    addConfig() {
      this.cmdOperation("add");
    }
    editConfig() {
      this.cmdOperation("set");
    }
    render() {
      const {
        configEntryModalShow,
        configName,
        attrNames,
        subtrees,
        acrossAllSubtrees,
        configEnabled,
        topEntryOc,
        subtreeEnriesOc,
        newEntry
      } = this.state;
      const title = (newEntry ? "Add" : "Edit") + " Attribute Uniqueness Plugin Config Entry";
      let saveBtnName = (newEntry ? "Add" : "Save") + " Config";
      const extraPrimaryProps = {};
      if (this.state.saving) {
        if (newEntry) {
          saveBtnName = "Adding Config ...";
        } else {
          saveBtnName = "Saving Config ...";
        }
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react11.default.createElement("div", { className: this.state.saving || this.state.modalSpinning ? "ds-disabled" : "" }, /* @__PURE__ */ import_react11.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          "aria-labelledby": "ds-modal",
          isOpen: configEntryModalShow,
          onClose: this.handleCloseModal,
          actions: [
            /* @__PURE__ */ import_react11.default.createElement(
              Button,
              {
                className: "ds-margin-top",
                key: "confirm",
                variant: "primary",
                onClick: newEntry ? this.addConfig : this.editConfig,
                isDisabled: this.state.saveBtnDisabled || this.state.saving,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react11.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react11.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react11.default.createElement(
          Grid,
          {
            className: "ds-margin-top",
            title: 'Sets the name of the plug-in configuration record. (cn) You can use any string, but "attribute_name Attribute Uniqueness" is recommended.'
          },
          /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Config Name"),
          /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react11.default.createElement(
            TextInput,
            {
              value: configName,
              type: "text",
              id: "configName",
              "aria-describedby": "horizontal-form-name-helper",
              name: "configName",
              isDisabled: !newEntry,
              onChange: (str, e) => {
                this.handleFieldChange(e);
              },
              validated: this.state.error.configName || this.state.configName === "" ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react11.default.createElement(Grid, { title: "Sets the name of the attribute whose values must be unique. This attribute is multi-valued. (uniqueness-attribute-name)" }, /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Attribute Names"), /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react11.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: this.handleAttributeNameToggle,
            onSelect: this.handleAttributeNameSelect,
            onClear: this.handleAttributeNameClear,
            selections: attrNames,
            isOpen: this.state.isAttributeNameOpen,
            "aria-labelledby": "typeAhead-attr-name",
            placeholderText: "Type an attribute name...",
            noResultsFoundText: "There are no matching attributes",
            validated: this.state.error.attrNames ? "error" : "default"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react11.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react11.default.createElement(Grid, { title: "Sets the DN under which the plug-in checks for uniqueness of the attributes value. This attribute is multi-valued (uniqueness-subtrees)" }, /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Subtrees"), /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react11.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a subtree DN",
            onToggle: this.handleSubtreesToggle,
            onSelect: this.handleSubtreesSelect,
            onClear: this.handleSubtreesClear,
            selections: subtrees,
            isOpen: this.state.isSubtreesOpen,
            "aria-labelledby": "typeAhead-subtrees",
            placeholderText: "Type a subtree DN...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleSubtreesCreateOption,
            validated: this.state.error.subtrees ? "error" : "default"
          },
          [""].map((dn, index) => /* @__PURE__ */ import_react11.default.createElement(
            SelectOption,
            {
              key: index,
              value: dn
            }
          ))
        ))), /* @__PURE__ */ import_react11.default.createElement(Grid, { title: "Verifies that the value of the attribute set in uniqueness-attribute-name is unique in this subtree (uniqueness-top-entry-oc)" }, /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Top Entry OC"), /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react11.default.createElement(
          FormSelect,
          {
            id: "topEntryOc",
            value: topEntryOc,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react11.default.createElement(FormSelectOption, { key: "no-setting", value: "", label: "-" }),
          this.props.objectClasses.map((attr, index) => /* @__PURE__ */ import_react11.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }))
        )), /* @__PURE__ */ import_react11.default.createElement(GridItem, { sm: 3 }, /* @__PURE__ */ import_react11.default.createElement(
          Checkbox,
          {
            id: "acrossAllSubtrees",
            className: "ds-left-margin",
            isChecked: acrossAllSubtrees,
            title: "If enabled (on), the plug-in checks that the attribute is unique across all subtrees set. If you set the attribute to off, uniqueness is only enforced within the subtree of the updated entry (uniqueness-across-all-subtrees)",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            label: "Across All Subtrees"
          }
        ))), /* @__PURE__ */ import_react11.default.createElement(Grid, { title: "Verifies if an attribute is unique, if the entry contains the objectclass set in this parameter (uniqueness-subtree-entries-oc)" }, /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Subtree Entry's OC"), /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react11.default.createElement(
          FormSelect,
          {
            id: "subtreeEnriesOc",
            value: subtreeEnriesOc,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react11.default.createElement(FormSelectOption, { key: "no_setting", value: "", label: "-" }),
          this.props.objectClasses.map((attr, index) => /* @__PURE__ */ import_react11.default.createElement(FormSelectOption, { key: index, value: attr, label: attr }))
        ))), /* @__PURE__ */ import_react11.default.createElement(Grid, { className: "ds-margin-bottom", title: "Identifies whether or not the config is enabled." }, /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Enable config"), /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react11.default.createElement(
          Switch,
          {
            id: "configEnabled",
            label: "Configuration is enabled",
            labelOff: "Configuration is disabled",
            isChecked: configEnabled,
            onChange: this.handleSwitchChange
          }
        ))))
      ), /* @__PURE__ */ import_react11.default.createElement(
        pluginBasicConfig_default,
        {
          removeSwitch: true,
          rows: this.props.rows,
          key: this.state.configRows,
          serverId: this.props.serverId,
          cn: "attribute uniqueness",
          pluginName: "Attribute Uniqueness",
          cmdName: "attr-uniq",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react11.default.createElement(Grid, null, /* @__PURE__ */ import_react11.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react11.default.createElement(
          AttrUniqConfigTable,
          {
            key: this.state.tableKey,
            rows: this.state.configRows,
            editConfig: this.showEditConfigModal,
            deleteConfig: this.showConfirmDelete
          }
        ), /* @__PURE__ */ import_react11.default.createElement(
          Button,
          {
            key: "add-config",
            variant: "primary",
            onClick: this.handleShowAddConfigModal
          },
          "Add Config"
        )))
      ), /* @__PURE__ */ import_react11.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.deleteConfig,
          spinning: this.state.modalSpinning,
          item: this.state.deleteName,
          checked: this.state.modalChecked,
          mTitle: "Delete Attribute Uniqueness Configuration",
          mMsg: "Are you sure you want to delete this configuration?",
          mSpinningMsg: "Deleting attribute uniqueness configuration...",
          mBtnName: "Delete Configuration"
        }
      ));
    }
  };
  AttributeUniqueness.propTypes = {
    rows: import_prop_types6.default.array,
    serverId: import_prop_types6.default.string,
    savePluginHandler: import_prop_types6.default.func,
    pluginListHandler: import_prop_types6.default.func,
    addNotification: import_prop_types6.default.func,
    toggleLoadingHandler: import_prop_types6.default.func,
    objectClasses: import_prop_types6.default.array
  };
  AttributeUniqueness.defaultProps = {
    rows: [],
    serverId: "",
    objectClasses: []
  };
  var attributeUniqueness_default = AttributeUniqueness;

  // src/lib/plugins/autoMembership.jsx
  var import_react12 = __toESM(require_react(), 1);
  var import_prop_types7 = __toESM(require_prop_types(), 1);
  var AutoMembership = class extends import_react12.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadDefinitions();
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        definitionRows: [],
        regexRows: [],
        _regexRows: [],
        regexesToDelete: [],
        modalSpinning: false,
        modalChecked: false,
        saving: false,
        savingRegex: false,
        saveBtnDisabled: true,
        saveRegexBtnDisabled: true,
        error: {},
        errorRegex: {},
        // Definition settings
        definitionName: "",
        defaultGroup: "",
        filter: "",
        groupingAttrMember: "",
        groupingAttrEntry: "",
        scope: "",
        _definitionName: "",
        _defaultGroup: "",
        _filter: "",
        _groupingAttrMember: "",
        _groupingAttrEntry: "",
        _scope: "",
        // Regex settings
        regexName: "",
        regexTargetGroup: "",
        regexExclusive: [],
        regexInclusive: [],
        _regexName: "",
        _regexTargetGroup: "",
        _regexExclusive: [],
        _excludeOptions: [],
        _regexInclusive: [],
        isRegexExcludeOpen: false,
        excludeOptions: [],
        isRegexIncludeOpen: false,
        includeOptions: [],
        regexTableKey: 0,
        newDefinitionEntry: false,
        newRegexEntry: false,
        definitionEntryModalShow: false,
        regexEntryModalShow: false,
        showConfirmDelete: false
      };
      const attrs = [...this.props.attributes, "dn"].sort();
      this.attrRows = attrs.map((attr) => /* @__PURE__ */ import_react12.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }));
      this.handleRegexExcludeSelect = (event, selection) => {
        const { regexExclusive } = this.state;
        if (regexExclusive.includes(selection)) {
          this.setState(
            (prevState) => ({
              regexExclusive: prevState.regexExclusive.filter((item) => item !== selection),
              isRegexExcludeOpen: false
            }),
            () => {
              this.validateRegex();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              regexExclusive: [...prevState.regexExclusive, selection],
              isRegexExcludeOpen: false
            }),
            () => {
              this.validateRegex();
            }
          );
        }
      };
      this.handleCreateRegexExcludeOption = (newValue) => {
        if (!this.state.excludeOptions.includes(newValue)) {
          this.setState({
            excludeOptions: [...this.state.excludeOptions, newValue],
            isRegexExcludeOpen: false
          });
        }
      };
      this.handleRegexExcludeToggle = (isRegexExcludeOpen) => {
        this.setState({
          isRegexExcludeOpen
        });
      };
      this.handleClearRegexExcludeSelection = () => {
        this.setState({
          regexExclusive: [],
          isRegexExcludeOpen: false
        }, () => {
          this.validateRegex();
        });
      };
      this.handleRegexIncludeSelect = (event, selection) => {
        const { regexInclusive } = this.state;
        if (regexInclusive.includes(selection)) {
          this.setState(
            (prevState) => ({
              regexInclusive: prevState.regexInclusive.filter((item) => item !== selection),
              isRegexIncludeOpen: false
            }),
            () => {
              this.validateRegex();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              regexInclusive: [...prevState.regexInclusive, selection],
              isRegexIncludeOpen: false
            }),
            () => {
              this.validateRegex();
            }
          );
        }
      };
      this.handleCreateRegexIncludeOption = (newValue) => {
        if (!this.state.includeOptions.includes(newValue)) {
          this.setState({
            includeOptions: [...this.state.includeOptions, newValue],
            isRegexIncludeOpen: false
          });
        }
      };
      this.handleRegexIncludeToggle = (isRegexIncludeOpen) => {
        this.setState({
          isRegexIncludeOpen
        });
      };
      this.handleClearRegexIncludeSelection = () => {
        this.setState({
          regexInclusive: [],
          isRegexIncludeOpen: false
        }, () => {
          this.validateRegex();
        });
      };
      this.validateModal = this.validateModal.bind(this);
      this.validateRegex = this.validateRegex.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleRegexChange = this.handleRegexChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.loadDefinitions = this.loadDefinitions.bind(this);
      this.loadRegexes = this.loadRegexes.bind(this);
      this.openModal = this.openModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.showEditDefinitionModal = this.showEditDefinitionModal.bind(this);
      this.handleShowAddDefinitionModal = this.handleShowAddDefinitionModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.deleteDefinition = this.deleteDefinition.bind(this);
      this.addDefinition = this.addDefinition.bind(this);
      this.editDefinition = this.editDefinition.bind(this);
      this.openRegexModal = this.openRegexModal.bind(this);
      this.handleCloseRegexModal = this.handleCloseRegexModal.bind(this);
      this.showEditRegexModal = this.showEditRegexModal.bind(this);
      this.handleShowAddRegexModal = this.handleShowAddRegexModal.bind(this);
      this.cmdRegexOperation = this.cmdRegexOperation.bind(this);
      this.deleteRegex = this.deleteRegex.bind(this);
      this.addRegex = this.addRegex.bind(this);
      this.editRegex = this.editRegex.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
    }
    validateModal() {
      const error = {};
      let all_good = true;
      const dnAttrs = [
        "defaultGroup",
        "scope"
      ];
      const reqAttrs = [
        "definitionName",
        "scope",
        "filter",
        "groupingAttrMember",
        "groupingAttrEntry"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          error[attr] = true;
          all_good = false;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          error[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "definitionName",
          "defaultGroup",
          "filter",
          "groupingAttrMember",
          "groupingAttrEntry",
          "scope"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (this.state.regexRows.length !== this.state._regexRows.length) {
          all_good = true;
        }
        if (!all_good) {
          for (const row of this.state.regexRows) {
            let found = false;
            for (const orig_row of this.state._regexRows) {
              if (orig_row.cn[0] === row.cn[0]) {
                found = true;
                if (orig_row.automembertargetgroup[0] !== row.automembertargetgroup[0]) {
                  all_good = true;
                  break;
                }
                for (const attr of ["automemberinclusiveregex", "automemberexclusiveregex"]) {
                  if (!listsEqual(orig_row[attr], row[attr])) {
                    all_good = true;
                    break;
                  }
                }
              }
            }
            if (!found) {
              all_good = true;
              break;
            }
          }
          if (!all_good) {
            for (const orig_row of this.state._regexRows) {
              let found = false;
              for (const row of this.state.regexRows) {
                if (orig_row.cn[0] === row.cn[0]) {
                  found = true;
                }
              }
              if (!found) {
                all_good = true;
                break;
              }
            }
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error
      });
    }
    validateRegex() {
      const error = {};
      let all_good = true;
      const dnAttrs = [
        "regexTargetGroup"
      ];
      const reqAttrs = [
        "regexName",
        "regexTargetGroup"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          error[attr] = true;
          all_good = false;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          error[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "regexTargetGroup"
        ];
        const attrsList = [
          "regexExclusive",
          "regexInclusive"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        for (const check_attr of attrsList) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveRegexBtnDisabled: !all_good,
        error
      }, () => {
        this.validateModal();
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleFieldChange(e) {
      const value = e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateModal();
      });
    }
    handleRegexChange(e) {
      const value = e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateRegex();
      });
    }
    loadDefinitions() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "automember",
        "list",
        "definitions"
      ];
      log_cmd("loadDefinitions", "Get Auto Membership Plugin definitions", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        this.setState({
          definitionRows: myObject.items.map((item) => item.attrs),
          firstLoad: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadDefinitions failed", errMsg.desc);
        }
      });
    }
    initRegexRows(rows) {
      for (const row of rows) {
        if (row.automembertargetgroup === void 0) {
          row.automembertargetgroup = "";
        }
        if (row.automemberexclusiveregex === void 0) {
          row.automemberexclusiveregex = [];
        }
        if (row.automemberinclusiveregex === void 0) {
          row.automemberinclusiveregex = [];
        }
      }
    }
    loadRegexes(defName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "automember",
        "list",
        "regexes",
        defName
      ];
      log_cmd("loadRegexes", "Get Auto Membership Plugin regexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const regexTableKey = this.state.regexTableKey + 1;
        const rows = myObject.items.map((item) => item.attrs);
        this.initRegexRows(rows);
        this.setState({
          regexRows: rows,
          _regexRows: JSON.parse(JSON.stringify(rows)),
          regexTableKey
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadRegexes failed", errMsg.desc);
        }
      });
    }
    showEditDefinitionModal(rowData) {
      this.openModal(rowData);
    }
    handleShowAddDefinitionModal(rowData) {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          definitionEntryModalShow: true,
          newDefinitionEntry: true,
          regexRows: [],
          definitionName: "",
          defaultGroup: "",
          filter: "",
          groupingAttrMember: "",
          groupingAttrEntry: "",
          scope: "",
          saveBtnDisabled: true
        });
      } else {
        this.loadRegexes(name2);
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          name2,
          "show"
        ];
        this.props.toggleLoadingHandler();
        log_cmd("openModal", "Fetch the Auto Membership Plugin definition entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const definitionEntry = JSON.parse(content).attrs;
          this.setState({
            saveBtnDisabled: true,
            definitionEntryModalShow: true,
            newDefinitionEntry: false,
            definitionName: definitionEntry.cn === void 0 ? "" : definitionEntry.cn[0],
            defaultGroup: definitionEntry.automemberdefaultgroup === void 0 ? "" : definitionEntry.automemberdefaultgroup[0],
            filter: definitionEntry.automemberfilter === void 0 ? "" : definitionEntry.automemberfilter[0],
            scope: definitionEntry.automemberscope === void 0 ? "" : definitionEntry.automemberscope[0],
            _definitionName: definitionEntry.cn === void 0 ? "" : definitionEntry.cn[0],
            _defaultGroup: definitionEntry.automemberdefaultgroup === void 0 ? "" : definitionEntry.automemberdefaultgroup[0],
            _filter: definitionEntry.automemberfilter === void 0 ? "" : definitionEntry.automemberfilter[0],
            _scope: definitionEntry.automemberscope === void 0 ? "" : definitionEntry.automemberscope[0]
          });
          if (definitionEntry.automembergroupingattr === void 0) {
            this.setState({
              groupingAttrMember: "",
              groupingAttrEntry: "",
              _groupingAttrMember: "",
              _groupingAttrEntry: ""
            });
          } else {
            const groupingAttr = definitionEntry.automembergroupingattr[0];
            this.setState({
              groupingAttrMember: groupingAttr.split(":")[0],
              groupingAttrEntry: groupingAttr.split(":")[1],
              _groupingAttrMember: groupingAttr.split(":")[0],
              _groupingAttrEntry: groupingAttr.split(":")[1]
            });
          }
          this.props.toggleLoadingHandler();
        }).fail((_) => {
          this.setState({
            definitionEntryModalShow: true,
            newDefinitionEntry: true,
            regexRows: [],
            definitionName: "",
            defaultGroup: "",
            filter: "",
            groupingAttrMember: "",
            groupingAttrEntry: "",
            scope: "",
            _definitionName: "",
            _defaultGroup: "",
            _filter: "",
            _groupingAttrMember: "",
            _groupingAttrEntry: "",
            _scope: ""
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    showEditRegexModal(name2) {
      this.openRegexModal(name2);
    }
    handleShowAddRegexModal() {
      this.openRegexModal();
    }
    handleCloseModal() {
      this.setState({
        definitionEntryModalShow: false,
        saving: false
      });
    }
    handleCloseRegexModal() {
      this.setState({ regexEntryModalShow: false });
    }
    cmdOperation(action) {
      const {
        definitionName,
        defaultGroup,
        filter,
        groupingAttrMember,
        groupingAttrEntry,
        scope
      } = this.state;
      if (definitionName === "" || scope === "" || filter === "" || groupingAttrMember === "" || groupingAttrEntry === "") {
        this.props.addNotification(
          "warning",
          "Name, Scope, Filter and Grouping Attribute are required."
        );
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          definitionName,
          action,
          "--default-group",
          defaultGroup || action === "add" ? defaultGroup : "delete",
          "--filter",
          filter || action === "add" ? filter : "delete",
          "--scope",
          scope || action === "add" ? scope : "delete"
        ];
        cmd = [...cmd, "--grouping-attr"];
        if (groupingAttrMember !== "" && groupingAttrEntry !== "") {
          cmd = [...cmd, `${groupingAttrMember}:${groupingAttrEntry}`];
        } else if (action === "add") {
          cmd = [...cmd, ""];
        } else {
          cmd = [...cmd, "delete"];
        }
        this.setState({
          saving: true
        });
        this.props.toggleLoadingHandler();
        log_cmd(
          "AutoMembershipOperation",
          `Do the ${action} operation on the Auto Membership Plugin`,
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info("AutoMembershipOperation", "Result", content);
          this.props.addNotification(
            "success",
            `The ${action} operation was successfully done on "${definitionName}" entry`
          );
          this.loadDefinitions();
          this.purgeRegexUpdate();
          this.handleCloseModal();
          this.props.toggleLoadingHandler();
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          if (errMsg.desc.indexOf("nothing to set") === 0) {
            this.props.addNotification(
              "error",
              `Error during the definition entry ${action} operation - ${errMsg.desc}`
            );
          } else {
            this.purgeRegexUpdate();
          }
          this.loadDefinitions();
          this.handleCloseModal();
          this.props.toggleLoadingHandler();
        });
      }
    }
    purgeRegexUpdate() {
      const { definitionName, regexesToDelete, regexRows } = this.state;
      for (const regexToDelete of regexesToDelete) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          definitionName,
          "regex",
          regexToDelete,
          "delete"
        ];
        log_cmd(
          "AutoMembershipRegexOperation",
          `Do the delete operation on the Auto Membership Plugin Regex Entry`,
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info(
            "AutoMembershipRegexOperation",
            "Result",
            `The delete operation was successfully done on "${regexToDelete}" entry`
          );
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Error during the regex "${regexToDelete}" entry delete operation - ${errMsg.desc}`
          );
        });
      }
      for (const row of regexRows) {
        let action = "";
        let regexName = "";
        if (row.needsadd !== void 0) {
          action = "add";
          regexName = row.cn[0];
        } else if (row.needsupdate !== void 0) {
          action = "set";
          regexName = row.cn[0];
        } else {
          continue;
        }
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          definitionName,
          "regex",
          regexName,
          action
        ];
        const regexTargetGroup = row.automembertargetgroup[0];
        const regexExclusive = row.automemberexclusiveregex === void 0 ? [] : row.automemberexclusiveregex;
        const regexInclusive = row.automemberinclusiveregex === void 0 ? [] : row.automemberinclusiveregex;
        if (!(action === "add" && regexTargetGroup === 0)) {
          cmd = [...cmd, "--target-group"];
          if (regexTargetGroup) {
            cmd = [...cmd, regexTargetGroup];
          } else if (action === "add") {
            cmd = [...cmd, ""];
          } else {
            cmd = [...cmd, "delete"];
          }
        }
        if (!(action === "add" && regexExclusive.length === 0)) {
          cmd = [...cmd, "--exclusive"];
          if (regexExclusive.length !== 0) {
            for (const regex of regexExclusive) {
              cmd = [...cmd, regex];
            }
          } else if (action === "add") {
            cmd = [...cmd, ""];
          } else {
            cmd = [...cmd, "delete"];
          }
        }
        if (!(action === "add" && regexInclusive.length === 0)) {
          cmd = [...cmd, "--inclusive"];
          if (regexInclusive.length !== 0) {
            for (const regex of regexInclusive) {
              cmd = [...cmd, regex];
            }
          } else if (action === "add") {
            cmd = [...cmd, ""];
          } else {
            cmd = [...cmd, "delete"];
          }
        }
        log_cmd(
          "AutoMembershipRegexOperation",
          `Do the ${action} operation on the Auto Membership Plugin Regex Entry`,
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info(
            "AutoMembershipRegexOperation",
            "Result",
            `The ${action} operation was successfully done on "${regexName}" entry`
          );
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Error during the regex "${regexName}" entry ${action} operation - ${errMsg.desc}`
          );
        });
      }
    }
    showConfirmDelete(definitionName) {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: definitionName
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    deleteDefinition() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "automember",
        "definition",
        this.state.deleteName,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteDefinition", "Delete the Auto Membership Plugin definition entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteDefinition", "Result", content);
        this.props.addNotification(
          "success",
          `Definition entry ${this.state.deleteName} was successfully deleted`
        );
        this.loadDefinitions();
        this.closeConfirmDelete();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the definition entry removal operation - ${errMsg.desc}`
        );
        this.loadDefinitions();
        this.closeConfirmDelete();
      });
    }
    addDefinition() {
      this.cmdOperation("add");
    }
    editDefinition() {
      this.cmdOperation("set");
    }
    openRegexModal(name2) {
      if (name2) {
        const regexEntry = this.state.regexRows.filter((row) => row.cn[0] === name2)[0];
        let exclusiveRegexList = [];
        let inclusiveRegexList = [];
        if (regexEntry.automemberexclusiveregex === void 0) {
          this.setState({ regexExclusive: [], _regexExclusive: [] });
        } else {
          for (const value of regexEntry.automemberexclusiveregex) {
            exclusiveRegexList = [...exclusiveRegexList, value];
          }
          this.setState({
            regexExclusive: exclusiveRegexList,
            _regexExclusive: [...exclusiveRegexList]
          });
        }
        if (regexEntry.automemberinclusiveregex === void 0) {
          this.setState({ regexInclusive: [], _regexInclusive: [] });
        } else {
          for (const value of regexEntry.automemberinclusiveregex) {
            inclusiveRegexList = [...inclusiveRegexList, value];
          }
          this.setState({
            regexInclusive: inclusiveRegexList,
            _regexInclusive: [...inclusiveRegexList]
          });
        }
        this.setState({
          regexEntryModalShow: true,
          newRegexEntry: false,
          regexName: regexEntry.cn[0],
          regexTargetGroup: regexEntry.automembertargetgroup === void 0 ? "" : regexEntry.automembertargetgroup[0],
          _regexName: regexEntry.cn[0],
          _regexTargetGroup: regexEntry.automembertargetgroup === void 0 ? "" : regexEntry.automembertargetgroup[0],
          saveRegexBtnDisabled: true
        });
      } else {
        this.setState({
          regexEntryModalShow: true,
          newRegexEntry: true,
          regexName: "",
          regexExclusive: [],
          regexInclusive: [],
          regexTargetGroup: "",
          _regexName: "",
          _regexExclusive: [],
          _regexInclusive: [],
          _regexTargetGroup: "",
          saveRegexBtnDisabled: true
        });
      }
    }
    cmdRegexOperation(action) {
      const {
        regexRows,
        regexName,
        regexExclusive,
        regexInclusive,
        regexTargetGroup
      } = this.state;
      let regexExists = false;
      if (regexRows.some((row) => row.cn[0] === regexName)) {
        regexExists = true;
      }
      if (regexName === "" || regexTargetGroup === "") {
        this.props.addNotification("warning", "Name and Target Group are required.");
      } else {
        const regexTableKey = this.state.regexTableKey + 1;
        if (action === "add") {
          if (!regexExists) {
            this.setState((prevState) => ({
              regexRows: [
                ...prevState.regexRows,
                {
                  cn: [regexName],
                  automembertargetgroup: [regexTargetGroup],
                  automemberexclusiveregex: regexExclusive.length !== 0 ? [...regexExclusive] : [],
                  automemberinclusiveregex: regexInclusive.length !== 0 ? [...regexInclusive] : [],
                  needsadd: true
                }
              ],
              regexTableKey
            }), () => {
              this.validateModal();
            });
          } else {
            this.props.addNotification("error", `Regex "${regexName}" already exists`);
          }
        } else if (action === "set") {
          if (regexExists) {
            this.setState({
              regexRows: regexRows.filter((row) => row.cn[0] !== regexName)
            });
            this.setState((prevState) => ({
              regexRows: [
                ...prevState.regexRows,
                {
                  cn: [regexName],
                  automembertargetgroup: [regexTargetGroup],
                  automemberexclusiveregex: regexExclusive.length !== 0 ? [...regexExclusive] : [],
                  automemberinclusiveregex: regexInclusive.length !== 0 ? [...regexInclusive] : [],
                  needsupdate: true
                }
              ],
              regexTableKey
            }), () => {
              this.validateModal();
            });
          } else {
            this.props.addNotification(
              "error",
              `Regex "${regexName}" does not exist - "${action}" is impossible`
            );
          }
        }
        this.handleCloseRegexModal();
      }
    }
    deleteRegex(regexName) {
      const { regexRows } = this.state;
      const regexTableKey = this.state.regexTableKey + 1;
      if (regexRows.some((row) => row.cn[0] === regexName)) {
        this.setState({
          regexRows: regexRows.filter((row) => row.cn[0] !== regexName),
          regexTableKey
        });
        this.setState((prevState) => ({
          regexesToDelete: [...prevState.regexesToDelete, regexName]
        }), () => {
          this.validateModal();
        });
      } else {
        this.props.addNotification(
          "error",
          `Regex "${regexName}" does not exist - impossible to delete`
        );
      }
    }
    addRegex() {
      this.cmdRegexOperation("add");
    }
    editRegex() {
      this.cmdRegexOperation("set");
    }
    render() {
      const {
        regexRows,
        definitionEntryModalShow,
        definitionName,
        defaultGroup,
        scope,
        filter,
        newDefinitionEntry,
        regexEntryModalShow,
        newRegexEntry,
        groupingAttrEntry,
        groupingAttrMember,
        regexName,
        regexExclusive,
        regexInclusive,
        regexTargetGroup,
        saving,
        saveBtnDisabled,
        saveRegexBtnDisabled,
        firstLoad
      } = this.state;
      const title = (newDefinitionEntry ? "Add" : "Edit") + " Auto Membership Plugin Definition Entry";
      const extraPrimaryProps = {};
      let saveBtnText = newDefinitionEntry ? "Add Definition" : "Save Definition";
      if (saving) {
        saveBtnText = newDefinitionEntry ? "Adding ..." : "Saving ...";
      }
      return /* @__PURE__ */ import_react12.default.createElement("div", { className: saving || firstLoad ? "ds-disabled" : "" }, /* @__PURE__ */ import_react12.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: definitionEntryModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleCloseModal,
          actions: [
            /* @__PURE__ */ import_react12.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: newDefinitionEntry ? this.addDefinition : this.editDefinition,
                isDisabled: saveBtnDisabled || saving,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnText
            ),
            /* @__PURE__ */ import_react12.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react12.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react12.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Definition Name"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          TextInput,
          {
            value: definitionName,
            type: "text",
            id: "definitionName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "definitionName",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            isDisabled: !newDefinitionEntry,
            validated: this.state.error.definitionName || definitionName === "" ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react12.default.createElement(Grid, { title: "Sets the subtree DN to search for entries (autoMemberScope)." }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Subtree Scope"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          TextInput,
          {
            value: scope,
            type: "text",
            id: "scope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "scope",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: this.state.error.scope || scope === "" ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react12.default.createElement(Grid, { title: "Sets a standard LDAP search filter to use to search for matching entries (autoMemberFilter)" }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Entry Filter"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          TextInput,
          {
            value: filter,
            type: "text",
            id: "filter",
            "aria-describedby": "horizontal-form-name-helper",
            name: "filter",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: this.state.error.filter || filter === "" ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react12.default.createElement(Grid, { title: "Specifies the name of the member attribute in the group entry and the attribute in the object entry that supplies the member attribute value, in the format group_member_attr:entry_attr (autoMemberGroupingAttr)" }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Grouping Attribute"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react12.default.createElement(
          FormSelect,
          {
            id: "groupingAttrMember",
            value: groupingAttrMember,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input",
            validated: groupingAttrMember === "" ? "error" : "default"
          },
          /* @__PURE__ */ import_react12.default.createElement(FormSelectOption, { key: "no-setting", value: "", label: "-" }),
          this.attrRows
        )), /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-center", span: 1 }, /* @__PURE__ */ import_react12.default.createElement(ArrowRightIcon, { className: "ds-lower-field-lg" })), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react12.default.createElement(
          FormSelect,
          {
            id: "groupingAttrEntry",
            value: groupingAttrEntry,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input",
            validated: groupingAttrEntry === "" ? "error" : "default"
          },
          /* @__PURE__ */ import_react12.default.createElement(FormSelectOption, { key: "no-setting", value: "", label: "-" }),
          this.attrRows
        ))), /* @__PURE__ */ import_react12.default.createElement(Grid, { title: "Sets an optional default or fallback group to add the entry to as a member (autoMemberDefaultGroup)" }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Default Group"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          TextInput,
          {
            value: defaultGroup,
            type: "text",
            id: "defaultGroup",
            "aria-describedby": "horizontal-form-name-helper",
            name: "defaultGroup",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: this.state.error.defaultGroup ? ValidatedOptions.error : ValidatedOptions.default
          }
        )))),
        /* @__PURE__ */ import_react12.default.createElement("hr", null),
        /* @__PURE__ */ import_react12.default.createElement(TextContent, null, /* @__PURE__ */ import_react12.default.createElement(Text, { className: "ds-center", component: TextVariants.h3 }, "Membership Regular Expressions")),
        /* @__PURE__ */ import_react12.default.createElement(Grid, null, /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react12.default.createElement(
          AutoMembershipRegexTable,
          {
            rows: regexRows,
            key: this.state.regexTableKey,
            editConfig: this.showEditRegexModal,
            deleteConfig: this.deleteRegex
          }
        ))),
        /* @__PURE__ */ import_react12.default.createElement(Grid, null, /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react12.default.createElement(
          Button,
          {
            variant: "secondary",
            onClick: this.handleShowAddRegexModal
          },
          "Add Regex"
        ))),
        /* @__PURE__ */ import_react12.default.createElement("hr", null)
      ), /* @__PURE__ */ import_react12.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Manage Auto Membership Plugin Regex Entry",
          isOpen: regexEntryModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleCloseRegexModal,
          actions: [
            /* @__PURE__ */ import_react12.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                isDisabled: saveRegexBtnDisabled,
                onClick: newRegexEntry ? this.addRegex : this.editRegex
              },
              "Save"
            ),
            /* @__PURE__ */ import_react12.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseRegexModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react12.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react12.default.createElement(Grid, null, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Regex Name"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          TextInput,
          {
            value: regexName,
            type: "text",
            id: "regexName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "regexName",
            onChange: (str, e) => {
              this.handleRegexChange(e);
            },
            isDisabled: !newRegexEntry,
            validated: this.state.errorRegex.regexName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react12.default.createElement(Grid, { title: "Sets a single regular expression to use to identify entries to exclude (autoMemberExclusiveRegex)" }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclusive Regex"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a regex",
            onToggle: this.handleRegexExcludeToggle,
            onSelect: this.handleRegexExcludeSelect,
            onClear: this.handleClearRegexExcludeSelection,
            selections: regexExclusive,
            isOpen: this.state.isRegexExcludeOpen,
            "aria-labelledby": "typeAhead-excl-regex",
            placeholderText: "Type a regex...",
            isCreatable: true,
            onCreateOption: this.handleCreateRegexExcludeOption
          },
          [].map((attr, index) => /* @__PURE__ */ import_react12.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react12.default.createElement(Grid, { title: "Sets a single regular expression to use to identify entries to exclude (autoMemberExclusiveRegex)" }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Inclusive Regex"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a regex",
            onToggle: this.handleRegexIncludeToggle,
            onSelect: this.handleRegexIncludeSelect,
            onClear: this.handleClearRegexIncludeSelection,
            selections: regexInclusive,
            isOpen: this.state.isRegexIncludeOpen,
            "aria-labelledby": "typeAhead-incl-regex",
            placeholderText: "Type a regex...",
            isCreatable: true,
            onCreateOption: this.handleCreateRegexIncludeOption
          },
          [].map((attr, index) => /* @__PURE__ */ import_react12.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react12.default.createElement(Grid, { title: "Sets which group to add the entry to as a member, if it meets the regular expression conditions (autoMemberTargetGroup)" }, /* @__PURE__ */ import_react12.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Target Group"), /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react12.default.createElement(
          TextInput,
          {
            value: regexTargetGroup,
            type: "text",
            id: "regexTargetGroup",
            "aria-describedby": "horizontal-form-name-helper",
            name: "regexTargetGroup",
            onChange: (str, e) => {
              this.handleRegexChange(e);
            },
            validated: this.state.errorRegex.regexTargetGroup ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))))
      ), /* @__PURE__ */ import_react12.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "Auto Membership Plugin",
          pluginName: "Auto Membership",
          cmdName: "automember",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react12.default.createElement(Grid, null, /* @__PURE__ */ import_react12.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react12.default.createElement(
          AutoMembershipDefinitionTable,
          {
            rows: this.state.definitionRows,
            key: this.state.definitionRows,
            editConfig: this.showEditDefinitionModal,
            deleteConfig: this.showConfirmDelete
          }
        ), /* @__PURE__ */ import_react12.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowAddDefinitionModal
          },
          "Add Definition"
        )))
      ), /* @__PURE__ */ import_react12.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.deleteDefinition,
          spinning: this.state.modalSpinning,
          item: this.state.deleteName,
          checked: this.state.modalChecked,
          mTitle: "Delete Autemebership Configuration",
          mMsg: "Are you sure you want to delete this configuration?",
          mSpinningMsg: "Deleting Configuration...",
          mBtnName: "Delete Configuration"
        }
      ));
    }
  };
  AutoMembership.propTypes = {
    rows: import_prop_types7.default.array,
    serverId: import_prop_types7.default.string,
    savePluginHandler: import_prop_types7.default.func,
    pluginListHandler: import_prop_types7.default.func,
    addNotification: import_prop_types7.default.func,
    toggleLoadingHandler: import_prop_types7.default.func
  };
  AutoMembership.defaultProps = {
    rows: [],
    serverId: ""
  };
  var autoMembership_default = AutoMembership;

  // src/lib/plugins/dna.jsx
  var import_react13 = __toESM(require_react(), 1);
  var import_prop_types8 = __toESM(require_prop_types(), 1);
  var DNAPlugin = class extends import_react13.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        configRows: [],
        sharedConfigRows: [],
        activeTabKey: 1,
        tableKey: 1,
        modalSpinning: false,
        modalChecked: false,
        deleteItem: "",
        loading: true,
        error: {},
        validatedBindMethod: ValidatedOptions.default,
        validatedBindMethodText: "",
        validatedConnProtocol: ValidatedOptions.default,
        validatedConnText: "",
        configName: "",
        prefix: "",
        nextValue: "",
        maxValue: "",
        interval: "",
        magicRegen: "",
        filter: "",
        scope: "",
        remoteBindDN: "",
        remoteBindCred: "",
        sharedConfigEntry: "",
        threshold: "",
        nextRange: "",
        rangeRequestTimeout: "",
        showDeleteConfirm: false,
        saving: false,
        sharedBaseDN: "",
        sharedHostname: "",
        sharedPort: "",
        sharedSecurePort: "",
        sharedRemainingValues: "",
        sharedRemoteBindMethod: "",
        sharedRemoteConnProtocol: "",
        showSharedDeleteConfirm: false,
        savingShared: false,
        newEntry: false,
        configEntryModalShow: false,
        sharedConfigEntryModalShow: false,
        // typeahead
        isOpen: false,
        selected: [],
        saveBtnDisabled: true
      };
      this.handleToggle = (isOpen) => {
        this.setState({
          isOpen
        });
      };
      this.handleClearSelection = () => {
        this.setState({
          selected: [],
          isOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSelect = (event, selection) => {
        const { selected } = this.state;
        if (selected.includes(selection)) {
          this.setState(
            (prevState) => ({
              selected: prevState.selected.filter((item) => item !== selection),
              isOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              selected: [...prevState.selected, selection],
              isOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        }
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateConfig();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validateConfig();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateConfig();
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.loadSharedConfigs = this.loadSharedConfigs.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.openModal = this.openModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.showEditConfigModal = this.showEditConfigModal.bind(this);
      this.handleShowAddConfigModal = this.handleShowAddConfigModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.addConfig = this.addConfig.bind(this);
      this.editConfig = this.editConfig.bind(this);
      this.openSharedModal = this.openSharedModal.bind(this);
      this.handleCloseSharedModal = this.handleCloseSharedModal.bind(this);
      this.showEditSharedConfigModal = this.showEditSharedConfigModal.bind(this);
      this.deleteSharedConfig = this.deleteSharedConfig.bind(this);
      this.handleEditSharedConfig = this.handleEditSharedConfig.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
      this.showSharedDeleteConfirm = this.showSharedDeleteConfirm.bind(this);
      this.closeSharedDeleteConfirm = this.closeSharedDeleteConfirm.bind(this);
      this.onConfirmChange = this.onConfirmChange.bind(this);
    }
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadConfigs();
        }
      }
    }
    showDeleteConfirm(item) {
      this.setState({
        deleteItem: item,
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        deleteItem: "",
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showSharedDeleteConfirm(item) {
      this.setState({
        deleteItem: item,
        showSharedDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeSharedDeleteConfirm() {
      this.setState({
        deleteItem: "",
        showSharedDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    onConfirmChange(e) {
      this.setState({
        modalChecked: e.target.checked
      });
    }
    handleFieldChange(str, e) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateConfig();
      });
    }
    loadConfigs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "list",
        "configs"
      ];
      log_cmd("loadConfigs", "Get DNA Plugin configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          configRows: myObject.items.map((item) => item.attrs),
          tableKey,
          loading: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadConfigs failed", errMsg.desc);
        }
        this.setState({
          loading: false
        });
      });
    }
    loadSharedConfigs(basedn) {
      if (basedn === "") {
        this.setState({
          sharedConfigRows: [],
          loading: false
        });
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "list",
        "shared-configs",
        basedn
      ];
      log_cmd("loadSharedConfigs", "Get DNA Plugin shared configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        this.setState({
          sharedConfigRows: myObject.items.map((item) => item.attrs),
          firstLoad: false,
          loading: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadSharedConfigs failed", errMsg.desc);
        }
      });
    }
    showEditConfigModal(rowData) {
      this.openModal(rowData);
    }
    handleShowAddConfigModal() {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          activeTabKey: 1,
          newEntry: true,
          configName: "",
          selected: [],
          prefix: "",
          nextValue: 1,
          maxValue: -1,
          interval: 1,
          magicRegen: "",
          filter: "",
          scope: "",
          remoteBindDN: "",
          remoteBindCred: "",
          sharedConfigEntry: "",
          threshold: 1,
          nextRange: "",
          rangeRequestTimeout: 600,
          sharedConfigRows: [],
          saveBtnDisabled: true,
          error: {}
        });
      } else {
        let dnaTypeList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "dna",
          "config",
          name2,
          "show"
        ];
        log_cmd("openModal", "Fetch the DNA Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          let sharedCfgDN = "";
          if ("dnasharedcfgdn" in configEntry) {
            sharedCfgDN = configEntry.dnasharedcfgdn[0];
          }
          configEntry.dnaprefix === void 0 ? configEntry.dnaprefix = "" : configEntry.dnaprefix = configEntry.dnaprefix[0];
          configEntry.dnanextvalue === void 0 ? configEntry.dnanextvalue = "" : configEntry.dnanextvalue = configEntry.dnanextvalue[0];
          configEntry.dnamaxvalue === void 0 ? configEntry.dnamaxvalue = "" : configEntry.dnamaxvalue = configEntry.dnamaxvalue[0];
          configEntry.dnainterval === void 0 ? configEntry.dnainterval = "" : configEntry.dnainterval = configEntry.dnainterval[0];
          configEntry.dnamagicregen === void 0 ? configEntry.dnamagicregen = "" : configEntry.dnamagicregen = configEntry.dnamagicregen[0];
          configEntry.dnafilter === void 0 ? configEntry.dnafilter = "" : configEntry.dnafilter = configEntry.dnafilter[0];
          configEntry.dnascope === void 0 ? configEntry.dnascope = "" : configEntry.dnascope = configEntry.dnascope[0];
          configEntry.dnaremotebinddn === void 0 ? configEntry.dnaremotebinddn = "" : configEntry.dnaremotebinddn = configEntry.dnaremotebinddn[0];
          configEntry.dnaremotebindcred === void 0 ? configEntry.dnaremotebindcred = "" : configEntry.dnaremotebindcred = configEntry.dnaremotebindcred[0];
          configEntry.dnasharedcfgdn === void 0 ? configEntry.dnasharedcfgdn = "" : configEntry.dnasharedcfgdn = configEntry.dnasharedcfgdn[0];
          configEntry.dnathreshold === void 0 ? configEntry.dnathreshold = "" : configEntry.dnathreshold = configEntry.dnathreshold[0];
          configEntry.dnanextrange === void 0 ? configEntry.dnanextrange = "" : configEntry.dnanextrange = configEntry.dnanextrange[0];
          configEntry.dnarangerequesttimeout === void 0 ? configEntry.dnarangerequesttimeout = "" : configEntry.dnarangerequesttimeout = configEntry.dnarangerequesttimeout[0];
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            activeTabKey: 1,
            configName: configEntry.cn[0],
            prefix: configEntry.dnaprefix,
            nextValue: Number(configEntry.dnanextvalue) === 0 ? 1 : Number(configEntry.dnanextvalue),
            maxValue: Number(configEntry.dnamaxvalue) === 0 ? -1 : Number(configEntry.dnamaxvalue),
            interval: Number(configEntry.dnainterval) === 0 ? 1 : Number(configEntry.dnainterval),
            magicRegen: configEntry.dnamagicregen,
            filter: configEntry.dnafilter,
            scope: configEntry.dnascope,
            remoteBindDN: configEntry.dnaremotebinddn,
            remoteBindCred: configEntry.dnaremotebindcred,
            sharedConfigEntry: configEntry.dnasharedcfgdn,
            threshold: Number(configEntry.dnathreshold) === 0 ? 1 : Number(configEntry.dnathreshold),
            nextRange: configEntry.dnanextrange,
            rangeRequestTimeout: Number(configEntry.dnarangerequesttimeout) === 0 ? 600 : Number(configEntry.dnarangerequesttimeout),
            // Preserve original values
            _prefix: configEntry.dnaprefix,
            _nextValue: Number(configEntry.dnanextvalue) === 0 ? 1 : Number(configEntry.dnanextvalue),
            _maxValue: Number(configEntry.dnamaxvalue) === 0 ? -1 : Number(configEntry.dnamaxvalue),
            _interval: Number(configEntry.dnainterval) === 0 ? 1 : Number(configEntry.dnainterval),
            _magicRegen: configEntry.dnamagicregen,
            _filter: configEntry.dnafilter,
            _scope: configEntry.dnascope,
            _remoteBindDN: configEntry.dnaremotebinddn,
            _remoteBindCred: configEntry.dnaremotebindcred,
            _sharedConfigEntry: configEntry.dnasharedcfgdn,
            _threshold: Number(configEntry.dnathreshold) === 0 ? 1 : Number(configEntry.dnathreshold),
            _nextRange: configEntry.dnanextrange,
            _rangeRequestTimeout: Number(configEntry.dnarangerequesttimeout) === 0 ? 600 : Number(configEntry.dnarangerequesttimeout),
            saveBtnDisabled: true,
            error: {}
          }, () => {
            this.loadSharedConfigs(sharedCfgDN);
          });
          if (configEntry.dnatype === void 0) {
            this.setState({ selected: [], _selected: [] });
          } else {
            for (const value of configEntry.dnatype) {
              dnaTypeList = [...dnaTypeList, value];
            }
            this.setState({ selected: dnaTypeList, _selected: [...dnaTypeList] });
          }
        }).fail((_) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configName: "",
            selected: [],
            prefix: "",
            nextValue: "",
            maxValue: "",
            interval: "",
            magicRegen: "",
            filter: "",
            scope: "",
            remoteBindDN: "",
            remoteBindCred: "",
            sharedConfigEntry: "",
            threshold: "",
            nextRange: "",
            rangeRequestTimeout: "",
            saveBtnDisabled: true
          });
        });
      }
    }
    showEditSharedConfigModal(sharedName) {
      this.openSharedModal(sharedName);
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    handleCloseSharedModal() {
      this.setState({ sharedConfigEntryModalShow: false });
    }
    cmdOperation(action, muteError) {
      const {
        configName,
        selected,
        prefix,
        nextValue,
        maxValue,
        interval: interval2,
        magicRegen,
        filter,
        scope,
        remoteBindDN,
        remoteBindCred,
        sharedConfigEntry,
        threshold: threshold2,
        nextRange,
        rangeRequestTimeout
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        configName,
        action,
        "--prefix",
        prefix || action === "add" ? prefix : "delete",
        "--next-value=" + (nextValue || action === "add" ? nextValue : "delete"),
        "--max-value=" + (maxValue || action === "add" ? maxValue : "delete"),
        "--interval=" + (interval2 || action === "add" ? interval2 : "delete"),
        "--magic-regen",
        magicRegen || action === "add" ? magicRegen : "delete",
        "--filter",
        filter || action === "add" ? filter : "delete",
        "--scope",
        scope || action === "add" ? scope : "delete",
        "--remote-bind-dn",
        remoteBindDN || action === "add" ? remoteBindDN : "delete",
        "--remote-bind-cred",
        remoteBindCred || action === "add" ? remoteBindCred : "delete",
        "--shared-config-entry",
        sharedConfigEntry || action === "add" ? sharedConfigEntry : "delete",
        "--threshold=" + (threshold2 || action === "add" ? threshold2 : "delete"),
        "--next-range",
        nextRange || action === "add" ? nextRange : "delete",
        "--range-request-timeout=" + (rangeRequestTimeout || action === "add" ? rangeRequestTimeout : "delete")
      ];
      if (!(action === "add" && selected.length === 0)) {
        cmd = [...cmd, "--type"];
        if (selected.length !== 0) {
          for (const value of selected) {
            cmd = [...cmd, value];
          }
        } else if (action === "add") {
          cmd = [...cmd, ""];
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      this.setState({
        saving: true
      });
      log_cmd("DNAOperation", `Do the ${action} operation on the DNA Plugin`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("DNAOperation", "Result", content);
        this.props.addNotification(
          "success",
          `The ${action} operation was successfully done on "${configName}" entry`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (muteError !== true) {
          this.props.addNotification(
            "error",
            `Error during the config entry ${action} operation - ${errMsg.desc}`
          );
        }
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        this.state.deleteItem,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the DNA Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${this.state.deleteItem} was successfully deleted`
        );
        this.closeDeleteConfirm();
        this.loadConfigs();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry removal operation - ${errMsg.desc}`
        );
        this.closeDeleteConfirm();
        this.loadConfigs();
        this.handleCloseModal();
      });
    }
    addConfig(muteError) {
      this.cmdOperation("add", muteError);
    }
    editConfig(muteError) {
      this.cmdOperation("set", muteError);
    }
    openSharedModal(sharedName) {
      if (sharedName) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "dna",
          "config",
          this.state.configName,
          "shared-config-entry",
          sharedName,
          "show"
        ];
        log_cmd("openSharedModal", "Fetch the DNA Plugin shared config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          configEntry.dnahostname === void 0 ? configEntry.dnahostname = "" : configEntry.dnahostname = configEntry.dnahostname[0];
          configEntry.dnaportnum === void 0 ? configEntry.dnaportnum = "" : configEntry.dnaportnum = configEntry.dnaportnum[0];
          configEntry.dnasecureportnum === void 0 ? configEntry.dnasecureportnum = "" : configEntry.dnasecureportnum = configEntry.dnasecureportnum[0];
          configEntry.dnaremainingvalues === void 0 ? configEntry.dnaremainingvalues = "" : configEntry.dnaremainingvalues = configEntry.dnaremainingvalues[0];
          configEntry.dnaremotebindmethod === void 0 ? configEntry.dnaremotebindmethod = "" : configEntry.dnaremotebindmethod = configEntry.dnaremotebindmethod[0];
          configEntry.dnaremoteconnprotocol === void 0 ? configEntry.dnaremoteconnprotocol = "" : configEntry.dnaremoteconnprotocol = configEntry.dnaremoteconnprotocol[0];
          this.setState({
            sharedConfigEntryModalShow: true,
            sharedHostname: configEntry.dnahostname,
            sharedPort: configEntry.dnaportnum,
            sharedSecurePort: configEntry.dnasecureportnum,
            sharedRemainingValues: configEntry.dnaremainingvalues,
            sharedRemoteBindMethod: configEntry.dnaremotebindmethod,
            sharedRemoteConnProtocol: configEntry.dnaremoteconnprotocol,
            // Preserve settings
            _sharedRemoteBindMethod: configEntry.dnaremotebindmethod,
            _sharedRemoteConnProtocol: configEntry.dnaremoteconnprotocol,
            saveBtnDisabled: true
          });
        }).fail((_) => {
          this.setState({
            sharedConfigEntryModalShow: true,
            sharedBaseDN: "",
            sharedHostname: "",
            sharedPort: "",
            sharedSecurePort: "",
            sharedRemainingValues: "",
            sharedRemoteBindMethod: "",
            sharedRemoteConnProtocol: ""
          });
        });
      } else {
        this.setState({
          sharedConfigEntryModalShow: true,
          sharedBaseDN: "",
          sharedHostname: "",
          sharedPort: "",
          sharedSecurePort: "",
          sharedRemainingValues: "",
          sharedRemoteBindMethod: "",
          sharedRemoteConnProtocol: ""
        });
      }
    }
    handleEditSharedConfig() {
      const {
        configName,
        sharedHostname,
        sharedPort,
        sharedRemoteBindMethod,
        sharedRemoteConnProtocol
      } = this.state;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        configName,
        "shared-config-entry",
        sharedHostname + ":" + sharedPort,
        "set",
        "--remote-bind-method",
        sharedRemoteBindMethod || "delete",
        "--remote-conn-protocol",
        sharedRemoteConnProtocol || "delete"
      ];
      this.setState({
        savingShared: true
      });
      log_cmd(
        "handleEditSharedConfig",
        `Do the set operation on the DNA Plugin Shared Entry`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          `The set operation was successfully done on "${sharedHostname}:${sharedPort}" entry`
        );
        this.loadSharedConfigs(this.state.sharedConfigEntry);
        this.handleCloseSharedModal();
        this.setState({
          savingShared: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry set operation - ${errMsg.desc}`
        );
        this.loadSharedConfigs(this.state.sharedConfigEntry);
        this.handleCloseSharedModal();
        this.setState({
          savingShared: false
        });
      });
    }
    deleteSharedConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        this.state.configName,
        "shared-config-entry",
        this.state.deleteItem,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteSharedConfig", "Delete the DNA Plugin Shared config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteSharedConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Shared config entry ${this.state.deleteItem} was successfully deleted`
        );
        this.closeSharedDeleteConfirm();
        this.loadSharedConfigs(this.state.sharedConfigEntry);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the shared config entry removal operation - ${errMsg.desc}`
        );
        this.closeSharedDeleteConfirm();
        this.loadSharedConfigs(this.state.sharedConfigEntry);
      });
    }
    validateSharedConfig(adding) {
      let validatedBindMethod = ValidatedOptions.default;
      let validatedBindMethodText = "";
      let validatedConnProtocol = ValidatedOptions.default;
      let validatedConnText = "";
      if (this.state.sharedRemoteBindMethod === "SSL" && this.state.sharedRemoteConnProtocol !== "TLS") {
        validatedBindMethodText = "You can not use 'SSL' if the connection protocol is not 'TLS'";
        validatedBindMethod = ValidatedOptions.error;
      } else if (this.state.sharedRemoteBindMethod.startsWith("SASL") && this.state.sharedRemoteConnProtocol === "TLS") {
        validatedBindMethodText = "You can not use a 'SASL' method if the connection protocol is 'TLS'";
        validatedBindMethod = ValidatedOptions.error;
      } else if (this.state.sharedRemoteBindMethod === "" && this.state.sharedRemoteConnProtocol !== "" || this.state.sharedRemoteBindMethod !== "" && this.state.sharedRemoteConnProtocol === "") {
        validatedBindMethodText = "You must either set, or unset, both preferences";
        validatedBindMethod = ValidatedOptions.error;
      }
      if (this.state.sharedRemoteConnProtocol === "TLS" && this.state.sharedRemoteBindMethod.startsWith("SASL/")) {
        validatedConnText = "You can not use the 'TLS' protocol if the BindMethod is a 'SASL' method";
        validatedConnProtocol = ValidatedOptions.error;
      } else if (this.state.sharedRemoteConnProtocol === "LDAP" && this.state.sharedRemoteBindMethod === "SSL") {
        validatedConnText = "You can not use the 'LDAP' protocol if the BindMethod is a 'TLS'";
        validatedConnProtocol = ValidatedOptions.error;
      } else if (this.state.sharedRemoteConnProtocol === "" && this.state.sharedRemoteBindMethod !== "" || this.state.sharedRemoteConnProtocol !== "" && this.state.sharedRemoteBindMethod === "") {
        validatedConnText = "You must either set, or unset, both preferences";
        validatedConnProtocol = ValidatedOptions.error;
      }
      let saveNotOK = validatedBindMethod !== ValidatedOptions.default || validatedConnProtocol !== ValidatedOptions.default;
      if (!adding && !saveNotOK) {
        if (this.state._sharedRemoteConnProtocol === this.state.sharedRemoteConnProtocol && this.state._sharedRemoteBindMethod === this.state.sharedRemoteBindMethod) {
          saveNotOK = true;
        }
      }
      return {
        validatedBindMethodText,
        validatedBindMethod,
        validatedConnText,
        validatedConnProtocol,
        saveSharedNotOK: saveNotOK
      };
    }
    validateConfig() {
      const error = {};
      let all_good = true;
      const dnAttrs = [
        "sharedConfigEntry",
        "scope"
      ];
      const reqAttrs = [
        "configName",
        "nextValue",
        "filter",
        "scope"
      ];
      if (this.state.selected === "" || this.state.selected.length === 0) {
        all_good = false;
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          error[attr] = true;
          all_good = false;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          error[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "maxValue",
          "interval",
          "magicRegen",
          "filter",
          "scope",
          "nextValue",
          "remoteBindDN",
          "remoteBindCred",
          "sharedConfigEntry",
          "threshold",
          "nextRange",
          "rangeRequestTimeout"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (!listsEqual(this.state.selected, this.state._selected)) {
          all_good = true;
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error
      });
    }
    render() {
      const {
        sharedConfigRows,
        configEntryModalShow,
        configName,
        newEntry,
        rangeRequestTimeout,
        sharedConfigEntry,
        sharedConfigEntryModalShow,
        sharedHostname,
        sharedPort,
        sharedSecurePort,
        sharedRemainingValues,
        sharedRemoteBindMethod,
        sharedRemoteConnProtocol,
        magicRegen,
        scope,
        filter,
        selected,
        nextValue,
        maxValue,
        interval: interval2,
        saving,
        savingShared,
        saveBtnDisabled,
        threshold: threshold2,
        error
      } = this.state;
      let sharedResult = {};
      const bindMethodOptions = [
        { value: "", label: "None" },
        { value: "SIMPLE", label: "SIMPLE" },
        { value: "SSL", label: "SSL" },
        { value: "SASL/GSSAPI", label: "SASL/GSSAPI" },
        { value: "SASL/DIGEST-MD5", label: "SASL/DIGEST-MD5" }
      ];
      const connProtocolOptions = [
        { value: "", label: "None" },
        { value: "LDAP", label: "LDAP" },
        { value: "TLS", label: "TLS" }
      ];
      const modalConfigFields = {
        prefix: {
          name: "Prefix",
          value: this.state.prefix,
          id: "prefix",
          type: "text",
          help: "Defines a prefix that can be prepended to the generated number values for the attribute (dnaPrefix)"
        },
        remoteBindDN: {
          name: "Remote Bind DN",
          value: this.state.remoteBindDN,
          id: "remoteBindDN",
          type: "text",
          help: "Specifies the Replication Manager DN (dnaRemoteBindDN)"
        },
        remoteBindCred: {
          name: "Remote Bind Credentials",
          value: this.state.remoteBindCred,
          id: "remoteBindCred",
          type: "text",
          help: "Specifies the Replication Manager's password (dnaRemoteBindCred)"
        },
        nextRange: {
          name: "Next Range",
          value: this.state.nextRange,
          id: "nextRange",
          type: "text",
          help: "Defines the next range to use when the current range is exhausted.  Format is '####-####', or '1000-5000' (dnaNextRange)."
        }
      };
      sharedResult = this.validateSharedConfig(newEntry);
      let saveBtnName;
      let saveSharedBtnName = "Save Shared Config";
      if (newEntry) {
        saveBtnName = "Add Config";
      } else {
        saveBtnName = "Save Config";
      }
      const extraPrimaryProps = {};
      if (saving) {
        if (newEntry) {
          saveBtnName = "Adding Config ...";
        } else {
          saveBtnName = "Saving Config ...";
        }
        saveSharedBtnName = "Saving Config ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react13.default.createElement("div", { className: saving || savingShared ? "ds-disabled" : "" }, /* @__PURE__ */ import_react13.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: newEntry ? "Create DNA Config Entry" : "Edit DNA Config Entry",
          isOpen: configEntryModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleCloseModal,
          actions: [
            /* @__PURE__ */ import_react13.default.createElement(
              Button,
              {
                key: "saveshared",
                isDisabled: saveBtnDisabled || saving,
                variant: "primary",
                onClick: newEntry ? this.addConfig : this.editConfig,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react13.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react13.default.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react13.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react13.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react13.default.createElement("b", null, "DNA Configuration")) }, /* @__PURE__ */ import_react13.default.createElement(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react13.default.createElement(Grid, null, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Config Name"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          TextInput,
          {
            value: configName,
            type: "text",
            id: "configName",
            "aria-describedby": "configName",
            name: "configName",
            onChange: this.handleFieldChange,
            isDisabled: !newEntry,
            validated: error.configName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets which attributes that will have unique numbers generated for them (dnaType)." }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "DNA Managed Attributes"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: this.handleToggle,
            onSelect: this.handleSelect,
            onClear: this.handleClearSelection,
            selections: selected,
            isOpen: this.state.isOpen,
            "aria-labelledby": "typeAhead-1",
            placeholderText: "Type an attribute...",
            validated: selected.length === 0 ? "error" : "default"
          },
          this.props.attributes.map((attr) => /* @__PURE__ */ import_react13.default.createElement(
            SelectOption,
            {
              key: attr,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets an LDAP filter to use to search for and identify the entries to which to apply the distributed numeric assignment range (dnaFilter)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Filter"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          TextInput,
          {
            value: filter,
            type: "text",
            id: "filter",
            "aria-describedby": "filter",
            name: "filter",
            onChange: this.handleFieldChange,
            validated: error.filter ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets the base DN to search for entries to which to apply the distributed numeric assignment (dnaScope)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Subtree Scope"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          TextInput,
          {
            value: scope,
            type: "text",
            id: "scope",
            "aria-describedby": "scope",
            name: "scope",
            onChange: this.handleFieldChange,
            validated: error.scope ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Gives the next available number which can be assigned (dnaNextValue)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Next Value"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          NumberInput,
          {
            value: nextValue,
            min: 1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("nextValue");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nextValue", 1);
            },
            onPlus: () => {
              this.onPlusConfig("nextValue");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets the maximum value that can be assigned for the range, default is -1 (dnaMaxValue)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Max Value"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          NumberInput,
          {
            value: maxValue,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("maxValue");
            },
            onChange: (e) => {
              this.onConfigChange(e, "maxValue", -1);
            },
            onPlus: () => {
              this.onPlusConfig("maxValue");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets a user-defined value that instructs the plug-in to assign a new value for the entry (dnaMagicRegen)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Magic Regeneration Value"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          TextInput,
          {
            value: magicRegen,
            type: "text",
            id: "magicRegen",
            "aria-describedby": "magicRegen",
            name: "magicRegen",
            onChange: this.handleFieldChange,
            validated: error.magicRegen ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), Object.entries(modalConfigFields).map(([id, content]) => /* @__PURE__ */ import_react13.default.createElement(Grid, { key: content.name, title: content.help }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { className: "ds-label", span: 3 }, content.name), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          TextInput,
          {
            value: content.value,
            type: content.type,
            id: content.id,
            "aria-describedby": content.name,
            name: content.name,
            key: content.name,
            onChange: this.handleFieldChange,
            validated: error[content.id] ? ValidatedOptions.error : ValidatedOptions.default
          }
        )))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets a threshold of remaining available numbers in the range. When the server hits the threshold, it sends a request for a new range (dnaThreshold)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Threshold"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          NumberInput,
          {
            value: threshold2,
            min: 1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("threshold");
            },
            onChange: (e) => {
              this.onConfigChange(e, "threshold", 1);
            },
            onPlus: () => {
              this.onPlusConfig("threshold");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets a timeout period, in seconds, for range requests so that the server does not stall waiting on a new range from one server and can request a range from a new server (dnaRangeRequestTimeout)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Range Request Timeout"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          NumberInput,
          {
            value: rangeRequestTimeout,
            min: 1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("rangeRequestTimeout");
            },
            onChange: (e) => {
              this.onConfigChange(e, "rangeRequestTimeout", 1);
            },
            onPlus: () => {
              this.onPlusConfig("rangeRequestTimeout");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Sets an interval, or increment, to add to the next DNA assigned number. If the next DNA number is '10', and the 'interval' is '1000', then the assigned value in the entry will be '1010' (dnaInterval)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Number Interval"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          NumberInput,
          {
            value: interval2,
            min: 1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("interval");
            },
            onChange: (e) => {
              this.onConfigChange(e, "interval", 1);
            },
            onPlus: () => {
              this.onPlusConfig("interval");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react13.default.createElement("hr", null))), /* @__PURE__ */ import_react13.default.createElement(
          Tab,
          {
            eventKey: 2,
            title: /* @__PURE__ */ import_react13.default.createElement(TabTitleText, null, "Shared Config Settings")
          },
          /* @__PURE__ */ import_react13.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react13.default.createElement(
            Tooltip,
            {
              content: /* @__PURE__ */ import_react13.default.createElement("div", null, "The DNA Shared Config Entry is an entry in the database that DNA configurations about remote replicas are stored under. Think of the Shared Config Entry as a container of DNA remote configurations.  These remote configurations are only used if the database is being replicated, otherwise these settings can be ignored. This entry must already be created prior to setting the", /* @__PURE__ */ import_react13.default.createElement("b", null, " Shared Config Entry"), " field.")
            },
            /* @__PURE__ */ import_react13.default.createElement("a", { className: "ds-font-size-sm" }, "What is a Shared Config Entry?")
          )),
          /* @__PURE__ */ import_react13.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react13.default.createElement(Grid, { title: "Defines a container entry DN for DNA remote server configuration that the servers can use to transfer ranges between one another (dnaSharedCfgDN)" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Shared Config Entry DN"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
            TextInput,
            {
              value: sharedConfigEntry,
              type: "text",
              id: "sharedConfigEntry",
              "aria-describedby": "sharedConfigEntry",
              name: "sharedConfigEntry",
              onChange: this.handleFieldChange,
              validated: error.sharedConfigEntry ? ValidatedOptions.error : ValidatedOptions.default
            }
          )))),
          /* @__PURE__ */ import_react13.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react13.default.createElement(
            DNASharedTable,
            {
              rows: sharedConfigRows,
              key: sharedConfigRows,
              editConfig: this.showEditSharedConfigModal,
              deleteConfig: this.showSharedDeleteConfirm
            }
          ), /* @__PURE__ */ import_react13.default.createElement("hr", null))
        ))
      ), /* @__PURE__ */ import_react13.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Manage DNA Plugin Shared Config Entry",
          isOpen: sharedConfigEntryModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleCloseSharedModal,
          actions: [
            /* @__PURE__ */ import_react13.default.createElement(
              Button,
              {
                key: "confirm",
                isDisabled: sharedResult.saveSharedNotOK || savingShared,
                variant: "primary",
                onClick: this.handleEditSharedConfig,
                isLoading: savingShared,
                spinnerAriaValueText: savingShared ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveSharedBtnName
            ),
            /* @__PURE__ */ import_react13.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseSharedModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react13.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react13.default.createElement(Grid, { hasGutter: true, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3 }, "Hostname:"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react13.default.createElement("b", null, sharedHostname)), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 2 }, "Port:"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react13.default.createElement("b", null, sharedPort)), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3 }, "Remaining Values:"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react13.default.createElement("b", null, sharedRemainingValues)), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 2 }, "Secure Port:"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react13.default.createElement("b", null, sharedSecurePort)), /* @__PURE__ */ import_react13.default.createElement("hr", null), /* @__PURE__ */ import_react13.default.createElement(TextContent, null, /* @__PURE__ */ import_react13.default.createElement(Text, { className: "ds-center", title: "Used with Replication to share ranges between replicas", component: TextVariants.h3 }, "Remote Authentication Preferences")), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Remote Bind Method"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          FormSelect,
          {
            id: "sharedRemoteBindMethod",
            value: sharedRemoteBindMethod,
            onChange: this.handleFieldChange,
            "aria-label": "FormSelect Input",
            validated: sharedResult.validatedBindMethod
          },
          bindMethodOptions.map((option, index) => /* @__PURE__ */ import_react13.default.createElement(FormSelectOption, { key: index, value: option.value, label: option.label }))
        )), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Connection Protocol"), /* @__PURE__ */ import_react13.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react13.default.createElement(
          FormSelect,
          {
            id: "sharedRemoteConnProtocol",
            value: sharedRemoteConnProtocol,
            onChange: this.handleFieldChange,
            "aria-label": "FormSelect Input",
            validated: sharedResult.validatedConnProtocol
          },
          connProtocolOptions.map((option, index) => /* @__PURE__ */ import_react13.default.createElement(FormSelectOption, { key: index, value: option.value, label: option.label }))
        ))))
      ), /* @__PURE__ */ import_react13.default.createElement("div", { className: "ds-margin-top-xlg ds-center", hidden: !this.state.loading }, /* @__PURE__ */ import_react13.default.createElement(TextContent, null, /* @__PURE__ */ import_react13.default.createElement(Text, { component: TextVariants.h3 }, "Loading DNA configuration")), /* @__PURE__ */ import_react13.default.createElement(Spinner, { size: "lg" })), /* @__PURE__ */ import_react13.default.createElement("div", { hidden: this.state.loading }, /* @__PURE__ */ import_react13.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          key: this.state.configRows,
          serverId: this.props.serverId,
          cn: "Distributed Numeric Assignment Plugin",
          pluginName: "Distributed Numeric Assignment",
          cmdName: "dna",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement(
          DNATable,
          {
            rows: this.state.configRows,
            key: this.state.tableKey,
            editConfig: this.showEditConfigModal,
            deleteConfig: this.showDeleteConfirm
          }
        ), /* @__PURE__ */ import_react13.default.createElement(
          Button,
          {
            className: "ds-margin-top",
            variant: "primary",
            onClick: this.handleShowAddConfigModal
          },
          "Add Config"
        ))
      )), /* @__PURE__ */ import_react13.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDeleteConfirm,
          closeHandler: this.closeDeleteConfirm,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteConfig,
          spinning: this.state.modalSpinning,
          item: this.state.configName,
          checked: this.state.modalChecked,
          mTitle: "Delete DNA Configuration",
          mMsg: "Are you really sure you want to delete this DNA configuration?",
          mSpinningMsg: "Deleting config ...",
          mBtnName: "Delete config"
        }
      ), /* @__PURE__ */ import_react13.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showSharedDeleteConfirm,
          closeHandler: this.closeSharedDeleteConfirm,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteSharedConfig,
          spinning: this.state.modalSpinning,
          item: this.state.sharedConfigEntry,
          checked: this.state.modalChecked,
          mTitle: "Delete Shared Config Entry",
          mMsg: "Are you really sure you want to delete this Shared Config Entry?",
          mSpinningMsg: "Deleting Shared Config ...",
          mBtnName: "Delete Shared Config"
        }
      ));
    }
  };
  DNAPlugin.propTypes = {
    rows: import_prop_types8.default.array,
    serverId: import_prop_types8.default.string,
    savePluginHandler: import_prop_types8.default.func,
    pluginListHandler: import_prop_types8.default.func,
    addNotification: import_prop_types8.default.func,
    toggleLoadingHandler: import_prop_types8.default.func
  };
  DNAPlugin.defaultProps = {
    rows: [],
    serverId: ""
  };
  var dna_default = DNAPlugin;

  // src/lib/plugins/linkedAttributes.jsx
  var import_react14 = __toESM(require_react(), 1);
  var import_prop_types9 = __toESM(require_prop_types(), 1);
  var LinkedAttributes = class extends import_react14.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadConfigs();
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        configRows: [],
        tableKey: 1,
        error: {},
        saveBtnDisabled: true,
        configName: "",
        linkType: [],
        managedType: [],
        linkScope: "",
        newEntry: false,
        showConfigModal: false,
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false,
        isLinkTypeOpen: false,
        isManagedTypeOpen: false
      };
      this.handleLinkTypeSelect = (event, selection) => {
        if (this.state.linkType.includes(selection)) {
          this.setState(
            (prevState) => ({
              linkType: prevState.linkType.filter((item) => item !== selection),
              isLinkTypeOpen: false
            }),
            () => {
              this.validate();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              linkType: [...prevState.linkType, selection],
              isLinkTypeOpen: false
            }),
            () => {
              this.validate();
            }
          );
        }
      };
      this.handleLinkTypeToggle = (isLinkTypeOpen) => {
        this.setState({
          isLinkTypeOpen
        });
      };
      this.handleLinkTypeClear = () => {
        this.setState({
          linkType: [],
          isLinkTypeOpen: false
        }, () => {
          this.validate();
        });
      };
      this.handleManagedTypeSelect = (event, selection) => {
        if (this.state.managedType.includes(selection)) {
          this.setState(
            (prevState) => ({
              managedType: prevState.managedType.filter((item) => item !== selection),
              isManagedTypeOpen: false
            }),
            () => {
              this.validate();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              managedType: [...prevState.managedType, selection],
              isManagedTypeOpen: false
            }),
            () => {
              this.validate();
            }
          );
        }
      };
      this.handleManagedTypeToggle = (isManagedTypeOpen) => {
        this.setState({
          isManagedTypeOpen
        });
      };
      this.handleManagedTypeClear = () => {
        this.setState({
          managedType: [],
          isManagedTypeOpen: false
        }, () => {
          this.validate();
        });
      };
      this.onFieldChange = this.onFieldChange.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.showEditConfigModal = this.showEditConfigModal.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.handleShowAddConfigModal = this.handleShowAddConfigModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.openModal = this.openModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.addConfig = this.addConfig.bind(this);
      this.editConfig = this.editConfig.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
    }
    showConfirmDelete(name2) {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    validate() {
      const errObj = {};
      let all_good = true;
      if (this.state.configName === "") {
        errObj.configName = true;
        all_good = false;
      }
      if (this.state.linkScope === "" || !valid_dn(this.state.linkScope)) {
        errObj.linkScope = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "linkScope",
          "managedType",
          "linkType",
          "configName"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    onFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    loadConfigs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "linked-attr",
        "list"
      ];
      log_cmd("loadConfigs", "Get Linked Attributes Plugin configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          configRows: myObject.items.map((item) => item.attrs),
          tableKey,
          firstLoad: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadConfigs failed", errMsg.desc);
        }
      });
    }
    showEditConfigModal(rowData) {
      this.openModal(rowData);
    }
    handleShowAddConfigModal(rowData) {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configName: "",
          linkType: [],
          managedType: [],
          linkScope: "",
          saveBtnDisabled: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "linked-attr",
          "config",
          name2,
          "show"
        ];
        this.props.toggleLoadingHandler();
        log_cmd("openModal", "Fetch the Linked Attributes Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            saveBtnDisabled: true,
            newEntry: false,
            configName: configEntry.cn === void 0 ? "" : configEntry.cn[0],
            linkType: configEntry.linktype === void 0 ? [] : [configEntry.linktype[0]],
            managedType: configEntry.managedtype === void 0 ? [] : [configEntry.managedtype[0]],
            linkScope: configEntry.linkscope === void 0 ? "" : configEntry.linkscope[0]
          });
          this.props.toggleLoadingHandler();
        }).fail((_) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configName: "",
            linkType: [],
            managedType: [],
            linkScope: "",
            saveBtnDisabled: true
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    cmdOperation(action) {
      const { configName, linkType, managedType, linkScope } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "linked-attr",
        "config",
        configName,
        action,
        "--link-scope",
        linkScope || action === "add" ? linkScope : "delete"
      ];
      cmd = [...cmd, "--link-type"];
      if (linkType.length !== 0) {
        cmd = [...cmd, linkType[0]];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--managed-type"];
      if (managedType.length !== 0) {
        cmd = [...cmd, managedType[0]];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      this.props.toggleLoadingHandler();
      log_cmd(
        "linkedAttributesOperation",
        `Do the ${action} operation on the Linked Attributes Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("linkedAttributesOperation", "Result", content);
        this.props.addNotification(
          "success",
          `The ${action} operation was successfully done on "${configName}" entry`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry ${action} operation - ${errMsg.desc}`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.props.toggleLoadingHandler();
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "linked-attr",
        "config",
        this.state.deleteName,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Linked Attributes Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${this.state.deleteName} was successfully deleted`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.closeConfirmDelete();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry removal operation - ${errMsg.desc}`
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.closeConfirmDelete();
      });
    }
    addConfig() {
      this.cmdOperation("add");
    }
    editConfig() {
      this.cmdOperation("set");
    }
    render() {
      const {
        configEntryModalShow,
        configName,
        linkType,
        managedType,
        linkScope,
        newEntry,
        error,
        saveBtnDisabled,
        saving,
        firstLoad
      } = this.state;
      const title = (newEntry ? "Add" : "Edit") + " Linked Attributes Plugin Config Entry";
      let saveBtnName = (newEntry ? "Add" : "Save") + " Config";
      const extraPrimaryProps = {};
      if (saving) {
        if (newEntry) {
          saveBtnName = "Adding Config ...";
        } else {
          saveBtnName = "Saving Config ...";
        }
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react14.default.createElement("div", { className: saving || firstLoad ? "ds-disabled" : "" }, /* @__PURE__ */ import_react14.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: configEntryModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleCloseModal,
          actions: [
            /* @__PURE__ */ import_react14.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: newEntry ? this.addConfig : this.editConfig,
                isDisabled: saveBtnDisabled || saving,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react14.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react14.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react14.default.createElement(Grid, { title: "The Linked Attributes configuration name" }, /* @__PURE__ */ import_react14.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Config Name"), /* @__PURE__ */ import_react14.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react14.default.createElement(
          TextInput,
          {
            value: configName,
            type: "text",
            id: "configName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configName",
            onChange: (str, e) => {
              this.onFieldChange(e);
            },
            validated: error.configName ? ValidatedOptions.error : ValidatedOptions.default,
            isDisabled: !newEntry
          }
        ))), /* @__PURE__ */ import_react14.default.createElement(Grid, { title: "Sets the attribute that is managed manually by administrators (linkType)" }, /* @__PURE__ */ import_react14.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Link Type"), /* @__PURE__ */ import_react14.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react14.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: this.handleLinkTypeToggle,
            onSelect: this.handleLinkTypeSelect,
            onClear: this.handleLinkTypeClear,
            selections: linkType,
            isOpen: this.state.isLinkTypeOpen,
            "aria-labelledby": "typeAhead-link-type",
            placeholderText: "Type an attribute...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react14.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react14.default.createElement(Grid, { title: "Sets the attribute that is created dynamically by the plugin (managedType)" }, /* @__PURE__ */ import_react14.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Managed Type"), /* @__PURE__ */ import_react14.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react14.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: this.handleManagedTypeToggle,
            onSelect: this.handleManagedTypeSelect,
            onClear: this.handleManagedTypeClear,
            selections: managedType,
            isOpen: this.state.isManagedTypeOpen,
            placeholderText: "Type an attribute...",
            "aria-labelledby": "typeAhead-managed-type",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react14.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react14.default.createElement(Grid, { title: "Sets the base DN that restricts the plugin to a specific part of the directory tree (linkScope)" }, /* @__PURE__ */ import_react14.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Link Scope"), /* @__PURE__ */ import_react14.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react14.default.createElement(
          TextInput,
          {
            value: linkScope,
            type: "text",
            id: "linkScope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "linkScope",
            onChange: (str, e) => {
              this.onFieldChange(e);
            },
            validated: error.linkScope ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))))
      ), /* @__PURE__ */ import_react14.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          key: this.state.configRows,
          serverId: this.props.serverId,
          cn: "Linked Attributes",
          pluginName: "Linked Attributes",
          cmdName: "linked-attr",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react14.default.createElement(Grid, null, /* @__PURE__ */ import_react14.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react14.default.createElement(
          LinkedAttributesTable,
          {
            rows: this.state.configRows,
            key: this.state.tableKey,
            editConfig: this.showEditConfigModal,
            deleteConfig: this.showConfirmDelete
          }
        ), /* @__PURE__ */ import_react14.default.createElement(
          Button,
          {
            key: "addconf",
            variant: "primary",
            onClick: this.handleShowAddConfigModal
          },
          "Add Config"
        )))
      ), /* @__PURE__ */ import_react14.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onFieldChange,
          actionHandler: this.deleteConfig,
          spinning: this.state.modalSpinning,
          item: this.state.deleteName,
          checked: this.state.modalChecked,
          mTitle: "Delete Linked Attribute Configuration",
          mMsg: "Are you sure you want to delete this configuration?",
          mSpinningMsg: "Deleting Configuration...",
          mBtnName: "Delete Configuration"
        }
      ));
    }
  };
  LinkedAttributes.propTypes = {
    rows: import_prop_types9.default.array,
    serverId: import_prop_types9.default.string,
    savePluginHandler: import_prop_types9.default.func,
    pluginListHandler: import_prop_types9.default.func,
    addNotification: import_prop_types9.default.func,
    toggleLoadingHandler: import_prop_types9.default.func
  };
  LinkedAttributes.defaultProps = {
    rows: [],
    serverId: ""
  };
  var linkedAttributes_default = LinkedAttributes;

  // src/lib/plugins/managedEntries.jsx
  var import_react15 = __toESM(require_react(), 1);
  var import_prop_types10 = __toESM(require_prop_types(), 1);
  var ManagedEntries = class extends import_react15.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        configArea: "",
        attributes: [],
        activeTabKey: 1,
        tableKey: 1,
        wasActiveList: [],
        saveNotOK: false,
        createNotOK: false,
        loading: false,
        // Templates
        templateRows: [],
        templateOptions: [],
        isRDNOpen: false,
        templateDN: "",
        templateRDNAttr: "",
        templateStaticAttr: [],
        templateMappedAttr: [],
        selectedMappedAttr: "",
        selectedStaticAttr: "",
        staticAttr: "",
        staticValue: "",
        mappedValue: "",
        mappedAttr: "",
        templateAddStaticShow: false,
        templateAddMappedShow: false,
        templateModalShow: false,
        showTempDeleteConfirm: false,
        newTemplateEntry: false,
        showStaticAttrDeleteConfirm: false,
        showMappedAttrDeleteConfirm: false,
        // Definitions
        saveDefOK: false,
        configRows: [],
        configName: "",
        originScope: "",
        originFilter: "",
        managedBase: "",
        managedTemplate: "",
        newDefEntry: false,
        configEntryModalShow: false,
        defCreateDisabled: false,
        showDefDeleteConfirm: false,
        // Validation
        addStaticValueValidated: ValidatedOptions.default,
        addMappedValueValidated: ValidatedOptions.default
      };
      this.handleNavSelect = (event, tabIndex) => {
        const { wasActiveList } = this.state;
        if (!wasActiveList.includes(tabIndex)) {
          const newList = wasActiveList.concat(tabIndex);
          this.setState({
            wasActiveList: newList,
            activeTabKey: tabIndex
          });
        } else {
          this.setState({
            activeTabKey: tabIndex
          });
        }
      };
      this.handleRDNSelect = (event, selection) => {
        this.setState({
          templateRDNAttr: selection,
          isRDNOpen: false
        });
      };
      this.handleRDNToggle = (isRDNOpen) => {
        this.setState({
          isRDNOpen
        });
      };
      this.handleClearRDNSelection = () => {
        this.setState({
          templateRDNAttr: "",
          isRDNOpen: false
        });
      };
      this.handleStaticSelect = (event, selection) => {
        this.setState({
          staticAttr: selection,
          isStaticOpen: false
        });
      };
      this.handleStaticToggle = (isStaticOpen) => {
        this.setState({
          isStaticOpen
        });
      };
      this.toggleLoading = () => {
        this.setState((prevState) => ({
          loading: !prevState.loading
        }));
      };
      this.handleClearStaticSelection = () => {
        this.setState({
          staticAttr: [],
          isStaticOpen: false
        });
      };
      this.handleMappedSelect = (event, selection) => {
        this.setState({
          mappedAttr: selection,
          isMappedOpen: false
        });
      };
      this.handleMappedToggle = (isMappedOpen) => {
        this.setState({
          isMappedOpen
        });
      };
      this.handleClearMappedSelection = () => {
        this.setState({
          mappedAttr: [],
          isMappedOpen: false
        });
      };
      this.handleStaticListSelect = (selectedItem, selectedItemProps) => {
        this.setState({
          selectedStaticAttr: selectedItem.current.textContent
        });
      };
      this.handleMappedListSelect = (selectedItem, selectedItemProps) => {
        this.setState({
          selectedMappedAttr: selectedItem.current.textContent
        });
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.updateFields = this.updateFields.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.getAttributes = this.getAttributes.bind(this);
      this.onConfirmChange = this.onConfirmChange.bind(this);
      this.openDefModal = this.openDefModal.bind(this);
      this.handleCloseDefModal = this.handleCloseDefModal.bind(this);
      this.showEditDefModal = this.showEditDefModal.bind(this);
      this.cmdDefOperation = this.cmdDefOperation.bind(this);
      this.showEditDefModal = this.showEditDefModal.bind(this);
      this.handleShowAddDefModal = this.handleShowAddDefModal.bind(this);
      this.deleteDefConfig = this.deleteDefConfig.bind(this);
      this.addDefConfig = this.addDefConfig.bind(this);
      this.editDefConfig = this.editDefConfig.bind(this);
      this.showDefDeleteConfirm = this.showDefDeleteConfirm.bind(this);
      this.closeDefDeleteConfirm = this.closeDefDeleteConfirm.bind(this);
      this.cmdTemplateOperation = this.cmdTemplateOperation.bind(this);
      this.showEditTempModal = this.showEditTempModal.bind(this);
      this.openTempModal = this.openTempModal.bind(this);
      this.handleCloseTempModal = this.handleCloseTempModal.bind(this);
      this.handleShowAddTempModal = this.handleShowAddTempModal.bind(this);
      this.deleteTemplate = this.deleteTemplate.bind(this);
      this.addTemplate = this.addTemplate.bind(this);
      this.editTemplate = this.editTemplate.bind(this);
      this.handleOpenStaticAttrModal = this.handleOpenStaticAttrModal.bind(this);
      this.handleCloseStaticAttrModal = this.handleCloseStaticAttrModal.bind(this);
      this.deleteStaticAttribute = this.deleteStaticAttribute.bind(this);
      this.handleOpenMappedAttrModal = this.handleOpenMappedAttrModal.bind(this);
      this.handleCloseMappedAttrModal = this.handleCloseMappedAttrModal.bind(this);
      this.deleteMappedAttribute = this.deleteMappedAttribute.bind(this);
      this.handleAddStaticAttrToList = this.handleAddStaticAttrToList.bind(this);
      this.handleAddMappedAttrToList = this.handleAddMappedAttrToList.bind(this);
      this.showTempDeleteConfirm = this.showTempDeleteConfirm.bind(this);
      this.closeTempDeleteConfirm = this.closeTempDeleteConfirm.bind(this);
      this.handleShowMappedAttrDeleteConfirm = this.handleShowMappedAttrDeleteConfirm.bind(this);
      this.closeMappedAttrDeleteConfirm = this.closeMappedAttrDeleteConfirm.bind(this);
      this.handleShowStaticAttrDeleteConfirm = this.handleShowStaticAttrDeleteConfirm.bind(this);
      this.closeStaticAttrDeleteConfirm = this.closeStaticAttrDeleteConfirm.bind(this);
    }
    componentDidMount() {
      this.updateFields();
    }
    handleFieldChange(str, e) {
      const value = e.target.value;
      const id = e.target.id;
      this.setState({
        [id]: value
      });
    }
    showTempDeleteConfirm(dn) {
      this.setState({
        templateDN: dn,
        showTempDeleteConfirm: true,
        modalChecked: false
      });
    }
    closeTempDeleteConfirm() {
      this.setState({
        showTempDeleteConfirm: false
      });
    }
    showDefDeleteConfirm(name2) {
      this.setState({
        configName: name2,
        showDefDeleteConfirm: true,
        modalChecked: false
      });
    }
    closeDefDeleteConfirm() {
      this.setState({
        showDefDeleteConfirm: false
      });
    }
    loadConfigs() {
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "list",
        "templates"
      ];
      log_cmd("loadConfigs", "Get Managed Entries templates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        let defCreateDisabled = false;
        const templateOptions = [];
        if (myObject.items.length === 0) {
          defCreateDisabled = true;
        } else {
          for (const temp of myObject.items) {
            templateOptions.push({
              value: temp.dn,
              label: temp.dn
            });
          }
        }
        this.setState({
          showDefDeleteConfirm: false,
          templateRows: myObject.items.map((item) => item.attrs),
          defCreateDisabled,
          templateOptions,
          managedTemplate: templateOptions.length ? templateOptions[0].value : ""
        });
        cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "managed-entries",
          "list",
          "configs"
        ];
        log_cmd("loadConfigs", "Get Managed Entries Plugin definitions", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const myObject2 = JSON.parse(content2);
          const tableKey = this.state.tableKey + 1;
          this.setState({
            configRows: myObject2.items.map((item) => item.attrs),
            tableKey,
            loading: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          if (err !== 0) {
            console.log("loadConfigs failed getting definitions", errMsg.desc);
          }
          this.setState({
            loading: false
          });
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadConfigs failed getting templates", errMsg.desc);
        }
        this.setState({
          loading: false
        });
      });
    }
    showEditTempModal(entrydn) {
      this.openTempModal(entrydn);
    }
    handleShowAddTempModal() {
      this.openTempModal();
    }
    openTempModal(entrydn) {
      this.getAttributes();
      if (entrydn === "" || entrydn === void 0) {
        this.setState({
          newTemplateEntry: true,
          templateDN: "",
          templateRDNAttr: "",
          templateStaticAttr: [],
          templateMappedAttr: [],
          saveTempOK: false,
          templateModalShow: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "managed-entries",
          "template",
          entrydn,
          "show"
        ];
        this.toggleLoading();
        log_cmd("openTempModal", "Fetch the Managed Entries template entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          configEntry.meprdnattr === void 0 ? configEntry.meprdnattr = "" : configEntry.meprdnattr = configEntry.meprdnattr[0];
          if (configEntry.mepstaticattr === void 0) {
            configEntry.mepstaticattr = [];
          }
          if (configEntry.mepmappedattr === void 0) {
            configEntry.mepmappedattr = [];
          }
          this.setState({
            newTemplateEntry: false,
            templateModalShow: true,
            saveTempOK: false,
            templateDN: entrydn,
            templateRDNAttr: configEntry.meprdnattr,
            templateStaticAttr: configEntry.mepstaticattr,
            templateMappedAttr: configEntry.mepmappedattr,
            // Preserve original Settings
            _templateDN: entrydn,
            _templateRDNAttr: configEntry.meprdnattr,
            _templateStaticAttr: [...configEntry.mepstaticattr],
            _templateMappedAttr: [...configEntry.mepmappedattr]
          }, this.toggleLoading());
        }).fail((_) => {
          this.setState({
            newTemplateEntry: true,
            templateDN: "",
            templateRDNAttr: "",
            templateStaticAttr: [],
            templateMappedAttr: []
          }, this.toggleLoading());
        });
      }
    }
    handleAddStaticAttrToList() {
      const value = this.state.staticAttr + ": " + this.state.staticValue;
      const values = this.state.templateStaticAttr;
      values.push(value);
      this.setState({
        templateStaticAttr: values,
        templateAddStaticShow: false
      });
    }
    deleteStaticAttribute() {
      const attrList = this.state.templateStaticAttr;
      for (let i = 0; i < attrList.length; i++) {
        if (attrList[i] === this.state.selectedStaticAttr) {
          attrList.splice(i, 1);
        }
      }
      this.setState({
        selectedStaticAttr: "",
        templateStaticAttr: attrList,
        showStaticAttrDeleteConfirm: false,
        modalChecked: false
      });
    }
    handleAddMappedAttrToList() {
      const values = this.state.templateMappedAttr;
      values.push(this.state.mappedAttr + ": " + this.state.mappedValue);
      this.setState((prevState) => ({
        templateMappedAttr: values,
        templateAddMappedShow: false
      }));
    }
    handleShowMappedAttrDeleteConfirm() {
      if (this.state.selectedMappedAttr !== "") {
        this.setState({
          showMappedAttrDeleteConfirm: true,
          modalChecked: false
        });
      }
    }
    closeMappedAttrDeleteConfirm() {
      this.setState({
        showMappedAttrDeleteConfirm: false
      });
    }
    handleShowStaticAttrDeleteConfirm() {
      if (this.state.selectedStaticAttr !== "") {
        this.setState({
          showStaticAttrDeleteConfirm: true,
          modalChecked: false
        });
      }
    }
    closeStaticAttrDeleteConfirm() {
      this.setState({
        showStaticAttrDeleteConfirm: false
      });
    }
    deleteMappedAttribute() {
      const attrList = this.state.templateMappedAttr;
      for (let i = 0; i < attrList.length; i++) {
        if (attrList[i] === this.state.selectedMappedAttr) {
          attrList.splice(i, 1);
        }
      }
      this.setState({
        selectedMappedAttr: "",
        templateMappedAttr: attrList,
        showMappedAttrDeleteConfirm: false,
        modalChecked: false
      });
    }
    handleCloseTempModal() {
      this.setState({ templateModalShow: false });
    }
    handleOpenMappedAttrModal() {
      this.setState({
        templateAddMappedShow: true,
        modalChecked: false,
        modalSpinning: false,
        mappedValue: "",
        mappedAttr: ""
      });
    }
    handleCloseMappedAttrModal() {
      this.setState({
        templateAddMappedShow: false
      });
    }
    handleOpenStaticAttrModal() {
      this.setState({
        templateAddStaticShow: true,
        modalChecked: false,
        modalSpinning: false,
        staticValue: "",
        staticAttr: ""
      });
    }
    handleCloseStaticAttrModal() {
      this.setState({ templateAddStaticShow: false });
    }
    showEditDefModal(rowData) {
      this.openDefModal(rowData);
    }
    handleShowAddDefModal(rowData) {
      this.openDefModal();
    }
    // Definition modal
    openDefModal(name2) {
      this.getAttributes();
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          newDefEntry: true,
          configName: "",
          originScope: "",
          originFilter: "",
          managedBase: ""
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "managed-entries",
          "config",
          name2,
          "show"
        ];
        this.toggleLoading();
        log_cmd("openDefModal", "Fetch the Managed Entries Plugin definition config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          configEntry.originscope === void 0 ? configEntry.originscope = "" : configEntry.originscope = configEntry.originscope[0];
          configEntry.originfilter === void 0 ? configEntry.originfilter = "" : configEntry.originfilter = configEntry.originfilter[0];
          configEntry.managedbase === void 0 ? configEntry.managedbase = "" : configEntry.managedbase = configEntry.managedbase[0];
          configEntry.managedtemplate === void 0 ? configEntry.managedtemplate = "" : configEntry.managedtemplate = configEntry.managedtemplate[0];
          this.setState({
            configEntryModalShow: true,
            newDefEntry: false,
            configName: configEntry.cn[0],
            originScope: configEntry.originscope,
            originFilter: configEntry.originfilter,
            managedBase: configEntry.managedbase,
            managedTemplate: configEntry.managedtemplate,
            // Preserve original settings
            _originScope: configEntry.originscope,
            _originFilter: configEntry.originfilter,
            _managedBase: configEntry.managedbase,
            _managedTemplate: configEntry.managedtemplate
          }, this.toggleLoading());
        }).fail((_) => {
          this.setState({
            configEntryModalShow: true,
            newDefEntry: true,
            configName: "",
            originScope: "",
            originFilter: "",
            managedBase: ""
          }, this.toggleLoading());
        });
      }
    }
    handleCloseDefModal() {
      this.setState({ configEntryModalShow: false });
    }
    deleteDefConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "config",
        this.state.configName,
        "delete"
      ];
      this.toggleLoading();
      log_cmd("deleteDefConfig", "Delete the Managed Entries Plugin definition entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteDefConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Definition entry ${this.state.configName} was successfully deleted`
        );
        this.loadConfigs();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the definition entry removal operation - ${errMsg.desc}`
        );
        this.loadConfigs();
      });
    }
    addDefConfig() {
      this.cmdDefOperation("add");
    }
    editDefConfig() {
      this.cmdDefOperation("set");
    }
    cmdDefOperation(action) {
      const { configName, originScope, originFilter, managedBase, managedTemplate } = this.state;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "config",
        configName,
        action,
        "--scope",
        originScope || action === "add" ? originScope : "delete",
        "--filter",
        originFilter || action === "add" ? originFilter : "delete",
        "--managed-base",
        managedBase || action === "add" ? managedBase : "delete",
        "--managed-template",
        managedTemplate || action === "add" ? managedTemplate : "delete"
      ];
      this.toggleLoading();
      log_cmd("cmdDefOperation", `Do the ${action} operation on the Managed Entries Plugin`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("cmdDefOperation", "Result", content);
        this.props.addNotification(
          "success",
          `The ${action} operation was successfully done on "${configName}" entry`
        );
        this.loadConfigs();
        this.handleCloseDefModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry ${action} operation - ${errMsg.desc}`
        );
        this.loadConfigs();
        this.handleCloseDefModal();
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Managed Entries");
        this.setState({
          loading: true,
          configArea: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0]
        }, this.loadConfigs());
      }
    }
    cmdTemplateOperation(action) {
      const { templateDN, templateRDNAttr, templateStaticAttr, templateMappedAttr } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "template",
        templateDN,
        action
      ];
      cmd = [...cmd, "--rdn-attr"];
      if (templateRDNAttr !== "") {
        cmd = [...cmd, templateRDNAttr];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      if (templateStaticAttr.length !== 0) {
        cmd = [...cmd, "--static-attr"];
        for (const value of templateStaticAttr) {
          cmd = [...cmd, value];
        }
      } else if (action !== "add") {
        cmd = [...cmd, "--static-attr", "delete"];
      }
      if (templateMappedAttr.length !== 0) {
        cmd = [...cmd, "--mapped-attr"];
        for (const value of templateMappedAttr) {
          cmd = [...cmd, value];
        }
      } else if (action !== "add") {
        cmd = [...cmd, "--mapped-attr", "delete"];
      }
      this.toggleLoading();
      log_cmd(
        "cmdTemplateOperation",
        `Do the ${action} operation on the Managed Entries template`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          `Config entry ${templateDN} was successfully ${action}ed`
        );
        this.loadConfigs();
        this.handleCloseTempModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleCloseTempModal();
        this.props.addNotification(
          "error",
          `Error during the template entry ${action} operation - ${errMsg.desc}`
        );
        this.toggleLoading();
      });
    }
    deleteTemplate() {
      const { templateDN } = this.state;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "template",
        templateDN,
        "delete"
      ];
      this.toggleLoading();
      log_cmd("deleteTemplate", "Delete the Managed Entries Plugin template entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          `Template entry ${templateDN} was successfully deleted`
        );
        this.loadConfigs();
        this.closeTempDeleteConfirm();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the template entry removal operation - ${errMsg.desc}`
        );
        this.closeTempDeleteConfirm();
        this.toggleLoading();
      });
    }
    addTemplate() {
      this.cmdTemplateOperation("add");
    }
    editTemplate() {
      this.cmdTemplateOperation("set");
    }
    getAttributes() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification("error", `Failed to get attributes - ${errMsg.desc}`);
      });
    }
    onConfirmChange(e) {
      this.setState({
        modalChecked: e.target.checked
      });
    }
    validateDef(newDefEntry) {
      let defSaveDisabled = false;
      if (this.state.configName === "" || (this.state.originScope === "" || !valid_dn(this.state.originScope)) || this.state.originFilter === "" || (this.state.managedBase === "" || !valid_dn(this.state.managedBase)) || this.state.managedTemplate === "") {
        defSaveDisabled = true;
      }
      if (!newDefEntry && !defSaveDisabled) {
        if (this.state.originScope === this.state._originScope && this.state.originFilter === this.state._originFilter && this.state.managedBase === this.state._managedBase && this.state.managedTemplate === this.state._managedTemplate) {
          defSaveDisabled = true;
        }
      }
      return defSaveDisabled;
    }
    validateTempRdnToAttrMapping() {
      let mappedMatchesRDN = false;
      for (const mAttr of this.state.templateMappedAttr) {
        if (mAttr.startsWith(this.state.templateRDNAttr + ":")) {
          mappedMatchesRDN = true;
          break;
        }
      }
      return mappedMatchesRDN;
    }
    validateTemp(newTemplateEntry) {
      let tempSaveDisabled = false;
      if (this.state.templateDN === "" || this.state.templateDN !== "" && !valid_dn(this.state.templateDN) || this.state.templateRDNAttr === "") {
        tempSaveDisabled = true;
      }
      if (!this.validateTempRdnToAttrMapping()) {
        tempSaveDisabled = true;
      }
      if (!newTemplateEntry && !tempSaveDisabled) {
        if (this.state.templateDN === this.state._templateDN && this.state.templateRDNAttr === this.state._templateRDNAttr && listsEqual(this.state.templateMappedAttr, this.state._templateMappedAttr) && listsEqual(this.state.templateStaticAttr, this.state._templateStaticAttr)) {
          tempSaveDisabled = true;
        }
      }
      return tempSaveDisabled;
    }
    render() {
      const {
        configArea,
        configRows,
        attributes,
        configName,
        originScope,
        originFilter,
        managedBase,
        managedTemplate,
        templateDN,
        templateRDNAttr,
        templateStaticAttr,
        templateMappedAttr,
        templateOptions,
        newDefEntry,
        configEntryModalShow,
        newTemplateEntry,
        templateAddStaticShow,
        templateAddMappedShow
      } = this.state;
      const specificPluginCMD = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "set",
        "--config-area",
        configArea || "delete"
      ];
      const templateTitle = (newTemplateEntry ? "Add" : "Edit") + " Managed Entries Template Entry";
      const title = (newDefEntry ? "Add" : "Edit") + " Managed Entries Definition Entry";
      const defSaveDisabled = this.validateDef(newDefEntry);
      const tempSaveDisabled = this.validateTemp(newTemplateEntry);
      const templateRdnMappingOK = this.validateTempRdnToAttrMapping();
      return /* @__PURE__ */ import_react15.default.createElement("div", null, /* @__PURE__ */ import_react15.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title,
          isOpen: configEntryModalShow,
          onClose: this.handleCloseDefModal,
          actions: [
            /* @__PURE__ */ import_react15.default.createElement(
              Button,
              {
                key: "saveshared",
                isDisabled: defSaveDisabled,
                variant: "primary",
                onClick: newDefEntry ? this.addDefConfig : this.editDefConfig
              },
              "Save Definition"
            ),
            /* @__PURE__ */ import_react15.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseDefModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react15.default.createElement(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Definition Name",
            fieldId: "configName",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: configName,
              type: "text",
              id: "configName",
              "aria-describedby": "configName",
              name: "configName",
              onChange: this.handleFieldChange,
              isDisabled: !newDefEntry,
              isRequired: true
            }
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Subtree Scope",
            fieldId: "originScope",
            helperTextInvalid: "A valid DN must be provided",
            validated: originScope !== "" && !valid_dn(originScope) ? ValidatedOptions.error : ValidatedOptions.default,
            title: "Sets the search base DN to use to find candidate entries (originScope)",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: originScope,
              type: "text",
              id: "originScope",
              "aria-describedby": "originScope",
              name: "originScope",
              onChange: this.handleFieldChange,
              validated: originScope !== "" && !valid_dn(originScope) ? ValidatedOptions.error : ValidatedOptions.default,
              isRequired: true
            }
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Filter",
            fieldId: "originFilter",
            title: "Sets the search filter to use to search for and identify the entries within the subtree which require a managed entry (originFilter)",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: originFilter,
              type: "text",
              id: "originFilter",
              "aria-describedby": "originFilter",
              name: "originFilter",
              onChange: this.handleFieldChange,
              isRequired: true
            }
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Managed Base",
            fieldId: "managedBase",
            helperTextInvalid: "A valid DN must be provided",
            validated: managedBase !== "" && !valid_dn(managedBase) ? ValidatedOptions.error : ValidatedOptions.default,
            title: "Sets the subtree where the managed entries are created (managedBase)",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: managedBase,
              type: "text",
              id: "managedBase",
              "aria-describedby": "managedBase",
              name: "managedBase",
              onChange: this.handleFieldChange,
              validated: managedBase !== "" && !valid_dn(managedBase) ? ValidatedOptions.error : ValidatedOptions.default,
              isRequired: true
            }
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Template",
            fieldId: "managedTemplate",
            title: "Choose which template to use for this definition",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            FormSelect,
            {
              id: "managedTemplate",
              value: managedTemplate,
              onChange: this.handleFieldChange,
              "aria-label": "FormSelect Input"
            },
            templateOptions.map((option, index) => /* @__PURE__ */ import_react15.default.createElement(FormSelectOption, { key: index, value: option.value, label: option.label }))
          )
        ))
      ), /* @__PURE__ */ import_react15.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: templateTitle,
          isOpen: this.state.templateModalShow,
          onClose: this.handleCloseTempModal,
          actions: [
            /* @__PURE__ */ import_react15.default.createElement(
              Button,
              {
                key: "savetemp",
                variant: "primary",
                onClick: newTemplateEntry ? this.addTemplate : this.editTemplate,
                isDisabled: tempSaveDisabled
              },
              "Save Template"
            ),
            /* @__PURE__ */ import_react15.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseTempModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react15.default.createElement(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Template DN",
            fieldId: "templateDN",
            helperTextInvalid: "The template DN must be set to a valid DN",
            validated: templateDN !== "" && !valid_dn(templateDN) ? ValidatedOptions.error : ValidatedOptions.default,
            title: "DN of the template entry",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: templateDN,
              type: "text",
              id: "templateDN",
              "aria-describedby": "templateDN",
              name: "templateDN",
              onChange: this.handleFieldChange,
              isDisabled: !newTemplateEntry,
              validated: templateDN !== "" && !valid_dn(templateDN) ? ValidatedOptions.error : ValidatedOptions.default
            }
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "RDN Attribute",
            fieldId: "templateDN",
            title: "DN of the template entry",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            Select,
            {
              variant: SelectVariant.typeahead,
              typeAheadAriaLabel: "Type an attribute",
              onToggle: this.handleRDNToggle,
              onSelect: this.handleRDNSelect,
              onClear: this.handleClearRDNSelection,
              selections: templateRDNAttr,
              isOpen: this.state.isRDNOpen,
              "aria-labelledby": "typeAhead-rdn",
              placeholderText: "Type an attribute..."
            },
            attributes.map((attr) => /* @__PURE__ */ import_react15.default.createElement(
              SelectOption,
              {
                key: attr,
                value: attr
              }
            ))
          )
        )),
        /* @__PURE__ */ import_react15.default.createElement(Form, { className: "ds-margin-top-lg", autoComplete: "off" }, /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Mapped Attributes",
            fieldId: "templateDN",
            title: "Dynamic attribute mappings",
            isRequired: true
          },
          /* @__PURE__ */ import_react15.default.createElement(
            SimpleList,
            {
              className: "ds-modal-list",
              onSelect: this.handleMappedListSelect,
              "aria-label": "mappedAttrList"
            },
            templateMappedAttr.length ? templateMappedAttr.map((attr) => /* @__PURE__ */ import_react15.default.createElement(SimpleListItem, { id: attr, key: attr }, attr)) : ""
          ),
          /* @__PURE__ */ import_react15.default.createElement(
            "p",
            {
              hidden: templateRdnMappingOK,
              className: "ds-error-msg"
            },
            "You must have at least one Mapped Attribute that matches the RDN Attribute"
          ),
          /* @__PURE__ */ import_react15.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react15.default.createElement(
            Button,
            {
              className: "ds-margin-top",
              key: "addstatic",
              variant: "primary",
              onClick: this.handleOpenMappedAttrModal
            },
            "Add Attribute"
          ), /* @__PURE__ */ import_react15.default.createElement(
            Button,
            {
              className: "ds-left-margin",
              key: "delstatic",
              variant: "primary",
              isDisabled: this.state.selectedMappedAttr === "",
              onClick: this.handleShowMappedAttrDeleteConfirm
            },
            "Delete Attribute"
          ))
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            className: "ds-margin-top-lg",
            label: "Static Attributes",
            fieldId: "templateDN",
            title: "Static attribute mappings"
          },
          /* @__PURE__ */ import_react15.default.createElement(
            SimpleList,
            {
              className: "ds-modal-list",
              onSelect: this.handleStaticListSelect,
              "aria-label": "Simple List Example"
            },
            templateStaticAttr.length ? templateStaticAttr.map((attr) => /* @__PURE__ */ import_react15.default.createElement(SimpleListItem, { id: attr, key: attr }, attr)) : ""
          ),
          /* @__PURE__ */ import_react15.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react15.default.createElement(
            Button,
            {
              key: "addstatic",
              variant: "primary",
              onClick: this.handleOpenStaticAttrModal
            },
            "Add Attribute"
          ), /* @__PURE__ */ import_react15.default.createElement(
            Button,
            {
              className: "ds-left-margin",
              key: "delstatic",
              variant: "primary",
              isDisabled: this.state.selectedStaticAttr === "",
              onClick: this.handleShowStaticAttrDeleteConfirm
            },
            "Delete Attribute"
          ), /* @__PURE__ */ import_react15.default.createElement("hr", null))
        ))
      ), /* @__PURE__ */ import_react15.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          "aria-labelledby": "ds-modal",
          title: "Add Static Attribute",
          isOpen: templateAddStaticShow,
          onClose: this.handleCloseStaticAttrModal,
          actions: [
            /* @__PURE__ */ import_react15.default.createElement(
              Button,
              {
                key: "saveshared",
                variant: "primary",
                onClick: this.handleAddStaticAttrToList,
                isDisabled: !this.state.staticAttr.length || this.state.staticValue === ""
              },
              "Add Attribute"
            ),
            /* @__PURE__ */ import_react15.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseStaticAttrModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react15.default.createElement(Form, { className: "ds-margin-top", autoComplete: "off" }, /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Static Attribute",
            fieldId: "staticAttr",
            title: "The attribute that is set in the managed entry"
          },
          /* @__PURE__ */ import_react15.default.createElement(
            Select,
            {
              variant: SelectVariant.typeahead,
              typeAheadAriaLabel: "Type an attribute",
              onToggle: this.handleStaticToggle,
              onSelect: this.handleStaticSelect,
              onClear: this.handleClearStaticSelection,
              selections: this.state.staticAttr,
              isOpen: this.state.isStaticOpen,
              "aria-labelledby": "typeAhead-static",
              placeholderText: "Type an attribute..."
            },
            attributes.map((attr) => /* @__PURE__ */ import_react15.default.createElement(
              SelectOption,
              {
                key: attr,
                value: attr
              }
            ))
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            className: "ds-margin-top-lg",
            label: "Attribute Value",
            fieldId: "staticValue",
            title: "The value set for the static attribute in the entry"
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: this.state.staticValue,
              type: "text",
              id: "staticValue",
              "aria-describedby": "staticValue",
              name: "staticValue",
              onChange: this.handleFieldChange,
              isRequired: true
            }
          )
        ), /* @__PURE__ */ import_react15.default.createElement("hr", null))
      ), /* @__PURE__ */ import_react15.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          "aria-labelledby": "ds-modal",
          title: "Add Mapped Attribute",
          isOpen: templateAddMappedShow,
          onClose: this.handleCloseMappedAttrModal,
          actions: [
            /* @__PURE__ */ import_react15.default.createElement(
              Button,
              {
                key: "savemapped",
                variant: "primary",
                onClick: this.handleAddMappedAttrToList,
                isDisabled: !this.state.mappedAttr.length || this.state.mappedValue === ""
              },
              "Add Attribute"
            ),
            /* @__PURE__ */ import_react15.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseMappedAttrModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react15.default.createElement(Form, { className: "ds-margin-top", autoComplete: "off" }, /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Mapped Attribute",
            fieldId: "mappedAttr",
            title: "The attribute that is set in the managed entry"
          },
          /* @__PURE__ */ import_react15.default.createElement(
            Select,
            {
              variant: SelectVariant.typeahead,
              typeAheadAriaLabel: "Type an attribute",
              onToggle: this.handleMappedToggle,
              onSelect: this.handleMappedSelect,
              onClear: this.handleClearMappedSelection,
              selections: this.state.mappedAttr,
              isOpen: this.state.isMappedOpen,
              "aria-labelledby": "typeAhead-static",
              placeholderText: "Type an attribute..."
            },
            attributes.map((attr) => /* @__PURE__ */ import_react15.default.createElement(
              SelectOption,
              {
                key: attr,
                value: attr
              }
            ))
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Mapped Value",
            fieldId: "mappedValue",
            className: "ds-margin-top-lg",
            title: "The value set for the mapped attribute"
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: this.state.mappedValue,
              type: "text",
              id: "mappedValue",
              "aria-describedby": "mappedValue",
              name: "mappedValue",
              onChange: this.handleFieldChange
            }
          )
        ), /* @__PURE__ */ import_react15.default.createElement("hr", null))
      ), /* @__PURE__ */ import_react15.default.createElement("div", { className: "ds-center ds-margin-top-xlg", hidden: !this.state.loading }, /* @__PURE__ */ import_react15.default.createElement(TextContent, null, /* @__PURE__ */ import_react15.default.createElement(Text, { component: TextVariants.h3 }, "Loading Managed Entries Configuration ...")), /* @__PURE__ */ import_react15.default.createElement(Spinner, { className: "ds-margin-top", size: "lg" })), /* @__PURE__ */ import_react15.default.createElement("div", { hidden: this.state.loading }, /* @__PURE__ */ import_react15.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "Managed Entries",
          pluginName: "Managed Entries",
          cmdName: "managed-entries",
          specificPluginCMD,
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.toggleLoading
        },
        /* @__PURE__ */ import_react15.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react15.default.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react15.default.createElement(
          Tab,
          {
            eventKey: 1,
            title: /* @__PURE__ */ import_react15.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react15.default.createElement("b", null, "Templates"))
          },
          /* @__PURE__ */ import_react15.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react15.default.createElement(
            Tooltip,
            {
              content: /* @__PURE__ */ import_react15.default.createElement("div", null, 'Templates are used by Definitions to construct the "Managed Entry".  You must have at least one Template before you can create a Definition entry.')
            },
            /* @__PURE__ */ import_react15.default.createElement("a", { className: "ds-font-size-sm" }, "What is a Template?")
          )),
          /* @__PURE__ */ import_react15.default.createElement(
            ManagedTemplateTable,
            {
              rows: this.state.templateRows,
              key: this.state.templateRows,
              editConfig: this.showEditTempModal,
              deleteConfig: this.showTempDeleteConfirm
            }
          ),
          /* @__PURE__ */ import_react15.default.createElement(
            Button,
            {
              className: "ds-left-margin",
              variant: "primary",
              onClick: this.handleShowAddTempModal
            },
            "Create Template"
          )
        ), /* @__PURE__ */ import_react15.default.createElement(
          Tab,
          {
            eventKey: 2,
            title: /* @__PURE__ */ import_react15.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react15.default.createElement("b", null, "Definitions"))
          },
          /* @__PURE__ */ import_react15.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react15.default.createElement(
            Tooltip,
            {
              content: /* @__PURE__ */ import_react15.default.createElement("div", null, 'Definitions describe the criteria that entries must meet in order for its "managed entry" to be created.  The Managed entry will be created using the Template specified in its configuration. You can not create a Definition until there is at least one Template.')
            },
            /* @__PURE__ */ import_react15.default.createElement("a", { className: "ds-font-size-sm" }, "What is a Definition?")
          )),
          /* @__PURE__ */ import_react15.default.createElement(
            ManagedDefinitionTable,
            {
              rows: configRows,
              key: this.state.tableKey,
              editConfig: this.showEditDefModal,
              deleteConfig: this.showDefDeleteConfirm
            }
          ),
          /* @__PURE__ */ import_react15.default.createElement(
            Button,
            {
              className: "ds-left-margin",
              variant: "primary",
              onClick: this.handleShowAddDefModal,
              isDisabled: this.state.defCreateDisabled
            },
            "Add Definition"
          )
        )), /* @__PURE__ */ import_react15.default.createElement("div", { className: "ds-margin-top-xlg" }), /* @__PURE__ */ import_react15.default.createElement("hr", null), /* @__PURE__ */ import_react15.default.createElement(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react15.default.createElement(
          FormGroup,
          {
            label: "Shared Config Area",
            fieldId: "configArea",
            helperTextInvalid: "The DN for the shared conifig area is invalid",
            validated: configArea !== "" && !valid_dn(configArea) ? ValidatedOptions.error : ValidatedOptions.default
          },
          /* @__PURE__ */ import_react15.default.createElement(
            TextInput,
            {
              value: configArea,
              type: "text",
              id: "configArea",
              "aria-describedby": "configArea",
              name: "configArea",
              onChange: this.handleFieldChange
            }
          )
        )))
      )), /* @__PURE__ */ import_react15.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showTempDeleteConfirm,
          closeHandler: this.closeTempDeleteConfirm,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteTemplate,
          spinning: this.state.modalSpinning,
          item: this.state.templateDN,
          checked: this.state.modalChecked,
          mTitle: "Delete Template Entry",
          mMsg: "Are you really sure you want to delete this template entry?",
          mSpinningMsg: "Deleting template ...",
          mBtnName: "Delete Template"
        }
      ), /* @__PURE__ */ import_react15.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDefDeleteConfirm,
          closeHandler: this.closeDefDeleteConfirm,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteDefConfig,
          spinning: this.state.modalSpinning,
          item: this.state.configName,
          checked: this.state.modalChecked,
          mTitle: "Delete Definition Entry",
          mMsg: "Are you really sure you want to delete this definition entry?",
          mSpinningMsg: "Deleting definition ...",
          mBtnName: "Delete Definition"
        }
      ), /* @__PURE__ */ import_react15.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showMappedAttrDeleteConfirm,
          closeHandler: this.closeMappedAttrDeleteConfirm,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteMappedAttribute,
          spinning: this.state.modalSpinning,
          item: this.state.selectedMappedAttr,
          checked: this.state.modalChecked,
          mTitle: "Delete Mapped Attribute From Template",
          mMsg: "Are you really sure you want to delete this mapped attribute?",
          mSpinningMsg: "Deleting mapped attribute ...",
          mBtnName: "Delete Attribute"
        }
      ), /* @__PURE__ */ import_react15.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showStaticAttrDeleteConfirm,
          closeHandler: this.closeStaticAttrDeleteConfirm,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteStaticAttribute,
          spinning: this.state.modalSpinning,
          item: this.state.selectedStaticAttr,
          checked: this.state.modalChecked,
          mTitle: "Delete Static Attribute From Template",
          mMsg: "Are you really sure you want to delete this static attribute?",
          mSpinningMsg: "Deleting static attribute ...",
          mBtnName: "Delete Attribute"
        }
      ));
    }
  };
  ManagedEntries.propTypes = {
    rows: import_prop_types10.default.array,
    serverId: import_prop_types10.default.string,
    savePluginHandler: import_prop_types10.default.func,
    pluginListHandler: import_prop_types10.default.func,
    addNotification: import_prop_types10.default.func
  };
  ManagedEntries.defaultProps = {
    rows: [],
    serverId: ""
  };
  var managedEntries_default = ManagedEntries;

  // src/lib/plugins/memberOf.jsx
  var import_react16 = __toESM(require_react(), 1);
  var import_prop_types11 = __toESM(require_prop_types(), 1);
  var MemberOf = class extends import_react16.default.Component {
    componentDidMount(prevProps) {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.updateFields();
        }
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.updateFields = this.updateFields.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.handleOpenModal = this.handleOpenModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.handleAddConfig = this.handleAddConfig.bind(this);
      this.handleEditConfig = this.handleEditConfig.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.handleRunFixup = this.handleRunFixup.bind(this);
      this.handleToggleFixupModal = this.handleToggleFixupModal.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleShowConfirmDelete = this.handleShowConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.state = {
        firstLoad: true,
        error: {},
        errorModal: {},
        saveBtnDisabled: true,
        saveBtnDisabledModal: true,
        showConfirmDelete: false,
        modalCheck: false,
        modalSpinning: false,
        memberOfAttr: "",
        memberOfGroupAttr: [],
        memberOfEntryScope: [],
        memberOfEntryScopeOptions: [],
        memberOfEntryScopeExcludeSubtree: [],
        memberOfEntryScopeExcludeOptions: [],
        memberOfAutoAddOC: "",
        memberOfAllBackends: false,
        memberOfSkipNested: false,
        memberOfConfigEntry: "",
        configEntryModalShow: false,
        fixupModalShow: false,
        isSubtreeScopeOpen: false,
        isExcludeScopeOpen: false,
        configDN: "",
        configAttr: "",
        configGroupAttr: [],
        configEntryScope: [],
        configEntryScopeOptions: [],
        configEntryScopeExcludeSubtree: [],
        configEntryScopeExcludeOptions: [],
        configAutoAddOC: "",
        configAllBackends: false,
        configSkipNested: false,
        isConfigSubtreeScopeOpen: false,
        isConfigExcludeScopeOpen: false,
        newEntry: true,
        fixupDN: "",
        fixupFilter: "",
        isConfigAttrOpen: false,
        isConfigGroupAttrOpen: false,
        isConfigAutoAddOCOpen: false,
        isMemberOfAttrOpen: false,
        isMemberOfGroupAttrOpen: false,
        isMemberOfAutoAddOCOpen: false
      };
      this.handleConfigAttrSelect = (event, selection) => {
        if (selection === this.state.configAttr) {
          this.handleConfigAttrClear();
        } else {
          this.setState({
            configAttr: selection,
            isConfigAttrOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleConfigAttrToggle = (isConfigAttrOpen) => {
        this.setState({
          isConfigAttrOpen
        });
      };
      this.handleConfigAttrClear = () => {
        this.setState({
          configAttr: "",
          isConfigAttrOpen: false
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigGroupAttrSelect = (event, selection) => {
        if (this.state.configGroupAttr.includes(selection)) {
          this.setState(
            (prevState) => ({
              configGroupAttr: prevState.configGroupAttr.filter((item) => item !== selection),
              isConfigGroupAttrOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              configGroupAttr: [...prevState.configGroupAttr, selection],
              isConfigGroupAttrOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        }
      };
      this.handleConfigGroupAttrToggle = (isConfigGroupAttrOpen) => {
        this.setState({
          isConfigGroupAttrOpen
        });
      };
      this.handleConfigGroupAttrClear = () => {
        this.setState({
          configGroupAttr: [],
          isConfigGroupAttrOpen: false
        }, () => {
          this.validateModal();
        });
      };
      this.handleMemberOfAttrSelect = (event, selection) => {
        if (selection === this.state.configAttr) {
          this.handleMemberOfAttrClear();
        } else {
          this.setState({
            memberOfAttr: selection,
            isMemberOfAttrOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleMemberOfAttrToggle = (isMemberOfAttrOpen) => {
        this.setState({
          isMemberOfAttrOpen
        });
      };
      this.handleMemberOfAttrClear = () => {
        this.setState({
          memberOfAttr: [],
          isMemberOfAttrOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleMemberOfGroupAttrSelect = (event, selection) => {
        if (this.state.memberOfGroupAttr.includes(selection)) {
          this.setState(
            (prevState) => ({
              memberOfGroupAttr: prevState.memberOfGroupAttr.filter((item) => item !== selection),
              isMemberOfGroupAttrOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              memberOfGroupAttr: [...prevState.memberOfGroupAttr, selection],
              isMemberOfGroupAttrOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        }
      };
      this.handleMemberOfGroupAttrToggle = (isMemberOfGroupAttrOpen) => {
        this.setState({
          isMemberOfGroupAttrOpen
        });
      };
      this.handleMemberOfGroupAttrClear = () => {
        this.setState({
          memberOfGroupAttr: [],
          isMemberOfGroupAttrOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreeScopeSelect = (event, selection) => {
        if (this.state.memberOfEntryScope.includes(selection)) {
          this.setState(
            (prevState) => ({
              memberOfEntryScope: prevState.memberOfEntryScope.filter((item) => item !== selection),
              isSubtreeScopeOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              memberOfEntryScope: [...prevState.memberOfEntryScope, selection],
              isSubtreeScopeOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        }
      };
      this.handleSubtreeScopeToggle = (isSubtreeScopeOpen) => {
        this.setState({
          isSubtreeScopeOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreeScopeClear = () => {
        this.setState({
          memberOfEntryScope: [],
          isSubtreeScopeOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreeScopeCreateOption = (newValue) => {
        if (!this.state.memberOfEntryScopeOptions.includes(newValue)) {
          this.setState({
            memberOfEntryScopeOptions: [...this.state.memberOfEntryScopeOptions, newValue],
            isSubtreeScopeOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleExcludeScopeSelect = (event, selection) => {
        if (this.state.memberOfEntryScopeExcludeSubtree.includes(selection)) {
          this.setState(
            (prevState) => ({
              memberOfEntryScopeExcludeSubtree: prevState.memberOfEntryScopeExcludeSubtree.filter((item) => item !== selection),
              isExcludeScopeOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              memberOfEntryScopeExcludeSubtree: [...prevState.memberOfEntryScopeExcludeSubtree, selection],
              isExcludeScopeOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        }
      };
      this.handleExcludeScopeToggle = (isExcludeScopeOpen) => {
        this.setState({
          isExcludeScopeOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeScopeClear = () => {
        this.setState({
          memberOfEntryScopeExcludeSubtree: [],
          isExcludeScopeOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeCreateOption = (newValue) => {
        if (!this.state.memberOfEntryScopeOptions.includes(newValue)) {
          this.setState({
            memberOfEntryScopeExcludeOptions: [...this.state.memberOfEntryScopeExcludeOptions, newValue],
            isExcludeScopeOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleConfigScopeSelect = (event, selection) => {
        if (this.state.configEntryScope.includes(selection)) {
          this.setState(
            (prevState) => ({
              configEntryScope: prevState.configEntryScope.filter((item) => item !== selection),
              isConfigSubtreeScopeOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              configEntryScope: [...prevState.configEntryScope, selection],
              isConfigSubtreeScopeOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        }
      };
      this.handleConfigScopeToggle = (isConfigSubtreeScopeOpen) => {
        this.setState({
          isConfigSubtreeScopeOpen
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigScopeClear = () => {
        this.setState({
          configEntryScope: [],
          isConfigSubtreeScopeOpen: false
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigCreateOption = (newValue) => {
        if (!this.state.configEntryScopeOptions.includes(newValue)) {
          this.setState({
            configEntryScopeOptions: [...this.state.configEntryScopeOptions, newValue],
            isConfigSubtreeScopeOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleConfigExcludeScopeSelect = (event, selection) => {
        if (this.state.configEntryScopeExcludeSubtree.includes(selection)) {
          this.setState(
            (prevState) => ({
              configEntryScopeExcludeSubtree: prevState.configEntryScopeExcludeSubtree.filter((item) => item !== selection),
              isConfigExcludeScopeOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              configEntryScopeExcludeSubtree: [...prevState.configEntryScopeExcludeSubtree, selection],
              isConfigExcludeScopeOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        }
      };
      this.handleConfigExcludeScopeToggle = (isConfigExcludeScopeOpen) => {
        this.setState({
          isConfigExcludeScopeOpen
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeScopeClear = () => {
        this.setState({
          configEntryScopeExcludeSubtree: [],
          isConfigExcludeScopeOpen: false
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeCreateOption = (newValue) => {
        if (!this.state.configEntryScopeExcludeOptions.includes(newValue)) {
          this.setState({
            configEntryScopeExcludeOptions: [...this.state.configEntryScopeExcludeOptions, newValue],
            isConfigExcludeScopeOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
    }
    handleToggleFixupModal() {
      this.setState((prevState) => ({
        fixupModalShow: !prevState.fixupModalShow,
        fixupDN: "",
        fixupFilter: "",
        savingModal: false
      }));
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = [
        "memberOfAttr"
      ];
      const reqLists = [
        "memberOfGroupAttr",
        "memberOfEntryScope"
      ];
      const dnAttrs = [
        "memberOfConfigEntry"
      ];
      const dnLists = [
        "memberOfEntryScopeExcludeSubtree",
        "memberOfEntryScope"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of reqLists) {
        if (this.state[attr].length === 0) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      for (const dn_list of dnLists) {
        for (const dn of this.state[dn_list]) {
          if (!valid_dn(dn)) {
            errObj[dn_list] = true;
            all_good = false;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrLists = [
          "memberOfEntryScope",
          "memberOfEntryScopeExcludeSubtree",
          "memberOfGroupAttr"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "memberOfAllBackends",
          "memberOfSkipNested",
          "memberOfConfigEntry",
          "memberOfAttr",
          "memberOfAutoAddOC"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    validateModal() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = [
        "configDN",
        "configAttr"
      ];
      const reqLists = [
        "configEntryScope",
        "configGroupAttr"
      ];
      const dnAttrs = [
        "configDN"
      ];
      const dnLists = [
        "configEntryScope",
        "configEntryScopeExcludeSubtree"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of reqLists) {
        if (this.state[attr].length === 0) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      for (const dn_list of dnLists) {
        for (const dn of this.state[dn_list]) {
          if (!valid_dn(dn)) {
            errObj[dn_list] = true;
            all_good = false;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrLists = [
          "configEntryScope",
          "configEntryScopeExcludeSubtree",
          "configGroupAttr"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "configDN",
          "configAttr",
          "configAutoAddOC",
          "configAllBackends",
          "configSkipNested"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        errorModal: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateConfig();
      });
    }
    handleModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateModal();
      });
    }
    handleShowConfirmDelete() {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    toggleFixupModal() {
      this.setState((prevState) => ({
        fixupModalShow: !prevState.fixupModalShow,
        fixupDN: "",
        fixupFilter: ""
      }));
    }
    handleRunFixup() {
      if (!this.state.fixupDN) {
        this.props.addNotification("warning", "Fixup DN is required.");
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "memberof",
          "fixup",
          this.state.fixupDN
        ];
        if (this.state.fixupFilter) {
          cmd = [...cmd, "--filter", this.state.fixupFilter];
        }
        this.props.toggleLoadingHandler();
        log_cmd("handleRunFixup", "Run fixup MemberOf Plugin ", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          this.props.addNotification(
            "success",
            `Fixup task for ${this.state.fixupDN} was successfull`
          );
          this.props.toggleLoadingHandler();
          this.setState({
            fixupModalShow: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Fixup task for ${this.state.fixupDN} has failed ${errMsg.desc}`
          );
          this.props.toggleLoadingHandler();
          this.setState({
            fixupModalShow: false
          });
        });
      }
    }
    handleOpenModal() {
      if (!this.state.memberOfConfigEntry) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configDN: "",
          configAttr: "",
          configGroupAttr: [],
          configEntryScope: [],
          configEntryScopeExcludeSubtree: [],
          configAutoAddOC: "",
          configAllBackends: false,
          configSkipNested: false,
          saveBtnDisabledModal: true
        });
      } else {
        let configScopeList = [];
        let configExcludeScopeList = [];
        let configGroupAttrObjectList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "memberof",
          "config-entry",
          "show",
          this.state.memberOfConfigEntry
        ];
        this.props.toggleLoadingHandler();
        log_cmd("openMemberOfModal", "Fetch the MemberOf Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            saveBtnDisabledModal: true,
            configDN: this.state.memberOfConfigEntry,
            configAttr: configEntry.memberofattr === void 0 ? "" : configEntry.memberofattr[0],
            configAutoAddOC: configEntry.memberofautoaddoc === void 0 ? "" : configEntry.memberofautoaddoc[0],
            configAllBackends: !(configEntry.memberofallbackends === void 0 || configEntry.memberofallbackends[0] === "off"),
            configSkipNested: !(configEntry.memberofskipnested === void 0 || configEntry.memberofskipnested[0] === "off"),
            configConfigEntry: configEntry["nsslapd-pluginConfigArea"] === void 0 ? "" : configEntry["nsslapd-pluginConfigArea"][0]
          });
          if (configEntry.memberofgroupattr === void 0) {
            this.setState({ configGroupAttr: [] });
          } else {
            for (const value of configEntry.memberofgroupattr) {
              configGroupAttrObjectList = [...configGroupAttrObjectList, value];
            }
            this.setState({
              configGroupAttr: configGroupAttrObjectList
            });
          }
          if (configEntry.memberofentryscope === void 0) {
            this.setState({ configEntryScope: [] });
          } else {
            for (const value of configEntry.memberofentryscope) {
              configScopeList = [...configScopeList, value];
            }
            this.setState({
              configEntryScope: configScopeList
            });
          }
          if (configEntry.memberofentryscopeexcludesubtree === void 0) {
            this.setState({ configEntryScopeExcludeSubtreeScope: [] });
          } else {
            for (const value of configEntry.memberofentryscopeexcludesubtree) {
              configExcludeScopeList = [...configExcludeScopeList, value];
            }
            this.setState({
              configEntryScopeExcludeSubtreeScope: configExcludeScopeList
            });
          }
          this.props.toggleLoadingHandler();
        }).fail((_) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configDN: this.state.memberOfConfigEntry,
            configAttr: [],
            configGroupAttr: [],
            configEntryScope: [],
            configEntryScopeExcludeSubtree: [],
            configAutoAddOC: "",
            configAllBackends: false,
            configSkipNested: false
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    cmdOperation(action) {
      const {
        configDN,
        configAttr,
        configGroupAttr,
        configEntryScope,
        configEntryScopeExcludeSubtree,
        configAutoAddOC,
        configAllBackends,
        configSkipNested
      } = this.state;
      if (configAttr.length === 0 || configGroupAttr.length === 0) {
        this.props.addNotification(
          "warning",
          "Config Attribute and Group Attribute are required."
        );
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "memberof",
          "config-entry",
          action,
          configDN,
          "--attr",
          configAttr || action === "add" ? configAttr : "delete",
          "--allbackends",
          configAllBackends ? "on" : "off",
          "--skipnested",
          configSkipNested ? "on" : "off",
          "--autoaddoc",
          configAutoAddOC || action === "add" ? configAutoAddOC : "delete"
        ];
        cmd = [...cmd, "--scope"];
        if (configEntryScope.length !== 0) {
          for (const value of configEntryScope) {
            cmd = [...cmd, value];
          }
        } else {
          cmd = [...cmd, "delete"];
        }
        cmd = [...cmd, "--exclude"];
        if (configEntryScopeExcludeSubtree.length !== 0) {
          for (const value of configEntryScopeExcludeSubtree) {
            cmd = [...cmd, value];
          }
        } else {
          cmd = [...cmd, "delete"];
        }
        cmd = [...cmd, "--groupattr"];
        if (configGroupAttr.length !== 0) {
          for (const value of configGroupAttr) {
            cmd = [...cmd, value];
          }
        } else {
          cmd = [...cmd, "delete"];
        }
        this.setState({
          savingModal: true
        });
        log_cmd("memberOfOperation", `Do the ${action} operation on the MemberOf Plugin`, cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info("memberOfOperation", "Result", content);
          this.props.addNotification(
            "success",
            `Config entry ${configDN} was successfully ${action === "set" ? "edit" : "add"}ed`
          );
          this.props.pluginListHandler();
          this.handleCloseModal();
          this.setState({
            savingModal: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Error during the config entry ${action} operation - ${errMsg.desc}`
          );
          this.props.pluginListHandler();
          this.handleCloseModal();
          this.setState({
            savingModal: true
          });
        });
      }
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "memberof",
        "config-entry",
        "delete",
        this.state.configDN
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the MemberOf Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${this.state.configDN} was successfully deleted`
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry removal operation - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        this.setState({
          modalSpinning: false
        });
      });
    }
    handleAddConfig() {
      this.cmdOperation("add");
    }
    handleEditConfig() {
      this.cmdOperation("set");
    }
    updateFields() {
      let memberOfGroupAttrObjectList = [];
      let memberOfEntryScopeList = [];
      let getSchemamemberOfExcludeScopeList = [];
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "MemberOf Plugin");
        this.setState({
          memberOfAttr: pluginRow.memberofattr === void 0 ? "" : pluginRow.memberofattr[0],
          memberOfAutoAddOC: pluginRow.memberofautoaddoc === void 0 ? "" : pluginRow.memberofautoaddoc[0],
          memberOfAllBackends: !(pluginRow.memberofallbackends === void 0 || pluginRow.memberofallbackends[0] === "off"),
          memberOfSkipNested: !(pluginRow.memberofskipnested === void 0 || pluginRow.memberofskipnested[0] === "off"),
          memberOfConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0],
          _memberOfAttr: pluginRow.memberofattr === void 0 ? "" : pluginRow.memberofattr[0],
          _memberOfAutoAddOC: pluginRow.memberofautoaddoc === void 0 ? "" : pluginRow.memberofautoaddoc[0],
          _memberOfAllBackends: !(pluginRow.memberofallbackends === void 0 || pluginRow.memberofallbackends[0] === "off"),
          _memberOfSkipNested: !(pluginRow.memberofskipnested === void 0 || pluginRow.memberofskipnested[0] === "off"),
          _memberOfConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0]
        });
        if (pluginRow.memberofgroupattr === void 0) {
          this.setState({ memberOfGroupAttr: [], _memberOfGroupAttr: [] });
        } else {
          for (const value of pluginRow.memberofgroupattr) {
            memberOfGroupAttrObjectList = [...memberOfGroupAttrObjectList, value];
          }
          this.setState({
            memberOfGroupAttr: memberOfGroupAttrObjectList,
            _memberOfGroupAttr: [...memberOfGroupAttrObjectList]
          });
        }
        if (pluginRow.memberofentryscope === void 0) {
          this.setState({ memberOfEntryScope: [], _memberOfEntryScope: [] });
        } else {
          for (const value of pluginRow.memberofentryscope) {
            memberOfEntryScopeList = [...memberOfEntryScopeList, value];
          }
          this.setState({
            memberOfEntryScope: memberOfEntryScopeList,
            _memberOfEntryScope: [...memberOfEntryScopeList]
          });
        }
        if (pluginRow.memberofentryscopeexcludesubtree === void 0) {
          this.setState({ memberOfEntryScopeExcludeSubtree: [], _memberOfEntryScopeExcludeSubtree: [] });
        } else {
          for (const value of pluginRow.memberofentryscopeexcludesubtree) {
            getSchemamemberOfExcludeScopeList = [...getSchemamemberOfExcludeScopeList, value];
          }
          this.setState({
            memberOfEntryScopeExcludeSubtree: getSchemamemberOfExcludeScopeList,
            _memberOfEntryScopeExcludeSubtree: [...getSchemamemberOfExcludeScopeList]
          });
        }
      }
      this.setState({
        firstLoad: false
      });
    }
    handleSaveConfig() {
      const {
        memberOfAttr,
        memberOfGroupAttr,
        memberOfEntryScope,
        memberOfEntryScopeExcludeSubtree,
        memberOfAutoAddOC,
        memberOfAllBackends,
        memberOfSkipNested,
        memberOfConfigEntry
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "memberof",
        "set",
        "--attr",
        memberOfAttr || "delete",
        "--config-entry",
        memberOfConfigEntry || "delete",
        "--allbackends",
        memberOfAllBackends ? "on" : "off",
        "--skipnested",
        memberOfSkipNested ? "on" : "off",
        "--autoaddoc",
        memberOfAutoAddOC || "delete"
      ];
      cmd = [...cmd, "--scope"];
      if (memberOfEntryScope.length !== 0) {
        for (const value of memberOfEntryScope) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--exclude"];
      if (memberOfEntryScopeExcludeSubtree.length !== 0) {
        for (const value of memberOfEntryScopeExcludeSubtree) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--groupattr"];
      if (memberOfGroupAttr.length !== 0) {
        for (const value of memberOfGroupAttr) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        saving: true
      });
      log_cmd("handleSaveConfig", `Save MemberOf Plugin`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          `Successfully updated MemberOf Plugin`
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      }).fail((err) => {
        let errMsg = JSON.parse(err);
        if ("info" in errMsg) {
          errMsg = errMsg.desc + " " + errMsg.info;
        } else {
          errMsg = errMsg.desc;
        }
        this.props.addNotification(
          "error",
          `Error during update - ${errMsg}`
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      });
    }
    render() {
      const {
        memberOfAttr,
        memberOfGroupAttr,
        memberOfEntryScope,
        memberOfEntryScopeExcludeSubtree,
        memberOfAutoAddOC,
        memberOfAllBackends,
        memberOfSkipNested,
        memberOfConfigEntry,
        configDN,
        configEntryModalShow,
        configAttr,
        configGroupAttr,
        configEntryScope,
        configEntryScopeExcludeSubtree,
        configAutoAddOC,
        configAllBackends,
        configSkipNested,
        newEntry,
        fixupModalShow,
        fixupDN,
        fixupFilter,
        error,
        errorModal,
        saving,
        savingModal,
        saveBtnDisabled,
        saveBtnDisabledModal,
        isSubtreeScopeOpen,
        isExcludeScopeOpen,
        isConfigExcludeScopeOpen,
        isConfigSubtreeScopeOpen
      } = this.state;
      let saveBtnName = "Save Config";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Saving Config ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let modalButtons = [];
      if (!newEntry) {
        modalButtons = [
          /* @__PURE__ */ import_react16.default.createElement(Button, { key: "del", variant: "primary", onClick: this.handleShowConfirmDelete }, "Delete Config"),
          /* @__PURE__ */ import_react16.default.createElement(
            Button,
            {
              key: "save",
              variant: "primary",
              onClick: this.handleEditConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? "Saving" : void 0,
              ...extraPrimaryProps
            },
            savingModal ? "Saving ..." : "Save Config"
          ),
          /* @__PURE__ */ import_react16.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
        ];
      } else {
        modalButtons = [
          /* @__PURE__ */ import_react16.default.createElement(
            Button,
            {
              key: "add",
              variant: "primary",
              onClick: this.handleAddConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? "Saving" : void 0,
              ...extraPrimaryProps
            },
            savingModal ? "Adding ..." : "Add Config"
          ),
          /* @__PURE__ */ import_react16.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
        ];
      }
      return /* @__PURE__ */ import_react16.default.createElement("div", null, /* @__PURE__ */ import_react16.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          "aria-labelledby": "ds-modal",
          title: "MemberOf Plugin FixupTask",
          isOpen: fixupModalShow,
          onClose: this.handleToggleFixupModal,
          actions: [
            /* @__PURE__ */ import_react16.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: this.handleRunFixup,
                isDisabled: !valid_dn(fixupDN)
              },
              "Run"
            ),
            /* @__PURE__ */ import_react16.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleToggleFixupModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react16.default.createElement(Grid, null, /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react16.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react16.default.createElement(TextContent, null, /* @__PURE__ */ import_react16.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h4 }, "This task only needs to be run after enabling the plugin for the first time, or if the plugin configuration has changed in a way that will impact the group memberships.")), /* @__PURE__ */ import_react16.default.createElement(Grid, { className: "ds-margin-top", title: "Base DN that contains entries to fix up." }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Subtree DN"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react16.default.createElement(
          TextInput,
          {
            value: fixupDN,
            type: "text",
            id: "fixupDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "fixupDN",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: !valid_dn(fixupDN) ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react16.default.createElement(FormHelperText, { isError: true, isHidden: valid_dn(fixupDN) }, "Value must be a valid DN"))), /* @__PURE__ */ import_react16.default.createElement(Grid, { className: "ds-margin-bottom", title: "Optional. Filter for finding entries to fix up. For example:  (uid=*).  If omitted, all entries with objectclass 'inetuser', 'inetadmin', or 'nsmemberof' under the specified subtree DN will have their memberOf attribute regenerated." }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Search Filter"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react16.default.createElement(
          TextInput,
          {
            value: fixupFilter,
            type: "text",
            id: "fixupFilter",
            "aria-describedby": "horizontal-form-name-helper",
            name: "fixupFilter",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            }
          }
        ))))))
      ), /* @__PURE__ */ import_react16.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: "Manage MemberOf Plugin Shared Config Entry",
          isOpen: configEntryModalShow,
          onClose: this.handleCloseModal,
          actions: modalButtons
        },
        /* @__PURE__ */ import_react16.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react16.default.createElement(Grid, { className: "ds-margin-top", title: "The config entry full DN" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Config DN"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react16.default.createElement(
          TextInput,
          {
            value: configDN,
            type: "text",
            id: "configDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configDN",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: errorModal.configDN ? ValidatedOptions.error : ValidatedOptions.default,
            isDisabled: newEntry
          }
        ), /* @__PURE__ */ import_react16.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configDN }, "Value must be a valid DN"))), /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "Specifies the attribute in the user entry for the Directory Server to manage to reflect group membership (memberOfAttr)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Membership Attribute"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type a member attribute",
            onToggle: this.handleConfigAttrToggle,
            onSelect: this.handleConfigAttrSelect,
            onClear: this.handleConfigAttrClear,
            selections: configAttr,
            isOpen: this.state.isConfigAttrOpen,
            "aria-labelledby": "typeAhead-config-attr",
            placeholderText: "Type a member attribute...",
            noResultsFoundText: "There are no matching entries",
            validated: errorModal.configAttr ? "error" : "default"
          },
          ["memberOf"].map((attr, index) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { className: "ds-margin-top", title: "Specifies the attribute in the group entry to use to identify the DNs of group members (memberOfGroupAttr)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Group Attribute"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a member group attribute",
            onToggle: this.handleConfigGroupAttrToggle,
            onSelect: this.handleConfigGroupAttrSelect,
            onClear: this.handleConfigGroupAttrClear,
            selections: configGroupAttr,
            isOpen: this.state.isConfigGroupAttrOpen,
            "aria-labelledby": "typeAhead-config-group-attr",
            placeholderText: "Type a member group attribute...",
            noResultsFoundText: "There are no matching entries",
            validated: errorModal.configGroupAttr ? "error" : "default"
          },
          ["member", "memberCertificate", "uniqueMember"].map((attr, index) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { className: "ds-margin-top", title: "Specifies backends or multiple-nested suffixes for the MemberOf plug-in to work on (memberOfEntryScope)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Subtree Scope"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a subtree DN",
            onToggle: this.handleConfigScopeToggle,
            onSelect: this.handleConfigScopeSelect,
            onClear: this.handleConfigScopeClear,
            selections: configEntryScope,
            isOpen: isConfigSubtreeScopeOpen,
            "aria-labelledby": "typeAhead-subtrees",
            placeholderText: "Type a subtree DN...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleConfigCreateOption,
            validated: errorModal.configEntryScope ? "error" : "default"
          },
          [""].map((dn, index) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: index,
              value: dn
            }
          ))
        ), /* @__PURE__ */ import_react16.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configEntryScope }, "Values must be valid DN's")), /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-left-margin", span: 3 }, /* @__PURE__ */ import_react16.default.createElement(
          Checkbox,
          {
            id: "configAllBackends",
            isChecked: configAllBackends,
            onChange: (checked, e) => {
              this.handleModalChange(e);
            },
            title: "Specifies whether to search the local suffix for user entries on all available suffixes (memberOfAllBackends)",
            label: "All Backends"
          }
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "Specifies backends or multiple-nested suffixes for the MemberOf plug-in to exclude (memberOfEntryScopeExcludeSubtree)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclude Subtree"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a subtree DN",
            onToggle: this.handleConfigExcludeScopeToggle,
            onSelect: this.handleConfigExcludeScopeSelect,
            onClear: this.handleConfigExcludeScopeClear,
            selections: configEntryScopeExcludeSubtree,
            isOpen: isConfigExcludeScopeOpen,
            "aria-labelledby": "typeAhead-subtrees",
            placeholderText: "Type a subtree DN...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleConfigExcludeCreateOption,
            validated: errorModal.configEntryScopeExcludeSubtree ? "error" : "default"
          },
          [""].map((dn, index) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: index,
              value: dn
            }
          ))
        ), /* @__PURE__ */ import_react16.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configEntryScopeExcludeSubtree }, "Values must be valid DN's")), /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-left-margin", span: 3 }, /* @__PURE__ */ import_react16.default.createElement(
          Checkbox,
          {
            id: "configSkipNested",
            isChecked: configSkipNested,
            onChange: (checked, e) => {
              this.handleModalChange(e);
            },
            title: "Specifies wherher to skip nested groups or not (memberOfSkipNested)",
            label: "Skip Nested"
          }
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "If an entry does not have an object class that allows the memberOf attribute then the memberOf plugin will automatically add the object class listed in the memberOfAutoAddOC parameter" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Auto Add OC"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react16.default.createElement(
          FormSelect,
          {
            id: "configAutoAddOC",
            value: configAutoAddOC,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react16.default.createElement(FormSelectOption, { key: "no_setting2", value: "", label: "-" }),
          this.props.objectClasses.map((attr, index) => /* @__PURE__ */ import_react16.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }))
        ))))
      ), /* @__PURE__ */ import_react16.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "MemberOf Plugin",
          pluginName: "MemberOf",
          cmdName: "memberof",
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react16.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "Specifies the attribute in the user entry for the Directory Server to manage to reflect group membership (memberOfAttr)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Membership Attribute"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type a member attribute",
            onToggle: this.handleMemberOfAttrToggle,
            onSelect: this.handleMemberOfAttrSelect,
            onClear: this.handleMemberOfAttrClear,
            selections: memberOfAttr,
            isOpen: this.state.isMemberOfAttrOpen,
            "aria-labelledby": "typeAhead-memberof-attr",
            placeholderText: "Type a member attribute...",
            noResultsFoundText: "There are no matching entries",
            validated: error.memberOfAttr ? "error" : "default"
          },
          ["memberOf"].map((attr) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: attr,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { className: "ds-margin-top", title: "Specifies the attribute in the group entry to use to identify the DNs of group members (memberOfGroupAttr)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Group Attribute"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a member group attribute",
            onToggle: this.handleMemberOfGroupAttrToggle,
            onSelect: this.handleMemberOfGroupAttrSelect,
            onClear: this.handleMemberOfGroupAttrClear,
            selections: memberOfGroupAttr,
            isOpen: this.state.isMemberOfGroupAttrOpen,
            "aria-labelledby": "typeAhead-memberof-group-attr",
            placeholderText: "Type a member group attribute...",
            noResultsFoundText: "There are no matching entries",
            validated: error.memberOfGroupAttr ? "error" : "default"
          },
          ["member", "memberCertificate", "uniqueMember"].map((attr) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: attr,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { className: "ds-margin-top", title: "Specifies backends or multiple-nested suffixes for the MemberOf plug-in to work on (memberOfEntryScope)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Subtree Scope"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a subtree DN",
            onToggle: this.handleSubtreeScopeToggle,
            onSelect: this.handleSubtreeScopeSelect,
            onClear: this.handleSubtreeScopeClear,
            selections: memberOfEntryScope,
            isOpen: isSubtreeScopeOpen,
            "aria-labelledby": "typeAhead-subtrees",
            placeholderText: "Type a subtree DN...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleSubtreeScopeCreateOption,
            validated: error.memberOfEntryScope ? "error" : "default"
          },
          [""].map((dn, index) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: index,
              value: dn
            }
          ))
        ), /* @__PURE__ */ import_react16.default.createElement(FormHelperText, { isError: true, isHidden: !error.memberOfEntryScope }, "A subtree is required, and values must be valid DN's")), /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-left-margin", span: 3 }, /* @__PURE__ */ import_react16.default.createElement(
          Checkbox,
          {
            id: "memberOfAllBackends",
            isChecked: memberOfAllBackends,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            title: "Specifies whether to search the local suffix for user entries on all available suffixes (memberOfAllBackends)",
            label: "All Backends"
          }
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "Specifies backends or multiple-nested suffixes for the MemberOf plug-in to exclude (memberOfEntryScopeExcludeSubtree)" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclude Subtree"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react16.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a subtree DN",
            onToggle: this.handleExcludeScopeToggle,
            onSelect: this.handleExcludeScopeSelect,
            onClear: this.handleExcludeScopeClear,
            selections: memberOfEntryScopeExcludeSubtree,
            isOpen: isExcludeScopeOpen,
            "aria-labelledby": "typeAhead-subtrees",
            placeholderText: "Type a subtree DN...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleExcludeCreateOption,
            validated: error.memberOfEntryScopeExcludeSubtree ? "error" : "default"
          },
          [""].map((dn, index) => /* @__PURE__ */ import_react16.default.createElement(
            SelectOption,
            {
              key: index,
              value: dn
            }
          ))
        ), /* @__PURE__ */ import_react16.default.createElement(FormHelperText, { isError: true, isHidden: !error.memberOfEntryScopeExcludeSubtree }, "Values must be valid DN's")), /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-left-margin", span: 3 }, /* @__PURE__ */ import_react16.default.createElement(
          Checkbox,
          {
            id: "memberOfSkipNested",
            isChecked: memberOfSkipNested,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            title: "Specifies wherher to skip nested groups or not (memberOfSkipNested)",
            label: "Skip Nested"
          }
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "The value to set as nsslapd-pluginConfigArea" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Shared Config Entry"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react16.default.createElement(
          TextInput,
          {
            value: memberOfConfigEntry,
            type: "text",
            id: "memberOfConfigEntry",
            "aria-describedby": "horizontal-form-name-helper",
            name: "memberOfConfigEntry",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: error.memberOfConfigEntry ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react16.default.createElement(FormHelperText, { isError: true, isHidden: !error.memberOfConfigEntry }, "Value must be a valid DN")), /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-left-margin", span: 3 }, /* @__PURE__ */ import_react16.default.createElement(
          Button,
          {
            variant: "primary",
            isDisabled: memberOfConfigEntry === "" || !valid_dn(memberOfConfigEntry),
            onClick: this.handleOpenModal
          },
          "Manage"
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "If an entry does not have an object class that allows the memberOf attribute then the memberOf plugin will automatically add the object class listed in the memberOfAutoAddOC parameter" }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Auto Add OC"), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react16.default.createElement(
          FormSelect,
          {
            id: "memberOfAutoAddOC",
            value: memberOfAutoAddOC,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react16.default.createElement(FormSelectOption, { key: "no_setting", value: "", label: "-" }),
          this.props.objectClasses.map((attr) => /* @__PURE__ */ import_react16.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }))
        ))), /* @__PURE__ */ import_react16.default.createElement(Grid, { title: "The fixup task will add the memberOf attribute to entries that are missing it.  This is typically only run once after enabling or changing the plugin." }, /* @__PURE__ */ import_react16.default.createElement(GridItem, { className: "ds-label ds-margin-top", span: 3 }, "MemberOf Fixup Task", /* @__PURE__ */ import_react16.default.createElement(WrenchIcon, { className: "ds-left-margin" })), /* @__PURE__ */ import_react16.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react16.default.createElement(Button, { className: "ds-margin-top", variant: "secondary", onClick: this.handleToggleFixupModal }, "Run Task")))),
        /* @__PURE__ */ import_react16.default.createElement(
          Button,
          {
            className: "ds-margin-top-lg",
            key: "at",
            isLoading: saving,
            spinnerAriaValueText: saving ? "Loading" : void 0,
            variant: "primary",
            onClick: this.handleSaveConfig,
            ...extraPrimaryProps,
            isDisabled: saveBtnDisabled || saving
          },
          saveBtnName
        )
      ), /* @__PURE__ */ import_react16.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.deleteConfig,
          spinning: this.state.modalSpinning,
          item: this.state.configDN,
          checked: this.state.modalChecked,
          mTitle: "Delete MemberOf Config Entry",
          mMsg: "Are you sure you want to delete this config entry?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ));
    }
  };
  MemberOf.propTypes = {
    rows: import_prop_types11.default.array,
    serverId: import_prop_types11.default.string,
    pluginListHandler: import_prop_types11.default.func,
    addNotification: import_prop_types11.default.func,
    objectClasses: import_prop_types11.default.array,
    toggleLoadingHandler: import_prop_types11.default.func
  };
  MemberOf.defaultProps = {
    rows: [],
    serverId: "",
    objectClasses: []
  };
  var memberOf_default = MemberOf;

  // src/lib/plugins/passthroughAuthentication.jsx
  var import_react17 = __toESM(require_react(), 1);
  var import_prop_types12 = __toESM(require_prop_types(), 1);
  var PassthroughAuthentication = class extends import_react17.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        urlRows: [],
        tableKey: 1,
        error: {},
        modalSpinning: false,
        modalChecked: false,
        oldURL: "",
        urlConnType: "ldaps",
        urlAuthDS: "",
        urlSubtree: "",
        urlMaxConns: 3,
        urlMaxOps: 5,
        urlTimeout: 300,
        urlLDVer: "3",
        urlConnLifeTime: 300,
        urlStartTLS: false,
        _urlConnType: "ldaps",
        _urlAuthDS: "",
        _urlSubtree: "",
        _urlMaxConns: 3,
        _urlMaxOps: 5,
        _urlTimeout: 300,
        _urlLDVer: "3",
        _urlConnLifeTime: 300,
        _urlStartTLS: false,
        showConfirmDeleteURL: false,
        saveBtnDisabledPassthru: true,
        savingPassthru: false,
        newURLEntry: false,
        urlEntryModalShow: false
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validatePassthru();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.attrRows = this.props.attributes.map((attr) => /* @__PURE__ */ import_react17.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }));
      this.handlePassthruChange = this.handlePassthruChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.validatePassthru = this.validatePassthru.bind(this);
      this.loadURLs = this.loadURLs.bind(this);
      this.openURLModal = this.openURLModal.bind(this);
      this.handleCloseURLModal = this.handleCloseURLModal.bind(this);
      this.showEditURLModal = this.showEditURLModal.bind(this);
      this.handleShowAddURLModal = this.handleShowAddURLModal.bind(this);
      this.cmdURLOperation = this.cmdURLOperation.bind(this);
      this.deleteURL = this.deleteURL.bind(this);
      this.addURL = this.addURL.bind(this);
      this.editURL = this.editURL.bind(this);
      this.showConfirmDeleteURL = this.showConfirmDeleteURL.bind(this);
      this.closeConfirmDeleteURL = this.closeConfirmDeleteURL.bind(this);
    }
    componentDidMount() {
      this.loadURLs();
    }
    validatePassthru() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = ["urlAuthDS", "urlSubtree"];
      const dnAttrs = ["urlSubtree"];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      for (const attr of dnAttrs) {
        if (!valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      if (all_good) {
        all_good = false;
        const configAttrs2 = [
          "urlSubtree",
          "urlConnType",
          "urlAuthDS",
          "urlMaxConns",
          "urlMaxOps",
          "urlTimeout",
          "urlLDVer",
          "urlConnLifeTime",
          "urlStartTLS"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledPassthru: !all_good,
        error: errObj
      });
    }
    handlePassthruChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validatePassthru();
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmDeleteConfig(name2) {
      this.setState({
        showConfirmDeleteConfig: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDeleteConfig() {
      this.setState({
        showConfirmDeleteConfig: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    showConfirmDeleteURL(name2) {
      this.setState({
        showConfirmDeleteURL: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDeleteURL() {
      this.setState({
        showConfirmDeleteURL: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    loadURLs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "ldap-pass-through-auth",
        "list"
      ];
      this.props.toggleLoadingHandler();
      log_cmd("loadURLs", "Get Passthough Authentication Plugin Configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          urlRows: myObject.items,
          tableKey
        });
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadURLs failed", errMsg.desc);
        }
        this.props.toggleLoadingHandler();
      });
    }
    showEditURLModal(rowData) {
      this.openURLModal(rowData);
    }
    handleShowAddURLModal() {
      this.openURLModal();
    }
    openURLModal(url) {
      if (!url) {
        this.setState({
          urlEntryModalShow: true,
          newURLEntry: true,
          oldURL: "",
          urlConnType: "ldap",
          urlAuthDS: "",
          urlSubtree: "",
          urlMaxConns: "3",
          urlMaxOps: "5",
          urlTimeout: "300",
          urlLDVer: "3",
          urlConnLifeTime: "300",
          urlStartTLS: false,
          saveBtnDisabledPassthru: true
        });
      } else {
        const link2 = url.split(" ")[0];
        const params = url.split(" ")[1];
        this.setState({
          urlEntryModalShow: true,
          oldURL: url,
          newURLEntry: false,
          urlConnType: link2.split(":")[0],
          urlAuthDS: link2.split("/")[2],
          urlSubtree: link2.split("/")[3],
          urlMaxConns: params.split(",")[0],
          urlMaxOps: params.split(",")[1],
          urlTimeout: params.split(",")[2],
          urlLDVer: params.split(",")[3],
          urlConnLifeTime: params.split(",")[4],
          urlStartTLS: !(params.split(",")[5] === "0"),
          saveBtnDisabledPassthru: true
        });
      }
    }
    handleCloseURLModal() {
      this.setState({
        urlEntryModalShow: false,
        savingPassthru: false
      });
    }
    deleteURL() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "ldap-pass-through-auth",
        "delete",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteURL", "Delete the Passthough Authentication Plugin URL entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteURL", "Result", content);
        this.props.addNotification("success", `URL ${this.state.deleteName} was successfully deleted`);
        this.loadURLs();
        this.closeConfirmDeleteURL();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the URL removal operation - ${errMsg.desc}`
        );
        this.loadURLs();
        this.closeConfirmDeleteURL();
      });
    }
    addURL() {
      this.cmdURLOperation("add");
    }
    editURL() {
      this.cmdURLOperation("modify");
    }
    cmdURLOperation(action) {
      const {
        oldURL,
        urlConnType,
        urlAuthDS,
        urlSubtree,
        urlMaxConns,
        urlMaxOps,
        urlTimeout,
        urlLDVer,
        urlConnLifeTime,
        urlStartTLS
      } = this.state;
      const constructedURL = `${urlConnType}://${urlAuthDS}/${urlSubtree} ${urlMaxConns},${urlMaxOps},${urlTimeout},${urlLDVer},${urlConnLifeTime},${urlStartTLS ? "1" : "0"}`;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "ldap-pass-through-auth",
        action
      ];
      if (oldURL !== "" && action === "modify") {
        cmd = [...cmd, oldURL, constructedURL];
      } else {
        cmd = [...cmd, constructedURL];
      }
      this.setState({
        savingPassthru: true
      });
      log_cmd(
        "PassthroughAuthOperation",
        `Do the ${action} operation on the Passthough Authentication Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("PassthroughAuthOperation", "Result", content);
        this.props.addNotification(
          "success",
          `The ${action} operation was successfully done on "${constructedURL}" entry`
        );
        this.loadURLs();
        this.handleCloseURLModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the URL ${action} operation - ${errMsg.desc}`
        );
        this.loadURLs();
        this.handleCloseURLModal();
      });
    }
    render() {
      const {
        urlRows,
        urlConnType,
        urlLDVer,
        urlAuthDS,
        urlSubtree,
        urlMaxConns,
        urlMaxOps,
        urlTimeout,
        urlConnLifeTime,
        urlStartTLS,
        newURLEntry,
        urlEntryModalShow,
        error,
        savingPassthru
      } = this.state;
      const modalURLFields = {
        urlAuthDS: {
          name: "Authentication Hostname",
          id: "urlAuthDS",
          value: urlAuthDS,
          help: `The authenticating directory host name. The port number of the Directory Server can be given by adding a colon and then the port number. For example, dirserver.example.com:389. If the port number is not specified, the PTA server attempts to connect using either of the standard ports: Port 389 if ldap:// is specified in the URL. Port 636 if ldaps:// is specified in the URL.`
        },
        urlSubtree: {
          name: "Subtree",
          id: "urlSubtree",
          value: urlSubtree,
          help: `The pass-through subtree. The PTA Directory Server passes through bind requests to the authenticating Directory Server from all clients whose DN is in this subtree.`
        }
      };
      const modalURLNumberFields = {
        urlMaxConns: {
          name: "Maximum Number of Connections",
          value: urlMaxConns,
          id: "urlMaxConns",
          help: `The maximum number of connections the PTA directory can simultaneously open to the authenticating directory.`
        },
        urlMaxOps: {
          name: "Maximum Number of Simultaneous Operations",
          value: urlMaxOps,
          id: "urlMaxOps",
          help: `The maximum number of simultaneous operations (usually bind requests) the PTA directory can send to the authenticating directory within a single connection.`
        },
        urlTimeout: {
          name: "Timeout",
          value: urlTimeout,
          id: "urlTimeout",
          help: `The time limit, in seconds, that the PTA directory waits for a response from the authenticating Directory Server. If this timeout is exceeded, the server returns an error to the client. The default is 300 seconds (five minutes). Specify zero (0) to indicate no time limit should be enforced.`
        },
        urlConnLifeTime: {
          name: "Connection Life Time",
          value: urlConnLifeTime,
          id: "urlConnLifeTime",
          help: `The time limit, in seconds, within which a connection may be used.`
        }
      };
      let saveBtnName = "Save Config";
      const extraPrimaryProps = {};
      if (this.state.savingPassthru) {
        saveBtnName = "Saving Config ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      const title_url = (newURLEntry ? "Add " : "Edit ") + "Pass-Though Authentication URL";
      return /* @__PURE__ */ import_react17.default.createElement("div", { className: savingPassthru ? "ds-disabled" : "" }, /* @__PURE__ */ import_react17.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: title_url,
          isOpen: urlEntryModalShow,
          onClose: this.handleCloseURLModal,
          actions: [
            /* @__PURE__ */ import_react17.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: newURLEntry ? this.addURL : this.editURL,
                isDisabled: this.state.saveBtnDisabledPassthru || this.state.savingPassthru,
                isLoading: this.state.savingPassthru,
                spinnerAriaValueText: this.state.savingPassthru ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react17.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseURLModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react17.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react17.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react17.default.createElement(
          GridItem,
          {
            className: "ds-label",
            span: 5,
            title: "Defines whether TLS is used for communication between the two Directory Servers."
          },
          "Connection Type"
        ), /* @__PURE__ */ import_react17.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react17.default.createElement(
          FormSelect,
          {
            id: "urlConnType",
            value: urlConnType,
            onChange: (value, event) => {
              this.handlePassthruChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react17.default.createElement(FormSelectOption, { key: "urlldaps", value: "ldaps", label: "ldaps" }),
          /* @__PURE__ */ import_react17.default.createElement(FormSelectOption, { key: "urlldap", value: "ldap", label: "ldap" })
        ))), Object.entries(modalURLFields).map(([id, content]) => /* @__PURE__ */ import_react17.default.createElement(Grid, { key: id }, /* @__PURE__ */ import_react17.default.createElement(GridItem, { className: "ds-label", span: 5, title: content.help }, content.name), /* @__PURE__ */ import_react17.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react17.default.createElement(
          TextInput,
          {
            value: content.value,
            type: "text",
            id: content.id,
            "aria-describedby": "horizontal-form-name-helper",
            name: content.name,
            onChange: (str, e) => {
              this.handlePassthruChange(e);
            },
            validated: error[content.id] ? ValidatedOptions.error : ValidatedOptions.default
          }
        )))), Object.entries(modalURLNumberFields).map(([id, content]) => /* @__PURE__ */ import_react17.default.createElement(Grid, { key: id }, /* @__PURE__ */ import_react17.default.createElement(GridItem, { className: "ds-label", span: 5, title: content.help }, content.name), /* @__PURE__ */ import_react17.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react17.default.createElement(
          NumberInput,
          {
            value: content.value,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig(content.id);
            },
            onChange: (e) => {
              this.onConfigChange(e, content.id, -1);
            },
            onPlus: () => {
              this.onPlusConfig(content.id);
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        )))), /* @__PURE__ */ import_react17.default.createElement(Grid, null, /* @__PURE__ */ import_react17.default.createElement(
          GridItem,
          {
            className: "ds-label",
            span: 5,
            title: "The version of the LDAP protocol used to connect to the authenticating directory. Directory Server supports LDAP version 2 and 3. The default is version 3, and Red Hat strongly recommends against using LDAPv2, which is old and will be deprecated."
          },
          "Version"
        ), /* @__PURE__ */ import_react17.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react17.default.createElement(
          FormSelect,
          {
            id: "urlLDVer",
            value: urlLDVer,
            onChange: (value, event) => {
              this.handlePassthruChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react17.default.createElement(FormSelectOption, { key: "LDAPv3", value: "3", label: "LDAPv3" }),
          /* @__PURE__ */ import_react17.default.createElement(FormSelectOption, { key: "LDAPv2", value: "2", label: "LDAPv2" })
        ))), /* @__PURE__ */ import_react17.default.createElement(Grid, null, /* @__PURE__ */ import_react17.default.createElement(GridItem, { className: "ds-label", span: 5 }, /* @__PURE__ */ import_react17.default.createElement(
          Checkbox,
          {
            id: "urlStartTLS",
            isChecked: urlStartTLS,
            onChange: (checked, e) => {
              this.handlePassthruChange(e);
            },
            title: "A flag of whether to use Start TLS for the connection to the authenticating directory. Start TLS establishes a secure connection over the standard port, so it is useful for connecting using LDAP instead of LDAPS. The TLS server and CA certificates need to be available on both of the servers. To use Start TLS, the LDAP URL must use ldap:, not ldaps:.",
            label: "Enable StartTLS"
          }
        ))), /* @__PURE__ */ import_react17.default.createElement("hr", null), /* @__PURE__ */ import_react17.default.createElement(Grid, { title: "The URL that will be added or modified after you click 'Save'" }, /* @__PURE__ */ import_react17.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Result URL"), /* @__PURE__ */ import_react17.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react17.default.createElement("b", null, urlConnType, "://", urlAuthDS, "/", urlSubtree, " ", urlMaxConns, ",", urlMaxOps, ",", urlTimeout, ",", urlLDVer, ",", urlConnLifeTime, ",", urlStartTLS ? "1" : "0"))))
      ), /* @__PURE__ */ import_react17.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "Pass Through Authentication",
          pluginName: "Pass Through Authentication",
          cmdName: "ldap-pass-through-auth",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react17.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react17.default.createElement(
          PassthroughAuthURLsTable,
          {
            rows: urlRows,
            key: this.state.tableKey,
            editConfig: this.showEditURLModal,
            deleteConfig: this.showConfirmDeleteURL
          }
        ), /* @__PURE__ */ import_react17.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowAddURLModal
          },
          "Add URL"
        ))
      ), /* @__PURE__ */ import_react17.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteURL,
          closeHandler: this.closeConfirmDeleteURL,
          handleChange: this.onModalChange,
          actionHandler: this.deleteURL,
          spinning: this.state.modalSpinning,
          item: this.state.deleteName,
          checked: this.state.modalChecked,
          mTitle: "Delete Passthru Authentication URL",
          mMsg: "Are you sure you want to delete this URL?",
          mSpinningMsg: "Deleting URL...",
          mBtnName: "Delete URL"
        }
      ));
    }
  };
  PassthroughAuthentication.propTypes = {
    rows: import_prop_types12.default.array,
    serverId: import_prop_types12.default.string,
    savePluginHandler: import_prop_types12.default.func,
    pluginListHandler: import_prop_types12.default.func,
    addNotification: import_prop_types12.default.func,
    toggleLoadingHandler: import_prop_types12.default.func
  };
  PassthroughAuthentication.defaultProps = {
    rows: [],
    serverId: ""
  };
  var passthroughAuthentication_default = PassthroughAuthentication;

  // src/lib/plugins/pamPassThru.jsx
  var import_react18 = __toESM(require_react(), 1);
  var import_prop_types13 = __toESM(require_prop_types(), 1);
  var PAMPassthroughAuthentication = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        pamConfigRows: [],
        tableKey: 1,
        error: {},
        modalSpinning: false,
        modalChecked: false,
        pamConfigName: "",
        pamExcludeSuffix: [],
        pamIncludeSuffix: [],
        pamMissingSuffix: "",
        pamFilter: "",
        pamIDAttr: "",
        pamIDMapMethod: "RDN",
        pamFallback: false,
        pamSecure: false,
        pamService: "ldapserver",
        _pamConfigName: "",
        _pamExcludeSuffix: [],
        _pamIncludeSuffix: [],
        _pamMissingSuffix: "",
        _pamFilter: "",
        _pamIDAttr: "",
        _pamIDMapMethod: "RDN",
        _pamFallback: false,
        _pamSecure: false,
        _pamService: "ldapserver",
        isExcludeOpen: false,
        excludeOptions: [],
        isIncludeOpen: false,
        includeOptions: [],
        showConfirmDeleteConfig: false,
        saveBtnDisabledPAM: true,
        savingPAM: false,
        newPAMConfigEntry: false,
        pamConfigEntryModalShow: false
      };
      this.handleExcludeToggle = (isExcludeOpen) => {
        this.setState({
          isExcludeOpen
        });
      };
      this.handleClearExcludeSelection = () => {
        this.setState({
          pamExcludeSuffix: [],
          isExcludeOpen: false
        }, () => {
          this.validatePAM();
        });
      };
      this.handleExcludeSelect = (event, selection) => {
        if (this.state.pamExcludeSuffix.includes(selection)) {
          this.setState(
            (prevState) => ({
              pamExcludeSuffix: prevState.pamExcludeSuffix.filter((item) => item !== selection),
              isExcludeOpen: false
            }),
            () => {
              this.validatePAM();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              pamExcludeSuffix: [...prevState.pamExcludeSuffix, selection],
              isExcludeOpen: false
            }),
            () => {
              this.validatePAM();
            }
          );
        }
      };
      this.handleCreateExcludeOption = (newValue) => {
        if (!this.state.excludeOptions.includes(newValue)) {
          this.setState({
            excludeOptions: [...this.state.excludeOptions, newValue],
            isExcludeOpen: false
          }, () => {
            this.validatePAM();
          });
        }
      };
      this.handleIncludeToggle = (isIncludeOpen) => {
        this.setState({
          isIncludeOpen
        });
      };
      this.handleClearIncludeSelection = () => {
        this.setState({
          pamIncludeSuffix: [],
          isIncludeOpen: false
        }, () => {
          this.validatePAM();
        });
      };
      this.handleIncludeSelect = (event, selection) => {
        if (this.state.pamIncludeSuffix.includes(selection)) {
          this.setState(
            (prevState) => ({
              pamIncludeSuffix: prevState.pamIncludeSuffix.filter((item) => item !== selection),
              isIncludeOpen: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              pamIncludeSuffix: [...prevState.pamIncludeSuffix, selection],
              isIncludeOpen: false
            })
          );
        }
      };
      this.handleCreateIncludeOption = (newValue) => {
        if (!this.state.includeOptions.includes(newValue)) {
          this.setState({
            includeOptions: [...this.state.includeOptions, newValue],
            isIncludeOpen: false
          });
        }
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validatePassthru();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.attrRows = this.props.attributes.map((attr) => /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }));
      this.handlePAMChange = this.handlePAMChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.validatePAM = this.validatePAM.bind(this);
      this.loadPAMConfigs = this.loadPAMConfigs.bind(this);
      this.openPAMModal = this.openPAMModal.bind(this);
      this.handleClosePAMModal = this.handleClosePAMModal.bind(this);
      this.showEditPAMConfigModal = this.showEditPAMConfigModal.bind(this);
      this.handleShowAddPAMConfigModal = this.handleShowAddPAMConfigModal.bind(this);
      this.cmdPAMOperation = this.cmdPAMOperation.bind(this);
      this.deletePAMConfig = this.deletePAMConfig.bind(this);
      this.handleAddPAMConfig = this.handleAddPAMConfig.bind(this);
      this.handleEditPAMConfig = this.handleEditPAMConfig.bind(this);
      this.showConfirmDeleteConfig = this.showConfirmDeleteConfig.bind(this);
      this.closeConfirmDeleteConfig = this.closeConfirmDeleteConfig.bind(this);
    }
    componentDidMount() {
      this.loadPAMConfigs();
    }
    validatePAM() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = ["pamConfigName", "pamIDAttr"];
      const dnAttrLists = ["pamExcludeSuffix", "pamExcludeSuffix"];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      for (const attrList of dnAttrLists) {
        for (const dn of this.state[attrList]) {
          if (!valid_dn(dn)) {
            errObj[attrList] = true;
            all_good = false;
            break;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrLists = ["pamExcludeSuffix", "pamIncludeSuffix"];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "pamConfigName",
          "pamFilter",
          "pamMissingSuffix",
          "pamIDMapMethod",
          "pamIDAttr",
          "pamFallback",
          "pamSecure",
          "pamService"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledPAM: !all_good,
        error: errObj
      });
    }
    handlePAMChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validatePAM();
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmDeleteConfig(name2) {
      this.setState({
        showConfirmDeleteConfig: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDeleteConfig() {
      this.setState({
        showConfirmDeleteConfig: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    loadPAMConfigs() {
      this.setState({
        firstLoad: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pam-pass-through-auth",
        "list"
      ];
      this.props.toggleLoadingHandler();
      log_cmd("loadPAMConfigs", "Get PAM Passthough Authentication Plugin Configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          pamConfigRows: myObject.items.map((item) => item.attrs),
          tableKey
        });
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (err !== 0) {
          console.log("loadPAMConfigs failed", errMsg.desc);
        }
        this.props.toggleLoadingHandler();
      });
    }
    showEditPAMConfigModal(rowData) {
      this.openPAMModal(rowData);
    }
    handleShowAddPAMConfigModal() {
      this.openPAMModal();
    }
    openPAMModal(name2) {
      if (!name2) {
        this.setState({
          pamConfigEntryModalShow: true,
          newPAMConfigEntry: true,
          pamConfigName: "",
          pamExcludeSuffix: [],
          pamIncludeSuffix: [],
          pamMissingSuffix: "",
          pamFilter: "",
          pamIDAttr: "",
          pamIDMapMethod: "RDN",
          pamFallback: false,
          pamSecure: false,
          pamService: "ldapserver",
          saveBtnDisabledPAM: true
        });
      } else {
        let pamExcludeSuffixList = [];
        let pamIncludeSuffixList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "pam-pass-through-auth",
          "config",
          name2,
          "show"
        ];
        this.props.toggleLoadingHandler();
        log_cmd(
          "openModal",
          "Fetch the PAM Passthough Authentication Plugin pamConfig entry",
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const pamConfigEntry = JSON.parse(content).attrs;
          const tableKey = this.state.tableKey + 1;
          if (pamConfigEntry.pamexcludesuffix !== void 0) {
            for (const value of pamConfigEntry.pamexcludesuffix) {
              pamExcludeSuffixList = [...pamExcludeSuffixList, value];
            }
          }
          if (pamConfigEntry.pamincludesuffix !== void 0) {
            for (const value of pamConfigEntry.pamincludesuffix) {
              pamIncludeSuffixList = [...pamIncludeSuffixList, value];
            }
          }
          this.setState({
            tableKey,
            saveBtnDisabledPAM: true,
            pamConfigEntryModalShow: true,
            newPAMConfigEntry: false,
            pamExcludeSuffix: pamExcludeSuffixList,
            pamIncludeSuffix: pamIncludeSuffixList,
            pamIDAttr: pamConfigEntry.pamidattr[0],
            pamConfigName: pamConfigEntry.cn === void 0 ? "" : pamConfigEntry.cn[0],
            pamMissingSuffix: pamConfigEntry.pammissingsuffix === void 0 ? "" : pamConfigEntry.pammissingsuffix[0],
            pamFilter: pamConfigEntry.pamfilter === void 0 ? "" : pamConfigEntry.pamfilter[0],
            pamIDMapMethod: pamConfigEntry.pamidmapmethod === void 0 ? "RDN" : pamConfigEntry.pamidmapmethod[0],
            pamFallback: !(pamConfigEntry.pamfallback === void 0 || pamConfigEntry.pamfallback[0] === "FALSE"),
            pamSecure: !(pamConfigEntry.pamsecure === void 0 || pamConfigEntry.pamsecure[0] === "FALSE"),
            pamService: pamConfigEntry.pamservice === void 0 ? "ldapserver" : pamConfigEntry.pamservice[0],
            // Backup values
            _pamExcludeSuffix: [...pamExcludeSuffixList],
            _pamIncludeSuffix: [...pamIncludeSuffixList],
            _pamIDAttr: pamConfigEntry.pamidattr[0],
            _pamConfigName: pamConfigEntry.cn === void 0 ? "" : pamConfigEntry.cn[0],
            _pamMissingSuffix: pamConfigEntry.pammissingsuffix === void 0 ? "" : pamConfigEntry.pammissingsuffix[0],
            _pamFilter: pamConfigEntry.pamfilter === void 0 ? "" : pamConfigEntry.pamfilter[0],
            _pamIDMapMethod: pamConfigEntry.pamidmapmethod === void 0 ? "ldapserver" : pamConfigEntry.pamidmapmethod[0],
            _pamFallback: !(pamConfigEntry.pamfallback === void 0 || pamConfigEntry.pamfallback[0] === "FALSE"),
            _pamSecure: !(pamConfigEntry.pamsecure === void 0 || pamConfigEntry.pamsecure[0] === "FALSE"),
            _pamService: pamConfigEntry.pamservice === void 0 ? "ldapserver" : pamConfigEntry.pamservice[0]
          });
          this.props.toggleLoadingHandler();
        }).fail((_) => {
          this.setState({
            pamConfigEntryModalShow: true,
            newPAMConfigEntry: true,
            pamConfigName: "",
            pamExcludeSuffix: [],
            pamIncludeSuffix: [],
            pamMissingSuffix: "",
            pamFilter: "",
            pamIDAttr: "",
            pamIDMapMethod: "",
            pamFallback: false,
            pamSecure: false,
            pamService: "",
            saveBtnDisabledPAM: true
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    handleClosePAMModal() {
      this.setState({
        pamConfigEntryModalShow: false,
        savingPAM: false
      });
    }
    deletePAMConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pam-pass-through-auth",
        "config",
        this.state.deleteName,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      this.props.toggleLoadingHandler();
      log_cmd(
        "deletePAMConfig",
        "Delete the PAM Passthough Authentication Plugin pamConfig entry",
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deletePAMConfig", "Result", content);
        this.props.addNotification(
          "success",
          `PAMConfig entry ${this.state.deleteName} was successfully deleted`
        );
        this.loadPAMConfigs();
        this.closeConfirmDeleteConfig();
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the pamConfig entry removal operation - ${errMsg.desc}`
        );
        this.loadPAMConfigs();
        this.closeConfirmDeleteConfig();
        this.props.toggleLoadingHandler();
      });
    }
    handleAddPAMConfig() {
      this.cmdPAMOperation("add");
    }
    handleEditPAMConfig() {
      this.cmdPAMOperation("set");
    }
    cmdPAMOperation(action) {
      const {
        pamConfigName,
        pamExcludeSuffix,
        pamIncludeSuffix,
        pamMissingSuffix,
        pamFilter,
        pamIDAttr,
        pamIDMapMethod,
        pamFallback,
        pamSecure,
        pamService
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pam-pass-through-auth",
        "config",
        pamConfigName,
        action,
        "--missing-suffix",
        pamMissingSuffix || action === "add" ? pamMissingSuffix : "delete",
        "--filter",
        pamFilter || action === "add" ? pamFilter : "delete",
        "--id_map_method",
        pamIDMapMethod || action === "add" ? pamIDMapMethod : "delete",
        "--fallback",
        pamFallback ? "TRUE" : "FALSE",
        "--secure",
        pamSecure ? "TRUE" : "FALSE",
        "--service",
        pamService || action === "add" ? pamService : "delete"
      ];
      cmd = [...cmd, "--exclude-suffix"];
      if (pamExcludeSuffix.length !== 0) {
        for (const value of pamExcludeSuffix) {
          cmd = [...cmd, value];
        }
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--include-suffix"];
      if (pamIncludeSuffix.length !== 0) {
        for (const value of pamIncludeSuffix) {
          cmd = [...cmd, value];
        }
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--id-attr"];
      if (pamIDAttr !== "") {
        cmd = [...cmd, pamIDAttr];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        savingPAM: true
      });
      log_cmd(
        "pamPassthroughAuthOperation",
        `Do the ${action} operation on the PAM Passthough Authentication Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("pamPassthroughAuthOperation", "Result", content);
        this.props.addNotification(
          "success",
          `The ${action} operation was successfully done on "${pamConfigName}" entry`
        );
        this.loadPAMConfigs();
        this.handleClosePAMModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the pamConfig entry ${action} operation - ${errMsg.desc}`
        );
        this.loadPAMConfigs();
        this.handleClosePAMModal();
      });
    }
    render() {
      const {
        pamConfigRows,
        pamConfigName,
        pamMissingSuffix,
        pamExcludeSuffix,
        pamIncludeSuffix,
        pamFilter,
        pamIDAttr,
        pamIDMapMethod,
        pamFallback,
        pamSecure,
        pamService,
        newPAMConfigEntry,
        pamConfigEntryModalShow,
        error,
        savingPAM
      } = this.state;
      let saveBtnName = "Save Config";
      const extraPrimaryProps = {};
      if (this.state.savingPAM) {
        saveBtnName = "Saving Config ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      const title = (newPAMConfigEntry ? "Add" : "Edit") + " PAM Passthough Auth Config Entry";
      return /* @__PURE__ */ import_react18.default.createElement("div", { className: savingPAM ? "ds-disabled" : "" }, /* @__PURE__ */ import_react18.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title,
          isOpen: pamConfigEntryModalShow,
          onClose: this.handleClosePAMModal,
          actions: [
            /* @__PURE__ */ import_react18.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: newPAMConfigEntry ? this.handleAddPAMConfig : this.handleEditPAMConfig,
                isDisabled: this.state.saveBtnDisabledPAM || this.state.savingPAM,
                isLoading: this.state.savingPAM,
                spinnerAriaValueText: this.state.savingPAM ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react18.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleClosePAMModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react18.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react18.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react18.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Config Name"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          TextInput,
          {
            value: pamConfigName,
            type: "text",
            id: "pamConfigName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "pamConfigName",
            onChange: (str, e) => {
              this.handlePAMChange(e);
            },
            isDisabled: !newPAMConfigEntry,
            validated: error.pamConfigName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, null, /* @__PURE__ */ import_react18.default.createElement(
          GridItem,
          {
            className: "ds-label",
            span: 3,
            title: "Specifies a suffix to exclude from PAM authentication (pamExcludeSuffix)"
          },
          "Exclude Suffix"
        ), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            isCreatable: true,
            onCreateOption: this.handleCreateExcludeOption,
            typeAheadAriaLabel: "Add a suffix",
            onToggle: this.handleExcludeToggle,
            onSelect: this.handleExcludeSelect,
            onClear: this.handleClearExcludeSelection,
            selections: pamExcludeSuffix,
            isOpen: this.state.isExcludeOpen,
            "aria-labelledby": "Add a suffix",
            placeholderText: "Type a suffix DN ..."
          },
          this.state.excludeOptions.map((suffix, index) => /* @__PURE__ */ import_react18.default.createElement(
            SelectOption,
            {
              key: index,
              value: suffix
            }
          ))
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, null, /* @__PURE__ */ import_react18.default.createElement(
          GridItem,
          {
            className: "ds-label",
            span: 3,
            title: "Sets a suffix to include for PAM authentication (pamIncludeSuffix)"
          },
          "Include Suffix"
        ), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            isCreatable: true,
            onCreateOption: this.handleCreateIncludeOption,
            typeAheadAriaLabel: "Add an include suffix",
            onToggle: this.handleIncludeToggle,
            onSelect: this.handleIncludeSelect,
            onClear: this.handleClearIncludeSelection,
            selections: pamIncludeSuffix,
            isOpen: this.state.isIncludeOpen,
            "aria-labelledby": "Add an include suffix",
            placeholderText: "Type a suffix DN ..."
          },
          this.state.includeOptions.map((suffix, index) => /* @__PURE__ */ import_react18.default.createElement(
            SelectOption,
            {
              key: index,
              value: suffix
            }
          ))
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, null, /* @__PURE__ */ import_react18.default.createElement(GridItem, { className: "ds-label", span: 3, title: "Contains the attribute name which is used to hold the PAM user ID (pamIDAttr)" }, "ID Attribute"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          FormSelect,
          {
            id: "pamIDAttr",
            value: pamIDAttr,
            onChange: (value, event) => {
              this.handlePAMChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "no_setting2", value: "", label: "Choose an attribute..." }),
          this.attrRows
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, { title: "Identifies how to handle missing include or exclude suffixes (pamMissingSuffix)" }, /* @__PURE__ */ import_react18.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Missing Suffix"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          FormSelect,
          {
            id: "pamMissingSuffix",
            value: pamMissingSuffix,
            onChange: (value, event) => {
              this.handlePAMChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "ERROR", value: "ERROR", label: "ERROR" }),
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "ALLOW", value: "ALLOW", label: "ALLOW" }),
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "IGNORE", value: "IGNORE", label: "IGNORE" })
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, { title: "Sets an LDAP filter to use to identify specific entries within the included suffixes for which to use PAM pass-through authentication (pamFilter)" }, /* @__PURE__ */ import_react18.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Filter"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          TextInput,
          {
            value: pamFilter,
            type: "text",
            id: "pamFilter",
            "aria-describedby": "horizontal-form-name-helper",
            name: "pamFilter",
            onChange: (str, e) => {
              this.handlePAMChange(e);
            },
            validated: error.pamFilter ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, { title: "Gives the method to use to map the LDAP bind DN to a PAM identity (pamIDMapMethod)" }, /* @__PURE__ */ import_react18.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Map Method"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          FormSelect,
          {
            id: "pamIDMapMethod",
            value: pamIDMapMethod,
            onChange: (value, event) => {
              this.handlePAMChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "RDN", value: "RDN", label: "RDN" }),
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "DN", value: "DN", label: "DN" }),
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "ENTRY", value: "ENTRY", label: "ENTRY" })
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, { title: "Contains the service name to pass to PAM (pamService)" }, /* @__PURE__ */ import_react18.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Service"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          FormSelect,
          {
            id: "pamService",
            value: pamService,
            onChange: (value, event) => {
              this.handlePAMChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "ldapserver", value: "ldapserver", label: "ldapserver" }),
          /* @__PURE__ */ import_react18.default.createElement(FormSelectOption, { key: "system-auth", value: "system-auth", label: "system-auth (For AD)" })
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, null, /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Fallback Auth Enabled"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          Checkbox,
          {
            id: "pamFallback",
            isChecked: pamFallback,
            onChange: (checked, e) => {
              this.handlePAMChange(e);
            },
            title: "Sets whether to fallback to regular LDAP authentication if PAM authentication fails (pamFallback)"
          }
        ))), /* @__PURE__ */ import_react18.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Require Secure Connection"), /* @__PURE__ */ import_react18.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react18.default.createElement(
          Checkbox,
          {
            id: "pamSecure",
            isChecked: pamSecure,
            onChange: (checked, e) => {
              this.handlePAMChange(e);
            },
            title: "Requires secure TLS connection for PAM authentication (pamSecure)"
          }
        ))))
      ), /* @__PURE__ */ import_react18.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "PAM Pass Through Auth",
          pluginName: "PAM Pass Through Auth",
          cmdName: "pam-pass-through-auth",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react18.default.createElement(
          PassthroughAuthConfigsTable,
          {
            rows: pamConfigRows,
            key: this.state.tableKey,
            editConfig: this.showEditPAMConfigModal,
            deleteConfig: this.showConfirmDeleteConfig
          }
        ),
        /* @__PURE__ */ import_react18.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowAddPAMConfigModal
          },
          "Add Config"
        )
      ), /* @__PURE__ */ import_react18.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteConfig,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onModalChange,
          actionHandler: this.deletePAMConfig,
          spinning: this.state.modalSpinning,
          item: this.state.deleteName,
          checked: this.state.modalChecked,
          mTitle: "Delete PAM Passthrough Configuration",
          mMsg: "Are you sure you want to delete this configuration?",
          mSpinningMsg: "Deleting Configuration...",
          mBtnName: "Delete Configuration"
        }
      ));
    }
  };
  PAMPassthroughAuthentication.propTypes = {
    rows: import_prop_types13.default.array,
    serverId: import_prop_types13.default.string,
    savePluginHandler: import_prop_types13.default.func,
    pluginListHandler: import_prop_types13.default.func,
    addNotification: import_prop_types13.default.func,
    toggleLoadingHandler: import_prop_types13.default.func
  };
  PAMPassthroughAuthentication.defaultProps = {
    rows: [],
    serverId: ""
  };
  var pamPassThru_default = PAMPassthroughAuthentication;

  // src/lib/plugins/referentialIntegrity.jsx
  var import_react19 = __toESM(require_react(), 1);
  var import_prop_types14 = __toESM(require_prop_types(), 1);
  var ReferentialIntegrity = class extends import_react19.default.Component {
    componentDidMount(prevProps) {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.updateFields();
        }
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        newEntry: true,
        isConfigMembershipAttrOpen: false,
        isMembershipAttrOpen: false,
        configEntryModalShow: false,
        saveBtnDisabled: true,
        saveBtnDisabledModal: true,
        saving: false,
        savingModal: false,
        modalSpinning: false,
        modalChecked: false,
        error: {},
        errorModal: {},
        showConfirmDelete: false,
        addSpinning: false,
        // Main settings
        updateDelay: "",
        membershipAttr: [],
        entryScope: "",
        excludeEntryScope: "",
        containerScope: "",
        logFile: "",
        referintConfigEntry: "",
        _updateDelay: "",
        _membershipAttr: [],
        _entryScope: "",
        _excludeEntryScope: "",
        _containerScope: "",
        _logFile: "",
        _referintConfigEntry: "",
        // Shared Config settings
        configDN: "",
        configUpdateDelay: "",
        configMembershipAttr: [],
        configEntryScope: "",
        configExcludeEntryScope: "",
        configContainerScope: "",
        configLogFile: "",
        _configDN: "",
        _configUpdateDelay: "",
        _configMembershipAttr: [],
        _configEntryScope: "",
        _configExcludeEntryScope: "",
        _configContainerScope: "",
        _configLogFile: ""
      };
      this.handleConfigMembershipAttrSelect = (event, selection) => {
        if (this.state.configMembershipAttr.includes(selection)) {
          this.setState(
            (prevState) => ({
              configMembershipAttr: prevState.configMembershipAttr.filter((item) => item !== selection),
              isConfigMembershipAttrOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              configMembershipAttr: [...prevState.configMembershipAttr, selection],
              isConfigMembershipAttrOpen: false
            }),
            () => {
              this.validateModal();
            }
          );
        }
      };
      this.handleConfigMembershipAttrToggle = (isConfigMembershipAttrOpen) => {
        this.setState({
          isConfigMembershipAttrOpen
        });
      };
      this.handleConfigMembershipAttrClear = () => {
        this.setState({
          configMembershipAttr: [],
          isConfigMembershipAttrOpen: false
        });
      };
      this.handleMembershipAttrSelect = (event, selection) => {
        if (this.state.membershipAttr.includes(selection)) {
          this.setState(
            (prevState) => ({
              membershipAttr: prevState.membershipAttr.filter((item) => item !== selection),
              isMembershipAttrOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              membershipAttr: [...prevState.membershipAttr, selection],
              isMembershipAttrOpen: false
            }),
            () => {
              this.validateConfig();
            }
          );
        }
      };
      this.handleMembershipAttrToggle = (isMembershipAttrOpen) => {
        this.setState({
          isMembershipAttrOpen
        });
      };
      this.handleMembershipAttrClear = () => {
        this.setState({
          membershipAttr: [],
          isMembershipAttrOpen: false
        });
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateConfig();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          id.startsWith("config") ? this.validateModal() : this.validateConfig();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateConfig();
        });
      };
      this.updateFields = this.updateFields.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.handleOpenModal = this.handleOpenModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.handleAddConfig = this.handleAddConfig.bind(this);
      this.handleEditConfig = this.handleEditConfig.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.cmdConfigOperation = this.cmdConfigOperation.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleShowConfirmDelete = this.handleShowConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
    }
    handleShowConfirmDelete() {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "entryScope",
        "excludeEntryScope",
        "containerScope",
        "referintConfigEntry"
      ];
      const reqAttrs = ["logFile"];
      for (const attr of dnAttrs) {
        errObj[attr] = false;
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
        }
      }
      if (!file_is_path(this.state.logFile)) {
        errObj.logFile = true;
        all_good = false;
      }
      errObj.membershipAttr = false;
      if (this.state.membershipAttr.length === 0) {
        errObj.membershipAttr = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "entryScope",
          "excludeEntryScope",
          "containerScope",
          "referintConfigEntry",
          "updateDelay",
          "logFile"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (!listsEqual(this.state.membershipAttr, this.state._membershipAttr)) {
          all_good = true;
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
      return all_good;
    }
    validateModal() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "configDN",
        "configEntryScope",
        "configExcludeEntryScope",
        "configContainerScope"
      ];
      const reqAttrs = ["configDN", "configLogFile"];
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
        }
      }
      if (!file_is_path(this.state.configLogFile)) {
        errObj.configLogFile = true;
        all_good = false;
      }
      errObj.configMembershipAttr = false;
      if (this.state.configMembershipAttr.length === 0) {
        errObj.configMembershipAttr = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "configDN",
          "configEntryScope",
          "configExcludeEntryScope",
          "configContainerScope",
          "configUpdateDelay"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (!listsEqual(this.state.configMembershipAttr, this.state._configMembershipAttr)) {
          all_good = true;
        }
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        errorModal: errObj
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleFieldChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateConfig();
      });
    }
    handleModalChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateModal();
      });
    }
    handleSaveConfig() {
      const {
        membershipAttr,
        entryScope,
        excludeEntryScope,
        containerScope,
        logFile,
        referintConfigEntry
      } = this.state;
      const updateDelay = this.state.updateDelay.toString();
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "referential-integrity",
        "set",
        "--update-delay",
        updateDelay || "delete",
        "--entry-scope",
        entryScope || "delete",
        "--exclude-entry-scope",
        excludeEntryScope || "delete",
        "--container-scope",
        containerScope || "delete",
        "--config-entry",
        referintConfigEntry || "delete",
        "--log-file",
        logFile || "delete"
      ];
      cmd = [...cmd, "--membership-attr"];
      if (membershipAttr.length !== 0) {
        for (const value of membershipAttr) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        saving: true
      });
      log_cmd(
        "handleSaveConfig",
        `Save Referential Integrity Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("referintOperation", "Result", content);
        this.props.addNotification(
          "success",
          `Successfully updated Referential Integrity Plugin`
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      }).fail((err) => {
        let errMsg = JSON.parse(err);
        if ("info" in errMsg) {
          errMsg = errMsg.desc + " " + errMsg.info;
        } else {
          errMsg = errMsg.desc;
        }
        this.props.addNotification(
          "error",
          `Error during update - ${errMsg}`
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      });
    }
    handleOpenModal() {
      if (!this.state.referintConfigEntry) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configDN: "",
          configUpdateDelay: "0",
          configMembershipAttr: [],
          configEntryScope: "",
          configExcludeEntryScope: "",
          configContainerScope: "",
          configLogFile: "",
          _configDN: "",
          _configUpdateDelay: "",
          _configMembershipAttr: [],
          _configEntryScope: "",
          _configExcludeEntryScope: "",
          _configContainerScope: "",
          _configLogFile: "",
          addSpinning: false,
          savingModal: false
        });
      } else {
        let membershipAttrList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "referential-integrity",
          "config-entry",
          "show",
          this.state.referintConfigEntry
        ];
        log_cmd("handleOpenModal", "Fetch the Referential Integrity Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const pluginRow = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            configDN: this.state.referintConfigEntry,
            configUpdateDelay: pluginRow["referint-update-delay"] === void 0 ? "" : pluginRow["referint-update-delay"][0],
            configEntryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
            configExcludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
            configContainerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
            configLogFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0],
            _configUpdateDelay: pluginRow["referint-update-delay"] === void 0 ? "" : pluginRow["referint-update-delay"][0],
            _configEntryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
            _configExcludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
            _configContainerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
            _configLogFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0]
          });
          if (pluginRow["referint-membership-attr"] === void 0) {
            this.setState({
              configMembershipAttr: [],
              _configMembershipAttr: []
            });
          } else {
            for (const value of pluginRow["referint-membership-attr"]) {
              membershipAttrList = [...membershipAttrList, value];
            }
            this.setState({
              configMembershipAttr: membershipAttrList,
              _configMembershipAttr: [...membershipAttrList]
            });
          }
        }).fail((_) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configDN: this.state.referintConfigEntry,
            configUpdateDelay: "0",
            configMembershipAttr: [],
            configEntryScope: "",
            configExcludeEntryScope: "",
            configContainerScope: "",
            configLogFile: "",
            _configDN: this.state.referintConfigEntry,
            _configUpdateDelay: "",
            _configMembershipAttr: [],
            _configEntryScope: "",
            _configExcludeEntryScope: "",
            _configContainerScope: "",
            _configLogFile: "",
            savingModal: false
          });
        });
      }
    }
    handleCloseModal() {
      this.setState({
        configEntryModalShow: false,
        savingModal: false,
        addSpinning: false,
        modalSpinning: false
      });
    }
    cmdConfigOperation(action) {
      const {
        configDN,
        configUpdateDelay,
        configMembershipAttr,
        configEntryScope,
        configExcludeEntryScope,
        configContainerScope,
        configLogFile
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "referential-integrity",
        "config-entry",
        action,
        configDN,
        "--update-delay",
        configUpdateDelay || action === "add" ? configUpdateDelay : "delete",
        "--entry-scope",
        configEntryScope || action === "add" ? configEntryScope : "delete",
        "--exclude-entry-scope",
        configExcludeEntryScope || action === "add" ? configExcludeEntryScope : "delete",
        "--container-scope",
        configContainerScope || action === "add" ? configContainerScope : "delete",
        "--log-file",
        configLogFile || action === "add" ? configLogFile : "delete"
      ];
      cmd = [...cmd, "--membership-attr"];
      if (configMembershipAttr.length !== 0) {
        for (const value of configMembershipAttr) {
          cmd = [...cmd, value];
        }
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      let spinning = "savingModal";
      if (action === "add") {
        spinning = "addSpinning";
      }
      this.setState({
        [spinning]: true
      });
      log_cmd(
        "referintOperation",
        `Do the ${action} operation on the Referential Integrity Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("referintOperation", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${configDN} was successfully ${action}ed`
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry ${action} operation - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "referential-integrity",
        "config-entry",
        "delete",
        this.state.configDN
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Referential Integrity Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          `Config entry ${this.state.configDN} was successfully deleted`
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during the config entry removal operation - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      });
    }
    handleAddConfig() {
      this.cmdConfigOperation("add");
    }
    handleEditConfig() {
      this.cmdConfigOperation("set");
    }
    updateFields() {
      let membershipAttrList = [];
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find(
          (row) => row.cn[0] === "referential integrity postoperation"
        );
        this.setState({
          updateDelay: pluginRow["referint-update-delay"] === void 0 ? "0" : pluginRow["referint-update-delay"][0],
          _updateDelay: pluginRow["referint-update-delay"] === void 0 ? "0" : pluginRow["referint-update-delay"][0],
          entryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
          _entryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
          excludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
          _excludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
          containerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
          _containerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
          referintConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0],
          _referintConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0],
          logFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0],
          _logFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0]
        });
        if (pluginRow["referint-membership-attr"] === void 0) {
          this.setState({
            membershipAttr: [],
            _membershipAttr: []
          });
        } else {
          for (const value of pluginRow["referint-membership-attr"]) {
            membershipAttrList = [...membershipAttrList, value];
          }
          this.setState({
            membershipAttr: membershipAttrList,
            _membershipAttr: [...membershipAttrList]
          });
        }
      }
    }
    render() {
      const {
        updateDelay,
        membershipAttr,
        entryScope,
        excludeEntryScope,
        containerScope,
        logFile,
        referintConfigEntry,
        configDN,
        configUpdateDelay,
        configMembershipAttr,
        configEntryScope,
        configExcludeEntryScope,
        configContainerScope,
        configEntryModalShow,
        configLogFile,
        newEntry,
        saveBtnDisabled,
        saveBtnDisabledModal,
        saving,
        savingModal,
        addSpinning,
        modalSpinning,
        error,
        errorModal
      } = this.state;
      let saveBtnText = "Save Config";
      let addBtnText = "Add Config";
      const extraPrimaryProps = {};
      if (savingModal) {
        saveBtnText = "Saving ...";
        addBtnText = "Adding ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      let modalButtons = [];
      if (!newEntry) {
        modalButtons = [
          /* @__PURE__ */ import_react19.default.createElement(
            Button,
            {
              key: "del",
              variant: "primary",
              onClick: this.handleShowConfirmDelete
            },
            "Delete Config"
          ),
          /* @__PURE__ */ import_react19.default.createElement(
            Button,
            {
              key: "save",
              variant: "primary",
              onClick: this.handleEditConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? "Saving" : void 0,
              ...extraPrimaryProps
            },
            saveBtnText
          ),
          /* @__PURE__ */ import_react19.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
        ];
      } else {
        modalButtons = [
          /* @__PURE__ */ import_react19.default.createElement(
            Button,
            {
              key: "add",
              variant: "primary",
              onClick: this.handleAddConfig,
              isDisabled: saveBtnDisabledModal || addSpinning,
              isLoading: addSpinning,
              spinnerAriaValueText: addSpinning ? "Saving" : void 0,
              ...extraPrimaryProps
            },
            addBtnText
          ),
          /* @__PURE__ */ import_react19.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Cancel")
        ];
      }
      return /* @__PURE__ */ import_react19.default.createElement("div", { className: saving || savingModal || addSpinning || modalSpinning ? "ds-disabled" : "" }, /* @__PURE__ */ import_react19.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Manage Referential Integrity Plugin Shared Config Entry",
          isOpen: configEntryModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleCloseModal,
          actions: modalButtons
        },
        /* @__PURE__ */ import_react19.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react19.default.createElement(Grid, { className: "ds-margin-top", title: "The config entry full DN" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Config DN"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: configDN,
            type: "text",
            id: "configDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configDN",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: errorModal.configDN ? ValidatedOptions.error : ValidatedOptions.default,
            isDisabled: !newEntry
          }
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configDN }, "Value must be a valid DN"))), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Specifies attributes to check for and update (referint-membership-attr)" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Membership Attribute"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react19.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: this.handleConfigMembershipAttrToggle,
            onSelect: this.handleConfigMembershipAttrSelect,
            onClear: this.handleConfigMembershipAttrClear,
            selections: configMembershipAttr,
            isOpen: this.state.isConfigMembershipAttrOpen,
            "aria-labelledby": "typeAhead-config-membership-attr",
            placeholderText: "Type an attribute...",
            noResultsFoundText: "There are no matching entries",
            validated: errorModal.configMembershipAttr ? "error" : "default"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react19.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configMembershipAttr }, "At least one attribute must be specified"))), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Defines the subtree in which the plug-in looks for the delete or rename operations of a user entry (nsslapd-pluginEntryScope)" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Entry Scope"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: configEntryScope,
            type: "text",
            id: "configEntryScope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configEntryScope",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: errorModal.configEntryScope ? ValidatedOptions.error : ValidatedOptions.default
          }
        )), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configEntryScope }, "Value must be a valid DN")), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Defines the subtree in which the plug-in ignores any operations for deleting or renaming a user (nsslapd-pluginExcludeEntryScope)" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclude Entry Scope"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: configExcludeEntryScope,
            type: "text",
            id: "configExcludeEntryScope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configExcludeEntryScope",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: errorModal.configExcludeEntryScope ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configExcludeEntryScope }, "Value must be a valid DN"))), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Specifies which branch the plug-in searches for the groups to which the user belongs. It only updates groups that are under the specified container branch, and leaves all other groups not updated (nsslapd-pluginContainerScope)." }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Container Scope"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: configContainerScope,
            type: "text",
            id: "configContainerScope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "configContainerScope",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: errorModal.configContainerScope ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configContainerScope }, "Value must be a valid DN"))), /* @__PURE__ */ import_react19.default.createElement(
          Grid,
          {
            title: `Specifies a path to the Referential integrity logfile. For example: /var/log/dirsrv/slapd-${this.props.serverId}/referint`
          },
          /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Logfile"),
          /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react19.default.createElement(
            TextInput,
            {
              value: configLogFile,
              type: "text",
              id: "configLogFile",
              "aria-describedby": "horizontal-form-name-helper",
              name: "configLogFile",
              onChange: (str, e) => {
                this.handleModalChange(e);
              },
              validated: errorModal.configLogFile ? ValidatedOptions.error : ValidatedOptions.default
            }
          ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !errorModal.configLogFile }, "Invalid log file name"))
        ), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Sets the update interval in seconds. Special values: 0 - The check is performed immediately, -1 - No check is performed. (referint-update-delay)" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Update Delay"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react19.default.createElement(
          NumberInput,
          {
            value: configUpdateDelay,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("configUpdateDelay");
            },
            onChange: (e) => {
              this.onConfigChange(e, "configUpdateDelay", -1);
            },
            onPlus: () => {
              this.onPlusConfig("configUpdateDelay");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))))
      ), /* @__PURE__ */ import_react19.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "referential integrity postoperation",
          pluginName: "Referential Integrity",
          cmdName: "referential-integrity",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler,
          saveBtnDisabled: this.state.saveBtnDisabled
        },
        /* @__PURE__ */ import_react19.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Specifies attributes to check for and update (referint-membership-attr)." }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Membership Attribute"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react19.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: this.handleMembershipAttrToggle,
            onSelect: this.handleMembershipAttrSelect,
            onClear: this.handleMembershipAttrClear,
            selections: membershipAttr,
            isOpen: this.state.isMembershipAttrOpen,
            "aria-labelledby": "typeAhead-membership-attr",
            placeholderText: "Type an attribute...",
            noResultsFoundText: "There are no matching entries",
            validated: error.membershipAttr ? "error" : "default"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react19.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !error.membershipAttr }, "At least one attribute needs to be specified"))), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Defines the subtree in which the plug-in looks for the delete or rename operations of a user entry (nsslapd-pluginEntryScope)" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Entry Scope"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: entryScope,
            type: "text",
            id: "entryScope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "entryScope",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: error.entryScope ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !error.entryScope }, "The value must be a valid DN"))), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Defines the subtree in which the plug-in ignores any operations for deleting or renaming a user (nsslapd-pluginExcludeEntryScope)" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclude Entry Scope"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: excludeEntryScope,
            type: "text",
            id: "excludeEntryScope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "excludeEntryScope",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: error.excludeEntryScope ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !error.excludeEntryScope }, "The value must be a valid DN"))), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Specifies which branch the plug-in searches for the groups to which the user belongs. It only updates groups that are under the specified container branch, and leaves all other groups not updated (nsslapd-pluginContainerScope)." }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Container Scope"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: containerScope,
            type: "text",
            id: "containerScope",
            "aria-describedby": "horizontal-form-name-helper",
            name: "containerScope",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: error.containerScope ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !error.containerScope }, "The value must be a valid DN"))), /* @__PURE__ */ import_react19.default.createElement(
          Grid,
          {
            title: `Specifies a path to the Referential integrity logfile. For example: /var/log/dirsrv/slapd-${this.props.serverId}/referint`
          },
          /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Logfile"),
          /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react19.default.createElement(
            TextInput,
            {
              value: logFile,
              type: "text",
              id: "logFile",
              "aria-describedby": "horizontal-form-name-helper",
              name: "logFile",
              onChange: (str, e) => {
                this.handleFieldChange(e);
              },
              validated: error.logFile ? ValidatedOptions.error : ValidatedOptions.default
            }
          ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !error.logFile }, "Invalid log nameN"))
        ), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "Sets the update interval. Special values: 0 - The check is performed immediately, -1 - No check is performed (referint-update-delay)" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Update Delay"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react19.default.createElement(
          NumberInput,
          {
            value: updateDelay,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("updateDelay");
            },
            onChange: (e) => {
              this.onConfigChange(e, "updateDelay", 0);
            },
            onPlus: () => {
              this.onPlusConfig("updateDelay");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8,
            unit: "Seconds"
          }
        ))), /* @__PURE__ */ import_react19.default.createElement(Grid, { title: "The value to set as nsslapd-pluginConfigArea" }, /* @__PURE__ */ import_react19.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Shared Config Entry"), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react19.default.createElement(
          TextInput,
          {
            value: referintConfigEntry,
            type: "text",
            id: "referintConfigEntry",
            "aria-describedby": "horizontal-form-name-helper",
            name: "referintConfigEntry",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: error.referintConfigEntry ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react19.default.createElement(FormHelperText, { isError: true, isHidden: !error.referintConfigEntry }, "The value must be a valid DN")), /* @__PURE__ */ import_react19.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react19.default.createElement(
          Button,
          {
            className: "ds-left-margin",
            variant: "primary",
            onClick: this.handleOpenModal
          },
          "Manage"
        )))),
        /* @__PURE__ */ import_react19.default.createElement(
          Button,
          {
            className: "ds-margin-top-lg",
            key: "at",
            isLoading: saving,
            spinnerAriaValueText: saving ? "Loading" : void 0,
            variant: "primary",
            onClick: this.handleSaveConfig,
            ...extraPrimaryProps,
            isDisabled: saveBtnDisabled || saving
          },
          saveBtnText
        )
      ), /* @__PURE__ */ import_react19.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.deleteConfig,
          spinning: this.state.modalSpinning,
          item: this.state.configDN,
          checked: this.state.modalChecked,
          mTitle: "Delete RI Plugin Config Entry",
          mMsg: "Are you sure you want to delete this config entry?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ));
    }
  };
  ReferentialIntegrity.propTypes = {
    rows: import_prop_types14.default.array,
    serverId: import_prop_types14.default.string,
    savePluginHandler: import_prop_types14.default.func,
    pluginListHandler: import_prop_types14.default.func,
    addNotification: import_prop_types14.default.func,
    toggleLoadingHandler: import_prop_types14.default.func
  };
  ReferentialIntegrity.defaultProps = {
    rows: [],
    serverId: ""
  };
  var referentialIntegrity_default = ReferentialIntegrity;

  // src/lib/plugins/retroChangelog.jsx
  var import_react20 = __toESM(require_react(), 1);
  var import_prop_types15 = __toESM(require_prop_types(), 1);
  var RetroChangelog = class extends import_react20.default.Component {
    componentDidMount(prevProps) {
      if (this.state.firstLoad) {
        this.updateFields();
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        saveBtnDisabled: true,
        saving: false,
        error: {},
        // Config settings
        isReplicated: false,
        maxAge: 0,
        maxAgeUnit: "w",
        trimInterval: 300,
        excludeSuffix: [],
        excludeAttrs: [],
        // original values
        _isReplicated: false,
        _maxAge: 0,
        _maxAgeUnit: "w",
        _trimInterval: 300,
        _excludeSuffix: [],
        _excludeAttrs: [],
        isExcludeAttrOpen: false,
        isExcludeSuffixOpen: false
      };
      this.maxValue = 2e7;
      this.minValue = 0;
      this.handleMinusConfig = () => {
        this.setState({
          maxAge: Number(this.state.maxAge) - 1
        }, () => {
          this.validate();
        });
      };
      this.handleMaxAgeChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          maxAge: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        }, () => {
          this.validate();
        });
      };
      this.handlePlusConfig = () => {
        this.setState({
          maxAge: Number(this.state.maxAge) + 1
        }, () => {
          this.validate();
        });
      };
      this.handleMinusTrim = () => {
        this.setState({
          trimInterval: Number(this.state.trimInterval) - 1
        }, () => {
          this.validate();
        });
      };
      this.handleTrimChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          trimInterval: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        }, () => {
          this.validate();
        });
      };
      this.handlePlusTrim = () => {
        this.setState({
          trimInterval: Number(this.state.trimInterval) + 1
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeAttrSelect = (event, selection) => {
        if (this.state.excludeAttrs.includes(selection)) {
          this.setState(
            (prevState) => ({
              excludeAttrs: prevState.excludeAttrs.filter((item) => item !== selection),
              isExcludeAttrOpen: false
            }),
            () => {
              this.validate();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              excludeAttrs: [...prevState.excludeAttrs, selection],
              isExcludeAttrOpen: false
            }),
            () => {
              this.validate();
            }
          );
        }
      };
      this.handleExcludeAttrToggle = (isExcludeAttrOpen) => {
        this.setState({
          isExcludeAttrOpen
        });
      };
      this.handleExcludeAttrClear = () => {
        this.setState({
          excludeAttrs: [],
          isExcludeAttrOpen: false
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeSuffixSelect = (event, selection) => {
        if (this.state.excludeSuffix.includes(selection)) {
          this.setState(
            (prevState) => ({
              excludeSuffix: prevState.excludeSuffix.filter((item) => item !== selection),
              isExcludeSuffixOpen: false
            }),
            () => {
              this.validate();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              excludeSuffix: [...prevState.excludeSuffix, selection],
              isExcludeSuffixOpen: false
            }),
            () => {
              this.validate();
            }
          );
        }
      };
      this.handleExcludeSuffixToggle = (isExcludeSuffixOpen) => {
        this.setState({
          isExcludeSuffixOpen
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeSuffixClear = () => {
        this.setState({
          excludeSuffix: [],
          isExcludeSuffixOpen: false
        }, () => {
          this.validate();
        });
      };
      this.onExcludeSuffixCreateOption = (newValue) => {
        if (!this.state.excludeSuffix.includes(newValue)) {
          this.setState({
            excludeSuffix: [...this.state.excludeSuffix, newValue],
            isExcludeSuffixOpen: false
          }, () => {
            this.validate();
          });
        }
      };
      this.updateFields = this.updateFields.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.validate = this.validate.bind(this);
      this.handleSavePlugin = this.handleSavePlugin.bind(this);
    }
    validate() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "excludeSuffix"
      ];
      for (const attr of dnAttrs) {
        for (const dnAttr of this.state[attr]) {
          if (!valid_dn(dnAttr)) {
            errObj[attr] = true;
            all_good = false;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "isReplicated",
          "maxAge",
          "maxAgeUnit",
          "trimInterval"
        ];
        const attrLists = [
          "excludeSuffix",
          "excludeAttrs"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
          }
        }
        for (const check_list of attrLists) {
          if (!listsEqual(this.state[check_list], this.state["_" + check_list])) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Retro Changelog Plugin");
        let maxAge = 0;
        let maxAgeUnit = "w";
        if (pluginRow["nsslapd-changelogmaxage"] !== void 0) {
          maxAge = Number(pluginRow["nsslapd-changelogmaxage"][0].slice(0, -1)) === 0 ? 0 : Number(pluginRow["nsslapd-changelogmaxage"][0].slice(0, -1));
          maxAgeUnit = pluginRow["nsslapd-changelogmaxage"][0] !== "" ? pluginRow["nsslapd-changelogmaxage"][0].slice(-1).toLowerCase() : "w";
        }
        this.setState({
          isReplicated: !(pluginRow.isReplicated === void 0 || pluginRow.isReplicated[0] === "FALSE"),
          excludeSuffix: pluginRow["nsslapd-exclude-suffix"] === void 0 ? [] : pluginRow["nsslapd-exclude-suffix"],
          excludeAttrs: pluginRow["nsslapd-exclude-attrs"] === void 0 ? [] : pluginRow["nsslapd-exclude-attrs"],
          maxAge,
          maxAgeUnit,
          trimInterval: pluginRow["nsslapd-changelog-trim-interval"] === void 0 ? 300 : pluginRow["nsslapd-changelog-trim-interval"][0],
          _isReplicated: !(pluginRow.isReplicated === void 0 || pluginRow.isReplicated[0] === "FALSE"),
          _excludeSuffix: pluginRow["nsslapd-exclude-suffix"] === void 0 ? [] : pluginRow["nsslapd-exclude-suffix"],
          _excludeAttrs: pluginRow["nsslapd-exclude-attrs"] === void 0 ? [] : pluginRow["nsslapd-exclude-attrs"],
          _maxAge: maxAge,
          _maxAgeUnit: maxAgeUnit,
          _trimInterval: pluginRow["nsslapd-changelog-trim-interval"] === void 0 ? 300 : pluginRow["nsslapd-changelog-trim-interval"][0]
        });
      }
    }
    handleSavePlugin() {
      const maxAge = this.state.maxAge.toString() + this.state.maxAgeUnit;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "retro-changelog",
        "set",
        "--is-replicated",
        this.state.isReplicated ? "TRUE" : "FALSE",
        "--max-age",
        maxAge || "delete",
        "--trim-interval",
        this.state.trimInterval.toString() || "300"
      ];
      if (this.state._excludeSuffix !== this.state.excludeSuffix) {
        cmd = [...cmd, "--exclude-suffix"];
        if (this.state.excludeSuffix.length !== 0) {
          for (const value of this.state.excludeSuffix) {
            cmd = [...cmd, value];
          }
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      if (this.state._excludeAttrs !== this.state.excludeAttrs) {
        cmd = [...cmd, "--exclude-attrs"];
        if (this.state.excludeAttrs.length !== 0) {
          for (const value of this.state.excludeAttrs) {
            cmd = [...cmd, value];
          }
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      this.setState({
        saving: true
      });
      log_cmd("handleSavePlugin", "update retrocl", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Successfully updated the Retro Changelog`
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to update Retro Changelog Plugin - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      });
    }
    render() {
      const {
        isReplicated,
        maxAge,
        maxAgeUnit,
        excludeSuffix,
        excludeAttrs,
        trimInterval,
        saving,
        error
      } = this.state;
      let saveBtnName = "Save";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Saving ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react20.default.createElement("div", { className: saving ? "ds-disabled" : "" }, /* @__PURE__ */ import_react20.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "Retro Changelog Plugin",
          pluginName: "Retro Changelog",
          cmdName: "retro-changelog",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react20.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react20.default.createElement(Grid, { title: "This attribute specifies the suffix which will be excluded from the scope of the plugin (nsslapd-exclude-suffix)" }, /* @__PURE__ */ import_react20.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Exclude Suffix"), /* @__PURE__ */ import_react20.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react20.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a suffix",
            onToggle: this.handleExcludeSuffixToggle,
            onSelect: this.handleExcludeSuffixSelect,
            onClear: this.handleExcludeSuffixClear,
            selections: excludeSuffix,
            isOpen: this.state.isExcludeSuffixOpen,
            "aria-labelledby": "typeAhead-config-exclude-suffix",
            placeholderText: "Type a suffix...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleSubtreeScopeCreateOption,
            validated: error.excludeSuffix ? ValidatedOptions.error : ValidatedOptions.default
          },
          [""].map((attr, index) => /* @__PURE__ */ import_react20.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ), /* @__PURE__ */ import_react20.default.createElement(FormHelperText, { isError: true, isHidden: !error.excludeSuffix }, "Values must be valid DN !")), /* @__PURE__ */ import_react20.default.createElement(GridItem, { className: "ds-left-margin", span: 2 }, /* @__PURE__ */ import_react20.default.createElement(
          Checkbox,
          {
            id: "isReplicated",
            isChecked: isReplicated,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            title: "Sets a flag to indicate on a change in the changelog whether the change is newly made on that server or whether it was replicated over from another server (isReplicated)",
            label: "Is Replicated"
          }
        ))), /* @__PURE__ */ import_react20.default.createElement(Grid, { title: "This specifies attribute which will be excluded from the scope of the plugin (nsslapd-exclude-attrs)" }, /* @__PURE__ */ import_react20.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Exclude attribute"), /* @__PURE__ */ import_react20.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react20.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: this.handleExcludeAttrToggle,
            onSelect: this.handleExcludeAttrSelect,
            onClear: this.handleExcludeAttrClear,
            selections: excludeAttrs,
            isOpen: this.state.isExcludeAttrOpen,
            "aria-labelledby": "typeAhead-config-exclude-attr",
            placeholderText: "Type an attribute...",
            noResultsFoundText: "There are no matching entries",
            validated: error.excludeAttrs ? ValidatedOptions.error : ValidatedOptions.default
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react20.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react20.default.createElement(Grid, { title: "Specifies the maximum age of any entry in the changelog before it is trimmed from the database (nsslapd-changelogmaxage)" }, /* @__PURE__ */ import_react20.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Max Age"), /* @__PURE__ */ import_react20.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react20.default.createElement(
          NumberInput,
          {
            value: maxAge,
            min: 0,
            max: this.maxValue,
            onMinus: this.handleMinusConfig,
            onChange: this.handleMaxAgeChange,
            onPlus: this.handlePlusConfig,
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        )), /* @__PURE__ */ import_react20.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react20.default.createElement(
          FormSelect,
          {
            className: "ds-margin-left",
            id: "maxAgeUnit",
            value: maxAgeUnit,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input",
            isDisabled: maxAge === 0
          },
          /* @__PURE__ */ import_react20.default.createElement(FormSelectOption, { key: "1", value: "w", label: "Weeks" }),
          /* @__PURE__ */ import_react20.default.createElement(FormSelectOption, { key: "2", value: "d", label: "Days" }),
          /* @__PURE__ */ import_react20.default.createElement(FormSelectOption, { key: "3", value: "h", label: "Hours" }),
          /* @__PURE__ */ import_react20.default.createElement(FormSelectOption, { key: "4", value: "m", label: "Minutes" })
        ))), /* @__PURE__ */ import_react20.default.createElement(Grid, { className: "ds-margin-top", title: "Sets in seconds how often the plugin checks if changes can be trimmed from the database based on the entry's max age (nsslapd-changelog-trim-interval)" }, /* @__PURE__ */ import_react20.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Trimming Interval"), /* @__PURE__ */ import_react20.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react20.default.createElement(
          NumberInput,
          {
            value: trimInterval,
            min: 0,
            max: this.maxValue,
            onMinus: this.handleMinusTrim,
            onChange: this.handleTrimChange,
            onPlus: this.handlePlusTrim,
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        )))),
        /* @__PURE__ */ import_react20.default.createElement(
          Button,
          {
            className: "ds-margin-top-xlg",
            variant: "primary",
            onClick: this.handleSavePlugin,
            isDisabled: this.state.saveBtnDisabled || this.state.saving,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )
      ));
    }
  };
  RetroChangelog.propTypes = {
    rows: import_prop_types15.default.array,
    serverId: import_prop_types15.default.string,
    savePluginHandler: import_prop_types15.default.func,
    pluginListHandler: import_prop_types15.default.func,
    addNotification: import_prop_types15.default.func,
    toggleLoadingHandler: import_prop_types15.default.func
  };
  RetroChangelog.defaultProps = {
    rows: [],
    serverId: ""
  };
  var retroChangelog_default = RetroChangelog;

  // src/lib/plugins/rootDNAccessControl.jsx
  var import_react21 = __toESM(require_react(), 1);
  var import_prop_types16 = __toESM(require_prop_types(), 1);
  var RootDNAccessControl = class extends import_react21.default.Component {
    componentDidMount(prevProps) {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        saving: false,
        saveBtnDisabled: true,
        error: {},
        // Settings
        allowHost: [],
        allowHostOptions: [],
        denyHost: [],
        denyHostOptions: [],
        allowIP: [],
        allowIPOptions: [],
        denyIP: [],
        denyIPOptions: [],
        openTime: "0000",
        closeTime: "1159",
        daysAllowed: "",
        allowMon: false,
        allowTue: false,
        allowWed: false,
        allowThu: false,
        allowFri: false,
        allowSat: false,
        allowSun: false,
        // original values
        _allowHost: [],
        _denyHost: [],
        _allowIP: [],
        _denyIP: [],
        _openTime: "00:00",
        _closeTime: "23:59",
        _daysAllowed: "",
        _allowMon: false,
        _allowTue: false,
        _allowWed: false,
        _allowThu: false,
        _allowFri: false,
        _allowSat: false,
        _allowSun: false,
        // Typeahead state
        isAllowHostOpen: false,
        isDenyHostOpen: false,
        isAllowIPOpen: false,
        isDenyIPOpen: false
      };
      this.handleAllowHostSelect = (event, selection) => {
        if (this.state.allowHost.includes(selection)) {
          this.setState(
            (prevState) => ({
              allowHost: prevState.allowHost.filter((item) => item !== selection),
              isAllowHostOpen: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              allowHost: [...prevState.allowHost, selection],
              isAllowHostOpen: false
            })
          );
        }
      };
      this.handleAllowHostToggle = (isAllowHostOpen) => {
        this.setState({
          isAllowHostOpen
        });
      };
      this.handleAllowHostClear = () => {
        this.setState({
          allowHost: [],
          isAllowHostOpen: false
        });
      };
      this.handleAllowHostCreateOption = (newValue) => {
        if (!this.state.allowHostOptions.includes(newValue)) {
          this.setState({
            allowHostOptions: [...this.state.allowHostOptions, newValue],
            isAllowHostOpen: false
          });
        }
      };
      this.handleDenyHostSelect = (event, selection) => {
        if (this.state.denyHost.includes(selection)) {
          this.setState(
            (prevState) => ({
              denyHost: prevState.denyHost.filter((item) => item !== selection),
              isDenyHostOpen: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              denyHost: [...prevState.denyHost, selection],
              isDenyHostOpen: false
            })
          );
        }
      };
      this.handleDenyHostToggle = (isDenyHostOpen) => {
        this.setState({
          isDenyHostOpen
        });
      };
      this.handleDenyHostClear = () => {
        this.setState({
          denyHost: [],
          isDenyHostOpen: false
        });
      };
      this.handleDenyHostCreateOption = (newValue) => {
        if (!this.state.denyHostOptions.includes(newValue)) {
          this.setState({
            denyHostOptions: [...this.state.denyHostOptions, newValue],
            isDenyHostOpen: false
          });
        }
      };
      this.handleAllowIPSelect = (event, selection) => {
        if (this.state.allowIP.includes(selection)) {
          this.setState(
            (prevState) => ({
              allowIP: prevState.allowIP.filter((item) => item !== selection),
              isAllowIPOpen: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              allowIP: [...prevState.allowIP, selection],
              isAllowIPOpen: false
            })
          );
        }
      };
      this.handleAllowIPToggle = (isAllowIPOpen) => {
        this.setState({
          isAllowIPOpen
        });
      };
      this.handleAllowIPClear = () => {
        this.setState({
          allowIP: [],
          isAllowIPOpen: false
        });
      };
      this.handleAllowIPCreateOption = (newValue) => {
        if (!this.state.allowIPOptions.includes(newValue)) {
          this.setState({
            allowIPOptions: [...this.state.allowIPOptions, newValue],
            isAllowIPOpen: false
          });
        }
      };
      this.handleDenyIPSelect = (event, selection) => {
        if (this.state.denyIP.includes(selection)) {
          this.setState(
            (prevState) => ({
              denyIP: prevState.denyIP.filter((item) => item !== selection),
              isDenyIPOpen: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              denyIP: [...prevState.denyIP, selection],
              isDenyIPOpen: false
            })
          );
        }
      };
      this.handleDenyIPToggle = (isDenyIPOpen) => {
        this.setState({
          isDenyIPOpen
        });
      };
      this.handleDenyIPClear = () => {
        this.setState({
          denyIP: [],
          isDenyIPOpen: false
        });
      };
      this.handleDenyIPCreateOption = (newValue) => {
        if (!this.state.denyIPOptions.includes(newValue)) {
          this.setState({
            denyIPOptions: [...this.state.denyIPOptions, newValue],
            isDenyIPOpen: false
          });
        }
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.handleSavePlugin = this.handleSavePlugin.bind(this);
      this.updateFields = this.updateFields.bind(this);
      this.validate = this.validate.bind(this);
    }
    validate() {
      const errObj = {};
      let all_good = false;
      const dayAttrs = [
        "allowMon",
        "allowTue",
        "allowWed",
        "allowThu",
        "allowFri",
        "allowSat",
        "allowSun"
      ];
      for (const check_attr of dayAttrs) {
        if (this.state[check_attr]) {
          all_good = true;
          break;
        }
      }
      if (!all_good) {
        errObj.daysAllowed = true;
      } else {
        all_good = false;
        const attrLists = [
          "allowHost",
          "denyHost",
          "allowIP",
          "denyIP"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const attrs = [
          "openTime",
          "closeTime",
          "allowMon",
          "allowTue",
          "allowWed",
          "allowThu",
          "allowFri",
          "allowSat",
          "allowSun"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    handleTimeChange(id, time_str) {
      const time_val = time_str.replace(":", "");
      this.setState({
        [id]: time_val
      }, () => {
        this.validate();
      });
    }
    updateFields() {
      let allowHostList = [];
      let denyHostList = [];
      let allowIPList = [];
      let denyIPList = [];
      const daysAllowed = {};
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "RootDN Access Control");
        if (pluginRow["rootdn-allow-host"] !== void 0) {
          for (const value of pluginRow["rootdn-allow-host"]) {
            allowHostList = [...allowHostList, value];
          }
        }
        if (pluginRow["rootdn-deny-host"] !== void 0) {
          for (const value of pluginRow["rootdn-deny-host"]) {
            denyHostList = [...denyHostList, value];
          }
        }
        if (pluginRow["rootdn-allow-ip"] !== void 0) {
          for (const value of pluginRow["rootdn-allow-ip"]) {
            allowIPList = [...allowIPList, value];
          }
        }
        if (pluginRow["rootdn-deny-ip"] !== void 0) {
          for (const value of pluginRow["rootdn-deny-ip"]) {
            denyIPList = [...denyIPList, value];
          }
        }
        if (pluginRow["rootdn-days-allowed"] !== void 0) {
          const daysStr = pluginRow["rootdn-days-allowed"][0].toLowerCase();
          for (const day of ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]) {
            if (daysStr.includes(day.toLowerCase())) {
              daysAllowed["allow" + day] = true;
              daysAllowed["_allow" + day] = true;
            }
          }
        }
        let openTime = "00:00";
        if (pluginRow["rootdn-open-time"] !== void 0) {
          const openHour = pluginRow["rootdn-open-time"][0].substring(0, 2);
          const openMin = pluginRow["rootdn-open-time"][0].substring(2, 4);
          openTime = openHour + ":" + openMin;
        }
        let closeTime = "11:59";
        if (pluginRow["rootdn-close-time"] !== void 0) {
          const closeHour = pluginRow["rootdn-close-time"][0].substring(0, 2);
          const closeMin = pluginRow["rootdn-close-time"][0].substring(2, 4);
          closeTime = closeHour + ":" + closeMin;
        }
        this.setState({
          openTime,
          closeTime,
          daysAllowed,
          denyIP: denyIPList,
          allowIP: allowIPList,
          denyHost: denyHostList,
          allowHost: allowHostList,
          ...daysAllowed,
          _openTime: pluginRow["rootdn-open-time"] === void 0 ? "" : pluginRow["rootdn-open-time"][0],
          _closeTime: pluginRow["rootdn-close-time"] === void 0 ? "" : pluginRow["rootdn-close-time"][0],
          _daysAllowed: daysAllowed,
          _denyIP: denyIPList,
          _allowIP: allowIPList,
          _denyHost: denyHostList,
          _allowHost: allowHostList
        });
      }
    }
    handleSavePlugin() {
      let daysAllowed = "";
      for (const day of ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]) {
        if (this.state["allow" + day]) {
          daysAllowed += day + ",";
        }
      }
      daysAllowed = daysAllowed.substring(0, daysAllowed.length - 1);
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "root-dn",
        "set",
        "--open-time",
        this.state.openTime.replace(":", "") || "delete",
        "--close-time",
        this.state.closeTime.replace(":", "") || "delete",
        "--days-allowed",
        daysAllowed || "delete"
      ];
      cmd = [...cmd, "--allow-host"];
      if (this.state.allowHost.length !== 0) {
        for (const value of this.state.allowHost) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--deny-host"];
      if (this.state.denyHost.length !== 0) {
        for (const value of this.state.denyHost) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--allow-ip"];
      if (this.state.allowIP.length !== 0) {
        for (const value of this.state.allowIP) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--allow-host"];
      if (this.state.allowHost.length !== 0) {
        for (const value of this.state.allowHost) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        saving: true
      });
      log_cmd("handleSavePlugin", "Update Root DN access control", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Successfully updated the RootDN Access Control`
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to update RootDN Access Control Plugin - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      });
    }
    render() {
      const {
        allowHost,
        denyHost,
        allowIP,
        denyIP,
        openTime,
        closeTime,
        allowMon,
        allowTue,
        allowWed,
        allowThu,
        allowFri,
        allowSat,
        allowSun,
        error,
        saveBtnDisabled,
        saving
      } = this.state;
      let saveBtnName = "Save";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Saving ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react21.default.createElement("div", { className: saving ? "ds-disabled" : "" }, /* @__PURE__ */ import_react21.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "RootDN Access Control",
          pluginName: "RootDN Access Control",
          cmdName: "root-dn",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react21.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react21.default.createElement(Grid, { title: "Sets what hosts, by fully-qualified domain name, the root user is allowed to use to access the Directory Server. Wildcards are accepted. Any hosts not listed are implicitly denied (rootdn-allow-host)" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Allow Host"), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react21.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a hostname ",
            onToggle: this.handleAllowHostToggle,
            onSelect: this.handleAllowHostSelect,
            onClear: this.handleAllowHostClear,
            selections: allowHost,
            isOpen: this.state.isAllowHostOpen,
            "aria-labelledby": "typeAhead-allow-host",
            placeholderText: "Type a hostname ...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleAllowHostCreateOption
          },
          this.state.allowHostOptions.map((host, index) => /* @__PURE__ */ import_react21.default.createElement(
            SelectOption,
            {
              key: index,
              value: host
            }
          ))
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { title: "Sets what hosts, by fully-qualified domain name, the root user is not allowed to use to access the Directory Server.  Wildcards are accepted.  Any hosts not listed are implicitly allowed (rootdn-deny-host). If a host address is listed in both the rootdn-allow-host and rootdn-deny-host attributes, it is denied access." }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Deny Host"), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react21.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a hostname ",
            onToggle: this.handleDenyHostToggle,
            onSelect: this.handleDenyHostSelect,
            onClear: this.handleDenyHostClear,
            selections: denyHost,
            isOpen: this.state.isDenyHostOpen,
            "aria-labelledby": "typeAhead-deny-host",
            placeholderText: "Type a hostname ...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleDenyHostCreateOption
          },
          this.state.denyHostOptions.map((host, index) => /* @__PURE__ */ import_react21.default.createElement(
            SelectOption,
            {
              key: index,
              value: host
            }
          ))
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { title: "Sets what IP addresses, either IPv4 or IPv6, for machines the root user is allowed to use to access the Directory Server. Wildcards are accepted.  Any IP addresses not listed are implicitly denied (rootdn-allow-ip)" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Allow IP address"), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react21.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an IP address",
            onToggle: this.handleAllowIPToggle,
            onSelect: this.handleAllowIPSelect,
            onClear: this.handleAllowIPClear,
            selections: allowIP,
            isOpen: this.state.isAllowIPOpen,
            "aria-labelledby": "typeAhead-allow-ip",
            placeholderText: "Type an IP address ...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleAllowIPCreateOption
          },
          this.state.allowIPOptions.map((ip, index) => /* @__PURE__ */ import_react21.default.createElement(
            SelectOption,
            {
              key: index,
              value: ip
            }
          ))
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { title: "Sets what IP addresses, either IPv4 or IPv6, for machines the root user is not allowed to use to access the Directory Server. Wildcards are accepted. Any IP addresses not listed are implicitly allowed (rootdn-deny-ip) If an IP address is listed in both the rootdn-allow-ip and rootdn-deny-ip attributes, it is denied access." }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Deny IP address"), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react21.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an IP address",
            onToggle: this.handleDenyIPToggle,
            onSelect: this.handleDenyIPSelect,
            onClear: this.handleDenyIPClear,
            selections: denyIP,
            isOpen: this.state.isDenyIPOpen,
            "aria-labelledby": "typeAhead-deny-ip",
            placeholderText: "Type an IP address ...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: this.handleDenyIPCreateOption
          },
          this.state.denyIPOptions.map((ip, index) => /* @__PURE__ */ import_react21.default.createElement(
            SelectOption,
            {
              key: index,
              value: ip
            }
          ))
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { title: "Sets part of a time period or range when the root user is allowed to access the Directory Server. This sets when the time-based access begins (rootdn-open-time)" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Open Time"), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react21.default.createElement(
          TimePicker,
          {
            time: openTime,
            onChange: (str) => {
              this.handleTimeChange("openTime", str);
            },
            is24Hour: true
          }
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { title: "Sets part of a time period or range when the root user is allowed to access the Directory Server. This sets when the time-based access ends (rootdn-close-time)" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Close Time"), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react21.default.createElement(
          TimePicker,
          {
            time: closeTime,
            onChange: (str) => {
              this.handleTimeChange("closeTime", str);
            },
            is24Hour: true
          }
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { title: "Gives a comma-separated list of what days the root user is allowed to use to access the Directory Server. Any days listed are implicitly denied (rootdn-days-allowed)" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 12, className: "ds-label" }, "Days To Allow Access"), /* @__PURE__ */ import_react21.default.createElement(GridItem, { className: "ds-margin-left", span: 9 }, /* @__PURE__ */ import_react21.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react21.default.createElement(
          Checkbox,
          {
            id: "allowMon",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            name,
            isChecked: allowMon,
            label: "Monday"
          }
        )), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react21.default.createElement(
          Checkbox,
          {
            id: "allowFri",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            name,
            isChecked: allowFri,
            label: "Friday"
          }
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react21.default.createElement(
          Checkbox,
          {
            id: "allowTue",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            name,
            isChecked: allowTue,
            label: "Tuesday"
          }
        )), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react21.default.createElement(
          Checkbox,
          {
            id: "allowSat",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            name,
            isChecked: allowSat,
            label: "Saturday"
          }
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react21.default.createElement(
          Checkbox,
          {
            id: "allowWed",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            name,
            isChecked: allowWed,
            label: "Wednesday"
          }
        )), /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react21.default.createElement(
          Checkbox,
          {
            id: "allowSun",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            name,
            isChecked: allowSun,
            label: "Sunday"
          }
        ))), /* @__PURE__ */ import_react21.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react21.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react21.default.createElement(
          Checkbox,
          {
            id: "allowThu",
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            name,
            isChecked: allowThu,
            label: "Thursday"
          }
        ))), /* @__PURE__ */ import_react21.default.createElement(FormHelperText, { isError: true, isHidden: !error.daysAllowed }, "You must set at least one day")))),
        /* @__PURE__ */ import_react21.default.createElement(
          Button,
          {
            className: "ds-margin-top-lg",
            variant: "primary",
            onClick: this.handleSavePlugin,
            isDisabled: saveBtnDisabled || saving,
            isLoading: saving,
            spinnerAriaValueText: saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )
      ));
    }
  };
  RootDNAccessControl.propTypes = {
    rows: import_prop_types16.default.array,
    serverId: import_prop_types16.default.string,
    savePluginHandler: import_prop_types16.default.func,
    pluginListHandler: import_prop_types16.default.func,
    addNotification: import_prop_types16.default.func,
    toggleLoadingHandler: import_prop_types16.default.func
  };
  RootDNAccessControl.defaultProps = {
    rows: [],
    serverId: ""
  };
  var rootDNAccessControl_default = RootDNAccessControl;

  // src/lib/plugins/usn.jsx
  var import_react22 = __toESM(require_react(), 1);
  var import_prop_types17 = __toESM(require_prop_types(), 1);
  var USNPlugin = class extends import_react22.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadSuffixList();
          this.updateSwitch();
        }
      }
    }
    constructor(props) {
      super(props);
      this.handleRunCleanup = this.handleRunCleanup.bind(this);
      this.handleToggleCleanupModal = this.handleToggleCleanupModal.bind(this);
      this.updateSwitch = this.updateSwitch.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.loadSuffixList = this.loadSuffixList.bind(this);
      this.state = {
        firstLoad: true,
        globalMode: false,
        disableSwitch: false,
        cleanupModalShow: false,
        cleanupSuffix: "",
        cleanupMaxUSN: 0,
        suffixList: [],
        pluginEnabled: false
      };
      this.minValue = 0;
      this.maxValue = 2e7;
      this.handleMinusConfig = () => {
        this.setState({
          cleanupMaxUSN: Number(this.state.cleanupMaxUSN) - 1
        });
      };
      this.handleConfigChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          cleanupMaxUSN: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        });
      };
      this.handlePlusConfig = (id) => {
        this.setState({
          cleanupMaxUSN: Number(this.state.cleanupMaxUSN) + 1
        });
      };
    }
    loadSuffixList() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "list",
        "--suffix"
      ];
      log_cmd("loadSuffixList", "Get a list of all the suffixes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const suffixList = JSON.parse(content);
        this.setState({
          suffixList: suffixList.items,
          cleanupSuffix: suffixList.items[0]
        });
      });
    }
    handleFieldChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      });
    }
    handleSwitchChange(value) {
      const { serverId, addNotification, toggleLoadingHandler } = this.props;
      const new_status = this.state.globalMode ? "off" : "on";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "plugin",
        "usn",
        "global",
        new_status
      ];
      toggleLoadingHandler();
      this.setState({ disableSwitch: true });
      log_cmd("handleSwitchChange", "Switch global USN mode from the USN plugin tab", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        this.updateSwitch();
        addNotification(
          "success",
          `Global USN mode was successfully set to ${new_status}.`
        );
        toggleLoadingHandler();
        this.setState({ disableSwitch: false });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        addNotification(
          "error",
          `Error during global USN mode modification - ${errMsg.desc}`
        );
        toggleLoadingHandler();
        this.setState({ disableSwitch: false });
      });
    }
    updateSwitch() {
      this.setState({
        firstLoad: false,
        disableSwitch: true
      });
      const pluginRow = this.props.rows.find((row) => row.cn[0] === "USN");
      let pluginEnabled = false;
      if (pluginRow["nsslapd-pluginEnabled"][0] === "on") {
        pluginEnabled = true;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get",
        "nsslapd-entryusn-global"
      ];
      this.props.toggleLoadingHandler();
      log_cmd("updateSwitch", "Get global USN status", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const usnGlobalAttr = myObject.attrs["nsslapd-entryusn-global"][0];
        this.setState({
          globalMode: !(usnGlobalAttr === "off"),
          pluginEnabled,
          disableSwitch: false
        });
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = JSON.parse(err);
          console.log("Get global USN failed", errMsg.desc);
        }
        this.setState({
          disableSwitch: false
        });
        this.props.toggleLoadingHandler();
      });
    }
    handleToggleCleanupModal() {
      this.setState((prevState) => ({
        cleanupModalShow: !prevState.cleanupModalShow,
        cleanupSuffix: prevState.suffixList[0],
        cleanupMaxUSN: 0
      }));
    }
    handleRunCleanup() {
      if (!this.state.cleanupSuffix) {
        this.props.addNotification("warning", "Suffix is required.");
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "usn",
          "cleanup"
        ];
        if (this.state.cleanupSuffix) {
          cmd = [...cmd, "--suffix=" + this.state.cleanupSuffix];
        }
        if (this.state.cleanupMaxUSN > 0) {
          cmd = [...cmd, "--max-usn=" + this.state.cleanupMaxUSN];
        }
        this.props.toggleLoadingHandler();
        log_cmd("handleRunCleanup", "Run cleanup USN tombstones", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          this.props.addNotification(
            "success",
            `Cleanup USN Tombstones task was successfull`
          );
          this.props.toggleLoadingHandler();
          this.setState({
            cleanupModalShow: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Cleanup USN Tombstones task has failed ${errMsg.desc}`
          );
          this.props.toggleLoadingHandler();
          this.setState({
            cleanupModalShow: false
          });
        });
      }
    }
    render() {
      const {
        globalMode,
        disableSwitch,
        cleanupModalShow,
        cleanupSuffix,
        cleanupMaxUSN,
        suffixList
      } = this.state;
      return /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "USN Tombstone Cleanup Task",
          "aria-labelledby": "ds-modal",
          isOpen: cleanupModalShow,
          onClose: this.handleToggleCleanupModal,
          actions: [
            /* @__PURE__ */ import_react22.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleRunCleanup }, "Run"),
            /* @__PURE__ */ import_react22.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleToggleCleanupModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react22.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react22.default.createElement(Grid, { title: "Gives the suffix in the Directory Server to run the cleanup operation against" }, /* @__PURE__ */ import_react22.default.createElement(GridItem, { span: 4 }, "Cleanup Suffix"), /* @__PURE__ */ import_react22.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react22.default.createElement(
          FormSelect,
          {
            id: "configAutoAddOC",
            value: cleanupSuffix,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          suffixList.map((attr) => /* @__PURE__ */ import_react22.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }))
        ))), /* @__PURE__ */ import_react22.default.createElement(Grid, { title: "Gives the highest USN value to delete when removing tombstone entries. All tombstone entries up to and including that number are deleted. Tombstone entries with higher USN values (that means more recent entries) are not deleted" }, /* @__PURE__ */ import_react22.default.createElement(GridItem, { span: 4 }, "Cleanup Max USN"), /* @__PURE__ */ import_react22.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react22.default.createElement(
          NumberInput,
          {
            value: cleanupMaxUSN,
            min: this.minValue,
            max: this.maxValue,
            onMinus: this.handleMinusConfig,
            onChange: this.handleConfigChange,
            onPlus: this.handlePlusConfig,
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))))
      ), /* @__PURE__ */ import_react22.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "USN",
          pluginName: "Update Sequence Numbers",
          cmdName: "usn",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react22.default.createElement(
          Tooltip,
          {
            maxWidth: 500,
            content: /* @__PURE__ */ import_react22.default.createElement("div", null, "The USN Plug-in enables LDAP clients and servers to identify if entries have been changed. When the USN Plug-in is enabled, update sequence numbers (USNs) are sequential numbers that are assigned to an entry whenever a write operation is performed against the entry. (Write operations include add, modify, modrdn, and delete operations. Internal database operations, like export operations, are not counted in the update sequence.) A USN counter keeps track of the most recently assigned USN.", /* @__PURE__ */ import_react22.default.createElement("br", null), /* @__PURE__ */ import_react22.default.createElement("br", null), "The USN plug-in also moves entries to tombstone entries when the entry is deleted. If replication is enabled, then separate tombstone entries are kept by both the USN and Replication plug-in. Note that both tombstone entries are deleted by the replication process.")
          },
          /* @__PURE__ */ import_react22.default.createElement("a", { className: "ds-font-size-sm" }, "What is the USN Plugin?")
        ),
        /* @__PURE__ */ import_react22.default.createElement(Form, null, /* @__PURE__ */ import_react22.default.createElement(Grid, { className: "ds-margin-top-xlg", title: "Enable entryUSN assignment across all backends, instead of per backend." }, /* @__PURE__ */ import_react22.default.createElement(GridItem, { span: 3, className: "ds-label" }, "USN Global"), /* @__PURE__ */ import_react22.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react22.default.createElement(
          Switch,
          {
            id: "globalMode",
            isChecked: globalMode,
            onChange: () => this.handleSwitchChange(globalMode),
            isDisabled: disableSwitch
          }
        ))), /* @__PURE__ */ import_react22.default.createElement(Grid, { title: "This task deletes the tombstone entries maintained by the USN plugin.  This task should not run against a suffix that is being replicated" }, /* @__PURE__ */ import_react22.default.createElement(GridItem, { className: "ds-label ds-margin-top", span: 3 }, "Tombstone Cleanup Task", /* @__PURE__ */ import_react22.default.createElement(WrenchIcon, { className: "ds-left-margin" })), /* @__PURE__ */ import_react22.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react22.default.createElement(Button, { className: "ds-margin-top", variant: "primary", isDisabled: !this.state.pluginEnabled, onClick: this.handleToggleCleanupModal }, "Run Task"))))
      ));
    }
  };
  USNPlugin.propTypes = {
    rows: import_prop_types17.default.array,
    serverId: import_prop_types17.default.string,
    savePluginHandler: import_prop_types17.default.func,
    pluginListHandler: import_prop_types17.default.func,
    addNotification: import_prop_types17.default.func,
    toggleLoadingHandler: import_prop_types17.default.func
  };
  USNPlugin.defaultProps = {
    rows: [],
    serverId: ""
  };
  var usn_default = USNPlugin;

  // src/lib/plugins/winsync.jsx
  var import_react23 = __toESM(require_react(), 1);
  var import_prop_types18 = __toESM(require_prop_types(), 1);
  var WinSync = class extends import_react23.default.Component {
    componentDidMount(prevProps) {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        fixupModalShow: false,
        fixupDN: "",
        fixupFilter: "",
        saveBtnDisabled: true,
        saveBtnDisabledModal: true,
        saving: false,
        savingModal: false,
        error: {},
        // Settings
        posixWinsyncCreateMemberOfTask: false,
        posixWinsyncLowerCaseUID: false,
        posixWinsyncMapMemberUID: false,
        posixWinsyncMapNestedGrouping: false,
        posixWinsyncMsSFUSchema: false,
        // Original values
        _posixWinsyncCreateMemberOfTask: false,
        _posixWinsyncLowerCaseUID: false,
        _posixWinsyncMapMemberUID: false,
        _posixWinsyncMapNestedGrouping: false,
        _posixWinsyncMsSFUSchema: false
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.updateFields = this.updateFields.bind(this);
      this.handleRunFixup = this.handleRunFixup.bind(this);
      this.handleToggleFixupModal = this.handleToggleFixupModal.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.handleSavePlugin = this.handleSavePlugin.bind(this);
    }
    handleToggleFixupModal() {
      this.setState((prevState) => ({
        fixupModalShow: !prevState.fixupModalShow,
        fixupDN: "",
        fixupFilter: "",
        savingModal: false
      }));
    }
    handleRunFixup() {
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "posix-winsync",
        "fixup",
        this.state.fixupDN
      ];
      if (this.state.fixupFilter) {
        cmd = [...cmd, "--filter", this.state.fixupFilter];
      }
      this.setState({
        savingModal: true
      });
      log_cmd("handleRunFixup", "Run Member UID task", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          `Fixup task for ${this.state.fixupDN} was successfully started`
        );
        this.setState({
          fixupModalShow: false,
          savingModal: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Fixup task for ${this.state.fixupDN} has failed ${errMsg.desc}`
        );
        this.setState({
          fixupModalShow: false,
          savingModal: false
        });
      });
    }
    validateConfig() {
      let all_good = false;
      const attrs = [
        "posixWinsyncCreateMemberOfTask",
        "posixWinsyncLowerCaseUID",
        "posixWinsyncMapMemberUID",
        "posixWinsyncMapNestedGrouping",
        "posixWinsyncMsSFUSchema"
      ];
      for (const check_attr of attrs) {
        if (this.state[check_attr] !== this.state["_" + check_attr]) {
          all_good = true;
          break;
        }
      }
      this.setState({
        saveBtnDisabled: !all_good
      });
    }
    validateModal() {
      const errObj = {};
      let all_good = true;
      if (!valid_dn(this.state.fixupDN)) {
        all_good = false;
        errObj.fixupDN = true;
      }
      if (this.state.fixupFilter === "") {
        all_good = false;
        errObj.fixupFilter = true;
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        error: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateConfig();
      });
    }
    handleModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateModal();
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Posix Winsync API");
        this.setState({
          posixWinsyncCreateMemberOfTask: !(pluginRow.posixwinsynccreatememberoftask === void 0 || pluginRow.posixwinsynccreatememberoftask[0] === "false"),
          posixWinsyncLowerCaseUID: !(pluginRow.posixwinsynclowercaseuid === void 0 || pluginRow.posixwinsynclowercaseuid[0] === "false"),
          posixWinsyncMapMemberUID: !(pluginRow.posixwinsyncmapmemberuid === void 0 || pluginRow.posixwinsyncmapmemberuid[0] === "false"),
          posixWinsyncMapNestedGrouping: !(pluginRow.posixwinsyncmapnestedgrouping === void 0 || pluginRow.posixwinsyncmapnestedgrouping[0] === "false"),
          posixWinsyncMsSFUSchema: !(pluginRow.posixwinsyncmssfuschema === void 0 || pluginRow.posixwinsyncmssfuschema[0] === "false"),
          _posixWinsyncCreateMemberOfTask: !(pluginRow.posixwinsynccreatememberoftask === void 0 || pluginRow.posixwinsynccreatememberoftask[0] === "false"),
          _posixWinsyncLowerCaseUID: !(pluginRow.posixwinsynclowercaseuid === void 0 || pluginRow.posixwinsynclowercaseuid[0] === "false"),
          _posixWinsyncMapMemberUID: !(pluginRow.posixwinsyncmapmemberuid === void 0 || pluginRow.posixwinsyncmapmemberuid[0] === "false"),
          _posixWinsyncMapNestedGrouping: !(pluginRow.posixwinsyncmapnestedgrouping === void 0 || pluginRow.posixwinsyncmapnestedgrouping[0] === "false"),
          _posixWinsyncMsSFUSchema: !(pluginRow.posixwinsyncmssfuschema === void 0 || pluginRow.posixwinsyncmssfuschema[0] === "false")
        });
      }
    }
    handleSavePlugin() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "posix-winsync",
        "set",
        "--create-memberof-task",
        this.state.posixWinsyncCreateMemberOfTask ? "true" : "false",
        "--lower-case-uid",
        this.state.posixWinsyncLowerCaseUID ? "true" : "false",
        "--map-member-uid",
        this.state.posixWinsyncMapMemberUID ? "true" : "false",
        "--map-nested-grouping",
        this.state.posixWinsyncMapNestedGrouping ? "true" : "false",
        "--ms-sfu-schema",
        this.state.posixWinsyncMsSFUSchema ? "true" : "false"
      ];
      this.setState({
        saving: true
      });
      log_cmd("handleSavePlugin", "Update Posix winsync plugin", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Successfully updated Posix winsync plugin`
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to update Posix winsync plugin - ${errMsg.desc}`
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      });
    }
    render() {
      const {
        posixWinsyncCreateMemberOfTask,
        posixWinsyncLowerCaseUID,
        posixWinsyncMapMemberUID,
        posixWinsyncMapNestedGrouping,
        posixWinsyncMsSFUSchema,
        fixupModalShow,
        fixupDN,
        fixupFilter,
        saving,
        savingModal,
        saveBtnDisabled,
        saveBtnDisabledModal,
        error
      } = this.state;
      let saveBtnName = "Save";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Saving ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      const saveBtnNameModal = "Run Task";
      if (savingModal) {
        saveBtnName = "Task running ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react23.default.createElement("div", { className: saving || savingModal ? "ds-disabled" : "" }, /* @__PURE__ */ import_react23.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "MemberOf Task",
          isOpen: fixupModalShow,
          "aria-labelledby": "ds-modal",
          onClose: this.handleToggleFixupModal,
          actions: [
            /* @__PURE__ */ import_react23.default.createElement(
              Button,
              {
                key: "task",
                variant: "primary",
                onClick: this.handleRunFixup,
                isDisabled: saveBtnDisabledModal || savingModal,
                isLoading: savingModal,
                spinnerAriaValueText: savingModal ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnNameModal
            ),
            /* @__PURE__ */ import_react23.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleToggleFixupModal }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react23.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react23.default.createElement(Grid, { title: "Base DN that contains entries to fix up" }, /* @__PURE__ */ import_react23.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Base DN"), /* @__PURE__ */ import_react23.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react23.default.createElement(
          TextInput,
          {
            value: fixupDN,
            type: "text",
            id: "fixupDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "fixupDN",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: error.fixupDN ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react23.default.createElement(FormHelperText, { isError: true, isHidden: !error.fixupDN }, "Value must be a valid DN"))), /* @__PURE__ */ import_react23.default.createElement(Grid, { className: "ds-margin-top", title: "Filter for entries to fix up. If omitted, all entries with objectclass inetuser/inetadmin/nsmemberof under the specified base will have their memberOf attribute regenerated." }, /* @__PURE__ */ import_react23.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Filter DN"), /* @__PURE__ */ import_react23.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react23.default.createElement(
          TextInput,
          {
            value: fixupFilter,
            type: "text",
            id: "fixupFilter",
            "aria-describedby": "horizontal-form-name-helper",
            name: "fixupFilter",
            onChange: (str, e) => {
              this.handleModalChange(e);
            },
            validated: error.fixupFilter ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react23.default.createElement(FormHelperText, { isError: true, isHidden: !error.fixupDN }, "Enter an LDAP search filter"))))
      ), /* @__PURE__ */ import_react23.default.createElement(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "Posix Winsync API",
          pluginName: "Posix Winsync API",
          cmdName: "posix-winsync",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler
        },
        /* @__PURE__ */ import_react23.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react23.default.createElement(Grid, { title: "Sets whether to run the memberOf fix-up task immediately after a sync run in order to update group memberships for synced users" }, /* @__PURE__ */ import_react23.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react23.default.createElement(
          Checkbox,
          {
            id: "posixWinsyncCreateMemberOfTask",
            isChecked: posixWinsyncCreateMemberOfTask,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            label: "Create MemberOf Task"
          }
        ))), /* @__PURE__ */ import_react23.default.createElement(Grid, { title: "Sets whether to store (and, if necessary, convert) the UID value in the memberUID attribute in lower case" }, /* @__PURE__ */ import_react23.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react23.default.createElement(
          Checkbox,
          {
            id: "posixWinsyncLowerCaseUID",
            isChecked: posixWinsyncLowerCaseUID,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            label: "Lower Case UID"
          }
        ))), /* @__PURE__ */ import_react23.default.createElement(Grid, { title: "Sets whether to map the memberUID attribute in an Active Directory group to the uniqueMember attribute in a Directory Server group" }, /* @__PURE__ */ import_react23.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react23.default.createElement(
          Checkbox,
          {
            id: "posixWinsyncMapMemberUID",
            isChecked: posixWinsyncMapMemberUID,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            label: "Map Member UID"
          }
        ))), /* @__PURE__ */ import_react23.default.createElement(Grid, { title: "Manages if nested groups are updated when memberUID attributes in an Active Directory POSIX group change" }, /* @__PURE__ */ import_react23.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react23.default.createElement(
          Checkbox,
          {
            id: "posixWinsyncMapNestedGrouping",
            isChecked: posixWinsyncMapNestedGrouping,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            label: "Map Nested Grouping"
          }
        ))), /* @__PURE__ */ import_react23.default.createElement(Grid, { title: "Sets whether to the older Microsoft System Services  for Unix 3.0 (msSFU30) schema when syncing Posix attributes from Active Directory" }, /* @__PURE__ */ import_react23.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react23.default.createElement(
          Checkbox,
          {
            id: "posixWinsyncMsSFUSchema",
            isChecked: posixWinsyncMsSFUSchema,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            },
            label: "Microsoft System Services for Unix 3.0 (msSFU30) schema"
          }
        )))),
        /* @__PURE__ */ import_react23.default.createElement(
          Button,
          {
            className: "ds-margin-top-lg",
            variant: "primary",
            onClick: this.handleToggleFixupModal,
            title: "Corrects mismatched member and uniquemember values"
          },
          "Run MemberOf Task"
        )
      ), /* @__PURE__ */ import_react23.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          variant: "primary",
          onClick: this.handleSavePlugin,
          isDisabled: saveBtnDisabled || saving,
          isLoading: saving,
          spinnerAriaValueText: saving ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveBtnName
      ));
    }
  };
  WinSync.propTypes = {
    rows: import_prop_types18.default.array,
    serverId: import_prop_types18.default.string,
    savePluginHandler: import_prop_types18.default.func,
    pluginListHandler: import_prop_types18.default.func,
    addNotification: import_prop_types18.default.func,
    toggleLoadingHandler: import_prop_types18.default.func
  };
  WinSync.defaultProps = {
    rows: [],
    serverId: ""
  };
  var winsync_default = WinSync;

  // src/plugins.jsx
  var Plugins = class extends import_react24.default.Component {
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.pluginList();
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.pluginList();
          }
        }
      }
    }
    componentDidMount() {
      this.getSchema();
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        loading: false,
        showPluginModal: false,
        currentPluginTab: "",
        activePlugin: "All Plugins",
        togglePluginName: "",
        togglePluginEnabled: false,
        showConfirmToggle: false,
        toggleSpinning: false,
        modalChecked: false,
        modalSpinning: false,
        rows: [],
        pluginTableKey: 0,
        attributes: [],
        objectclasses: [],
        // Plugin attributes
        currentPluginName: "",
        currentPluginType: "",
        currentPluginEnabled: false,
        currentPluginPath: "",
        currentPluginInitfunc: "",
        currentPluginId: "",
        currentPluginVendor: "",
        currentPluginVersion: "",
        currentPluginDescription: "",
        currentPluginDependsOnType: "",
        currentPluginDependsOnNamed: "",
        currentPluginPrecedence: ""
      };
      this.handleSelect = (result) => {
        this.setState({
          activePlugin: result.itemId
        });
      };
      this.onFieldChange = this.onFieldChange.bind(this);
      this.pluginList = this.pluginList.bind(this);
      this.onChangeTab = this.onChangeTab.bind(this);
      this.savePlugin = this.savePlugin.bind(this);
      this.toggleLoading = this.toggleLoading.bind(this);
      this.getIconAndName = this.getIconAndName.bind(this);
      this.togglePlugin = this.togglePlugin.bind(this);
      this.showConfirmToggle = this.showConfirmToggle.bind(this);
      this.closeConfirmToggle = this.closeConfirmToggle.bind(this);
      this.getSchema = this.getSchema.bind(this);
    }
    getSchema() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getSchema", "Plugins Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        const oc_cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "objectclasses",
          "list"
        ];
        log_cmd("getSchema", "Get objectClasses", oc_cmd);
        cockpit_default.spawn(oc_cmd, { superuser: true, err: "message" }).done((content2) => {
          const ocContent = JSON.parse(content2);
          const ocs = [];
          for (const content3 of ocContent.items) {
            ocs.push(content3.name[0]);
          }
          this.setState({
            objectClasses: ocs,
            attributes: attrs
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification("error", `Failed to get objectClasses - ${errMsg.desc}`);
        });
      });
    }
    onChangeTab(event) {
      this.setState({ currentPluginTab: event.target.value });
    }
    onFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    toggleLoading() {
      this.setState((prevState) => ({
        loading: !prevState.loading
      }));
    }
    pluginList() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "list"
      ];
      log_cmd("pluginList", "Get plugins for table rows", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const pluginTableKey = this.state.pluginTableKey + 1;
        if (this.state.firstLoad) {
          this.setState((prevState) => ({
            pluginTabs: {
              ...prevState.pluginTabs,
              basicConfig: true
            },
            rows: myObject.items,
            firstLoad: false,
            pluginTableKey
          }));
        } else {
          this.setState({
            rows: myObject.items,
            pluginTableKey
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `${errMsg.desc} error during plugin loading`
        );
      });
    }
    savePlugin(data) {
      let nothingToSetErr = false;
      let basicPluginSuccess = false;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "set",
        data.name,
        "--type",
        data.type || "delete",
        "--path",
        data.path || "delete",
        "--initfunc",
        data.initfunc || "delete",
        "--id",
        data.id || "delete",
        "--vendor",
        data.vendor || "delete",
        "--version",
        data.version || "delete",
        "--description",
        data.description || "delete",
        "--depends-on-type",
        data.dependsOnType || "delete",
        "--depends-on-named",
        data.dependsOnNamed || "delete",
        "--precedence",
        data.precedence || "delete"
      ];
      if ("enabled" in data) {
        cmd = [...cmd, "--enabled", data.enabled ? "on" : "off"];
      }
      this.toggleLoading();
      log_cmd("savePlugin", "Edit the plugin", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        basicPluginSuccess = true;
        this.props.addNotification(
          "success",
          `Plugin ${data.name} was successfully modified`
        );
        this.pluginList();
        this.closePluginModal();
        this.toggleLoading();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (errMsg.desc.indexOf("nothing to set") >= 0) {
          nothingToSetErr = true;
        } else {
          this.props.addNotification(
            "error",
            `${errMsg.desc} error during ${data.name} modification`
          );
        }
        this.closePluginModal();
        this.toggleLoading();
      }).always(() => {
        if ("specificPluginCMD" in data && data.specificPluginCMD.length !== 0) {
          this.toggleLoading();
          log_cmd(
            "savePlugin",
            "Edit the plugin from the plugin config tab",
            data.specificPluginCMD
          );
          cockpit_default.spawn(data.specificPluginCMD, {
            superuser: true,
            err: "message"
          }).done((content) => {
            if (!basicPluginSuccess) {
              this.props.addNotification(
                "success",
                `Plugin ${data.name} was successfully modified`
              );
            }
            this.pluginList();
            this.toggleLoading();
            console.info("savePlugin", "Result", content);
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            if (errMsg.desc.indexOf("nothing to set") >= 0 && nothingToSetErr || errMsg.desc.indexOf("nothing to set") < 0) {
              if (basicPluginSuccess) {
                this.props.addNotification(
                  "success",
                  `Plugin ${data.name} was successfully modified`
                );
                this.pluginList();
              }
              this.props.addNotification(
                "error",
                `${errMsg.desc} error during ${data.name} modification`
              );
            }
            this.toggleLoading();
          });
        } else {
          this.pluginList();
        }
      });
    }
    showConfirmToggle(plugin_name, enabled) {
      this.setState({
        showConfirmToggle: true,
        togglePluginName: plugin_name,
        togglePluginEnabled: enabled,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmToggle() {
      this.setState({
        showConfirmToggle: false,
        togglePluginName: "",
        togglePluginEnabled: ""
      });
    }
    togglePlugin() {
      const new_status = this.state.togglePluginEnabled ? "off" : "on";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "set",
        "--enabled=" + new_status,
        this.state.togglePluginName
      ];
      this.setState({ modalSpinning: true });
      log_cmd("togglePlugin", "Switch plugin states from the plugin tab", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        this.pluginList();
        this.props.addNotification(
          "warning",
          `${this.state.togglePluginName} plugin was successfully set to "${new_status}".
                        Please, restart the instance.`
        );
        this.setState({
          modalSpinning: false,
          showConfirmToggle: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during ${this.state.togglePluginName} plugin modification - ${errMsg.desc}`
        );
        this.setState({
          modalSpinning: false,
          showConfirmToggle: false
        });
      });
    }
    getIconAndName(name2, plugin_name) {
      const pluginRow = this.state.rows.find((row) => row.cn[0] === plugin_name);
      if (pluginRow) {
        if (pluginRow["nsslapd-pluginEnabled"][0] === "on") {
          return /* @__PURE__ */ import_react24.default.createElement("div", { className: "ds-ok-icon" }, /* @__PURE__ */ import_react24.default.createElement(CheckCircleIcon, { title: "Plugin is enabled", className: "ds-icon-sm" }), name2);
        } else {
          return /* @__PURE__ */ import_react24.default.createElement("div", { className: "ds-disabled-icon" }, /* @__PURE__ */ import_react24.default.createElement(BanIcon, { title: "Plugin is disabled", className: "ds-icon-sm" }), name2);
        }
      } else {
        const otherRows = this.state.rows.filter((row) => row["nsslapd-pluginId"][0] === "NSUniqueAttr");
        if (otherRows.length > 0) {
          for (const plugin of otherRows) {
            if (plugin["nsslapd-pluginEnabled"][0] === "on") {
              return /* @__PURE__ */ import_react24.default.createElement("div", { className: "ds-ok-icon" }, /* @__PURE__ */ import_react24.default.createElement(CheckCircleIcon, { title: "Plugin is enabled", className: "ds-icon-sm" }), name2);
            }
          }
          return /* @__PURE__ */ import_react24.default.createElement("div", { className: "ds-disabled-icon" }, /* @__PURE__ */ import_react24.default.createElement(BanIcon, { title: "Plugin is disabled", className: "ds-icon-sm" }), name2);
        } else {
          return /* @__PURE__ */ import_react24.default.createElement("div", { className: "ds-disabled-icon" }, /* @__PURE__ */ import_react24.default.createElement(ResourcesEmptyIcon, { title: "Plugin is not configured", className: "ds-icon-sm" }), name2);
        }
      }
    }
    render() {
      const selectPlugins = {
        allPlugins: {
          name: "All Plugins",
          icon: /* @__PURE__ */ import_react24.default.createElement("div", null, /* @__PURE__ */ import_react24.default.createElement(ListIcon, { className: "ds-icon-sm" }), "All Plugins"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            PluginTable,
            {
              key: this.state.pluginTableKey,
              rows: this.state.rows,
              showConfirmToggle: this.showConfirmToggle,
              spinning: this.state.modalSpinning
            }
          )
        },
        accountPolicy: {
          name: "Account Policy",
          icon: this.getIconAndName("Account Policy", "Account Policy Plugin"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            accountPolicy_default,
            {
              key: this.state.rows,
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              attributes: this.state.attributes
            }
          )
        },
        attributeUniqueness: {
          name: "Attribute Uniqueness",
          icon: this.getIconAndName("Attribute Uniqueness", "attribute uniqueness"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            attributeUniqueness_default,
            {
              rows: this.state.rows,
              key: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              objectClasses: this.state.objectClasses
            }
          )
        },
        autoMembership: {
          name: "Auto Membership",
          icon: this.getIconAndName("Auto Membership", "Auto Membership Plugin"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            autoMembership_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              key: this.props.wasActiveList
            }
          )
        },
        dna: {
          name: "DNA",
          icon: this.getIconAndName("DNA", "Distributed Numeric Assignment Plugin"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            dna_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              key: this.props.wasActiveList
            }
          )
        },
        linkedAttributes: {
          name: "Linked Attributes",
          icon: this.getIconAndName("Linked Attributes", "Linked Attributes"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            linkedAttributes_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              key: this.props.wasActiveList
            }
          )
        },
        managedEntries: {
          name: "Managed Entries",
          icon: this.getIconAndName("Managed Entries", "Managed Entries"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            managedEntries_default,
            {
              rows: this.state.rows,
              key: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              attributes: this.state.attributes,
              addNotification: this.props.addNotification
            }
          )
        },
        memberOf: {
          name: "MemberOf",
          icon: this.getIconAndName("MemberOf", "MemberOf Plugin"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            memberOf_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              objectClasses: this.state.objectClasses,
              key: this.props.wasActiveList
            }
          )
        },
        passthroughAuthentication: {
          name: "LDAP Pass Through Auth",
          icon: this.getIconAndName("LDAP Pass Through Auth", "Pass Through Authentication"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            passthroughAuthentication_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              key: this.props.wasActiveList
            }
          )
        },
        pamPassthroughAuthentication: {
          name: "PAM Pass Through Auth",
          icon: this.getIconAndName("PAM Pass Through Auth", "PAM Pass Through Auth"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            pamPassThru_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              key: this.props.wasActiveList
            }
          )
        },
        winsync: {
          name: "Posix Winsync",
          icon: this.getIconAndName("Posix Winsync", "Posix Winsync API"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            winsync_default,
            {
              rows: this.state.rows,
              key: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              attributes: this.state.attributes,
              toggleLoadingHandler: this.toggleLoading
            }
          )
        },
        referentialIntegrity: {
          name: "Referential Integrity",
          icon: this.getIconAndName("Referential Integrity", "referential integrity postoperation"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            referentialIntegrity_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              key: this.props.wasActiveList
            }
          )
        },
        retroChangelog: {
          name: "Retro Changelog",
          icon: this.getIconAndName("Retro Changelog", "Retro Changelog Plugin"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            retroChangelog_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              key: this.props.wasActiveList
            }
          )
        },
        rootDnaAccessControl: {
          name: "RootDN Access Control",
          icon: this.getIconAndName("RootDN Access Control", "RootDN Access Control"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            rootDNAccessControl_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              toggleLoadingHandler: this.toggleLoading
            }
          )
        },
        usn: {
          name: "USN",
          icon: this.getIconAndName("USN", "USN"),
          component: /* @__PURE__ */ import_react24.default.createElement(
            usn_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              key: this.props.wasActiveList
            }
          )
        }
      };
      return /* @__PURE__ */ import_react24.default.createElement("div", { className: "container-fluid" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "ds-margin-top-xlg ds-center", hidden: !this.state.firstLoad }, /* @__PURE__ */ import_react24.default.createElement(TextContent, null, /* @__PURE__ */ import_react24.default.createElement(Text, { component: TextVariants.h3 }, "Loading Plugins ...")), /* @__PURE__ */ import_react24.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" })), /* @__PURE__ */ import_react24.default.createElement("div", { hidden: this.state.firstLoad, className: this.state.loading ? "ds-disabled" : "" }, /* @__PURE__ */ import_react24.default.createElement(Grid, { className: "ds-margin-top-xlg", hasGutter: true }, /* @__PURE__ */ import_react24.default.createElement(GridItem, { span: 3, className: "ds-vert-scroll" }, /* @__PURE__ */ import_react24.default.createElement(Nav, { key: this.state.pluginTableKey, theme: "light", onSelect: this.handleSelect }, /* @__PURE__ */ import_react24.default.createElement(NavList, null, Object.entries(selectPlugins).map(([id, item]) => /* @__PURE__ */ import_react24.default.createElement(NavItem, { key: item.name, itemId: item.name, isActive: this.state.activePlugin === item.name }, item.icon))))), /* @__PURE__ */ import_react24.default.createElement(GridItem, { className: "ds-indent-md", span: 9 }, Object.entries(selectPlugins).filter((plugin) => plugin[1].name === this.state.activePlugin).map((filteredPlugin) => /* @__PURE__ */ import_react24.default.createElement("div", { key: filteredPlugin[1].name, className: "ds-margin-top" }, filteredPlugin[1].component)))), /* @__PURE__ */ import_react24.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmToggle,
          closeHandler: this.closeConfirmToggle,
          handleChange: this.onFieldChange,
          actionHandler: this.togglePlugin,
          spinning: this.state.modalSpinning,
          item: this.state.togglePluginName,
          checked: this.state.modalChecked,
          mTitle: this.state.togglePluginEnabled ? "Disable Plugin" : "Enable Plugin",
          mMsg: this.state.togglePluginEnabled ? "Are you really sure you want to disable this plugin?  Disabling some plugins can cause the server to not start, please use caution." : "Are you sure you want to enable this plugin?",
          mSpinningMsg: this.state.togglePluginEnabled ? "Disabling plugin ..." : "Enabling plugin ...",
          mBtnName: this.state.togglePluginEnabled ? "Disable Plugin" : "Enable Plugin"
        }
      )));
    }
  };
  Plugins.propTypes = {
    addNotification: import_prop_types19.default.func,
    serverId: import_prop_types19.default.string
  };
  Plugins.defaultProps = {
    serverId: ""
  };

  // src/database.jsx
  var import_react39 = __toESM(require_react(), 1);

  // src/lib/database/chaining.jsx
  var import_react26 = __toESM(require_react(), 1);
  var import_prop_types21 = __toESM(require_prop_types(), 1);

  // node_modules/@fortawesome/fontawesome-svg-core/index.es.js
  function _typeof(obj) {
    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof = function(obj2) {
        return typeof obj2;
      };
    } else {
      _typeof = function(obj2) {
        return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
      };
    }
    return _typeof(obj);
  }
  function _classCallCheck2(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass2(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties(Constructor, staticProps);
    return Constructor;
  }
  function _defineProperty3(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _objectSpread(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};
      var ownKeys24 = Object.keys(source);
      if (typeof Object.getOwnPropertySymbols === "function") {
        ownKeys24 = ownKeys24.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
        }));
      }
      ownKeys24.forEach(function(key) {
        _defineProperty3(target, key, source[key]);
      });
    }
    return target;
  }
  function _slicedToArray(arr, i) {
    return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  }
  function _arrayWithHoles(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _iterableToArrayLimit(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = void 0;
    try {
      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i)
          break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null)
          _i["return"]();
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance");
  }
  var noop = function noop2() {
  };
  var _WINDOW = {};
  var _DOCUMENT = {};
  var _MUTATION_OBSERVER = null;
  var _PERFORMANCE = {
    mark: noop,
    measure: noop
  };
  try {
    if (typeof window !== "undefined")
      _WINDOW = window;
    if (typeof document !== "undefined")
      _DOCUMENT = document;
    if (typeof MutationObserver !== "undefined")
      _MUTATION_OBSERVER = MutationObserver;
    if (typeof performance !== "undefined")
      _PERFORMANCE = performance;
  } catch (e) {
  }
  var _ref = _WINDOW.navigator || {};
  var _ref$userAgent = _ref.userAgent;
  var userAgent = _ref$userAgent === void 0 ? "" : _ref$userAgent;
  var WINDOW = _WINDOW;
  var DOCUMENT = _DOCUMENT;
  var PERFORMANCE = _PERFORMANCE;
  var IS_BROWSER = !!WINDOW.document;
  var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === "function" && typeof DOCUMENT.createElement === "function";
  var IS_IE = ~userAgent.indexOf("MSIE") || ~userAgent.indexOf("Trident/");
  var NAMESPACE_IDENTIFIER = "___FONT_AWESOME___";
  var DEFAULT_FAMILY_PREFIX = "fa";
  var DEFAULT_REPLACEMENT_CLASS = "svg-inline--fa";
  var DATA_FA_I2SVG = "data-fa-i2svg";
  var PRODUCTION = function() {
    try {
      return false;
    } catch (e) {
      return false;
    }
  }();
  var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
  var DUOTONE_CLASSES = {
    GROUP: "group",
    SWAP_OPACITY: "swap-opacity",
    PRIMARY: "primary",
    SECONDARY: "secondary"
  };
  var RESERVED_CLASSES = ["xs", "sm", "lg", "fw", "ul", "li", "border", "pull-left", "pull-right", "spin", "pulse", "rotate-90", "rotate-180", "rotate-270", "flip-horizontal", "flip-vertical", "flip-both", "stack", "stack-1x", "stack-2x", "inverse", "layers", "layers-text", "layers-counter", DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY].concat(oneToTen.map(function(n) {
    return "".concat(n, "x");
  })).concat(oneToTwenty.map(function(n) {
    return "w-".concat(n);
  }));
  var initial = WINDOW.FontAwesomeConfig || {};
  function getAttrConfig(attr) {
    var element = DOCUMENT.querySelector("script[" + attr + "]");
    if (element) {
      return element.getAttribute(attr);
    }
  }
  function coerce(val) {
    if (val === "")
      return true;
    if (val === "false")
      return false;
    if (val === "true")
      return true;
    return val;
  }
  if (DOCUMENT && typeof DOCUMENT.querySelector === "function") {
    attrs = [["data-family-prefix", "familyPrefix"], ["data-replacement-class", "replacementClass"], ["data-auto-replace-svg", "autoReplaceSvg"], ["data-auto-add-css", "autoAddCss"], ["data-auto-a11y", "autoA11y"], ["data-search-pseudo-elements", "searchPseudoElements"], ["data-observe-mutations", "observeMutations"], ["data-mutate-approach", "mutateApproach"], ["data-keep-original-source", "keepOriginalSource"], ["data-measure-performance", "measurePerformance"], ["data-show-missing-icons", "showMissingIcons"]];
    attrs.forEach(function(_ref2) {
      var _ref22 = _slicedToArray(_ref2, 2), attr = _ref22[0], key = _ref22[1];
      var val = coerce(getAttrConfig(attr));
      if (val !== void 0 && val !== null) {
        initial[key] = val;
      }
    });
  }
  var attrs;
  var _default = {
    familyPrefix: DEFAULT_FAMILY_PREFIX,
    replacementClass: DEFAULT_REPLACEMENT_CLASS,
    autoReplaceSvg: true,
    autoAddCss: true,
    autoA11y: true,
    searchPseudoElements: false,
    observeMutations: true,
    mutateApproach: "async",
    keepOriginalSource: true,
    measurePerformance: false,
    showMissingIcons: true
  };
  var _config = _objectSpread({}, _default, initial);
  if (!_config.autoReplaceSvg)
    _config.observeMutations = false;
  var config = _objectSpread({}, _config);
  WINDOW.FontAwesomeConfig = config;
  var w = WINDOW || {};
  if (!w[NAMESPACE_IDENTIFIER])
    w[NAMESPACE_IDENTIFIER] = {};
  if (!w[NAMESPACE_IDENTIFIER].styles)
    w[NAMESPACE_IDENTIFIER].styles = {};
  if (!w[NAMESPACE_IDENTIFIER].hooks)
    w[NAMESPACE_IDENTIFIER].hooks = {};
  if (!w[NAMESPACE_IDENTIFIER].shims)
    w[NAMESPACE_IDENTIFIER].shims = [];
  var namespace = w[NAMESPACE_IDENTIFIER];
  var functions = [];
  var listener = function listener2() {
    DOCUMENT.removeEventListener("DOMContentLoaded", listener2);
    loaded = 1;
    functions.map(function(fn) {
      return fn();
    });
  };
  var loaded = false;
  if (IS_DOM) {
    loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
    if (!loaded)
      DOCUMENT.addEventListener("DOMContentLoaded", listener);
  }
  var PENDING = "pending";
  var SETTLED = "settled";
  var FULFILLED = "fulfilled";
  var REJECTED = "rejected";
  var NOOP = function NOOP2() {
  };
  var isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && typeof global.process.emit === "function";
  var asyncSetTimer = typeof setImmediate === "undefined" ? setTimeout : setImmediate;
  var asyncQueue = [];
  var asyncTimer;
  function asyncFlush() {
    for (var i = 0; i < asyncQueue.length; i++) {
      asyncQueue[i][0](asyncQueue[i][1]);
    }
    asyncQueue = [];
    asyncTimer = false;
  }
  function asyncCall(callback, arg) {
    asyncQueue.push([callback, arg]);
    if (!asyncTimer) {
      asyncTimer = true;
      asyncSetTimer(asyncFlush, 0);
    }
  }
  function invokeResolver(resolver, promise) {
    function resolvePromise(value) {
      resolve(promise, value);
    }
    function rejectPromise(reason) {
      reject(promise, reason);
    }
    try {
      resolver(resolvePromise, rejectPromise);
    } catch (e) {
      rejectPromise(e);
    }
  }
  function invokeCallback(subscriber) {
    var owner = subscriber.owner;
    var settled = owner._state;
    var value = owner._data;
    var callback = subscriber[settled];
    var promise = subscriber.then;
    if (typeof callback === "function") {
      settled = FULFILLED;
      try {
        value = callback(value);
      } catch (e) {
        reject(promise, e);
      }
    }
    if (!handleThenable(promise, value)) {
      if (settled === FULFILLED) {
        resolve(promise, value);
      }
      if (settled === REJECTED) {
        reject(promise, value);
      }
    }
  }
  function handleThenable(promise, value) {
    var resolved;
    try {
      if (promise === value) {
        throw new TypeError("A promises callback cannot return that same promise.");
      }
      if (value && (typeof value === "function" || _typeof(value) === "object")) {
        var then2 = value.then;
        if (typeof then2 === "function") {
          then2.call(value, function(val) {
            if (!resolved) {
              resolved = true;
              if (value === val) {
                fulfill(promise, val);
              } else {
                resolve(promise, val);
              }
            }
          }, function(reason) {
            if (!resolved) {
              resolved = true;
              reject(promise, reason);
            }
          });
          return true;
        }
      }
    } catch (e) {
      if (!resolved) {
        reject(promise, e);
      }
      return true;
    }
    return false;
  }
  function resolve(promise, value) {
    if (promise === value || !handleThenable(promise, value)) {
      fulfill(promise, value);
    }
  }
  function fulfill(promise, value) {
    if (promise._state === PENDING) {
      promise._state = SETTLED;
      promise._data = value;
      asyncCall(publishFulfillment, promise);
    }
  }
  function reject(promise, reason) {
    if (promise._state === PENDING) {
      promise._state = SETTLED;
      promise._data = reason;
      asyncCall(publishRejection, promise);
    }
  }
  function publish(promise) {
    promise._then = promise._then.forEach(invokeCallback);
  }
  function publishFulfillment(promise) {
    promise._state = FULFILLED;
    publish(promise);
  }
  function publishRejection(promise) {
    promise._state = REJECTED;
    publish(promise);
    if (!promise._handled && isNode) {
      global.process.emit("unhandledRejection", promise._data, promise);
    }
  }
  function notifyRejectionHandled(promise) {
    global.process.emit("rejectionHandled", promise);
  }
  function P(resolver) {
    if (typeof resolver !== "function") {
      throw new TypeError("Promise resolver " + resolver + " is not a function");
    }
    if (this instanceof P === false) {
      throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
    }
    this._then = [];
    invokeResolver(resolver, this);
  }
  P.prototype = {
    constructor: P,
    _state: PENDING,
    _then: null,
    _data: void 0,
    _handled: false,
    then: function then(onFulfillment, onRejection) {
      var subscriber = {
        owner: this,
        then: new this.constructor(NOOP),
        fulfilled: onFulfillment,
        rejected: onRejection
      };
      if ((onRejection || onFulfillment) && !this._handled) {
        this._handled = true;
        if (this._state === REJECTED && isNode) {
          asyncCall(notifyRejectionHandled, this);
        }
      }
      if (this._state === FULFILLED || this._state === REJECTED) {
        asyncCall(invokeCallback, subscriber);
      } else {
        this._then.push(subscriber);
      }
      return subscriber.then;
    },
    catch: function _catch(onRejection) {
      return this.then(null, onRejection);
    }
  };
  P.all = function(promises) {
    if (!Array.isArray(promises)) {
      throw new TypeError("You must pass an array to Promise.all().");
    }
    return new P(function(resolve2, reject2) {
      var results = [];
      var remaining = 0;
      function resolver(index) {
        remaining++;
        return function(value) {
          results[index] = value;
          if (!--remaining) {
            resolve2(results);
          }
        };
      }
      for (var i = 0, promise; i < promises.length; i++) {
        promise = promises[i];
        if (promise && typeof promise.then === "function") {
          promise.then(resolver(i), reject2);
        } else {
          results[i] = promise;
        }
      }
      if (!remaining) {
        resolve2(results);
      }
    });
  };
  P.race = function(promises) {
    if (!Array.isArray(promises)) {
      throw new TypeError("You must pass an array to Promise.race().");
    }
    return new P(function(resolve2, reject2) {
      for (var i = 0, promise; i < promises.length; i++) {
        promise = promises[i];
        if (promise && typeof promise.then === "function") {
          promise.then(resolve2, reject2);
        } else {
          resolve2(promise);
        }
      }
    });
  };
  P.resolve = function(value) {
    if (value && _typeof(value) === "object" && value.constructor === P) {
      return value;
    }
    return new P(function(resolve2) {
      resolve2(value);
    });
  };
  P.reject = function(reason) {
    return new P(function(resolve2, reject2) {
      reject2(reason);
    });
  };
  var meaninglessTransform = {
    size: 16,
    x: 0,
    y: 0,
    rotate: 0,
    flipX: false,
    flipY: false
  };
  function insertCss(css3) {
    if (!css3 || !IS_DOM) {
      return;
    }
    var style = DOCUMENT.createElement("style");
    style.setAttribute("type", "text/css");
    style.innerHTML = css3;
    var headChildren = DOCUMENT.head.childNodes;
    var beforeChild = null;
    for (var i = headChildren.length - 1; i > -1; i--) {
      var child = headChildren[i];
      var tagName = (child.tagName || "").toUpperCase();
      if (["STYLE", "LINK"].indexOf(tagName) > -1) {
        beforeChild = child;
      }
    }
    DOCUMENT.head.insertBefore(style, beforeChild);
    return css3;
  }
  var idPool = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  function nextUniqueId() {
    var size = 12;
    var id = "";
    while (size-- > 0) {
      id += idPool[Math.random() * 62 | 0];
    }
    return id;
  }
  function htmlEscape(str) {
    return "".concat(str).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
  }
  function joinAttributes(attributes) {
    return Object.keys(attributes || {}).reduce(function(acc, attributeName) {
      return acc + "".concat(attributeName, '="').concat(htmlEscape(attributes[attributeName]), '" ');
    }, "").trim();
  }
  function joinStyles(styles164) {
    return Object.keys(styles164 || {}).reduce(function(acc, styleName) {
      return acc + "".concat(styleName, ": ").concat(styles164[styleName], ";");
    }, "");
  }
  function transformIsMeaningful(transform2) {
    return transform2.size !== meaninglessTransform.size || transform2.x !== meaninglessTransform.x || transform2.y !== meaninglessTransform.y || transform2.rotate !== meaninglessTransform.rotate || transform2.flipX || transform2.flipY;
  }
  function transformForSvg(_ref2) {
    var transform2 = _ref2.transform, containerWidth = _ref2.containerWidth, iconWidth = _ref2.iconWidth;
    var outer = {
      transform: "translate(".concat(containerWidth / 2, " 256)")
    };
    var innerTranslate = "translate(".concat(transform2.x * 32, ", ").concat(transform2.y * 32, ") ");
    var innerScale = "scale(".concat(transform2.size / 16 * (transform2.flipX ? -1 : 1), ", ").concat(transform2.size / 16 * (transform2.flipY ? -1 : 1), ") ");
    var innerRotate = "rotate(".concat(transform2.rotate, " 0 0)");
    var inner = {
      transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
    };
    var path2 = {
      transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
    };
    return {
      outer,
      inner,
      path: path2
    };
  }
  var ALL_SPACE = {
    x: 0,
    y: 0,
    width: "100%",
    height: "100%"
  };
  function fillBlack(abstract) {
    var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
    if (abstract.attributes && (abstract.attributes.fill || force)) {
      abstract.attributes.fill = "black";
    }
    return abstract;
  }
  function deGroup(abstract) {
    if (abstract.tag === "g") {
      return abstract.children;
    } else {
      return [abstract];
    }
  }
  function makeIconMasking(_ref2) {
    var children = _ref2.children, attributes = _ref2.attributes, main2 = _ref2.main, mask = _ref2.mask, explicitMaskId = _ref2.maskId, transform2 = _ref2.transform;
    var mainWidth = main2.width, mainPath = main2.icon;
    var maskWidth = mask.width, maskPath = mask.icon;
    var trans = transformForSvg({
      transform: transform2,
      containerWidth: maskWidth,
      iconWidth: mainWidth
    });
    var maskRect = {
      tag: "rect",
      attributes: _objectSpread({}, ALL_SPACE, {
        fill: "white"
      })
    };
    var maskInnerGroupChildrenMixin = mainPath.children ? {
      children: mainPath.children.map(fillBlack)
    } : {};
    var maskInnerGroup = {
      tag: "g",
      attributes: _objectSpread({}, trans.inner),
      children: [fillBlack(_objectSpread({
        tag: mainPath.tag,
        attributes: _objectSpread({}, mainPath.attributes, trans.path)
      }, maskInnerGroupChildrenMixin))]
    };
    var maskOuterGroup = {
      tag: "g",
      attributes: _objectSpread({}, trans.outer),
      children: [maskInnerGroup]
    };
    var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
    var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
    var maskTag = {
      tag: "mask",
      attributes: _objectSpread({}, ALL_SPACE, {
        id: maskId,
        maskUnits: "userSpaceOnUse",
        maskContentUnits: "userSpaceOnUse"
      }),
      children: [maskRect, maskOuterGroup]
    };
    var defs = {
      tag: "defs",
      children: [{
        tag: "clipPath",
        attributes: {
          id: clipId
        },
        children: deGroup(maskPath)
      }, maskTag]
    };
    children.push(defs, {
      tag: "rect",
      attributes: _objectSpread({
        fill: "currentColor",
        "clip-path": "url(#".concat(clipId, ")"),
        mask: "url(#".concat(maskId, ")")
      }, ALL_SPACE)
    });
    return {
      children,
      attributes
    };
  }
  function makeIconStandard(_ref2) {
    var children = _ref2.children, attributes = _ref2.attributes, main2 = _ref2.main, transform2 = _ref2.transform, styles164 = _ref2.styles;
    var styleString = joinStyles(styles164);
    if (styleString.length > 0) {
      attributes["style"] = styleString;
    }
    if (transformIsMeaningful(transform2)) {
      var trans = transformForSvg({
        transform: transform2,
        containerWidth: main2.width,
        iconWidth: main2.width
      });
      children.push({
        tag: "g",
        attributes: _objectSpread({}, trans.outer),
        children: [{
          tag: "g",
          attributes: _objectSpread({}, trans.inner),
          children: [{
            tag: main2.icon.tag,
            children: main2.icon.children,
            attributes: _objectSpread({}, main2.icon.attributes, trans.path)
          }]
        }]
      });
    } else {
      children.push(main2.icon);
    }
    return {
      children,
      attributes
    };
  }
  function asIcon(_ref2) {
    var children = _ref2.children, main2 = _ref2.main, mask = _ref2.mask, attributes = _ref2.attributes, styles164 = _ref2.styles, transform2 = _ref2.transform;
    if (transformIsMeaningful(transform2) && main2.found && !mask.found) {
      var width = main2.width, height = main2.height;
      var offset2 = {
        x: width / height / 2,
        y: 0.5
      };
      attributes["style"] = joinStyles(_objectSpread({}, styles164, {
        "transform-origin": "".concat(offset2.x + transform2.x / 16, "em ").concat(offset2.y + transform2.y / 16, "em")
      }));
    }
    return [{
      tag: "svg",
      attributes,
      children
    }];
  }
  function asSymbol(_ref2) {
    var prefix = _ref2.prefix, iconName = _ref2.iconName, children = _ref2.children, attributes = _ref2.attributes, symbol = _ref2.symbol;
    var id = symbol === true ? "".concat(prefix, "-").concat(config.familyPrefix, "-").concat(iconName) : symbol;
    return [{
      tag: "svg",
      attributes: {
        style: "display: none;"
      },
      children: [{
        tag: "symbol",
        attributes: _objectSpread({}, attributes, {
          id
        }),
        children
      }]
    }];
  }
  function makeInlineSvgAbstract(params) {
    var _params$icons = params.icons, main2 = _params$icons.main, mask = _params$icons.mask, prefix = params.prefix, iconName = params.iconName, transform2 = params.transform, symbol = params.symbol, title = params.title, maskId = params.maskId, titleId = params.titleId, extra = params.extra, _params$watchable = params.watchable, watchable = _params$watchable === void 0 ? false : _params$watchable;
    var _ref2 = mask.found ? mask : main2, width = _ref2.width, height = _ref2.height;
    var isUploadedIcon = prefix === "fak";
    var widthClass = isUploadedIcon ? "" : "fa-w-".concat(Math.ceil(width / height * 16));
    var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : "", widthClass].filter(function(c2) {
      return extra.classes.indexOf(c2) === -1;
    }).filter(function(c2) {
      return c2 !== "" || !!c2;
    }).concat(extra.classes).join(" ");
    var content = {
      children: [],
      attributes: _objectSpread({}, extra.attributes, {
        "data-prefix": prefix,
        "data-icon": iconName,
        "class": attrClass,
        "role": extra.attributes.role || "img",
        "xmlns": "http://www.w3.org/2000/svg",
        "viewBox": "0 0 ".concat(width, " ").concat(height)
      })
    };
    var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf("fa-fw") ? {
      width: "".concat(width / height * 16 * 0.0625, "em")
    } : {};
    if (watchable) {
      content.attributes[DATA_FA_I2SVG] = "";
    }
    if (title)
      content.children.push({
        tag: "title",
        attributes: {
          id: content.attributes["aria-labelledby"] || "title-".concat(titleId || nextUniqueId())
        },
        children: [title]
      });
    var args = _objectSpread({}, content, {
      prefix,
      iconName,
      main: main2,
      mask,
      maskId,
      transform: transform2,
      symbol,
      styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)
    });
    var _ref22 = mask.found && main2.found ? makeIconMasking(args) : makeIconStandard(args), children = _ref22.children, attributes = _ref22.attributes;
    args.children = children;
    args.attributes = attributes;
    if (symbol) {
      return asSymbol(args);
    } else {
      return asIcon(args);
    }
  }
  var noop$1 = function noop3() {
  };
  var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
    mark: noop$1,
    measure: noop$1
  };
  var bindInternal4 = function bindInternal42(func, thisContext) {
    return function(a2, b, c2, d) {
      return func.call(thisContext, a2, b, c2, d);
    };
  };
  var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
    var keys = Object.keys(subject), length = keys.length, iterator = thisContext !== void 0 ? bindInternal4(fn, thisContext) : fn, i, key, result;
    if (initialValue === void 0) {
      i = 1;
      result = subject[keys[0]];
    } else {
      i = 0;
      result = initialValue;
    }
    for (; i < length; i++) {
      key = keys[i];
      result = iterator(result, subject[key], key, subject);
    }
    return result;
  };
  function defineIcons(prefix, icons) {
    var params = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    var _params$skipHooks = params.skipHooks, skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
    var normalized = Object.keys(icons).reduce(function(acc, iconName) {
      var icon2 = icons[iconName];
      var expanded = !!icon2.icon;
      if (expanded) {
        acc[icon2.iconName] = icon2.icon;
      } else {
        acc[iconName] = icon2;
      }
      return acc;
    }, {});
    if (typeof namespace.hooks.addPack === "function" && !skipHooks) {
      namespace.hooks.addPack(prefix, normalized);
    } else {
      namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);
    }
    if (prefix === "fas") {
      defineIcons("fa", icons);
    }
  }
  var styles163 = namespace.styles;
  var shims = namespace.shims;
  var _byUnicode = {};
  var _byLigature = {};
  var _byOldName = {};
  var build = function build2() {
    var lookup = function lookup2(reducer) {
      return reduce(styles163, function(o, style, prefix) {
        o[prefix] = reduce(style, reducer, {});
        return o;
      }, {});
    };
    _byUnicode = lookup(function(acc, icon2, iconName) {
      if (icon2[3]) {
        acc[icon2[3]] = iconName;
      }
      return acc;
    });
    _byLigature = lookup(function(acc, icon2, iconName) {
      var ligatures = icon2[2];
      acc[iconName] = iconName;
      ligatures.forEach(function(ligature) {
        acc[ligature] = iconName;
      });
      return acc;
    });
    var hasRegular = "far" in styles163;
    _byOldName = reduce(shims, function(acc, shim) {
      var oldName = shim[0];
      var prefix = shim[1];
      var iconName = shim[2];
      if (prefix === "far" && !hasRegular) {
        prefix = "fas";
      }
      acc[oldName] = {
        prefix,
        iconName
      };
      return acc;
    }, {});
  };
  build();
  var styles$1 = namespace.styles;
  function iconFromMapping(mapping, prefix, iconName) {
    if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
      return {
        prefix,
        iconName,
        icon: mapping[prefix][iconName]
      };
    }
  }
  function toHtml(abstractNodes) {
    var tag = abstractNodes.tag, _abstractNodes$attrib = abstractNodes.attributes, attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib, _abstractNodes$childr = abstractNodes.children, children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
    if (typeof abstractNodes === "string") {
      return htmlEscape(abstractNodes);
    } else {
      return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(""), "</").concat(tag, ">");
    }
  }
  var parseTransformString = function parseTransformString2(transformString) {
    var transform2 = {
      size: 16,
      x: 0,
      y: 0,
      flipX: false,
      flipY: false,
      rotate: 0
    };
    if (!transformString) {
      return transform2;
    } else {
      return transformString.toLowerCase().split(" ").reduce(function(acc, n) {
        var parts = n.toLowerCase().split("-");
        var first = parts[0];
        var rest = parts.slice(1).join("-");
        if (first && rest === "h") {
          acc.flipX = true;
          return acc;
        }
        if (first && rest === "v") {
          acc.flipY = true;
          return acc;
        }
        rest = parseFloat(rest);
        if (isNaN(rest)) {
          return acc;
        }
        switch (first) {
          case "grow":
            acc.size = acc.size + rest;
            break;
          case "shrink":
            acc.size = acc.size - rest;
            break;
          case "left":
            acc.x = acc.x - rest;
            break;
          case "right":
            acc.x = acc.x + rest;
            break;
          case "up":
            acc.y = acc.y - rest;
            break;
          case "down":
            acc.y = acc.y + rest;
            break;
          case "rotate":
            acc.rotate = acc.rotate + rest;
            break;
        }
        return acc;
      }, transform2);
    }
  };
  function MissingIcon(error) {
    this.name = "MissingIcon";
    this.message = error || "Icon unavailable";
    this.stack = new Error().stack;
  }
  MissingIcon.prototype = Object.create(Error.prototype);
  MissingIcon.prototype.constructor = MissingIcon;
  var FILL = {
    fill: "currentColor"
  };
  var ANIMATION_BASE = {
    attributeType: "XML",
    repeatCount: "indefinite",
    dur: "2s"
  };
  var RING = {
    tag: "path",
    attributes: _objectSpread({}, FILL, {
      d: "M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"
    })
  };
  var OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {
    attributeName: "opacity"
  });
  var DOT = {
    tag: "circle",
    attributes: _objectSpread({}, FILL, {
      cx: "256",
      cy: "364",
      r: "28"
    }),
    children: [{
      tag: "animate",
      attributes: _objectSpread({}, ANIMATION_BASE, {
        attributeName: "r",
        values: "28;14;28;28;14;28;"
      })
    }, {
      tag: "animate",
      attributes: _objectSpread({}, OPACITY_ANIMATE, {
        values: "1;0;1;1;0;1;"
      })
    }]
  };
  var QUESTION = {
    tag: "path",
    attributes: _objectSpread({}, FILL, {
      opacity: "1",
      d: "M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"
    }),
    children: [{
      tag: "animate",
      attributes: _objectSpread({}, OPACITY_ANIMATE, {
        values: "1;0;0;0;0;1;"
      })
    }]
  };
  var EXCLAMATION = {
    tag: "path",
    attributes: _objectSpread({}, FILL, {
      opacity: "0",
      d: "M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"
    }),
    children: [{
      tag: "animate",
      attributes: _objectSpread({}, OPACITY_ANIMATE, {
        values: "0;0;1;1;0;0;"
      })
    }]
  };
  var styles$2 = namespace.styles;
  function asFoundIcon(icon2) {
    var width = icon2[0];
    var height = icon2[1];
    var _icon$slice = icon2.slice(4), _icon$slice2 = _slicedToArray(_icon$slice, 1), vectorData = _icon$slice2[0];
    var element = null;
    if (Array.isArray(vectorData)) {
      element = {
        tag: "g",
        attributes: {
          class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
        },
        children: [{
          tag: "path",
          attributes: {
            class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
            fill: "currentColor",
            d: vectorData[0]
          }
        }, {
          tag: "path",
          attributes: {
            class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
            fill: "currentColor",
            d: vectorData[1]
          }
        }]
      };
    } else {
      element = {
        tag: "path",
        attributes: {
          fill: "currentColor",
          d: vectorData
        }
      };
    }
    return {
      found: true,
      width,
      height,
      icon: element
    };
  }
  var styles$3 = namespace.styles;
  var baseStyles = 'svg:not(:root).svg-inline--fa {\n  overflow: visible;\n}\n\n.svg-inline--fa {\n  display: inline-block;\n  font-size: inherit;\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n  width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n  width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n  width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n  width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n  width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n  width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n  width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n  width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n  width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n  width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n  width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n  width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n  width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n  width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n  width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n  width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n  width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n  width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n  width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n  width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-border {\n  height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n  width: 2em;\n}\n.svg-inline--fa.fa-fw {\n  width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  -webkit-transform: translate(-50%, -50%);\n          transform: translate(-50%, -50%);\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: #ff253a;\n  border-radius: 1em;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  color: #fff;\n  height: 1.5em;\n  line-height: 1;\n  max-width: 5em;\n  min-width: 1.5em;\n  overflow: hidden;\n  padding: 0.25em;\n  right: 0;\n  text-overflow: ellipsis;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: 0;\n  right: 0;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom right;\n          transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: 0;\n  left: 0;\n  right: auto;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom left;\n          transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  right: 0;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: 0;\n  right: auto;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top left;\n          transform-origin: top left;\n}\n\n.fa-lg {\n  font-size: 1.3333333333em;\n  line-height: 0.75em;\n  vertical-align: -0.0667em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: 2.5em;\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: -2em;\n  position: absolute;\n  text-align: center;\n  width: 2em;\n  line-height: inherit;\n}\n\n.fa-border {\n  border: solid 0.08em #eee;\n  border-radius: 0.1em;\n  padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n  float: left;\n}\n\n.fa-pull-right {\n  float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n  margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n  margin-left: 0.3em;\n}\n\n.fa-spin {\n  -webkit-animation: fa-spin 2s infinite linear;\n          animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n  -webkit-animation: fa-spin 1s infinite steps(8);\n          animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n\n@keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n  -webkit-transform: rotate(90deg);\n          transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n  -webkit-transform: rotate(180deg);\n          transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n  -webkit-transform: rotate(270deg);\n          transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n  -webkit-transform: scale(-1, 1);\n          transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n  -webkit-transform: scale(1, -1);\n          transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n  -webkit-transform: scale(-1, -1);\n          transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n  -webkit-filter: none;\n          filter: none;\n}\n\n.fa-stack {\n  display: inline-block;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: #fff;\n}\n\n.sr-only {\n  border: 0;\n  clip: rect(0, 0, 0, 0);\n  height: 1px;\n  margin: -1px;\n  overflow: hidden;\n  padding: 0;\n  position: absolute;\n  width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n  clip: auto;\n  height: auto;\n  margin: 0;\n  overflow: visible;\n  position: static;\n  width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}\n\n.fad.fa-inverse {\n  color: #fff;\n}';
  function css2() {
    var dfp = DEFAULT_FAMILY_PREFIX;
    var drc = DEFAULT_REPLACEMENT_CLASS;
    var fp = config.familyPrefix;
    var rc = config.replacementClass;
    var s2 = baseStyles;
    if (fp !== dfp || rc !== drc) {
      var dPatt = new RegExp("\\.".concat(dfp, "\\-"), "g");
      var customPropPatt = new RegExp("\\--".concat(dfp, "\\-"), "g");
      var rPatt = new RegExp("\\.".concat(drc), "g");
      s2 = s2.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
    }
    return s2;
  }
  var Library = /* @__PURE__ */ function() {
    function Library2() {
      _classCallCheck2(this, Library2);
      this.definitions = {};
    }
    _createClass2(Library2, [{
      key: "add",
      value: function add() {
        var _this = this;
        for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
          definitions[_key] = arguments[_key];
        }
        var additions = definitions.reduce(this._pullDefinitions, {});
        Object.keys(additions).forEach(function(key) {
          _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);
          defineIcons(key, additions[key]);
          build();
        });
      }
    }, {
      key: "reset",
      value: function reset() {
        this.definitions = {};
      }
    }, {
      key: "_pullDefinitions",
      value: function _pullDefinitions(additions, definition) {
        var normalized = definition.prefix && definition.iconName && definition.icon ? {
          0: definition
        } : definition;
        Object.keys(normalized).map(function(key) {
          var _normalized$key = normalized[key], prefix = _normalized$key.prefix, iconName = _normalized$key.iconName, icon2 = _normalized$key.icon;
          if (!additions[prefix])
            additions[prefix] = {};
          additions[prefix][iconName] = icon2;
        });
        return additions;
      }
    }]);
    return Library2;
  }();
  function ensureCss() {
    if (config.autoAddCss && !_cssInserted) {
      insertCss(css2());
      _cssInserted = true;
    }
  }
  function apiObject(val, abstractCreator) {
    Object.defineProperty(val, "abstract", {
      get: abstractCreator
    });
    Object.defineProperty(val, "html", {
      get: function get() {
        return val.abstract.map(function(a2) {
          return toHtml(a2);
        });
      }
    });
    Object.defineProperty(val, "node", {
      get: function get() {
        if (!IS_DOM)
          return;
        var container = DOCUMENT.createElement("div");
        container.innerHTML = val.html;
        return container.children;
      }
    });
    return val;
  }
  function findIconDefinition(iconLookup) {
    var _iconLookup$prefix = iconLookup.prefix, prefix = _iconLookup$prefix === void 0 ? "fa" : _iconLookup$prefix, iconName = iconLookup.iconName;
    if (!iconName)
      return;
    return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
  }
  function resolveIcons(next) {
    return function(maybeIconDefinition) {
      var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
      var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
      var mask = params.mask;
      if (mask) {
        mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
      }
      return next(iconDefinition, _objectSpread({}, params, {
        mask
      }));
    };
  }
  var library = new Library();
  var _cssInserted = false;
  var parse = {
    transform: function transform(transformString) {
      return parseTransformString(transformString);
    }
  };
  var icon = resolveIcons(function(iconDefinition) {
    var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var _params$transform = params.transform, transform2 = _params$transform === void 0 ? meaninglessTransform : _params$transform, _params$symbol = params.symbol, symbol = _params$symbol === void 0 ? false : _params$symbol, _params$mask = params.mask, mask = _params$mask === void 0 ? null : _params$mask, _params$maskId = params.maskId, maskId = _params$maskId === void 0 ? null : _params$maskId, _params$title = params.title, title = _params$title === void 0 ? null : _params$title, _params$titleId = params.titleId, titleId = _params$titleId === void 0 ? null : _params$titleId, _params$classes = params.classes, classes = _params$classes === void 0 ? [] : _params$classes, _params$attributes = params.attributes, attributes = _params$attributes === void 0 ? {} : _params$attributes, _params$styles = params.styles, styles164 = _params$styles === void 0 ? {} : _params$styles;
    if (!iconDefinition)
      return;
    var prefix = iconDefinition.prefix, iconName = iconDefinition.iconName, icon2 = iconDefinition.icon;
    return apiObject(_objectSpread({
      type: "icon"
    }, iconDefinition), function() {
      ensureCss();
      if (config.autoA11y) {
        if (title) {
          attributes["aria-labelledby"] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
        } else {
          attributes["aria-hidden"] = "true";
          attributes["focusable"] = "false";
        }
      }
      return makeInlineSvgAbstract({
        icons: {
          main: asFoundIcon(icon2),
          mask: mask ? asFoundIcon(mask.icon) : {
            found: false,
            width: null,
            height: null,
            icon: {}
          }
        },
        prefix,
        iconName,
        transform: _objectSpread({}, meaninglessTransform, transform2),
        symbol,
        title,
        maskId,
        titleId,
        extra: {
          attributes,
          styles: styles164,
          classes
        }
      });
    });
  });

  // node_modules/@fortawesome/react-fontawesome/index.es.js
  var import_prop_types20 = __toESM(require_prop_types());
  var import_react25 = __toESM(require_react());
  function ownKeys2(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread22(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
        _defineProperty4(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _typeof2(obj) {
    "@babel/helpers - typeof";
    return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
      return typeof obj2;
    } : function(obj2) {
      return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
    }, _typeof2(obj);
  }
  function _defineProperty4(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _objectWithoutPropertiesLoose(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  function _objectWithoutProperties2(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _toConsumableArray2(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  }
  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray(arr);
  }
  function _iterableToArray(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _unsupportedIterableToArray(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray(o, minLen);
  }
  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++)
      arr2[i] = arr[i];
    return arr2;
  }
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function classList(props) {
    var _classes;
    var beat = props.beat, fade = props.fade, beatFade = props.beatFade, bounce = props.bounce, shake = props.shake, flash = props.flash, spin = props.spin, spinPulse = props.spinPulse, spinReverse = props.spinReverse, pulse = props.pulse, fixedWidth = props.fixedWidth, inverse = props.inverse, border = props.border, listItem = props.listItem, flip2 = props.flip, size = props.size, rotation = props.rotation, pull = props.pull;
    var classes = (_classes = {
      "fa-beat": beat,
      "fa-fade": fade,
      "fa-beat-fade": beatFade,
      "fa-bounce": bounce,
      "fa-shake": shake,
      "fa-flash": flash,
      "fa-spin": spin,
      "fa-spin-reverse": spinReverse,
      "fa-spin-pulse": spinPulse,
      "fa-pulse": pulse,
      "fa-fw": fixedWidth,
      "fa-inverse": inverse,
      "fa-border": border,
      "fa-li": listItem,
      "fa-flip": flip2 === true,
      "fa-flip-horizontal": flip2 === "horizontal" || flip2 === "both",
      "fa-flip-vertical": flip2 === "vertical" || flip2 === "both"
    }, _defineProperty4(_classes, "fa-".concat(size), typeof size !== "undefined" && size !== null), _defineProperty4(_classes, "fa-rotate-".concat(rotation), typeof rotation !== "undefined" && rotation !== null && rotation !== 0), _defineProperty4(_classes, "fa-pull-".concat(pull), typeof pull !== "undefined" && pull !== null), _defineProperty4(_classes, "fa-swap-opacity", props.swapOpacity), _classes);
    return Object.keys(classes).map(function(key) {
      return classes[key] ? key : null;
    }).filter(function(key) {
      return key;
    });
  }
  function _isNumerical(obj) {
    obj = obj - 0;
    return obj === obj;
  }
  function camelize3(string) {
    if (_isNumerical(string)) {
      return string;
    }
    string = string.replace(/[\-_\s]+(.)?/g, function(match, chr) {
      return chr ? chr.toUpperCase() : "";
    });
    return string.substr(0, 1).toLowerCase() + string.substr(1);
  }
  var _excluded$1 = ["style"];
  function capitalize3(val) {
    return val.charAt(0).toUpperCase() + val.slice(1);
  }
  function styleToObject(style) {
    return style.split(";").map(function(s2) {
      return s2.trim();
    }).filter(function(s2) {
      return s2;
    }).reduce(function(acc, pair) {
      var i = pair.indexOf(":");
      var prop = camelize3(pair.slice(0, i));
      var value = pair.slice(i + 1).trim();
      prop.startsWith("webkit") ? acc[capitalize3(prop)] = value : acc[prop] = value;
      return acc;
    }, {});
  }
  function convert(createElement220, element) {
    var extraProps = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    if (typeof element === "string") {
      return element;
    }
    var children = (element.children || []).map(function(child) {
      return convert(createElement220, child);
    });
    var mixins = Object.keys(element.attributes || {}).reduce(function(acc, key) {
      var val = element.attributes[key];
      switch (key) {
        case "class":
          acc.attrs["className"] = val;
          delete element.attributes["class"];
          break;
        case "style":
          acc.attrs["style"] = styleToObject(val);
          break;
        default:
          if (key.indexOf("aria-") === 0 || key.indexOf("data-") === 0) {
            acc.attrs[key.toLowerCase()] = val;
          } else {
            acc.attrs[camelize3(key)] = val;
          }
      }
      return acc;
    }, {
      attrs: {}
    });
    var _extraProps$style = extraProps.style, existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style, remaining = _objectWithoutProperties2(extraProps, _excluded$1);
    mixins.attrs["style"] = _objectSpread22(_objectSpread22({}, mixins.attrs["style"]), existingStyle);
    return createElement220.apply(void 0, [element.tag, _objectSpread22(_objectSpread22({}, mixins.attrs), remaining)].concat(_toConsumableArray2(children)));
  }
  var PRODUCTION2 = false;
  try {
    PRODUCTION2 = false;
  } catch (e) {
  }
  function log() {
    if (!PRODUCTION2 && console && typeof console.error === "function") {
      var _console;
      (_console = console).error.apply(_console, arguments);
    }
  }
  function normalizeIconArgs(icon2) {
    if (icon2 && _typeof2(icon2) === "object" && icon2.prefix && icon2.iconName && icon2.icon) {
      return icon2;
    }
    if (parse.icon) {
      return parse.icon(icon2);
    }
    if (icon2 === null) {
      return null;
    }
    if (icon2 && _typeof2(icon2) === "object" && icon2.prefix && icon2.iconName) {
      return icon2;
    }
    if (Array.isArray(icon2) && icon2.length === 2) {
      return {
        prefix: icon2[0],
        iconName: icon2[1]
      };
    }
    if (typeof icon2 === "string") {
      return {
        prefix: "fas",
        iconName: icon2
      };
    }
  }
  function objectWithKey(key, value) {
    return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty4({}, key, value) : {};
  }
  var _excluded = ["forwardedRef"];
  function FontAwesomeIcon(_ref2) {
    var forwardedRef = _ref2.forwardedRef, props = _objectWithoutProperties2(_ref2, _excluded);
    var iconArgs = props.icon, maskArgs = props.mask, symbol = props.symbol, className = props.className, title = props.title, titleId = props.titleId, maskId = props.maskId;
    var iconLookup = normalizeIconArgs(iconArgs);
    var classes = objectWithKey("classes", [].concat(_toConsumableArray2(classList(props)), _toConsumableArray2(className.split(" "))));
    var transform2 = objectWithKey("transform", typeof props.transform === "string" ? parse.transform(props.transform) : props.transform);
    var mask = objectWithKey("mask", normalizeIconArgs(maskArgs));
    var renderedIcon = icon(iconLookup, _objectSpread22(_objectSpread22(_objectSpread22(_objectSpread22({}, classes), transform2), mask), {}, {
      symbol,
      title,
      titleId,
      maskId
    }));
    if (!renderedIcon) {
      log("Could not find icon", iconLookup);
      return null;
    }
    var abstract = renderedIcon.abstract;
    var extraProps = {
      ref: forwardedRef
    };
    Object.keys(props).forEach(function(key) {
      if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {
        extraProps[key] = props[key];
      }
    });
    return convertCurry(abstract[0], extraProps);
  }
  FontAwesomeIcon.displayName = "FontAwesomeIcon";
  FontAwesomeIcon.propTypes = {
    beat: import_prop_types20.default.bool,
    border: import_prop_types20.default.bool,
    beatFade: import_prop_types20.default.bool,
    bounce: import_prop_types20.default.bool,
    className: import_prop_types20.default.string,
    fade: import_prop_types20.default.bool,
    flash: import_prop_types20.default.bool,
    mask: import_prop_types20.default.oneOfType([import_prop_types20.default.object, import_prop_types20.default.array, import_prop_types20.default.string]),
    maskId: import_prop_types20.default.string,
    fixedWidth: import_prop_types20.default.bool,
    inverse: import_prop_types20.default.bool,
    flip: import_prop_types20.default.oneOf([true, false, "horizontal", "vertical", "both"]),
    icon: import_prop_types20.default.oneOfType([import_prop_types20.default.object, import_prop_types20.default.array, import_prop_types20.default.string]),
    listItem: import_prop_types20.default.bool,
    pull: import_prop_types20.default.oneOf(["right", "left"]),
    pulse: import_prop_types20.default.bool,
    rotation: import_prop_types20.default.oneOf([0, 90, 180, 270]),
    shake: import_prop_types20.default.bool,
    size: import_prop_types20.default.oneOf(["2xs", "xs", "sm", "lg", "xl", "2xl", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x"]),
    spin: import_prop_types20.default.bool,
    spinPulse: import_prop_types20.default.bool,
    spinReverse: import_prop_types20.default.bool,
    symbol: import_prop_types20.default.oneOfType([import_prop_types20.default.bool, import_prop_types20.default.string]),
    title: import_prop_types20.default.string,
    titleId: import_prop_types20.default.string,
    transform: import_prop_types20.default.oneOfType([import_prop_types20.default.string, import_prop_types20.default.object]),
    swapOpacity: import_prop_types20.default.bool
  };
  FontAwesomeIcon.defaultProps = {
    border: false,
    className: "",
    mask: null,
    maskId: null,
    fixedWidth: false,
    inverse: false,
    flip: false,
    icon: null,
    listItem: false,
    pull: null,
    pulse: false,
    rotation: null,
    size: null,
    spin: false,
    spinPulse: false,
    spinReverse: false,
    beat: false,
    fade: false,
    beatFade: false,
    bounce: false,
    shake: false,
    symbol: false,
    title: "",
    titleId: null,
    transform: null,
    swapOpacity: false
  };
  var convertCurry = convert.bind(null, import_react25.default.createElement);

  // node_modules/@fortawesome/free-solid-svg-icons/index.es.js
  var faBook = {
    prefix: "fas",
    iconName: "book",
    icon: [448, 512, [], "f02d", "M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"]
  };
  var faClone = {
    prefix: "fas",
    iconName: "clone",
    icon: [512, 512, [], "f24d", "M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z"]
  };
  var faLeaf = {
    prefix: "fas",
    iconName: "leaf",
    icon: [576, 512, [], "f06c", "M546.2 9.7c-5.6-12.5-21.6-13-28.3-1.2C486.9 62.4 431.4 96 368 96h-80C182 96 96 182 96 288c0 7 .8 13.7 1.5 20.5C161.3 262.8 253.4 224 384 224c8.8 0 16 7.2 16 16s-7.2 16-16 16C132.6 256 26 410.1 2.4 468c-6.6 16.3 1.2 34.9 17.5 41.6 16.4 6.8 35-1.1 41.8-17.3 1.5-3.6 20.9-47.9 71.9-90.6 32.4 43.9 94 85.8 174.9 77.2C465.5 467.5 576 326.7 576 154.3c0-50.2-10.8-102.2-29.8-144.6z"]
  };
  var faLink = {
    prefix: "fas",
    iconName: "link",
    icon: [512, 512, [], "f0c1", "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"]
  };
  var faSyncAlt = {
    prefix: "fas",
    iconName: "sync-alt",
    icon: [512, 512, [], "f2f1", "M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"]
  };
  var faTree = {
    prefix: "fas",
    iconName: "tree",
    icon: [384, 512, [], "f1bb", "M378.31 378.49L298.42 288h30.63c9.01 0 16.98-5 20.78-13.06 3.8-8.04 2.55-17.26-3.28-24.05L268.42 160h28.89c9.1 0 17.3-5.35 20.86-13.61 3.52-8.13 1.86-17.59-4.24-24.08L203.66 4.83c-6.03-6.45-17.28-6.45-23.32 0L70.06 122.31c-6.1 6.49-7.75 15.95-4.24 24.08C69.38 154.65 77.59 160 86.69 160h28.89l-78.14 90.91c-5.81 6.78-7.06 15.99-3.27 24.04C37.97 283 45.93 288 54.95 288h30.63L5.69 378.49c-6 6.79-7.36 16.09-3.56 24.26 3.75 8.05 12 13.25 21.01 13.25H160v24.45l-30.29 48.4c-5.32 10.64 2.42 23.16 14.31 23.16h95.96c11.89 0 19.63-12.52 14.31-23.16L224 440.45V416h136.86c9.01 0 17.26-5.2 21.01-13.25 3.8-8.17 2.44-17.47-3.56-24.26z"]
  };

  // src/lib/database/chaining.jsx
  var ChainingDatabaseConfig = class extends import_react26.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: this.props.activeKey,
        oids: this.props.data.oids,
        oidList: this.props.data.oidList,
        availableOids: this.props.data.availableOids,
        comps: this.props.data.comps,
        compList: this.props.data.compList,
        availableComps: this.props.data.availableComps,
        selectedOid: "",
        selectedComp: "",
        removeOid: "",
        removeComp: "",
        showConfirmCompDelete: false,
        showConfirmOidDelete: false,
        showOidModal: false,
        showCompsModal: false,
        isExpanded: false,
        saveBtnDisabled: true,
        isOpen: false,
        isModalSelectOpen: false,
        modalChecked: false,
        modalSpinning: false,
        // Chaining config settings
        defSearchCheck: this.props.data.defSearchCheck[0],
        defBindConnLimit: this.props.data.defBindConnLimit[0],
        defBindTimeout: this.props.data.defBindTimeout[0],
        defBindRetryLimit: this.props.data.defBindRetryLimit[0],
        defConcurLimit: this.props.data.defConcurLimit[0],
        defConcurOpLimit: this.props.data.defConcurOpLimit[0],
        defConnLife: this.props.data.defConnLife[0],
        defHopLimit: this.props.data.defHopLimit[0],
        defDelay: this.props.data.defDelay[0],
        defTestDelay: this.props.data.defTestDelay[0],
        defOpConnLimit: this.props.data.defOpConnLimit[0],
        defSizeLimit: this.props.data.defSizeLimit[0],
        defTimeLimit: this.props.data.defTimeLimit[0],
        defProxy: this.props.data.defProxy,
        defRefOnScoped: this.props.data.defRefOnScoped,
        defCheckAci: this.props.data.defCheckAci,
        defUseStartTLS: this.props.data.defUseStartTLS,
        // Original values used for saving config
        _defSearchCheck: this.props.data.defSearchCheck[0],
        _defBindConnLimit: this.props.data.defBindConnLimit[0],
        _defBindTimeout: this.props.data.defBindTimeout[0],
        _defBindRetryLimit: this.props.data.defBindRetryLimit[0],
        _defConcurLimit: this.props.data.defConcurLimit[0],
        _defConcurOpLimit: this.props.data.defConcurOpLimit[0],
        _defConnLife: this.props.data.defConnLife[0],
        _defHopLimit: this.props.data.defHopLimit[0],
        _defDelay: this.props.data.defDelay[0],
        _defTestDelay: this.props.data.defTestDelay[0],
        _defOpConnLimit: this.props.data.defOpConnLimit[0],
        _defSizeLimit: this.props.data.defSizeLimit[0],
        _defTimeLimit: this.props.data.defTimeLimit[0],
        _defProxy: this.props.data.defProxy,
        _defRefOnScoped: this.props.data.defRefOnScoped,
        _defCheckAci: this.props.data.defCheckAci,
        _defUseStartTLS: this.props.data.defUseStartTLS
      };
      this.handleToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onModalToggle = (isModalSelectOpen) => {
        this.setState({
          isModalSelectOpen
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSaveChainingConfig = this.handleSaveChainingConfig.bind(this);
      this.handleShowOidModal = this.handleShowOidModal.bind(this);
      this.closeOidModal = this.closeOidModal.bind(this);
      this.onOIDChange = this.onOIDChange.bind(this);
      this.saveOids = this.saveOids.bind(this);
      this.deleteOids = this.deleteOids.bind(this);
      this.handleSelectOids = this.handleSelectOids.bind(this);
      this.handleShowCompsModal = this.handleShowCompsModal.bind(this);
      this.closeCompsModal = this.closeCompsModal.bind(this);
      this.onCompsChange = this.onCompsChange.bind(this);
      this.saveComps = this.saveComps.bind(this);
      this.deleteComps = this.deleteComps.bind(this);
      this.handleSelectComps = this.handleSelectComps.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.closeConfirmOidDelete = this.closeConfirmOidDelete.bind(this);
      this.closeConfirmCompDelete = this.closeConfirmCompDelete.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleChange(e) {
      let saveBtnDisabled = true;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const check_attrs = [
        "defSearchCheck",
        "defBindConnLimit",
        "defBindTimeout",
        "defBindRetryLimit",
        "defConcurLimit",
        "defConcurOpLimit",
        "defConnLife",
        "defHopLimit",
        "defDelay",
        "defTestDelay",
        "defOpConnLimit",
        "defSizeLimit",
        "defTimeLimit",
        "defProxy",
        "defRefOnScoped",
        "defCheckAci",
        "defUseStartTLS"
      ];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        } else if (value !== this.state["_" + check_attr]) {
          saveBtnDisabled = false;
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled
      });
    }
    handleSaveChainingConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set-def"
      ];
      let val = "";
      if (this.state._defUseStartTLS !== this.state.defUseStartTLS) {
        val = "off";
        if (this.state.defUseStartTLS) {
          val = "on";
        }
        cmd.push("--use-starttls=" + val);
      }
      if (this.state._defCheckAci !== this.state.defCheckAci) {
        val = "off";
        if (this.state.defCheckAci) {
          val = "on";
        }
        cmd.push("--check-aci=" + val);
      }
      if (this.state._defRefOnScoped !== this.state.defRefOnScoped) {
        val = "off";
        if (this.state.defRefOnScoped) {
          val = "on";
        }
        cmd.push("--return-ref=" + val);
      }
      if (this.state._defProxy !== this.state.defProxy) {
        val = "off";
        if (this.state.defProxy) {
          val = "on";
        }
        cmd.push("--proxied-auth=" + val);
      }
      if (this.state._defTestDelay !== this.state.defTestDelay) {
        cmd.push("--test-response-delay=" + this.state.defTestDelay);
      }
      if (this.state._defOpConnLimit !== this.state.defOpConnLimit) {
        cmd.push("--conn-op-limit=" + this.state.defOpConnLimit);
      }
      if (this.state._defSizeLimit !== this.state.defSizeLimit) {
        cmd.push("--size-limit=" + this.state.defSizeLimit);
      }
      if (this.state._defTimeLimit !== this.state.defTimeLimit) {
        cmd.push("--time-limit=" + this.state.defTimeLimit);
      }
      if (this.state._defSearchCheck !== this.state.defSearchCheck) {
        cmd.push("--abandon-check-interval=" + this.state.defSearchCheck);
      }
      if (this.state._defBindTimeout !== this.state.defBindTimeout) {
        cmd.push("--bind-timeout=" + this.state.defBindTimeout);
      }
      if (this.state._defBindRetryLimit !== this.state.defBindRetryLimit) {
        cmd.push("--bind-attempts=" + this.state.defBindRetryLimit);
      }
      if (this.state._defConcurLimit !== this.state.defConcurLimit) {
        cmd.push("--bind-limit=" + this.state.defConcurLimit);
      }
      if (this.state._defConcurOpLimit !== this.state.defConcurOpLimit) {
        cmd.push("--op-limit=" + this.state.defConcurOpLimit);
      }
      if (this.state._defConnLife !== this.state.defConnLife) {
        cmd.push("--conn-lifetime=" + this.state.defConnLife);
      }
      if (this.state._defHopLimit !== this.state.defHopLimit) {
        cmd.push("--hop-limit=" + this.state.defHopLimit);
      }
      if (this.state._defDelay !== this.state.defDelay) {
        cmd.push("--response-delay=" + this.state.defDelay);
      }
      if (this.state._defBindConnLimit !== this.state.defBindConnLimit) {
        cmd.push("--conn-bind-limit=" + this.state.defBindConnLimit);
      }
      if (cmd.length > 5) {
        this.setState({
          saving: true
        });
        log_cmd("handleSaveChainingConfig", "Applying default chaining config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload();
          this.props.addNotification(
            "success",
            `Successfully updated chaining configuration`
          );
          this.setState({
            saving: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.reload();
          this.props.addNotification(
            "error",
            `Error updating chaining configuration - ${errMsg.desc}`
          );
          this.setState({
            saving: false
          });
        });
      }
    }
    //
    // Chaining OID modal functions
    //
    handleShowOidModal() {
      this.setState({
        showOidModal: true,
        selectedOid: ""
      });
    }
    closeOidModal() {
      this.setState({
        showOidModal: false
      });
    }
    onOIDChange(selectedItem, selectedItemProps) {
      const oid = selectedItemProps.children;
      if (oid !== this.state.selectedOid) {
        this.setState({
          selectedOid: oid
        });
      }
    }
    saveOids() {
      if (this.state.selectedOid === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--add-control=" + this.state.selectedOid
      ];
      this.setState({
        selectedOid: "",
        modalSpinning: true
      });
      log_cmd("saveOids", "Save new chaining OID controls", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeOidModal();
        this.props.reload(1);
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          `Successfully updated chaining controls`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          modalSpinning: false
        });
        this.closeOidModal();
        this.props.reload(1);
        this.props.addNotification(
          "error",
          `Error updating chaining controls - ${errMsg.desc}`
        );
      });
    }
    handleSelectOids(selectedItem, selectedItemProps) {
      const oid = selectedItemProps.children;
      if (oid !== this.state.removeOid) {
        this.setState({
          removeOid: oid
        });
      }
    }
    deleteOids(props) {
      if (this.state.removeOid === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--del-control=" + this.state.removeOid
      ];
      this.setState({
        removeOid: ""
      });
      log_cmd("deleteOids", "Delete chaining control oid", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(1);
        this.props.addNotification(
          "success",
          `Successfully removed chaining controls`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload();
        this.props.addNotification(
          "error",
          `Error removing chaining controls - ${errMsg.desc}`
        );
      });
    }
    //
    // Chaining Component modal functions
    //
    handleShowCompsModal() {
      this.setState({
        showCompsModal: true,
        selectedComp: ""
      });
    }
    closeCompsModal() {
      this.setState({
        showCompsModal: false
      });
    }
    onCompsChange(selectedItem, selectedItemProps) {
      const comp = selectedItemProps.children;
      if (comp !== this.state.selectedComp) {
        this.setState({
          selectedComp: comp
        });
      }
    }
    handleSelectComps(selectedItem, selectedItemProps) {
      const comp = selectedItemProps.children;
      if (comp !== this.state.removeComp) {
        this.setState({
          removeComp: comp
        });
      }
    }
    saveComps() {
      if (this.state.selectedComp === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--add-comp=" + this.state.selectedComp
      ];
      this.setState({
        modalSpinning: true,
        selectedComp: ""
      });
      log_cmd("saveComps", "Save new chaining components", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeCompsModal();
        this.props.reload(1);
        this.setState({
          modalSpinnming: false
        });
        this.props.addNotification(
          "success",
          `Successfully updated chaining components`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.closeCompsModal();
        this.props.reload();
        this.setState({
          modalSpinnming: false
        });
        this.props.addNotification(
          "error",
          `Error updating chaining components - ${errMsg.desc}`
        );
      });
    }
    deleteComps(props) {
      if (this.state.removeComp === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--del-comp=" + this.state.removeComp
      ];
      this.setState({
        removeComp: ""
      });
      log_cmd("deleteComps", "Delete chaining components", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(1);
        this.props.addNotification(
          "success",
          `Successfully removed chaining components`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload();
        this.props.addNotification(
          "error",
          `Error removing chaining components - ${errMsg.desc}`
        );
      });
    }
    //
    // Confirm deletion functions
    //
    showConfirmDelete(item) {
      if (item === "oid") {
        if (this.state.removeOid.length) {
          this.setState({
            showConfirmOidDelete: true
          });
        }
      } else if (item === "comp") {
        if (this.state.removeComp.length) {
          this.setState({
            showConfirmCompDelete: true
          });
        }
      }
    }
    closeConfirmOidDelete() {
      this.setState({
        showConfirmOidDelete: false
      });
    }
    closeConfirmCompDelete() {
      this.setState({
        showConfirmCompDelete: false
      });
    }
    render() {
      let oids = this.state.oidList.map(
        (oid) => /* @__PURE__ */ import_react26.default.createElement(SimpleListItem, { key: oid }, oid)
      );
      if (oids.length === 0) {
        oids = "";
      }
      let comps = this.state.compList.map(
        (comps2) => /* @__PURE__ */ import_react26.default.createElement(SimpleListItem, { key: comps2 }, comps2)
      );
      if (comps.length === 0) {
        comps = "";
      }
      let saveBtnName = "Save Settings";
      const extraPrimaryProps = {};
      if (this.props.refreshing) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react26.default.createElement("div", { id: "chaining-page", className: this.state.saving ? "ds-disabled" : "" }, /* @__PURE__ */ import_react26.default.createElement(TextContent, null, /* @__PURE__ */ import_react26.default.createElement(Text, { className: "ds-config-header", component: TextVariants.h2 }, "Database Chaining Settings")), /* @__PURE__ */ import_react26.default.createElement(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react26.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react26.default.createElement(TabTitleText, null, "Default Creation Settings") }, /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The size limit of entries returned over a database link (nsslapd-sizelimit).",
          className: "ds-margin-top-xlg"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Size Limit"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defSizeLimit,
            type: "number",
            id: "defSizeLimit",
            "aria-describedby": "defSizeLimit",
            name: "defSizeLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The maximum number of operations per connections. (nsconcurrentoperationslimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Operations Per Conn"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defConcurOpLimit,
            type: "number",
            id: "defConcurOpLimit",
            "aria-describedby": "defConcurOpLimit",
            name: "defConcurOpLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The time limit of an operation over a database link (nsslapd-timelimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Time Limit"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defTimeLimit,
            type: "number",
            id: "defTimeLimit",
            "aria-describedby": "defTimeLimit",
            name: "defTimeLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The maximum number of operations per connections. (nsconcurrentoperationslimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Connection Lifetime"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defConnLife,
            type: "number",
            id: "defConnLife",
            "aria-describedby": "defConnLife",
            name: "defConnLife",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The maximum number of TCP connections the database link establishes with the remote server.  (nsbindconnectionslimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max TCP Connections"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defBindConnLimit,
            type: "number",
            id: "defBindConnLimit",
            "aria-describedby": "defBindConnLimit",
            name: "defBindConnLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The maximum number of connections allowed over the database link.  (nsoperationconnectionslimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max LDAP Connections"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defOpConnLimit,
            type: "number",
            id: "defOpConnLimit",
            "aria-describedby": "defOpConnLimit",
            name: "defOpConnLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The number of seconds that pass before the server checks for abandoned operations.  (nsabandonedsearchcheckinterval).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Abandoned Op Check Interval"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defSearchCheck,
            type: "number",
            id: "defSearchCheck",
            "aria-describedby": "defSearchCheck",
            name: "defSearchCheck",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The maximum number of connections allowed over the database link.  (nsoperationconnectionslimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Binds Per Connection"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defConcurLimit,
            type: "number",
            id: "defConcurLimit",
            "aria-describedby": "defConcurLimit",
            name: "defConcurLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The maximum number of times a request can be forwarded from one database link to another.  (nshoplimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Database Link Hop Limit"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defHopLimit,
            type: "number",
            id: "defHopLimit",
            "aria-describedby": "defHopLimit",
            name: "defHopLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The amount of time before the bind attempt times out. (nsbindtimeout).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Timeout"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defBindTimeout,
            type: "number",
            id: "defBindTimeout",
            "aria-describedby": "defBindTimeout",
            name: "defBindTimeout",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The number of times the database link tries to bind with the remote server after a connection failure. (nsbindretrylimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Retry Limit"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.defBindRetryLimit,
            type: "number",
            id: "defBindRetryLimit",
            "aria-describedby": "defBindRetryLimit",
            name: "defBindRetryLimit",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "Sets whether ACIs are evaluated on the database link as well as the remote data server (nschecklocalaci).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
          Checkbox,
          {
            label: "Check Local ACIs",
            id: "defCheckAci",
            isChecked: this.state.defCheckAci,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "check aci"
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "Sets whether referrals are returned by scoped searches (meaning 'one-level' or 'subtree' scoped searches). (nsreferralonscopedsearch).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
          Checkbox,
          {
            label: "Send Referral On Scoped Search",
            id: "defRefOnScoped",
            isChecked: this.state.defRefOnScoped,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "send ref"
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "Sets whether proxied authentication is allowed. (nsproxiedauthorization).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
          Checkbox,
          {
            label: "Allow Proxied Authentication",
            id: "defProxy",
            isChecked: this.state.defProxy,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "prox auth"
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "Use StartTLS for connections to remote server. (nsusestarttls).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
          Checkbox,
          {
            label: "Use StartTLS",
            id: "defUseStartTLS",
            isChecked: this.state.defUseStartTLS,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "startTLS"
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Button,
        {
          className: "ds-margin-top-xlg",
          variant: "primary",
          onClick: this.handleSaveChainingConfig,
          isDisabled: this.state.saveBtnDisabled || this.state.saving,
          isLoading: this.state.saving,
          spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveBtnName
      ))), /* @__PURE__ */ import_react26.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react26.default.createElement(TabTitleText, null, "Controls & Components") }, /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react26.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react26.default.createElement(
        GridItem,
        {
          span: 4,
          title: "A list of LDAP control OIDs to be forwarded through chaining."
        },
        /* @__PURE__ */ import_react26.default.createElement(TextContent, null, /* @__PURE__ */ import_react26.default.createElement(Text, { component: TextVariants.h4 }, "Forwarded LDAP Controls")),
        /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-box ds-margin-top" }, /* @__PURE__ */ import_react26.default.createElement(SimpleList, { onSelect: this.handleSelectOids, "aria-label": "forward ctrls" }, oids)),
        /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-margin-bottom-md ds-container" }, /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-panel-left" }, /* @__PURE__ */ import_react26.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowOidModal,
            className: "ds-button-left"
          },
          "Add"
        )), /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-panel-right" }, /* @__PURE__ */ import_react26.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: (e) => this.showConfirmDelete("oid"),
            className: "ds-button-right",
            isDisabled: this.state.removeOid === ""
          },
          "Delete"
        )))
      ), /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 1 }), /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 4, title: "A list of components to go through chaining" }, /* @__PURE__ */ import_react26.default.createElement(TextContent, null, /* @__PURE__ */ import_react26.default.createElement(Text, { component: TextVariants.h4 }, "Components to Chain")), /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-box ds-margin-top" }, /* @__PURE__ */ import_react26.default.createElement(SimpleList, { onSelect: this.handleSelectComps, "aria-label": "comps" }, comps)), /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-margin-bottom-md ds-container" }, /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-panel-left" }, /* @__PURE__ */ import_react26.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: this.handleShowCompsModal,
          className: "ds-button-left"
        },
        "Add"
      )), /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-panel-right" }, /* @__PURE__ */ import_react26.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: (e) => this.showConfirmDelete("comp"),
          className: "ds-button-right",
          isDisabled: this.state.removeComp === ""
        },
        "Delete"
      )))))))), /* @__PURE__ */ import_react26.default.createElement(
        ChainControlsModal,
        {
          showModal: this.state.showOidModal,
          closeHandler: this.closeOidModal,
          handleChange: this.onOIDChange,
          saveHandler: this.saveOids,
          oidList: this.state.availableOids,
          spinning: this.state.modalSpinning
        }
      ), /* @__PURE__ */ import_react26.default.createElement(
        ChainCompsModal,
        {
          showModal: this.state.showCompsModal,
          closeHandler: this.closeCompsModal,
          handleChange: this.onCompsChange,
          saveHandler: this.saveComps,
          compList: this.state.availableComps,
          spinning: this.state.modalSpinning
        }
      ), /* @__PURE__ */ import_react26.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmOidDelete,
          closeHandler: this.closeConfirmOidDelete,
          handleChange: this.onModalChange,
          actionHandler: this.deleteOids,
          spinning: this.state.modalSpinning,
          item: this.state.removeOid,
          checked: this.state.modalChecked,
          mTitle: "Remove Chaining OID",
          mMsg: "Are you sure you want to delete this OID?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ), /* @__PURE__ */ import_react26.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmCompDelete,
          closeHandler: this.closeConfirmCompDelete,
          handleChange: this.onModalChange,
          actionHandler: this.deleteComps,
          spinning: this.state.modalSpinning,
          item: this.state.removeComp,
          checked: this.state.modalChecked,
          mTitle: "Remove Chaining Component",
          mMsg: "Are you sure you want to delete this component?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ));
    }
  };
  var ChainingConfig = class extends import_react26.default.Component {
    constructor(props) {
      super(props);
      if (this.props.data) {
        this.state = {
          errObj: {},
          showDeleteConfirm: false,
          linkPwdMatch: true,
          modalSpinning: false,
          modalChecked: false,
          saving: false,
          saveBtnDisabled: true,
          isOpen: false,
          // Settings
          nsfarmserverurl: this.props.data.nsfarmserverurl,
          nsmultiplexorbinddn: this.props.data.nsmultiplexorbinddn,
          nsmultiplexorcredentials: this.props.data.nsmultiplexorcredentials,
          nsmultiplexorcredentials_confirm: this.props.data.nsmultiplexorcredentials,
          sizelimit: this.props.data.sizelimit,
          timelimit: this.props.data.timelimit,
          bindconnlimit: this.props.data.bindconnlimit,
          opconnlimit: this.props.data.opconnlimit,
          concurrbindlimit: this.props.data.concurrbindlimit,
          bindtimeout: this.props.data.bindtimeout,
          bindretrylimit: this.props.data.bindretrylimit,
          concurroplimit: this.props.data.concurroplimit,
          connlifetime: this.props.data.connlifetime,
          searchcheckinterval: this.props.data.searchcheckinterval,
          hoplimit: this.props.data.hoplimit,
          nsbindmechanism: this.props.data.nsbindmechanism,
          nsusestarttls: this.props.data.nsusestarttls,
          nsreferralonscopedsearch: this.props.data.nsreferralonscopedsearch,
          nsproxiedauthorization: this.props.data.nsproxiedauthorization,
          nschecklocalaci: this.props.data.nschecklocalaci,
          // Original settings
          _nsfarmserverurl: this.props.data.nsfarmserverurl,
          _nsmultiplexorbinddn: this.props.data.nsmultiplexorbinddn,
          _nsmultiplexorcredentials: this.props.data.nsmultiplexorcredentials,
          _nsmultiplexorcredentials_confirm: this.props.data.nsmultiplexorcredentials,
          _sizelimit: this.props.data.sizelimit,
          _timelimit: this.props.data.timelimit,
          _bindconnlimit: this.props.data.bindconnlimit,
          _opconnlimit: this.props.data.opconnlimit,
          _concurrbindlimit: this.props.data.concurrbindlimit,
          _bindtimeout: this.props.data.bindtimeout,
          _bindretrylimit: this.props.data.bindretrylimit,
          _concurroplimit: this.props.data.concurroplimit,
          _connlifetime: this.props.data.connlifetime,
          _searchcheckinterval: this.props.data.searchcheckinterval,
          _hoplimit: this.props.data.hoplimit,
          _nsbindmechanism: this.props.data.nsbindmechanism,
          _nsusestarttls: this.props.data.nsusestarttls,
          _nsreferralonscopedsearch: this.props.data.nsreferralonscopedsearch,
          _nsproxiedauthorization: this.props.data.nsproxiedauthorization,
          _nschecklocalaci: this.props.data.nschecklocalaci
        };
      } else {
        this.state = {
          errObj: {},
          showDeleteConfirm: false,
          linkPwdMatch: true
        };
      }
      this.handleSelectToggle = (isOpen) => {
        this.setState({
          isOpen
        });
      };
      this.handleSelect = (event, selection, isPlaceholder) => {
        let saveBtnDisabled = true;
        const check_attrs = [
          "nsfarmserverurl",
          "nsmultiplexorbinddn",
          "nsmultiplexorcredentials",
          "nsmultiplexorcredentials_confirm",
          "sizelimit",
          "timelimit",
          "bindconnlimit",
          "opconnlimit",
          "concurrbindlimit",
          "bindtimeout",
          "bindretrylimit",
          "concurroplimit",
          "connlifetime",
          "searchcheckinterval",
          "hoplimit",
          "nsbindmechanism",
          "nsusestarttls",
          "nsusestarttls",
          "nsreferralonscopedsearch",
          "nsproxiedauthorization",
          "nschecklocalaci"
        ];
        for (const check_attr of check_attrs) {
          if (check_attr !== "nsbindmechanism" && this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        }
        if (selection !== this.state._nsbindmechanism) {
          saveBtnDisabled = false;
        }
        this.setState({
          nsbindmechanism: selection,
          saveBtnDisabled,
          isOpen: false
        });
      };
      this.onChange = this.onChange.bind(this);
      this.handleSaveLink = this.handleSaveLink.bind(this);
      this.deleteLink = this.deleteLink.bind(this);
      this.handleShowDeleteConfirm = this.handleShowDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleShowDeleteConfirm() {
      this.setState({
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    checkPasswords() {
      let pwdMatch = false;
      if (this.state.nsmultiplexorcredentials === this.state.nsmultiplexorcredentials_confirm) {
        pwdMatch = true;
      }
      this.setState({
        linkPwdMatch: pwdMatch
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let saveBtnDisabled = true;
      const check_attrs = [
        "nsfarmserverurl",
        "nsmultiplexorbinddn",
        "nsmultiplexorcredentials",
        "nsmultiplexorcredentials_confirm",
        "sizelimit",
        "timelimit",
        "bindconnlimit",
        "opconnlimit",
        "concurrbindlimit",
        "bindtimeout",
        "bindretrylimit",
        "concurroplimit",
        "connlifetime",
        "searchcheckinterval",
        "hoplimit",
        "nsbindmechanism",
        "nsusestarttls",
        "nsusestarttls",
        "nsreferralonscopedsearch",
        "nsproxiedauthorization",
        "nschecklocalaci"
      ];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        } else if (value !== this.state["_" + check_attr]) {
          saveBtnDisabled = false;
        }
      }
      if (value === "") {
        valueErr = true;
      }
      errObj[attr] = valueErr;
      this.setState({
        [attr]: value,
        errObj,
        saveBtnDisabled
      }, this.checkPasswords);
    }
    handleSaveLink() {
      const missingArgs = {};
      let bind_pw = "";
      let errors = false;
      if (this.state.nsfarmserverurl === "") {
        this.props.addNotification(
          "warning",
          `Missing Remote Server LDAP URL`
        );
        missingArgs.nsfarmserverurl = true;
        errors = true;
      }
      if (this.state.nsmultiplexorbinddn === "") {
        this.props.addNotification(
          "warning",
          `Missing Remote Bind DN`
        );
        missingArgs.nsmultiplexorbinddn = true;
        errors = true;
      }
      if (this.state.nsmultiplexorcredentials === "") {
        this.props.addNotification(
          "warning",
          `Missing Remote Bind DN Password`
        );
        missingArgs.nsmultiplexorcredentials = true;
        errors = true;
      }
      if (this.state.nsmultiplexorcredentials_confirm === "") {
        this.props.addNotification(
          "warning",
          `Missing Remote Bind DN Password Confirmation`
        );
        missingArgs.nsmultiplexorcredentials_confirm = true;
        errors = true;
      }
      if (this.state.nsmultiplexorcredentials !== this.state.nsmultiplexorcredentials_confirm) {
        this.props.addNotification(
          "warning",
          `Remote Bind DN Password Do Not Match`
        );
        missingArgs.nsmultiplexorcredentials = true;
        missingArgs.nsmultiplexorcredentials_confirm = true;
        errors = true;
      }
      if (errors) {
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-set",
        this.props.suffix
      ];
      if (this.state.nsfarmserverurl !== this.state._nsfarmserverurl) {
        cmd.push("--server-url=" + this.state.nsfarmserverurl);
      }
      if (this.state.nsmultiplexorbinddn !== this.state._nsmultiplexorbinddn) {
        cmd.push("--bind-dn=" + this.state.nsmultiplexorbinddn);
      }
      if (this.state.nsmultiplexorcredentials !== this.state._nsmultiplexorcredentials) {
        bind_pw = this.state.nsmultiplexorcredentials;
      }
      if (this.state.timelimit !== this.state._timelimit) {
        cmd.push("--time-limit=" + this.state.timelimit);
      }
      if (this.state.sizelimit !== this.state._sizelimit) {
        cmd.push("--size-limit=" + this.state.sizelimit);
      }
      if (this.state.bindconnlimit !== this.state._bindconnlimit) {
        cmd.push("--conn-bind-limit=" + this.state.bindconnlimit);
      }
      if (this.state.opconnlimit !== this.state._opconnlimit) {
        cmd.push("--conn-op-limit=" + this.state.opconnlimit);
      }
      if (this.state.concurrbindlimit !== this.state._concurrbindlimit) {
        cmd.push("--bind-limit=" + this.state.concurrbindlimit);
      }
      if (this.state.bindtimeout !== this.state._bindtimeout) {
        cmd.push("--bind-timeout=" + this.state.bindtimeout);
      }
      if (this.state.bindretrylimit !== this.state._bindretrylimit) {
        cmd.push("--bind-attempts=" + this.state.bindretrylimit);
      }
      if (this.state.concurroplimit !== this.state._concurroplimit) {
        cmd.push("--op-limit=" + this.state.concurroplimit);
      }
      if (this.state.connlifetime !== this.state._connlifetime) {
        cmd.push("--conn-lifetime=" + this.state.connlifetime);
      }
      if (this.state.searchcheckinterval !== this.state._searchcheckinterval) {
        cmd.push("--abandon-check-interval=" + this.state.searchcheckinterval);
      }
      if (this.state.hoplimit !== this.state._hoplimit) {
        cmd.push("--hop-limit=" + this.state.hoplimit);
      }
      if (this.state.nsbindmechanism !== this.state._nsbindmechanism) {
        cmd.push("--bind-mech=" + this.state.nsbindmechanism);
      }
      if (this.state.nsusestarttls !== this.state._nsusestarttls) {
        if (this.state.nsusestarttls) {
          cmd.push("--use-starttls=on");
        } else {
          cmd.push("--use-starttls=off");
        }
      }
      if (this.state.nsreferralonscopedsearch !== this.state._nsreferralonscopedsearch) {
        if (this.state.nsreferralonscopedsearch) {
          cmd.push("--return-ref=on");
        } else {
          cmd.push("--return-ref=off");
        }
      }
      if (this.state.nsproxiedauthorization !== this.state._nsproxiedauthorization) {
        if (this.state.nsproxiedauthorization) {
          cmd.push("--proxied-auth=on");
        } else {
          cmd.push("--proxied-auth=off");
        }
      }
      if (this.state.nschecklocalaci !== this.state._nschecklocalaci) {
        if (this.state.nschecklocalaci) {
          cmd.push("--check-aci=on");
        } else {
          cmd.push("--check-aci=off");
        }
      }
      if (cmd.length > 6) {
        this.setState({
          saving: true
        });
        const config2 = {
          cmd,
          promptArg: "--bind-pw-prompt",
          passwd: bind_pw,
          addNotification: this.props.addNotification,
          success_msg: "Successfully Updated Link Configuration",
          error_msg: "Failed to update link configuration",
          state_callback: () => {
            this.setState({ saving: false });
          },
          reload_func: this.props.reload,
          reload_arg: this.props.suffix,
          funcName: "handleSaveLink",
          funcDesc: "Save chaining link config"
        };
        callCmdStreamPassword(config2);
      }
    }
    deleteLink() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-delete",
        this.props.suffix
      ];
      log_cmd("deleteLink", "Delete database chaining link", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(true);
        this.props.addNotification(
          "success",
          `Successfully Deleted Database Link`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.loadSuffixTree(true);
        this.props.addNotification(
          "error",
          `Failed to delete database link - ${errMsg.desc}`
        );
      });
    }
    render() {
      const error = this.state.errObj;
      const extraPrimaryProps = {};
      let saveBtnName = "Save Settings";
      if (this.state.loading) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      return /* @__PURE__ */ import_react26.default.createElement("div", { className: this.state.saving ? "ds-disabled" : "" }, /* @__PURE__ */ import_react26.default.createElement(Grid, null, /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 10, className: "ds-word-wrap" }, /* @__PURE__ */ import_react26.default.createElement(TextContent, null, /* @__PURE__ */ import_react26.default.createElement(Text, { className: "ds-suffix-header", component: TextVariants.h3 }, /* @__PURE__ */ import_react26.default.createElement(FontAwesomeIcon, { size: "sm", icon: faLink }), " ", this.props.suffix, " (", /* @__PURE__ */ import_react26.default.createElement("i", null, /* @__PURE__ */ import_react26.default.createElement("font", { size: "3" }, this.props.bename)), ")", /* @__PURE__ */ import_react26.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh database link",
          onClick: () => this.props.reload(this.props.suffix)
        }
      )))), /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react26.default.createElement(
        Button,
        {
          className: "ds-float-right",
          variant: "danger",
          onClick: this.handleShowDeleteConfirm
        },
        "Delete Link"
      ))), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The LDAP URL for the remote server.  Add additional failure server URLs by separating them with a space. (nsfarmserverurl).",
          className: "ds-margin-top-lg"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Remote Server LDAP URL"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.nsfarmserverurl,
            type: "text",
            id: "nsfarmserverurl",
            "aria-describedby": "nsfarmserverurl",
            name: "nsfarmserverurl",
            onChange: (str, e) => {
              this.onChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The distinguished name (DN) of the entry to authenticate to the remote server. (nsmultiplexorbinddn).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Remote Server Bind DN"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.nsmultiplexorbinddn,
            type: "text",
            id: "nsmultiplexorbinddn",
            "aria-describedby": "nsmultiplexorbinddn",
            name: "nsmultiplexorbinddn",
            onChange: (str, e) => {
              this.onChange(e);
            }
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The password for the authenticating entry. (nsmultiplexorcredentials).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN Password"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.nsmultiplexorcredentials,
            type: "password",
            id: "nsmultiplexorcredentials",
            "aria-describedby": "nsmultiplexorcredentials",
            name: "nsmultiplexorcredentials",
            onChange: (str, e) => {
              this.onChange(e);
            },
            validated: error.nsmultiplexorcredentials || !this.state.linkPwdMatch ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "Confirm the password for the authenticating entry. (nsmultiplexorcredentials).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Confirm Password"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          TextInput,
          {
            value: this.state.nsmultiplexorcredentials_confirm,
            type: "password",
            id: "nsmultiplexorcredentials_confirm",
            "aria-describedby": "nsmultiplexorcredentials_confirm",
            name: "nsmultiplexorcredentials_confirm",
            onChange: (str, e) => {
              this.onChange(e);
            },
            validated: error.nsmultiplexorcredentials_confirm || !this.state.linkPwdMatch ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "The authentication mechanism.  Simple (user name and password), SASL/DIGEST-MD5, or SASL>GSSAPI. (nsbindmechanism).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Method"),
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
          Select,
          {
            variant: SelectVariant.single,
            "aria-label": "Select Input",
            onToggle: this.handleSelectToggle,
            onSelect: this.handleSelect,
            selections: this.state.nsbindmechanism,
            isOpen: this.state.isOpen,
            "aria-labelledby": "UID"
          },
          /* @__PURE__ */ import_react26.default.createElement(SelectOption, { key: "Simple", value: "Simple" }),
          /* @__PURE__ */ import_react26.default.createElement(SelectOption, { key: "SASL/DIGEST-MD5", value: "SASL/DIGEST-MD5" }),
          /* @__PURE__ */ import_react26.default.createElement(SelectOption, { key: "SASL/GSSAPI", value: "SASL/GSSAPI" })
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        Grid,
        {
          title: "Use StartTLS for connections to the remote server. (nsusestarttls).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
          Checkbox,
          {
            label: "Use StartTLS",
            id: "nsusestarttls",
            isChecked: this.state.nsusestarttls,
            onChange: (str, e) => {
              this.onChange(e);
            },
            "aria-label": "check startTLS"
          }
        ))
      ), /* @__PURE__ */ import_react26.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-top-xlg",
          toggleText: this.state.isExpanded ? "Hide Advanced Settings" : "Show Advanced Settings",
          onToggle: this.handleToggle,
          isExpanded: this.state.isExpanded
        },
        /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-margin-top ds-margin-left" }, /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The size limit of entries returned over a database link (nsslapd-sizelimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Size Limit"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.sizelimit,
              type: "number",
              id: "sizelimit",
              "aria-describedby": "sizelimit",
              name: "sizelimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The time limit of an operation over a database link (nsslapd-timelimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Time Limit"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.sizelimit,
              type: "number",
              id: "timelimit",
              "aria-describedby": "timelimit",
              name: "timelimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The maximum number of TCP connections the database link establishes with the remote server.  (nsbindconnectionslimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max TCP Connections"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.bindconnlimit,
              type: "number",
              id: "bindconnlimit",
              "aria-describedby": "bindconnlimit",
              name: "bindconnlimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The maximum number of connections allowed over the database link.  (nsoperationconnectionslimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max LDAP Connections"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.opconnlimit,
              type: "number",
              id: "opconnlimit",
              "aria-describedby": "opconnlimit",
              name: "opconnlimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The maximum number of concurrent bind operations per TCP connection. (nsconcurrentbindlimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Binds Per Connection"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.concurrbindlimit,
              type: "number",
              id: "concurrbindlimit",
              "aria-describedby": "concurrbindlimit",
              name: "concurrbindlimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The amount of time before the bind attempt times out. (nsbindtimeout).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Timeout"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.bindtimeout,
              type: "number",
              id: "bindtimeout",
              "aria-describedby": "bindtimeout",
              name: "bindtimeout",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The number of times the database link tries to bind with the remote server after a connection failure. (nsbindretrylimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Retry Limit"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.bindtimeout,
              type: "number",
              id: "bindretrylimit",
              "aria-describedby": "bindretrylimit",
              name: "bindretrylimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The maximum number of operations per connections. (nsconcurrentoperationslimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Operations Per Connection"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.concurroplimit,
              type: "number",
              id: "concurroplimit",
              "aria-describedby": "concurroplimit",
              name: "concurroplimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The life of a database link connection to the remote server in seconds.  0 is unlimited  (nsconnectionlife).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Connection Lifetime"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.connlifetime,
              type: "number",
              id: "connlifetime",
              "aria-describedby": "connlifetime",
              name: "connlifetime",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The number of seconds that pass before the server checks for abandoned operations.  (nsabandonedsearchcheckinterval).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Abandoned Op Check Interval"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.searchcheckinterval,
              type: "number",
              id: "searchcheckinterval",
              "aria-describedby": "searchcheckinterval",
              name: "searchcheckinterval",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "The maximum number of times a request can be forwarded from one database link to another.  (nshoplimit).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Hop Limit"),
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react26.default.createElement(
            TextInput,
            {
              value: this.state.hoplimit,
              type: "number",
              id: "hoplimit",
              "aria-describedby": "hoplimit",
              name: "hoplimit",
              onChange: (str, e) => {
                this.onChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "Allow proxied authentication to the remote server. (nsproxiedauthorization).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
            Checkbox,
            {
              label: "Allow Proxied Authentication",
              id: "nsproxiedauthorization",
              isChecked: this.state.nsproxiedauthorization,
              onChange: (str, e) => {
                this.onChange(e);
              },
              "aria-label": "send ref"
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "Sets whether ACIs are evaluated on the database link as well as the remote data server (nschecklocalaci).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
            Checkbox,
            {
              label: "Check Local ACIs",
              id: "nschecklocalaci",
              isChecked: this.state.nschecklocalaci,
              onChange: (str, e) => {
                this.onChange(e);
              },
              "aria-label": "send ref"
            }
          ))
        ), /* @__PURE__ */ import_react26.default.createElement(
          Grid,
          {
            title: "Sets whether referrals are returned by scoped searches (meaning 'one-level' or 'subtree' scoped searches). (nsreferralonscopedsearch).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react26.default.createElement(GridItem, { className: "ds-label", span: 12 }, /* @__PURE__ */ import_react26.default.createElement(
            Checkbox,
            {
              label: "Send Referral On Scoped Search",
              id: "nsreferralonscopedsearch",
              isChecked: this.state.nsreferralonscopedsearch,
              onChange: (str, e) => {
                this.onChange(e);
              },
              "aria-label": "send ref"
            }
          ))
        )),
        /* @__PURE__ */ import_react26.default.createElement("hr", null)
      ), /* @__PURE__ */ import_react26.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          onClick: this.handleSaveLink,
          variant: "primary",
          isLoading: this.state.saving,
          spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
          ...extraPrimaryProps,
          isDisabled: this.state.saveBtnDisabled || this.state.saving
        },
        saveBtnName
      ), /* @__PURE__ */ import_react26.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDeleteConfirm,
          closeHandler: this.closeDeleteConfirm,
          handleChange: this.onChange,
          actionHandler: this.deleteLink,
          spinning: this.state.modalSpinning,
          item: this.props.suffix,
          checked: this.state.modalChecked,
          mTitle: "Delete Database Link",
          mMsg: "Are you really sure you want to delete this database link?",
          mSpinningMsg: "Deleting Database Link...",
          mBtnName: "Delete Database Link"
        }
      ));
    }
  };
  var ChainControlsModal = class extends import_react26.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        oidList,
        spinning
      } = this.props;
      const oids = oidList.map(
        (oid) => /* @__PURE__ */ import_react26.default.createElement(SimpleListItem, { key: oid }, oid)
      );
      let btnName = "Add New Controls";
      const extraPrimaryProps = {};
      if (spinning) {
        btnName = "Saving Controls ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react26.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Chaining LDAP Controls",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react26.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                isDisabled: spinning,
                spinnerAriaValueText: spinning ? "Loading" : void 0,
                ...extraPrimaryProps
              },
              btnName
            ),
            /* @__PURE__ */ import_react26.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react26.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react26.default.createElement(TextContent, { title: "A list of LDAP control OIDs to be forwarded through chaining" }, /* @__PURE__ */ import_react26.default.createElement(Text, { component: TextVariants.h3 }, "Available LDAP Controls")), /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-box ds-margin-top" }, /* @__PURE__ */ import_react26.default.createElement(SimpleList, { onSelect: handleChange, "aria-label": "comps" }, oids)))
      );
    }
  };
  var ChainCompsModal = class extends import_react26.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        compList,
        spinning
      } = this.props;
      const comps = compList.map(
        (comp) => /* @__PURE__ */ import_react26.default.createElement(SimpleListItem, { key: comp }, comp)
      );
      let btnName = "Add New Components";
      const extraPrimaryProps = {};
      if (spinning) {
        btnName = "Saving Components ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react26.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Chaining Components",
          isOpen: showModal,
          onClose: closeHandler,
          "aria-labelledby": "ds-modal",
          actions: [
            /* @__PURE__ */ import_react26.default.createElement(
              Button,
              {
                key: "comps",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                isDisabled: spinning,
                spinnerAriaValueText: spinning ? "Loading" : void 0,
                ...extraPrimaryProps
              },
              btnName
            ),
            /* @__PURE__ */ import_react26.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react26.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react26.default.createElement(TextContent, { title: "A list of LDAP control components" }, /* @__PURE__ */ import_react26.default.createElement(Text, { component: TextVariants.h3 }, "Available Components")), "Available LDAP Controls", /* @__PURE__ */ import_react26.default.createElement("div", { className: "ds-box ds-margin-top" }, /* @__PURE__ */ import_react26.default.createElement(SimpleList, { onSelect: handleChange, "aria-label": "comps" }, comps)))
      );
    }
  };
  ChainCompsModal.propTypes = {
    showModal: import_prop_types21.default.bool,
    closeHandler: import_prop_types21.default.func,
    handleChange: import_prop_types21.default.func,
    saveHandler: import_prop_types21.default.func,
    compList: import_prop_types21.default.array
  };
  ChainCompsModal.defaultProps = {
    showModal: false,
    compList: []
  };
  ChainControlsModal.propTypes = {
    showModal: import_prop_types21.default.bool,
    closeHandler: import_prop_types21.default.func,
    handleChange: import_prop_types21.default.func,
    saveHandler: import_prop_types21.default.func,
    oidList: import_prop_types21.default.array
  };
  ChainControlsModal.defaultProps = {
    showModal: false,
    oidList: []
  };
  ChainingDatabaseConfig.propTypes = {
    serverId: import_prop_types21.default.string,
    addNotification: import_prop_types21.default.func,
    reload: import_prop_types21.default.func,
    data: import_prop_types21.default.object,
    enableTree: import_prop_types21.default.func
  };
  ChainingDatabaseConfig.defaultProps = {
    serverId: "",
    data: {}
  };
  ChainingConfig.propTypes = {
    serverId: import_prop_types21.default.string,
    suffix: import_prop_types21.default.string,
    bename: import_prop_types21.default.string,
    loadSuffixTree: import_prop_types21.default.func,
    addNotification: import_prop_types21.default.func,
    data: import_prop_types21.default.object,
    reload: import_prop_types21.default.func,
    enableTree: import_prop_types21.default.func
  };
  ChainingConfig.defaultProps = {
    serverId: "",
    suffix: "",
    bename: "",
    data: {}
  };

  // src/lib/database/databaseConfig.jsx
  var import_react27 = __toESM(require_react(), 1);
  var import_prop_types22 = __toESM(require_prop_types(), 1);
  var import_outlined_question_circle_icon = __toESM(require_outlined_question_circle_icon(), 1);
  var GlobalDatabaseConfig = class extends import_react27.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        saving: false,
        saveBtnDisabled: true,
        activeTabKey: this.props.data.activeTab,
        db_cache_auto: this.props.data.db_cache_auto,
        import_cache_auto: this.props.data.import_cache_auto,
        looklimit: this.props.data.looklimit,
        idscanlimit: this.props.data.idscanlimit,
        pagelooklimit: this.props.data.pagelooklimit,
        pagescanlimit: this.props.data.pagescanlimit,
        rangelooklimit: this.props.data.rangelooklimit,
        autosize: this.props.data.autosize,
        autosizesplit: this.props.data.autosizesplit,
        dbcachesize: this.props.data.dbcachesize,
        txnlogdir: this.props.data.txnlogdir,
        dbhomedir: this.props.data.dbhomedir,
        dblocks: this.props.data.dblocks,
        dblocksMonitoring: this.props.data.dblocksMonitoring,
        dblocksMonitoringThreshold: this.props.data.dblocksMonitoringThreshold,
        dblocksMonitoringPause: this.props.data.dblocksMonitoringPause,
        chxpoint: this.props.data.chxpoint,
        compactinterval: this.props.data.compactinterval,
        compacttime: this.props.data.compacttime,
        importcachesize: this.props.data.importcachesize,
        importcacheauto: this.props.data.importcacheauto,
        ndncachemaxsize: this.props.data.ndncachemaxsize,
        // These variables store the original value (used for saving config)
        _looklimit: this.props.data.looklimit,
        _idscanlimit: this.props.data.idscanlimit,
        _pagelooklimit: this.props.data.pagelooklimit,
        _pagescanlimit: this.props.data.pagescanlimit,
        _rangelooklimit: this.props.data.rangelooklimit,
        _autosize: this.props.data.autosize,
        _autosizesplit: this.props.data.autosizesplit,
        _dbcachesize: this.props.data.dbcachesize,
        _txnlogdir: this.props.data.txnlogdir,
        _dbhomedir: this.props.data.dbhomedir,
        _dblocks: this.props.data.dblocks,
        _dblocksMonitoring: this.props.data.dblocksMonitoring,
        _dblocksMonitoringThreshold: this.props.data.dblocksMonitoringThreshold,
        _dblocksMonitoringPause: this.props.data.dblocksMonitoringPause,
        _chxpoint: this.props.data.chxpoint,
        _compactinterval: this.props.data.compactinterval,
        _compacttime: this.props.data.compacttime,
        _importcachesize: this.props.data.importcachesize,
        _importcacheauto: this.props.data.importcacheauto,
        _db_cache_auto: this.props.data.db_cache_auto,
        _import_cache_auto: this.props.data.import_cache_auto,
        _ndncachemaxsize: this.props.data.ndncachemaxsize
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.handleSelectDBLocksMonitoring = this.handleSelectDBLocksMonitoring.bind(this);
      this.handleSaveDBConfig = this.handleSaveDBConfig.bind(this);
      this.maxValue = 2147483647;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onConfigChange = (event, id, min3, max3) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleSelectDBLocksMonitoring(val, e) {
      this.setState({
        dblocksMonitoring: !this.state.dblocksMonitoring
      }, this.handleChange(val, e));
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      const check_attrs = [
        "db_cache_auto",
        "import_cache_auto",
        "looklimit",
        "idscanlimit",
        "pagelooklimit",
        "pagescanlimit",
        "rangelooklimit",
        "autosize",
        "autosizesplit",
        "dbcachesize",
        "txnlogdir",
        "dbhomedir",
        "dblocks",
        "dblocksMonitoring",
        "dblocksMonitoringThreshold",
        "dblocksMonitoringPause",
        "chxpoint",
        "compactinterval",
        "compacttime",
        "importcachesize",
        "importcacheauto",
        "ndncachemaxsize"
      ];
      for (const config_attr of check_attrs) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      this.setState({
        saveBtnDisabled
      });
    }
    handleChange(str, e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    handleTimeChange(value) {
      this.setState({
        compacttime: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    save_ndn_cache(requireRestart) {
      const msg = "Successfully updated database configuration";
      if (this.state._ndncachemaxsize !== this.state.ndncachemaxsize) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "replace",
          "nsslapd-ndn-cache-max-size=" + this.state.ndncachemaxsize
        ];
        log_cmd("save_ndn_cache", "Applying config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          if (requireRestart) {
            this.props.addNotification(
              "warning",
              msg + ". You must restart the Directory Server for these changes to take effect."
            );
          } else {
            this.props.addNotification(
              "success",
              msg
            );
          }
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          this.props.addNotification(
            "error",
            `Error updating configuration - ${errMsg.desc}`
          );
        });
      } else {
        this.props.reload(this.state.activeTabKey);
        this.setState({
          saving: false
        });
        if (requireRestart) {
          this.props.addNotification(
            "warning",
            msg + ". You must restart the Directory Server for these changes to take effect."
          );
        } else {
          this.props.addNotification(
            "success",
            msg
          );
        }
      }
    }
    handleSaveDBConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "set"
      ];
      let requireRestart = false;
      if (this.state._looklimit !== this.state.looklimit) {
        cmd.push("--lookthroughlimit=" + this.state.looklimit);
      }
      if (this.state._idscanlimit !== this.state.idscanlimit) {
        cmd.push("--idlistscanlimit=" + this.state.idscanlimit);
      }
      if (this.state._pagelooklimit !== this.state.pagelooklimit) {
        cmd.push("--pagedlookthroughlimit=" + this.state.pagelooklimit);
      }
      if (this.state._pagescanlimit !== this.state.pagescanlimit) {
        cmd.push("--pagedidlistscanlimit=" + this.state.pagescanlimit);
      }
      if (this.state._rangelooklimit !== this.state.rangelooklimit) {
        cmd.push("--rangelookthroughlimit=" + this.state.rangelooklimit);
      }
      if (this.state.db_cache_auto) {
        if (this.state._db_cache_auto !== this.state.db_cache_auto) {
          if (this.state.autosize === "0") {
            cmd.push("--cache-autosize=10");
          } else {
            cmd.push("--cache-autosize=" + this.state.autosize);
          }
          requireRestart = true;
        } else if (this.state._autosize !== this.state.autosize) {
          cmd.push("--cache-autosize=" + this.state.autosize);
          requireRestart = true;
        }
      } else {
        if (this.state._db_cache_auto !== this.state.db_cache_auto) {
          cmd.push("--cache-autosize=0");
          requireRestart = true;
        }
      }
      if (this.state._autosizesplit !== this.state.autosizesplit) {
        cmd.push("--cache-autosize-split=" + this.state.autosizesplit);
        requireRestart = true;
      }
      if (this.state._dbcachesize !== this.state.dbcachesize) {
        cmd.push("--dbcachesize=" + this.state.dbcachesize);
        requireRestart = true;
      }
      if (this.state._txnlogdir !== this.state.txnlogdir) {
        cmd.push("--logdirectory=" + this.state.txnlogdir);
        requireRestart = true;
      }
      if (this.state._dbhomedir !== this.state.dbhomedir) {
        cmd.push("--db-home-directory=" + this.state.dbhomedir);
        requireRestart = true;
      }
      if (this.state._dblocks !== this.state.dblocks) {
        cmd.push("--locks=" + this.state.dblocks);
        requireRestart = true;
      }
      if (this.state._dblocksMonitoring !== this.state.dblocksMonitoring) {
        if (this.state.dblocksMonitoring) {
          cmd.push("--locks-monitoring-enabled=on");
        } else {
          cmd.push("--locks-monitoring-enabled=off");
        }
        requireRestart = true;
      }
      if (this.state._dblocksMonitoringThreshold !== this.state.dblocksMonitoringThreshold) {
        cmd.push("--locks-monitoring-threshold=" + this.state.dblocksMonitoringThreshold);
        requireRestart = true;
      }
      if (this.state._dblocksMonitoringPause !== this.state.dblocksMonitoringPause) {
        cmd.push("--locks-monitoring-pause=" + this.state.dblocksMonitoringPause);
      }
      if (this.state._chxpoint !== this.state.chxpoint) {
        cmd.push("--checkpoint-interval=" + this.state.chxpoint);
        requireRestart = true;
      }
      if (this.state._compactinterval !== this.state.compactinterval) {
        cmd.push("--compactdb-interval=" + this.state.compactinterval);
        requireRestart = true;
      }
      if (this.state._compacttime !== this.state.compacttime) {
        cmd.push("--compactdb-time=" + this.state.compacttime);
        requireRestart = true;
      }
      if (this.state.import_cache_auto) {
        if (this.state._import_cache_auto !== this.state.import_cache_auto) {
          if (this.state.importcachesize === "0") {
            cmd.push("--import-cache-autosize=-1");
          } else {
            cmd.push("--import-cache-autosize=" + this.state.importcacheauto);
          }
        } else if (this.state._importcacheauto !== this.state.importcacheauto) {
          cmd.push("--import-cache-autosize=" + this.state.importcacheauto);
        }
      } else {
        if (this.state._import_cache_auto !== this.state.import_cache_auto) {
          cmd.push("--import-cache-autosize=0");
        }
      }
      if (this.state._importcachesize !== this.state.importcachesize) {
        cmd.push("--import-cachesize=" + this.state.importcachesize);
      }
      if (cmd.length > 6) {
        this.setState({
          saving: true
        });
        log_cmd("handleSaveDBConfig", "Applying config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.save_ndn_cache(requireRestart);
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          this.props.addNotification(
            "error",
            `Error updating configuration - ${errMsg.desc}`
          );
        });
      } else {
        this.setState({
          saving: true
        }, () => {
          this.save_ndn_cache(requireRestart);
        });
      }
    }
    render() {
      let db_cache_form;
      let import_cache_form;
      let db_auto_checked = false;
      let import_auto_checked = false;
      let dblocksMonitor = "";
      const dblocksThreshold = this.state.dblocksMonitoringThreshold;
      const dblocksPause = this.state.dblocksMonitoringPause;
      if (this.state.dblocksMonitoring) {
        dblocksMonitor = /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-margin-left ds-margin-top" }, /* @__PURE__ */ import_react27.default.createElement(
          Grid,
          {
            title: "Sets the DB lock exhaustion value in percentage (valid range is 70-95). If too many locks are acquired, the server will abort the searches while the number of locks are not decreased. It helps to avoid DB corruption and long recovery. (nsslapd-db-locks-monitoring-threshold).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 3 }, "DB Locks Threshold Percentage"),
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react27.default.createElement(
            NumberInput,
            {
              value: dblocksThreshold,
              min: 70,
              max: 95,
              onMinus: () => {
                this.onMinusConfig("dblocksMonitoringThreshold");
              },
              onChange: (e) => {
                this.onConfigChange(e, "dblocksMonitoringThreshold", 70, 95);
              },
              onPlus: () => {
                this.onPlusConfig("dblocksMonitoringThreshold");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 10,
              unit: "%"
            }
          ))
        ), /* @__PURE__ */ import_react27.default.createElement(
          Grid,
          {
            title: "Sets the amount of time (milliseconds) that the monitoring thread spends waiting between checks. (nsslapd-db-locks-monitoring-pause).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 3 }, "DB Locks Pause Milliseconds"),
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react27.default.createElement(
            NumberInput,
            {
              value: dblocksPause,
              min: 0,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("dblocksMonitoringPause");
              },
              onChange: (e) => {
                this.onConfigChange(e, "dblocksMonitoringPause", 0, 0);
              },
              onPlus: () => {
                this.onPlusConfig("dblocksMonitoringPause");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 10
            }
          ))
        ));
      }
      if (this.state.db_cache_auto) {
        db_cache_form = /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react27.default.createElement(
          Grid,
          {
            title: "Enable database and entry cache auto-tuning using a percentage of the system's current resources (nsslapd-cache-autosize). If 0 is set, the default value is used instead.",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Memory Percentage"),
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react27.default.createElement(
            NumberInput,
            {
              value: this.state.autosize,
              min: 0,
              max: 100,
              onMinus: () => {
                this.onMinusConfig("autosize");
              },
              onChange: (e) => {
                this.onConfigChange(e, "autosize", 0, 100);
              },
              onPlus: () => {
                this.onPlusConfig("autosize");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 4,
              unit: "%"
            }
          ))
        ), /* @__PURE__ */ import_react27.default.createElement(
          Grid,
          {
            title: "Sets the percentage of memory that is used for the database cache. The remaining percentage is used for the entry cache (nsslapd-cache-autosize-split). If 0 is set, the default value is used instead.",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 3 }, "DB Cache Percentage"),
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react27.default.createElement(
            NumberInput,
            {
              value: this.state.autosizesplit,
              min: 1,
              max: 99,
              onMinus: () => {
                this.onMinusConfig("autosizesplit");
              },
              onChange: (e) => {
                this.onConfigChange(e, "autosizesplit", 1, 99);
              },
              onPlus: () => {
                this.onPlusConfig("autosizesplit");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 4,
              unit: "%"
            }
          ))
        ));
        db_auto_checked = true;
      } else {
        db_cache_form = /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react27.default.createElement(
          Grid,
          {
            title: "Specifies the database index cache size in bytes (nsslapd-dbcachesize).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Database Cache Size"),
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react27.default.createElement(
            NumberInput,
            {
              value: this.state.dbcachesize,
              min: 512e3,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("dbcachesize");
              },
              onChange: (e) => {
                this.onConfigChange(e, "dbcachesize", 512e3, 0);
              },
              onPlus: () => {
                this.onPlusConfig("dbcachesize");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 10
            }
          ))
        ));
        db_auto_checked = false;
      }
      if (this.state.import_cache_auto) {
        import_cache_form = /* @__PURE__ */ import_react27.default.createElement("div", { id: "auto-import-cache-form", className: "ds-margin-left" }, /* @__PURE__ */ import_react27.default.createElement(
          Grid,
          {
            title: "Enter '-1' to use 50% of available memory, '0' to disable autotuning, or enter the percentage of available memory to use.  Value range -1 through 100, default is '-1' (nsslapd-import-cache-autosize).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Import Cache Autosize"),
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react27.default.createElement(
            NumberInput,
            {
              value: this.state.importcacheauto,
              min: -1,
              max: 100,
              onMinus: () => {
                this.onMinusConfig("importcacheauto");
              },
              onChange: (e) => {
                this.onConfigChange(e, "importcacheauto", -1, 100);
              },
              onPlus: () => {
                this.onPlusConfig("importcacheauto");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 4,
              unit: this.state.importcacheauto > 0 ? "%" : ""
            }
          ))
        ));
        import_auto_checked = true;
      } else {
        import_cache_form = /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react27.default.createElement(
          Grid,
          {
            title: "The size of the database cache in bytes used in the bulk import process. (nsslapd-import-cachesize).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Import Cache Size"),
          /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react27.default.createElement(
            NumberInput,
            {
              value: this.state.importcachesize,
              min: 512e3,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("importcachesize");
              },
              onChange: (e) => {
                this.onConfigChange(e, "importcachesize", 512e3, 0);
              },
              onPlus: () => {
                this.onPlusConfig("importcachesize");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 10
            }
          ))
        ));
        import_auto_checked = false;
      }
      let spinner = "";
      if (this.state.loading) {
        spinner = /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react27.default.createElement(TextContent, null, /* @__PURE__ */ import_react27.default.createElement(Text, { component: TextVariants.h3 }, "Loading global database configuration ...")), /* @__PURE__ */ import_react27.default.createElement(Spinner, { className: "ds-margin-top", loading: true, size: "md" }));
      }
      let saveBtnName = "Save Config";
      const extraPrimaryProps = {};
      if (this.props.refreshing) {
        saveBtnName = "Saving config ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react27.default.createElement("div", { className: this.state.saving ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md", id: "db-global-page" }, spinner, /* @__PURE__ */ import_react27.default.createElement("div", { className: this.state.loading ? "ds-fadeout" : "ds-fadein" }, /* @__PURE__ */ import_react27.default.createElement(TextContent, null, /* @__PURE__ */ import_react27.default.createElement(Text, { className: "ds-config-header", component: TextVariants.h2 }, "Global Database Configuration")), /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react27.default.createElement(Tabs, { isFilled: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react27.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react27.default.createElement(TabTitleText, null, "Limits") }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The maximum number of entries that the Directory Server will check when examining candidate entries in response to a search request (nsslapd-lookthrough-limit).",
          className: "ds-margin-top-xlg"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Database Look Through Limit"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.looklimit,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("looklimit");
            },
            onChange: (e) => {
              this.onConfigChange(e, "looklimit", -1, 0);
            },
            onPlus: () => {
              this.onPlusConfig("looklimit");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The number of entry IDs that are searched during a search operation (nsslapd-idlistscanlimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "ID List Scan Limit"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.idscanlimit,
            min: 100,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("idscanlimit");
            },
            onChange: (e) => {
              this.onConfigChange(e, "idscanlimit", 100, 0);
            },
            onPlus: () => {
              this.onPlusConfig("idscanlimit");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The maximum number of entries that the Directory Server will check when examining candidate entries for a search which uses the simple paged results control (nsslapd-pagedlookthroughlimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Paged Search Look Through Limit"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.pagelooklimit,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("pagelooklimit");
            },
            onChange: (e) => {
              this.onConfigChange(e, "pagelooklimit", -1, 0);
            },
            onPlus: () => {
              this.onPlusConfig("pagelooklimit");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The number of entry IDs that are searched, specifically, for a search operation using the simple paged results control (nsslapd-pagedidlistscanlimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Paged Search ID List Scan Limit"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.pagescanlimit,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("pagescanlimit");
            },
            onChange: (e) => {
              this.onConfigChange(e, "pagescanlimit", -1, 0);
            },
            onPlus: () => {
              this.onPlusConfig("pagescanlimit");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The maximum number of entries that the Directory Server will check when examining candidate entries in response to a range search request (nsslapd-rangelookthroughlimit).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Range Search Look Through Limit"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.rangelooklimit,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("rangelooklimit");
            },
            onChange: (e) => {
              this.onConfigChange(e, "rangelooklimit", -1, 0);
            },
            onPlus: () => {
              this.onPlusConfig("rangelooklimit");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ))), /* @__PURE__ */ import_react27.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react27.default.createElement(TabTitleText, null, "Database Cache") }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react27.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react27.default.createElement(
        Checkbox,
        {
          label: "Automatic Cache Tuning",
          onChange: this.handleChange,
          isChecked: db_auto_checked,
          "aria-label": "uncontrolled checkbox example",
          id: "db_cache_auto"
        }
      )), /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 12 }, db_cache_form)))), /* @__PURE__ */ import_react27.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react27.default.createElement(TabTitleText, null, "Import Cache") }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react27.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react27.default.createElement(
        Checkbox,
        {
          label: "Automatic Import Cache Tuning",
          title: "Set import cache to be set automatically",
          onChange: this.handleChange,
          isChecked: import_auto_checked,
          "aria-label": "uncontrolled checkbox example",
          id: "import_cache_auto"
        }
      )), /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 12 }, import_cache_form)))), /* @__PURE__ */ import_react27.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react27.default.createElement(TabTitleText, null, "NDN Cache") }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "Set the maximum size in bytes for the Normalized DN Cache (nsslapd-ndn-cache-max-size).",
          className: "ds-margin-top-xlg"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Normalized DN Cache Max Size"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.ndncachemaxsize,
            min: 1e6,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("ndncachemaxsize");
            },
            onChange: (e) => {
              this.onConfigChange(e, "ndncachemaxsize", 1e6, 0);
            },
            onPlus: () => {
              this.onPlusConfig("ndncachemaxsize");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ))), /* @__PURE__ */ import_react27.default.createElement(Tab, { eventKey: 4, title: /* @__PURE__ */ import_react27.default.createElement(TabTitleText, null, "Database Locks") }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The number of database locks (nsslapd-db-locks).",
          className: "ds-margin-top-xlg"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Database Locks"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.dblocks,
            min: 1e4,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("dblocks");
            },
            onChange: (e) => {
              this.onConfigChange(e, "dblocks", 1e4, 0);
            },
            onPlus: () => {
              this.onPlusConfig("dblocks");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-inline" }, /* @__PURE__ */ import_react27.default.createElement(
        Checkbox,
        {
          label: "Enable DB Lock Monitoring",
          id: "dblocksMonitoring",
          isChecked: this.state.dblocksMonitoring,
          onChange: this.handleSelectDBLocksMonitoring,
          "aria-label": "uncontrolled checkbox example"
        }
      )), /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-inline" }, /* @__PURE__ */ import_react27.default.createElement(
        Tooltip,
        {
          id: "dblockmonitor",
          position: "bottom",
          content: /* @__PURE__ */ import_react27.default.createElement("div", null, "Database lock monitoring checks if the database locks are about to be exhausted, and if they are the server will abort all the current searches in order to prevent database corruption.")
        },
        /* @__PURE__ */ import_react27.default.createElement(
          import_outlined_question_circle_icon.OutlinedQuestionCircleIcon,
          {
            className: "ds-left-margin"
          }
        )
      ))), /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 12 }, dblocksMonitor)))), /* @__PURE__ */ import_react27.default.createElement(Tab, { eventKey: 5, title: /* @__PURE__ */ import_react27.default.createElement(TabTitleText, null, "Advanced Settings") }, /* @__PURE__ */ import_react27.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "Database Transaction Log Location (nsslapd-db-logdirectory).",
          className: "ds-margin-top-xlg"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Transaction Logs Directory"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          TextInput,
          {
            value: this.state.txnlogdir,
            type: "text",
            id: "txnlogdir",
            "aria-describedby": "txnlogdir",
            name: "txnlogdir",
            onChange: this.handleChange
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "Location for database memory mapped files.  You must specify a subdirectory of a tempfs type filesystem (nsslapd-db-home-directory).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Database Home Directory"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          TextInput,
          {
            value: this.state.dbhomedir,
            type: "text",
            id: "dbhomedir",
            "aria-describedby": "dbhomedir",
            name: "dbhomedir",
            onChange: this.handleChange
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The Time Of Day to perform the database compaction after the compact interval has been met.  Uses the format: 'HH:MM' and defaults to '23:59'. (nsslapd-db-compactdb-time)",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Database Compaction Time"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react27.default.createElement(
          TimePicker,
          {
            time: this.state.compacttime,
            onChange: this.handleTimeChange,
            is24Hour: true
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "The interval in seconds when the database is compacted (nsslapd-db-compactdb-interval). The default is 30 days at midnight. 0 is no compaction.",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Database Compaction Interval"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.compactinterval,
            min: 0,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("compactinterval");
            },
            onChange: (e) => {
              this.onConfigChange(e, "compactinterval", 0, 0);
            },
            onPlus: () => {
              this.onPlusConfig("compactinterval");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ), /* @__PURE__ */ import_react27.default.createElement(
        Grid,
        {
          title: "Amount of time in seconds after which the Directory Server sends a checkpoint entry to the database transaction log (nsslapd-db-checkpoint-interval).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Database Checkpoint Interval"),
        /* @__PURE__ */ import_react27.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react27.default.createElement(
          NumberInput,
          {
            value: this.state.chxpoint,
            min: 10,
            max: 300,
            onMinus: () => {
              this.onMinusConfig("chxpoint");
            },
            onChange: (e) => {
              this.onConfigChange(e, "chxpoint", 10, 0);
            },
            onPlus: () => {
              this.onPlusConfig("chxpoint");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 10
          }
        ))
      ))))), /* @__PURE__ */ import_react27.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          onClick: this.handleSaveDBConfig,
          variant: "primary",
          isLoading: this.state.saving,
          spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
          ...extraPrimaryProps,
          isDisabled: this.state.saveBtnDisabled || this.state.saving
        },
        saveBtnName
      )));
    }
  };
  GlobalDatabaseConfig.propTypes = {
    serverId: import_prop_types22.default.string,
    addNotification: import_prop_types22.default.func,
    data: import_prop_types22.default.object,
    reload: import_prop_types22.default.func,
    enableTree: import_prop_types22.default.func
  };
  GlobalDatabaseConfig.defaultProps = {
    serverId: "",
    data: {}
  };

  // src/lib/database/suffix.jsx
  var import_react35 = __toESM(require_react(), 1);

  // src/lib/database/attrEncryption.jsx
  var import_react29 = __toESM(require_react(), 1);

  // src/lib/database/databaseTables.jsx
  var import_react28 = __toESM(require_react(), 1);
  var import_trash_alt_icon = __toESM(require_trash_alt_icon(), 1);
  var import_arrow_right_icon3 = __toESM(require_arrow_right_icon(), 1);
  var import_prop_types23 = __toESM(require_prop_types(), 1);
  var ReferralTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Referral", transforms: [sortable] },
          { props: { textCenter: true }, title: "Delete Referral" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getDeleteButton = this.getDeleteButton.bind(this);
    }
    getDeleteButton(name2) {
      return /* @__PURE__ */ import_react28.default.createElement("a", null, /* @__PURE__ */ import_react28.default.createElement(
        import_trash_alt_icon.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.props.deleteRef(name2);
          },
          title: "Delete this referral"
        }
      ));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const refRow of this.props.rows) {
        rows.push({
          cells: [refRow, { props: { textCenter: true }, title: this.getDeleteButton(refRow) }]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Referrals"] }];
        columns = [{ title: "Referrals" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedRefs = [...this.props.rows];
      sortedRefs.sort();
      if (direction !== SortByDirection.asc) {
        sortedRefs.reverse();
      }
      for (const refRow of sortedRefs) {
        rows.push({ cells: [refRow, { props: { textCenter: true }, title: this.getDeleteButton(refRow) }] });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "referral table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var IndexTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Attribute", transforms: [sortable] },
          // name
          { title: "Indexing Types", transforms: [sortable] },
          // types
          { title: "Matching Rules", transforms: [sortable] }
          // matchingrules
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      this.setState({ rows: [...this.props.rows] });
    }
    actions() {
      return [
        {
          title: "Edit Index",
          onClick: (event, rowId, rowData, extra) => this.props.editIndex(rowData)
        },
        {
          title: "Reindex",
          onClick: (event, rowId, rowData, extra) => this.props.reindexIndex(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Index",
          onClick: (event, rowId, rowData, extra) => this.props.deleteIndex(rowData[0], rowData)
        }
      ];
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      for (const row of this.props.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2]]);
      }
      if (val === "") {
        rows = [...this.props.rows];
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Indexes" }];
        tableRows = [{ cells: ["No Indexes"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react28.default.createElement(
        SearchInput,
        {
          className: "ds-margin-top-xlg",
          placeholder: "Search indexes",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt, val) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "glue table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort,
          actions: has_rows && this.props.editable ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var EncryptedAttrTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Encrypted Attribute", transforms: [sortable] },
          { props: { textCenter: true }, title: "Delete Attribute" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getDeleteButton = this.getDeleteButton.bind(this);
    }
    getDeleteButton(name2) {
      return /* @__PURE__ */ import_react28.default.createElement("a", null, /* @__PURE__ */ import_react28.default.createElement(
        import_trash_alt_icon.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.props.deleteAttr(name2);
          },
          title: "Delete this attribute"
        }
      ));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const attrRow of this.props.rows) {
        rows.push({
          cells: [attrRow, { props: { textCenter: true }, title: this.getDeleteButton(attrRow) }]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Attributes"] }];
        columns = [{ title: "Encrypted Attribute" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedAttrs = [...this.props.rows];
      sortedAttrs.sort();
      if (direction !== SortByDirection.asc) {
        sortedAttrs.reverse();
      }
      for (const attrRow of sortedAttrs) {
        rows.push({ cells: [attrRow, { props: { textCenter: true }, title: this.getDeleteButton(attrRow) }] });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "referral table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var LDIFTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "LDIF File", transforms: [sortable] },
          { title: "Creation Date", transforms: [sortable] },
          { title: "File Size", transforms: [sortable] },
          { title: "" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getImportButton = this.getImportButton.bind(this);
    }
    getImportButton(name2) {
      return /* @__PURE__ */ import_react28.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: () => {
            this.props.confirmImport(name2);
          },
          title: "Initialize the database with this LDIF file"
        },
        "Import"
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const ldifRow of this.props.rows) {
        rows.push({
          cells: [
            ldifRow[0],
            ldifRow[1],
            ldifRow[2]
          ]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No LDIF files"] }];
        columns = [{ title: "LDIF File" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedLDIF = [...this.props.rows];
      sortedLDIF.sort();
      if (direction !== SortByDirection.asc) {
        sortedLDIF.reverse();
      }
      for (const ldifRow of sortedLDIF) {
        rows.push({
          cells: [
            ldifRow[0],
            ldifRow[1],
            ldifRow[2]
          ]
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Import LDIF File",
          onClick: (event, rowId, rowData, extra) => this.props.confirmImport(rowData.cells[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "ldif table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: this.props.rows.length > 0 ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var LDIFManageTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "LDIF File", transforms: [sortable] },
          { title: "Suffix", transforms: [sortable] },
          { title: "Creation Date", transforms: [sortable] },
          { title: "File Size", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const ldifRow of this.props.rows) {
        rows.push({
          cells: [ldifRow[0], ldifRow[3], ldifRow[1], ldifRow[2]]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No LDIF files"] }];
        columns = [{ title: "LDIF File" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedLDIF = [...this.props.rows];
      sortedLDIF.sort();
      if (direction !== SortByDirection.asc) {
        sortedLDIF.reverse();
      }
      for (const ldifRow of sortedLDIF) {
        rows.push({
          cells: [ldifRow[0], ldifRow[3], ldifRow[1], ldifRow[2]]
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Import LDIF",
          onClick: (event, rowId, rowData, extra) => this.props.confirmImport(rowData.cells[0], rowData.cells[1])
        },
        {
          title: "Delete LDIF",
          onClick: (event, rowId, rowData, extra) => this.props.confirmDelete(rowData.cells[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      let hasRows = true;
      if (this.props.rows.length === 0) {
        hasRows = false;
      }
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "manage ldif table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: hasRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var BackupTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Backup", transforms: [sortable] },
          { title: "Creation Date", transforms: [sortable] },
          { title: "Size", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const bakRow of this.props.rows) {
        rows.push({
          cells: [bakRow[0], bakRow[1], bakRow[2]]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Backups"] }];
        columns = [{ title: "Backups" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedBaks = [...this.props.rows];
      sortedBaks.sort();
      if (direction !== SortByDirection.asc) {
        sortedBaks.reverse();
      }
      for (const bakRow of sortedBaks) {
        rows.push({
          cells: [bakRow[0], bakRow[1], bakRow[2]]
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Restore Backup",
          onClick: (event, rowId, rowData, extra) => this.props.confirmRestore(rowData.cells[0])
        },
        {
          title: "Delete Backup",
          onClick: (event, rowId, rowData, extra) => this.props.confirmDelete(rowData.cells[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      let hasRows = true;
      if (this.props.rows.length === 0) {
        hasRows = false;
      }
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "backup table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: hasRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "up"
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var PwpTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Target DN", transforms: [sortable] },
          { title: "Policy Type", transforms: [sortable] },
          { title: "Database Suffix", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const pwpRow of this.props.rows) {
        rows.push({
          cells: [pwpRow[0], pwpRow[1], pwpRow[2]]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Local Policies"] }];
        columns = [{ title: "Local Password Policies" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedPwp = [...this.props.rows];
      sortedPwp.sort();
      if (direction !== SortByDirection.asc) {
        sortedPwp.reverse();
      }
      for (const pwpRow of sortedPwp) {
        rows.push({
          cells: [pwpRow[0], pwpRow[1], pwpRow[2]]
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Policy",
          onClick: (event, rowId, rowData, extra) => this.props.editPolicy(rowData.cells[0])
        },
        {
          title: "Delete policy",
          onClick: (event, rowId, rowData, extra) => this.props.deletePolicy(rowData.cells[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      let hasRows = true;
      if (this.props.rows.length === 0) {
        hasRows = false;
      }
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "pwp table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: hasRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var VLVTable = class extends import_react28.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        noRows: true,
        columns: [
          {
            title: "Name",
            transforms: [sortable],
            cellFormatters: [expandable]
          },
          {
            title: "Search Base",
            transforms: [sortable]
          }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1]
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2]
          ]
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getScopeKey(scope) {
      const mapping = {
        2: "subtree",
        1: "one",
        0: "base"
      };
      return mapping[scope];
    }
    getExpandedRow(row) {
      const sort_indexes = row.sorts.map((sort) => {
        let indexState;
        if (sort.attrs.vlvenabled[0] === "0") {
          indexState = /* @__PURE__ */ import_react28.default.createElement("font", { size: "2", color: "#d01c8b" }, /* @__PURE__ */ import_react28.default.createElement("b", null, "Disabled"));
        } else {
          indexState = /* @__PURE__ */ import_react28.default.createElement("font", { size: "2", color: "#4dac26" }, /* @__PURE__ */ import_react28.default.createElement("b", null, "Uses: "), sort.attrs.vlvuses[0]);
        }
        return /* @__PURE__ */ import_react28.default.createElement(GridItem, { key: sort.attrs.vlvsort[0], className: "ds-container" }, /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-lower-field-md" }, /* @__PURE__ */ import_react28.default.createElement(import_arrow_right_icon3.ArrowRightIcon, null), " ", sort.attrs.vlvsort[0], " (", indexState, ")"), /* @__PURE__ */ import_react28.default.createElement("div", null, /* @__PURE__ */ import_react28.default.createElement(
          Button,
          {
            className: "ds-left-margin",
            onClick: () => {
              this.props.deleteSortFunc(row.attrs.cn[0], sort.attrs.vlvsort[0]);
            },
            id: row.attrs.cn[0],
            icon: /* @__PURE__ */ import_react28.default.createElement(import_trash_alt_icon.TrashAltIcon, null),
            variant: "link"
          },
          "Delete"
        )));
      });
      return /* @__PURE__ */ import_react28.default.createElement(Grid, null, /* @__PURE__ */ import_react28.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Search Base:"), /* @__PURE__ */ import_react28.default.createElement(GridItem, { span: 10 }, row.attrs.vlvbase[0]), /* @__PURE__ */ import_react28.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Search Filter:"), /* @__PURE__ */ import_react28.default.createElement(GridItem, { span: 10 }, row.attrs.vlvfilter[0]), /* @__PURE__ */ import_react28.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Scope:"), /* @__PURE__ */ import_react28.default.createElement(GridItem, { span: 10 }, this.getScopeKey(row.attrs.vlvscope[0])), /* @__PURE__ */ import_react28.default.createElement(GridItem, { className: "ds-label", span: 12 }, "Sort Indexes:"), /* @__PURE__ */ import_react28.default.createElement("div", { className: "ds-margin-top ds-indent" }, sort_indexes), /* @__PURE__ */ import_react28.default.createElement(GridItem, { className: "ds-label", span: 1 }, /* @__PURE__ */ import_react28.default.createElement(
        Button,
        {
          className: "ds-margin-top",
          onClick: () => {
            this.props.addSortFunc(row.attrs.cn[0]);
          },
          variant: "primary"
        },
        "Create Sort Index"
      )));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let count = 0;
      let noRows = true;
      for (const row of this.props.rows) {
        rows.push(
          {
            isOpen: false,
            cells: [row.attrs.cn[0], row.attrs.vlvbase[0]]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No VLV Indexes"] }];
        columns = [{ title: "VLV Indexes" }];
      } else {
        noRows = false;
      }
      this.setState({
        rows,
        columns,
        noRows
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    actions() {
      return [
        {
          title: "Reindex VLV",
          onClick: (event, rowId, rowData, extra) => this.props.reindexFunc(rowData.cells[0])
        },
        {
          title: "Delete VLV",
          onClick: (event, rowId, rowData, extra) => {
            this.props.deleteFunc(rowData.cells[0]);
          }
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react28.default.createElement("div", { className: this.props.saving || this.props.updating ? "ds-margin-top-lg ds-disabled" : "ds-margin-top-lg" }, /* @__PURE__ */ import_react28.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "vlv table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          onCollapse: this.handleCollapse,
          actions: !this.state.noRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react28.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react28.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react28.default.createElement(
        Pagination,
        {
          itemCount: this.state.rows.length / 2,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  VLVTable.propTypes = {
    rows: import_prop_types23.default.array,
    deleteFunc: import_prop_types23.default.func,
    reindexFunc: import_prop_types23.default.func
  };
  VLVTable.defaultProps = {
    rows: []
  };
  PwpTable.propTypes = {
    rows: import_prop_types23.default.array,
    editPolicy: import_prop_types23.default.func,
    deletePolicy: import_prop_types23.default.func
  };
  PwpTable.defaultProps = {
    rows: []
  };
  BackupTable.propTypes = {
    rows: import_prop_types23.default.array,
    confirmRestore: import_prop_types23.default.func,
    confirmDelete: import_prop_types23.default.func
  };
  BackupTable.defaultProps = {
    rows: []
  };
  LDIFTable.propTypes = {
    rows: import_prop_types23.default.array,
    confirmImport: import_prop_types23.default.func
  };
  LDIFTable.defaultProps = {
    rows: []
  };
  LDIFManageTable.propTypes = {
    rows: import_prop_types23.default.array,
    confirmImport: import_prop_types23.default.func,
    confirmDelete: import_prop_types23.default.func
  };
  LDIFManageTable.defaultProps = {
    rows: []
  };
  ReferralTable.propTypes = {
    rows: import_prop_types23.default.array,
    deleteRef: import_prop_types23.default.func
  };
  ReferralTable.defaultProps = {
    rows: []
  };
  IndexTable.propTypes = {
    editable: import_prop_types23.default.bool,
    rows: import_prop_types23.default.array,
    editIndex: import_prop_types23.default.func,
    reindexIndex: import_prop_types23.default.func,
    deleteIndex: import_prop_types23.default.func
  };
  IndexTable.defaultProps = {
    editable: false,
    rows: []
  };
  EncryptedAttrTable.propTypes = {
    deleteAttr: import_prop_types23.default.func,
    rows: import_prop_types23.default.array
  };
  EncryptedAttrTable.defaultProps = {
    rows: []
  };

  // src/lib/database/attrEncryption.jsx
  var import_prop_types24 = __toESM(require_prop_types(), 1);
  var AttrEncryption = class extends import_react29.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSelect", (event, selection) => {
        this.setState({
          addAttr: selection,
          isSelectOpen: false
        });
      });
      __publicField(this, "handleSelectToggle", (isSelectOpen) => {
        this.setState({
          isSelectOpen
        });
      });
      __publicField(this, "handleSelectClear", () => {
        this.setState({
          addAttr: "",
          isSelectOpen: false
        });
      });
      this.state = {
        showConfirmAttrDelete: false,
        addAttr: "",
        delAttr: "",
        isSelectOpen: false,
        modalSpinning: false,
        modalChecked: false,
        saving: false
      };
      this.showConfirmAttrDelete = this.showConfirmAttrDelete.bind(this);
      this.closeConfirmAttrDelete = this.closeConfirmAttrDelete.bind(this);
      this.handleAddEncryptedAttr = this.handleAddEncryptedAttr.bind(this);
      this.delEncryptedAttr = this.delEncryptedAttr.bind(this);
      this.onHandleModalChange = this.onHandleModalChange.bind(this);
      this.handleSelect = this.handleSelect.bind(this);
      this.handleSelectToggle = this.handleSelectToggle.bind(this);
      this.handleSelectClear = this.handleSelectClear.bind(this);
    }
    onHandleModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmAttrDelete(name2) {
      this.setState({
        showConfirmAttrDelete: true,
        delAttr: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmAttrDelete() {
      this.setState({
        showConfirmAttrDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    handleAddEncryptedAttr() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "attr-encrypt",
        "--add-attr=" + this.state.addAttr,
        this.props.suffix
      ];
      log_cmd("handleAddEncryptedAttr", "Delete suffix referral", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          `Successfully added encrypted attribute`
        );
        this.setState({
          saving: false,
          addAttr: ""
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failed to add encrypted attribute - ${errMsg.desc}`
        );
        this.setState({
          saving: false,
          addAttr: ""
        });
      });
    }
    delEncryptedAttr() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "attr-encrypt",
        "--del-attr=" + this.state.delAttr,
        this.props.suffix
      ];
      log_cmd("delEncryptedAttr", "Delete encrypted attribute", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          `Encrypted attribute successfully deleted`
        );
        this.closeConfirmAttrDelete();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failure deleting encrypted attribute - ${errMsg.desc}`
        );
        this.closeConfirmAttrDelete();
      });
    }
    render() {
      const {
        addAttr,
        saving,
        isSelectOpen,
        modalSpinning
      } = this.state;
      const fullList = [];
      const attrs = [];
      for (const attrProp of this.props.rows) {
        fullList.push(attrProp.name);
      }
      for (const attr of this.props.attrs) {
        if (fullList.indexOf(attr) === -1) {
          attrs.push(attr);
        }
      }
      let saveBtnName = "Add Attribute";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Adding Attribute ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react29.default.createElement("div", { className: saving || modalSpinning ? "ds-margin-top-lg ds-disabled" : "ds-margin-top-lg" }, /* @__PURE__ */ import_react29.default.createElement(
        EncryptedAttrTable,
        {
          key: this.props.rows,
          rows: this.props.rows,
          deleteAttr: this.showConfirmAttrDelete
        }
      ), /* @__PURE__ */ import_react29.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react29.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react29.default.createElement(
        Select,
        {
          variant: SelectVariant.typeahead,
          onToggle: this.handleSelectToggle,
          onSelect: this.handleSelect,
          onClear: this.handleSelectClear,
          selections: addAttr,
          isOpen: isSelectOpen,
          "aria-labelledby": "typeAhead-AttrEnc",
          placeholderText: "Type attribute name to be encrypted",
          noResultsFoundText: "There are no matching entries"
        },
        attrs.map((attr, index) => /* @__PURE__ */ import_react29.default.createElement(
          SelectOption,
          {
            key: index,
            value: attr
          }
        ))
      )), /* @__PURE__ */ import_react29.default.createElement(GridItem, { span: 3, className: "ds-no-padding" }, /* @__PURE__ */ import_react29.default.createElement(
        Button,
        {
          className: "ds-left-margin",
          variant: "primary",
          onClick: this.handleAddEncryptedAttr,
          isLoading: saving,
          isDisabled: addAttr === "" || saving,
          spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveBtnName
      ))), /* @__PURE__ */ import_react29.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmAttrDelete,
          closeHandler: this.closeConfirmAttrDelete,
          handleChange: this.onHandleModalChange,
          actionHandler: this.delEncryptedAttr,
          spinning: this.state.modalSpinning,
          item: this.state.delAttr,
          checked: this.state.modalChecked,
          mTitle: "Remove Attribute Encryption",
          mMsg: "Are you sure you want to remove this encrypted attribute?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ));
    }
  };
  AttrEncryption.propTypes = {
    rows: import_prop_types24.default.array,
    suffix: import_prop_types24.default.string,
    serverId: import_prop_types24.default.string,
    addNotification: import_prop_types24.default.func,
    attrs: import_prop_types24.default.array,
    reload: import_prop_types24.default.func
  };
  AttrEncryption.defaultProps = {
    rows: [],
    suffix: "",
    serverId: "",
    attrs: []
  };

  // src/lib/database/suffixConfig.jsx
  var import_react30 = __toESM(require_react(), 1);
  var import_prop_types25 = __toESM(require_prop_types(), 1);
  var SuffixConfig = class extends import_react30.default.Component {
    render() {
      let cacheInputs;
      if (this.props.autoTuning) {
        const cacheValue = this.props.cachesize + "  (auto-sized)";
        const cachememValue = this.props.cachememsize + "  (auto-sized)";
        cacheInputs = /* @__PURE__ */ import_react30.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "The entry cache size in bytes setting is being auto-sized and is read-only - see Global Database Configuration" }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Entry Cache Size"), /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react30.default.createElement(
          TextInput,
          {
            value: cachememValue,
            type: "text",
            id: "cachememsize",
            "aria-describedby": "cachememsize",
            name: "cachememsize",
            isDisabled: true
          }
        ))), /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "The entry cache max entries setting is being auto-sized and is read-only - see Global Database Configuration" }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Entry Cache Max Entries"), /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react30.default.createElement(
          TextInput,
          {
            value: cacheValue,
            type: "text",
            id: "cachesize",
            "aria-describedby": "cachesize",
            name: "cachesize",
            isDisabled: true
          }
        ))), /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "The available memory space in bytes for the DN cache. The DN cache is similar to the entry cache for a database, only its table stores only the entry ID and the entry DN (nsslapd-dncachememsize)." }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { className: "ds-label", span: 3 }, "DN Cache Size"), /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react30.default.createElement(
          TextInput,
          {
            value: this.props.dncachememsize,
            type: "number",
            id: "dncachememsize",
            "aria-describedby": "dncachememsize",
            name: "dncachememsize",
            onChange: (str, e) => {
              this.props.handleChange(e);
            }
          }
        ))));
      } else {
        cacheInputs = /* @__PURE__ */ import_react30.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "The size for the available memory space in bytes for the entry cache (nsslapd-cachememsize)." }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Entry Cache Size"), /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react30.default.createElement(
          TextInput,
          {
            value: this.props.cachememsize,
            type: "number",
            id: "cachememsize",
            "aria-describedby": "cachememsize",
            name: "cachememsize",
            onChange: (str, e) => {
              this.props.handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "The number of entries to keep in the entry cache, use'-1' for unlimited (nsslapd-cachesize)." }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Entry Cache Max Entries"), /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react30.default.createElement(
          TextInput,
          {
            value: this.props.cachesize,
            type: "number",
            id: "cachesize",
            "aria-describedby": "cachesize",
            name: "cachesize",
            onChange: (str, e) => {
              this.props.handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "the available memory space in bytes for the DN cache. The DN cache is similar to the entry cache for a database, only its table stores only the entry ID and the entry DN (nsslapd-dncachememsize)." }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { className: "ds-label", span: 3 }, "DN Cache Size"), /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react30.default.createElement(
          TextInput,
          {
            value: this.props.dncachememsize,
            type: "number",
            id: "dncachememsize",
            "aria-describedby": "dncachememsize",
            name: "dncachememsize",
            onChange: (str, e) => {
              this.props.handleChange(e);
            }
          }
        ))));
      }
      let saveBtnName = "Save Configuration";
      const extraPrimaryProps = {};
      if (this.props.saving) {
        saveBtnName = "Saving ...";
        extraPrimaryProps.spinnerAriaValueText = "saving";
      }
      return /* @__PURE__ */ import_react30.default.createElement("div", { className: "ds-margin-top-lg" }, cacheInputs, /* @__PURE__ */ import_react30.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react30.default.createElement(
        Grid,
        {
          className: "ds-margin-top-lg",
          title: "Set the backend type.  Warning, changing this setting could lead to unexpected database behavior."
        },
        /* @__PURE__ */ import_react30.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Backend State"),
        /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react30.default.createElement(
          FormSelect,
          {
            id: "dbstate",
            value: this.props.dbstate,
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react30.default.createElement(FormSelectOption, { value: "backend", label: "Backend" }),
          /* @__PURE__ */ import_react30.default.createElement(FormSelectOption, { value: "disabled", label: "Disabled" }),
          /* @__PURE__ */ import_react30.default.createElement(FormSelectOption, { value: "referral", label: "Referral" }),
          /* @__PURE__ */ import_react30.default.createElement(FormSelectOption, { value: "referral on update", label: "Referral On Update" })
        ))
      ), /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "Put database in Read-Only mode (nsslapd-readonly)." }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react30.default.createElement(
        Checkbox,
        {
          label: "Database Read-Only Mode",
          id: "readOnly",
          isChecked: this.props.readOnly,
          onChange: (checked, e) => {
            this.props.handleChange(e);
          },
          "aria-label": "send ref"
        }
      ))), /* @__PURE__ */ import_react30.default.createElement(Grid, { title: "Block unindexed searches on this suffix (nsslapd-require-index)." }, /* @__PURE__ */ import_react30.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react30.default.createElement(
        Checkbox,
        {
          label: "Block Unindexed Searches",
          id: "requireIndex",
          isChecked: this.props.requireIndex,
          onChange: (checked, e) => {
            this.props.handleChange(e);
          },
          "aria-label": "requireIndex"
        }
      )))), /* @__PURE__ */ import_react30.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react30.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          onClick: this.props.handleSave,
          variant: "primary",
          isLoading: this.props.saving,
          spinnerAriaValueText: this.props.saving ? "Saving" : void 0,
          ...extraPrimaryProps,
          isDisabled: this.props.saveBtnDisabled || this.props.saving
        },
        saveBtnName
      )));
    }
  };
  SuffixConfig.propTypes = {
    cachememsize: import_prop_types25.default.string,
    cachesize: import_prop_types25.default.string,
    dncachememsize: import_prop_types25.default.string,
    readOnly: import_prop_types25.default.bool,
    requireIndex: import_prop_types25.default.bool,
    autoTuning: import_prop_types25.default.bool,
    handleChange: import_prop_types25.default.func,
    saveHandler: import_prop_types25.default.func
  };
  SuffixConfig.defaultProps = {
    cachememsize: "",
    cachesize: "",
    dncachememsize: "",
    readOnly: false,
    requireIndex: false,
    autoTuning: false
  };

  // src/lib/database/referrals.jsx
  var import_react31 = __toESM(require_react(), 1);
  var import_prop_types26 = __toESM(require_prop_types(), 1);
  var SuffixReferrals = class extends import_react31.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showConfirmRefDelete: false,
        showRefModal: false,
        removeRef: "",
        refProtocol: "ldap://",
        refHost: "",
        refPort: "",
        refSuffix: "",
        refFilter: "",
        refScope: "sub",
        refAttrs: "",
        refValue: "",
        errObj: {},
        saving: false,
        saveBtnDisabled: true,
        modalSpinning: false,
        modalChecked: false
      };
      this.showConfirmRefDelete = this.showConfirmRefDelete.bind(this);
      this.closeConfirmRefDelete = this.closeConfirmRefDelete.bind(this);
      this.deleteRef = this.deleteRef.bind(this);
      this.saveRef = this.saveRef.bind(this);
      this.handleShowRefModal = this.handleShowRefModal.bind(this);
      this.closeRefModal = this.closeRefModal.bind(this);
      this.onRefChange = this.onRefChange.bind(this);
      this.buildRef = this.buildRef.bind(this);
      this.onChange = this.onChange.bind(this);
      this.onScopeChange = this.onScopeChange.bind(this);
      this.onLdapChange = this.onLdapChange.bind(this);
    }
    onScopeChange(value, event) {
      this.setState({
        refScope: value
      });
    }
    onLdapChange(value, event) {
      this.setState({
        refProtocol: value
      });
    }
    showConfirmRefDelete(item) {
      this.setState({
        removeRef: item,
        showConfirmRefDelete: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    handleShowRefModal() {
      this.setState({
        showRefModal: true,
        errObj: {},
        refValue: ""
      });
    }
    closeConfirmRefDelete() {
      this.setState({
        showConfirmRefDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeRefModal() {
      this.setState({
        showRefModal: false
      });
    }
    deleteRef() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "set",
        "--del-referral=" + this.state.removeRef,
        this.props.suffix
      ];
      log_cmd("deleteRef", "Delete suffix referral", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          `Referral successfully deleted`
        );
        this.setState({
          modalSpinning: false,
          showConfirmRefDelete: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failure deleting referral - ${errMsg.desc}`
        );
        this.setState({
          modalSpinning: false,
          showConfirmRefDelete: false
        });
      });
    }
    // Create referral
    saveRef() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "set",
        "--add-referral=" + this.state.refValue,
        this.props.suffix
      ];
      log_cmd("saveRef", "Add referral", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.closeRefModal();
        this.props.addNotification(
          "success",
          `Referral successfully created`
        );
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.closeRefModal();
        this.props.addNotification(
          "error",
          `Failure creating referral - ${errMsg.desc}`
        );
        this.setState({
          saving: false
        });
      });
    }
    buildRef() {
      let previewRef = this.state.refProtocol + this.state.refHost;
      const ref_port = this.state.refPort;
      const ref_suffix = this.state.refSuffix;
      const ref_attrs = this.state.refAttrs;
      const ref_filter = this.state.refFilter;
      const ref_scope = this.state.refScope;
      if (ref_port !== "") {
        previewRef += ":" + ref_port;
      }
      if (ref_suffix !== "" || ref_attrs !== "" || ref_filter !== "" || ref_scope !== "") {
        previewRef += "/" + encodeURIComponent(ref_suffix);
        if (ref_attrs !== "") {
          previewRef += "?" + encodeURIComponent(ref_attrs);
        } else if (ref_filter !== "" || ref_scope !== "") {
          previewRef += "?";
        }
        if (ref_scope !== "") {
          previewRef += "?" + encodeURIComponent(ref_scope);
        } else if (ref_filter !== "") {
          previewRef += "?";
        }
        if (ref_filter !== "") {
          previewRef += "?" + encodeURIComponent(ref_filter);
        }
      }
      this.setState({
        refValue: previewRef
      });
    }
    onRefChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let valueErr = false;
      let saveBtnDisabled = false;
      const check_attrs = ["refHost", "refPort"];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr) {
          if (this.state[check_attr] === "") {
            saveBtnDisabled = true;
          }
        }
      }
      if (attr === "refHost" && value === "") {
        saveBtnDisabled = true;
        valueErr = true;
      }
      if (attr === "refPort" && (value === "" || !valid_port(value))) {
        saveBtnDisabled = true;
        valueErr = true;
      }
      if (attr === "refSuffix" && (value !== "" && !valid_dn(value))) {
        saveBtnDisabled = true;
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveBtnDisabled
      }, this.buildRef);
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    render() {
      return /* @__PURE__ */ import_react31.default.createElement("div", { className: "ds-sub-header ds-margin-bottom-md" }, /* @__PURE__ */ import_react31.default.createElement(
        ReferralTable,
        {
          key: this.props.rows,
          rows: this.props.rows,
          deleteRef: this.showConfirmRefDelete
        }
      ), /* @__PURE__ */ import_react31.default.createElement(Button, { variant: "primary", onClick: this.handleShowRefModal }, "Create Referral"), /* @__PURE__ */ import_react31.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmRefDelete,
          closeHandler: this.closeConfirmRefDelete,
          handleChange: this.onChange,
          actionHandler: this.deleteRef,
          spinning: this.state.modalSpinning,
          item: this.state.removeRef,
          checked: this.state.modalChecked,
          mTitle: "Delete Referral",
          mMsg: "Are you sure you want to delete this referral?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ), /* @__PURE__ */ import_react31.default.createElement(
        AddReferralModal,
        {
          showModal: this.state.showRefModal,
          closeHandler: this.closeRefModal,
          handleChange: this.onRefChange,
          handleScopeChange: this.onScopeChange,
          handleLdapChange: this.onLdapChange,
          saveHandler: this.saveRef,
          previewValue: this.state.refValue,
          refProtocol: this.state.refProtocol,
          refScope: this.state.refScope,
          error: this.state.errObj,
          saving: this.state.saving,
          saveBtnDisabled: this.state.saveBtnDisabled
        }
      ));
    }
  };
  var AddReferralModal = class extends import_react31.default.Component {
    render() {
      let {
        showModal,
        closeHandler,
        handleChange,
        handleScopeChange,
        handleLdapChange,
        saveHandler,
        previewValue,
        error,
        saving,
        saveBtnDisabled,
        refProtocol,
        refScope
      } = this.props;
      if (previewValue === "") {
        previewValue = "ldap://";
      }
      let saveBtnName = "Create Referral";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Creating ...";
        extraPrimaryProps.spinnerAriaValueText = "Creating";
      }
      return /* @__PURE__ */ import_react31.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Add Database Referral",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react31.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isDisabled: saveBtnDisabled || saving,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react31.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react31.default.createElement(Form, { className: "ds-margin-top", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react31.default.createElement(Grid, null, /* @__PURE__ */ import_react31.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Protocol"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement(FormSelect, { id: "refProtocol", value: refProtocol, onChange: handleLdapChange, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react31.default.createElement(FormSelectOption, { key: 1, value: "ldap://", label: "ldap://" }), /* @__PURE__ */ import_react31.default.createElement(FormSelectOption, { key: 2, value: "ldaps://", label: "ldaps://" })))), /* @__PURE__ */ import_react31.default.createElement(Grid, null, /* @__PURE__ */ import_react31.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Host Name"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement(
          TextInput,
          {
            type: "text",
            id: "refHost",
            "aria-describedby": "horizontal-form-name-helper",
            name: "refHost",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.refHost ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react31.default.createElement(Grid, null, /* @__PURE__ */ import_react31.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Port Number"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement(
          TextInput,
          {
            type: "number",
            id: "refPort",
            "aria-describedby": "horizontal-form-name-helper",
            name: "refPort",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.refPort ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react31.default.createElement(Grid, null, /* @__PURE__ */ import_react31.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Suffix"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement(
          TextInput,
          {
            type: "text",
            id: "refSuffix",
            "aria-describedby": "horizontal-form-name-helper",
            name: "refSuffix",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.refSuffix ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react31.default.createElement(Grid, { title: "Comma separated list of attributes to return" }, /* @__PURE__ */ import_react31.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Attributes"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement(
          TextInput,
          {
            type: "text",
            id: "refAttrs",
            "aria-describedby": "horizontal-form-name-helper",
            name: "refAttrs",
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react31.default.createElement(Grid, null, /* @__PURE__ */ import_react31.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Filter"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement(
          TextInput,
          {
            type: "text",
            id: "refFilter",
            "aria-describedby": "horizontal-form-name-helper",
            name: "refFilter",
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react31.default.createElement(Grid, null, /* @__PURE__ */ import_react31.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Scope"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement(FormSelect, { id: "refScope", value: refScope, onChange: handleScopeChange, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react31.default.createElement(FormSelectOption, { key: 1, value: "sub", label: "sub" }), /* @__PURE__ */ import_react31.default.createElement(FormSelectOption, { key: 2, value: "one", label: "one" }), /* @__PURE__ */ import_react31.default.createElement(FormSelectOption, { key: 3, value: "base", label: "base" })))), /* @__PURE__ */ import_react31.default.createElement("hr", null), /* @__PURE__ */ import_react31.default.createElement(Grid, null, /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 3 }, "Computed Referral"), /* @__PURE__ */ import_react31.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react31.default.createElement("b", null, previewValue))), /* @__PURE__ */ import_react31.default.createElement("hr", null))
      );
    }
  };
  SuffixReferrals.propTypes = {
    rows: import_prop_types26.default.array,
    suffix: import_prop_types26.default.string,
    reload: import_prop_types26.default.func,
    addNotification: import_prop_types26.default.func,
    serverId: import_prop_types26.default.string
  };
  SuffixReferrals.defaultProps = {
    rows: [],
    suffix: "",
    serverId: ""
  };
  AddReferralModal.propTypes = {
    showModal: import_prop_types26.default.bool,
    closeHandler: import_prop_types26.default.func,
    handleChange: import_prop_types26.default.func,
    saveHandler: import_prop_types26.default.func,
    previewValue: import_prop_types26.default.string,
    error: import_prop_types26.default.object
  };
  AddReferralModal.defaultProps = {
    showModal: false,
    previewValue: "",
    error: {}
  };

  // src/lib/database/indexes.jsx
  var import_react32 = __toESM(require_react(), 1);
  var import_prop_types27 = __toESM(require_prop_types(), 1);
  var SuffixIndexes = class extends import_react32.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSelectToggle", (isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "onSelectClear", (item) => (event) => {
        switch (item) {
          case "addIndexAttributes":
            this.setState({
              indexName: [],
              isAddIndexSelectOpen: false
            });
            break;
          case "addMatchingRules":
            this.setState({
              mrs: [],
              isAddMrsSelectOpen: false
            });
            break;
          case "matchingRulesEdit":
            this.setState({
              mrs: [],
              isEditIndexSelectOpen: false
            });
            break;
          default:
            break;
        }
      });
      this.state = {
        // indexes
        showIndexModal: false,
        showEditIndexModal: false,
        activeTabKey: 0,
        modalChecked: false,
        modalSpinning: false,
        types: "",
        attributes: [],
        matchingRules: [],
        mrs: [],
        _mrs: [],
        showConfirmReindex: false,
        reindexAttrName: "",
        showConfirmDeleteIndex: false,
        deleteAttrName: "",
        saving: false,
        saveBtnDisabled: true,
        // Add indexes
        indexName: [],
        indexTypeEq: false,
        indexTypePres: false,
        indexTypeSub: false,
        indexTypeApprox: false,
        reindexOnAdd: false,
        // Edit indexes
        errObj: {},
        _isMounted: true,
        // Select Typeahead
        isAttributeOpen: false,
        isMatchingruleOpen: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onAttributeSelect = (event, selection) => {
        if (this.state.indexName.includes(selection)) {
          this.setState(
            (prevState) => ({
              indexName: prevState.indexName.filter((item) => item !== selection),
              isAttributeOpen: false
            }),
            () => {
              this.validateSaveBtn();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              indexName: [...prevState.indexName, selection],
              isAttributeOpen: false
            }),
            () => {
              this.validateSaveBtn();
            }
          );
        }
      };
      this.handleAttributeToggle = (isAttributeOpen) => {
        this.setState({
          isAttributeOpen
        });
      };
      this.handleAttributeClear = () => {
        this.setState({
          indexName: [],
          isAttributeOpen: false
        });
      };
      this.handleMatchingruleAddToggle = (isMatchingruleOpen) => {
        this.setState({
          isMatchingruleOpen
        });
      };
      this.handleMatchingruleAddClear = () => {
        this.setState({
          mrs: [],
          isMatchingruleOpen: false
        });
      };
      this.handleMatchingruleEditToggle = (isMatchingruleOpen) => {
        this.setState({
          isMatchingruleOpen
        });
      };
      this.handleMatchingruleEditClear = () => {
        this.setState({
          mrs: [],
          isMatchingruleOpen: false
        });
      };
      this.loadIndexes = this.loadIndexes.bind(this);
      this.handleShowIndexModal = this.handleShowIndexModal.bind(this);
      this.closeIndexModal = this.closeIndexModal.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.onSelectToggle = this.onSelectToggle.bind(this);
      this.onSelectClear = this.onSelectClear.bind(this);
      this.saveIndex = this.saveIndex.bind(this);
      this.saveEditIndex = this.saveEditIndex.bind(this);
      this.reindexIndex = this.reindexIndex.bind(this);
      this.deleteIndex = this.deleteIndex.bind(this);
      this.showEditIndexModal = this.showEditIndexModal.bind(this);
      this.closeEditIndexModal = this.closeEditIndexModal.bind(this);
      this.showConfirmReindex = this.showConfirmReindex.bind(this);
      this.closeConfirmReindex = this.closeConfirmReindex.bind(this);
      this.showConfirmDeleteIndex = this.showConfirmDeleteIndex.bind(this);
      this.closeConfirmDeleteIndex = this.closeConfirmDeleteIndex.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleMatchingruleSelect = this.handleMatchingruleSelect.bind(this);
    }
    componentDidMount() {
      this.loadIndexes();
    }
    componentWillUnmount() {
      this.setState({
        _isMounted: false
      });
    }
    loadIndexes() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "matchingrules",
        "list"
      ];
      log_cmd("loadIndexes (suffix config)", "Get matching rules", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const mrContent = JSON.parse(content);
        const mrs = [];
        for (let i = 0; i < mrContent.items.length; i++) {
          if (mrContent.items[i].name[0] !== "") {
            mrs.push(mrContent.items[i].name[0]);
          }
        }
        const idx_cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "backend",
          "index",
          "list",
          "--just-names",
          this.props.suffix
        ];
        log_cmd("loadIndexes (suffix config)", "Get current index list", idx_cmd);
        cockpit_default.spawn(idx_cmd, { superuser: true, err: "message" }).done((content2) => {
          const idxContent = JSON.parse(content2);
          const indexList = idxContent.items;
          const attr_cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "schema",
            "attributetypes",
            "list"
          ];
          log_cmd("loadIndexes (suffix config)", "Get attrs", attr_cmd);
          cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content3) => {
            const attrContent = JSON.parse(content3);
            const attrs = [];
            for (const content4 of attrContent.items) {
              if (indexList.indexOf(content4.name[0]) === -1) {
                attrs.push(content4.name[0]);
              }
            }
            if (this.state._isMounted) {
              this.setState({
                matchingRules: mrs,
                attributes: attrs,
                saveBtnDisabled: true
              });
            }
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.props.addNotification(
              "error",
              `Failed to get attributes - ${errMsg.desc}`
            );
          });
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to get matching rules - ${errMsg.desc}`
        );
      });
    }
    //
    // Index Modal functions
    //
    handleShowIndexModal() {
      this.setState({
        showIndexModal: true,
        errObj: {},
        mrs: [],
        indexName: [],
        indexTypeEq: false,
        indexTypeSub: false,
        indexTypePres: false,
        indexTypeApprox: false,
        reindexOnAdd: false,
        modalChecked: false,
        modalSpinning: false,
        saveBtnDisabled: true
      });
    }
    closeIndexModal() {
      this.setState({
        showIndexModal: false
      });
      if (this.state.isMatchingruleOpen) {
        this.setState({
          isMatchingruleOpen: false
        });
      }
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      const check_attrs = [
        "indexTypeEq",
        "indexTypeSub",
        "indexTypePres",
        "indexTypeApprox"
      ];
      for (const config_attr of check_attrs) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      if (JSON.stringify(this.state._mrs) !== JSON.stringify(this.state.mrs)) {
        saveBtnDisabled = false;
      }
      if (!this.state.indexTypeEq && !this.state.indexTypeSub && !this.state.indexTypePres && !this.state.indexTypeApprox || this.state.indexName.length === 0 || this.state.indexName[0] === "") {
        saveBtnDisabled = true;
      }
      this.setState({
        saveBtnDisabled
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    // Edit Matching Rules
    handleMatchingruleSelect(event, selection) {
      const new_mrs = [...this.state.mrs];
      if (new_mrs.includes(selection)) {
        const index = new_mrs.indexOf(selection);
        new_mrs.splice(index, 1);
        this.setState({
          mrs: new_mrs,
          isMatchingruleOpen: false
        }, () => {
          this.validateSaveBtn();
        });
      } else {
        new_mrs.push(selection);
        this.setState({
          mrs: new_mrs,
          isMatchingruleOpen: false
        }, () => {
          this.validateSaveBtn();
        });
      }
    }
    saveIndex() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "add",
        "--attr=" + this.state.indexName[0],
        this.props.suffix
      ];
      if (this.state.indexTypeEq) {
        cmd.push("--index-type=eq");
      }
      if (this.state.indexTypePres) {
        cmd.push("--index-type=pres");
      }
      if (this.state.indexTypeSub) {
        cmd.push("--index-type=sub");
      }
      if (this.state.indexTypeApprox) {
        cmd.push("--index-type=approx");
      }
      for (let i = 0; i < this.state.mrs.length; i++) {
        cmd.push("--matching-rule=" + this.state.mrs[i]);
      }
      if (this.state.reindexOnAdd) {
        cmd.push("--reindex");
      }
      this.setState({
        saving: true
      });
      log_cmd("saveIndex", "Create new index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.closeIndexModal();
        if (this.state.reindexOnAdd) {
          this.reindexAttr(this.state.indexName[0]);
        }
        this.props.addNotification(
          "success",
          `Successfully created new index`
        );
        this.setState({
          saving: false,
          saveBtnDisabled: true
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.closeIndexModal();
        this.props.addNotification(
          "error",
          `Error creating index - ${errMsg.desc}`
        );
        this.setState({
          saving: false,
          saveBtnDisabled: true
        });
      });
    }
    showEditIndexModal(item) {
      const currentMRS = [];
      if (item[2] !== void 0 && item[2].length > 0) {
        const parts = item[2].split(",").map((item2) => item2.trim());
        for (const part of parts) {
          currentMRS.push(part);
        }
      }
      this.setState({
        indexName: [item[0]],
        types: item[1],
        mrs: currentMRS,
        _mrs: currentMRS,
        showEditIndexModal: true,
        errObj: {},
        reindexOnAdd: false,
        indexTypeEq: item[1].includes("eq"),
        indexTypeSub: item[1].includes("sub"),
        indexTypePres: item[1].includes("pres"),
        indexTypeApprox: item[1].includes("approx"),
        _indexTypeEq: item[1].includes("eq"),
        _indexTypeSub: item[1].includes("sub"),
        _indexTypePres: item[1].includes("pres"),
        _indexTypeApprox: item[1].includes("approx"),
        modalChecked: false,
        modalSpinning: false,
        saveBtnDisabled: true
      });
    }
    closeEditIndexModal() {
      this.setState({
        showEditIndexModal: false
      });
      if (this.state.isMatchingruleOpen) {
        this.setState({
          isMatchingruleOpen: false
        });
      }
    }
    reindexAttr(attr) {
      const reindex_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "reindex",
        "--wait",
        "--attr=" + attr,
        this.props.suffix
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("reindexAttr", "index attribute", reindex_cmd);
      cockpit_default.spawn(reindex_cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          "Attribute (" + attr + ") has successfully been reindexed"
        );
        this.setState({
          saving: false,
          modalSpinning: false,
          showConfirmReindex: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error indexing attribute ${attr} - ${errMsg.desc}`
        );
        this.setState({
          saving: false,
          modalSpinning: false,
          showConfirmReindex: false
        });
      });
    }
    saveEditIndex() {
      const origMRS = this.state._mrs;
      const newMRS = this.state.mrs;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "set",
        "--attr=" + this.state.indexName,
        this.props.suffix
      ];
      for (const newMR of newMRS) {
        let found = false;
        for (const origMR of origMRS) {
          if (origMR === newMR) {
            found = true;
            break;
          }
        }
        if (!found) {
          cmd.push("--add-mr=" + newMR);
        }
      }
      for (const origMR of origMRS) {
        let found = false;
        for (const newMR of newMRS) {
          if (newMR === origMR) {
            found = true;
            break;
          }
        }
        if (!found) {
          cmd.push("--del-mr=" + origMR);
        }
      }
      if (this.state.indexTypeEq && !this.state._indexTypeEq) {
        cmd.push("--add-type=eq");
      } else if (!this.state.indexTypeEq && this.state._indexTypeEq) {
        cmd.push("--del-type=eq");
      }
      if (this.state.indexTypeSub && !this.state._indexTypeSub) {
        cmd.push("--add-type=sub");
      } else if (!this.state.indexTypeSub && this.state._indexTypeSub) {
        cmd.push("--del-type=sub");
      }
      if (this.state.indexTypePres && !this.state._indexTypePres) {
        cmd.push("--add-type=pres");
      } else if (!this.state.indexTypePres && this.state._indexTypePres) {
        cmd.push("--del-type=pres");
      }
      if (this.state.indexTypeApprox && !this.state._indexTypeApprox) {
        cmd.push("--add-type=approx");
      } else if (!this.state.indexTypeApprox && this.state._indexTypeApprox) {
        cmd.push("--del-type=approx");
      }
      if (cmd.length > 8) {
        this.setState({
          saving: true
        });
        log_cmd("saveEditIndex", "Edit index", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload(this.props.suffix);
          this.closeEditIndexModal();
          this.props.addNotification(
            "success",
            `Successfully edited index`
          );
          if (this.state.reindexOnAdd) {
            this.reindexAttr(this.state.indexName);
          } else {
            this.setState({
              saving: false
            });
          }
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.reload(this.props.suffix);
          this.closeEditIndexModal();
          this.props.addNotification(
            "error",
            `Error editing index - ${errMsg.desc}`
          );
          this.setState({
            saving: false
          });
        });
      }
    }
    showConfirmReindex(item) {
      this.setState({
        reindexAttrName: item,
        showConfirmReindex: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmReindex(item) {
      this.setState({
        reindexAttrName: "",
        showConfirmReindex: false
      });
    }
    showConfirmDeleteIndex(item) {
      this.setState({
        deleteAttrName: item,
        showConfirmDeleteIndex: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteIndex() {
      this.setState({
        deleteAttrName: "",
        showConfirmDeleteIndex: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    reindexIndex() {
      this.reindexAttr(this.state.reindexAttrName);
    }
    deleteIndex() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "delete",
        "--attr=" + this.state.deleteAttrName,
        this.props.suffix
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteIndex", "deleteEdit index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          "Successfully deleted index: " + this.state.deleteAttrName
        );
        this.props.reload(this.props.suffix);
        this.closeConfirmDeleteIndex();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Error deleting index - ${errMsg.desc}`
        );
        this.closeConfirmDeleteIndex();
      });
    }
    render() {
      return /* @__PURE__ */ import_react32.default.createElement("div", { className: "ds-margin-top-xlg ds-left-indent" }, /* @__PURE__ */ import_react32.default.createElement(Tabs, { isSecondary: true, isBox: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react32.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react32.default.createElement(TabTitleText, null, "Database Indexes ", /* @__PURE__ */ import_react32.default.createElement("font", { size: "2" }, "(", this.props.indexRows.length, ")")) }, /* @__PURE__ */ import_react32.default.createElement("div", { className: "ds-left-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react32.default.createElement(
        IndexTable,
        {
          editable: true,
          rows: this.props.indexRows,
          key: this.props.indexRows,
          editIndex: this.showEditIndexModal,
          reindexIndex: this.showConfirmReindex,
          deleteIndex: this.showConfirmDeleteIndex
        }
      ), /* @__PURE__ */ import_react32.default.createElement(
        Button,
        {
          variant: "primary",
          type: "button",
          onClick: this.handleShowIndexModal
        },
        "Add Index"
      ))), /* @__PURE__ */ import_react32.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react32.default.createElement(TabTitleText, null, "System Indexes ", /* @__PURE__ */ import_react32.default.createElement("font", { size: "2" }, "(", this.props.systemIndexRows.length, ")")) }, /* @__PURE__ */ import_react32.default.createElement("div", { className: "ds-left-indent" }, /* @__PURE__ */ import_react32.default.createElement(
        IndexTable,
        {
          rows: this.props.systemIndexRows
        }
      )))), /* @__PURE__ */ import_react32.default.createElement(
        AddIndexModal,
        {
          showModal: this.state.showIndexModal,
          closeHandler: this.closeIndexModal,
          handleChange: this.onChange,
          saveHandler: this.saveIndex,
          matchingRules: this.state.matchingRules,
          attributes: this.state.attributes,
          mrs: this.state.mrs,
          attributeName: this.state.indexName,
          indexTypeEq: this.state.indexTypeEq,
          indexTypePres: this.state.indexTypePres,
          indexTypeSub: this.state.indexTypeSub,
          indexTypeApprox: this.state.indexTypeApprox,
          reindexOnAdd: this.state.reindexOnAdd,
          onAttributeSelect: this.handleAttributeSelect,
          onAttributeToggle: this.handleAttributeToggle,
          onAttributeClear: this.handleAttributeClear,
          isAttributeOpen: this.state.isAttributeOpen,
          onMatchingruleSelect: this.handleMatchingruleSelect,
          onMatchingruleAddToggle: this.handleMatchingruleAddToggle,
          onMatchingruleAddClear: this.handleMatchingruleAddClear,
          isMatchingruleOpen: this.state.isMatchingruleOpen,
          saving: this.state.saving,
          saveBtnDisabled: this.state.saveBtnDisabled
        }
      ), /* @__PURE__ */ import_react32.default.createElement(
        EditIndexModal,
        {
          showModal: this.state.showEditIndexModal,
          closeHandler: this.closeEditIndexModal,
          handleChange: this.onChange,
          saveHandler: this.saveEditIndex,
          types: this.state.types,
          mrs: this.state.mrs,
          matchingRules: this.state.matchingRules,
          indexName: this.state.indexName,
          indexTypeEq: this.state.indexTypeEq,
          indexTypePres: this.state.indexTypePres,
          indexTypeSub: this.state.indexTypeSub,
          indexTypeApprox: this.state.indexTypeApprox,
          reindexOnAdd: this.state.reindexOnAdd,
          onMatchingruleSelect: this.handleMatchingruleSelect,
          onMatchingruleEditToggle: this.handleMatchingruleEditToggle,
          onMatchingruleEditClear: this.handleMatchingruleEditClear,
          isMatchingruleOpen: this.state.isMatchingruleOpen,
          saving: this.state.saving,
          saveBtnDisabled: this.state.saveBtnDisabled
        }
      ), /* @__PURE__ */ import_react32.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmReindex,
          closeHandler: this.closeConfirmReindex,
          handleChange: this.onChange,
          actionHandler: this.reindexIndex,
          spinning: this.state.modalSpinning,
          item: this.state.reindexAttrName,
          checked: this.state.modalChecked,
          mTitle: "Reindex Attribute",
          mMsg: "Are you sure you want to reindex this attribute?",
          mSpinningMsg: "Reindexing ...",
          mBtnName: "Reindex"
        }
      ), /* @__PURE__ */ import_react32.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteIndex,
          closeHandler: this.closeConfirmDeleteIndex,
          handleChange: this.onChange,
          actionHandler: this.deleteIndex,
          spinning: this.state.modalSpinning,
          item: this.state.deleteAttrName,
          checked: this.state.modalChecked,
          mTitle: "Delete Index",
          mMsg: "Are you sure you want to delete this index?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete"
        }
      ));
    }
  };
  var AddIndexModal = class extends import_react32.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        matchingRules,
        attributes,
        mrs,
        attributeName,
        onAttributeToggle,
        onAttributeClear,
        onAttributeSelect,
        isAttributeOpen,
        onMatchingruleAddToggle,
        onMatchingruleAddClear,
        onMatchingruleSelect,
        isMatchingruleOpen,
        saving,
        saveBtnDisabled
      } = this.props;
      const availMR = [];
      for (const mr of matchingRules) {
        availMR.push(mr);
      }
      const availAttrs = [];
      for (const attr of attributes) {
        availAttrs.push(attr);
      }
      let saveBtnName = "Create Index";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Creating ...";
        extraPrimaryProps.spinnerAriaValueText = "Creating";
      }
      return /* @__PURE__ */ import_react32.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Add Database Index",
          isOpen: showModal,
          onClose: closeHandler,
          "aria-labelledby": "ds-modal",
          actions: [
            /* @__PURE__ */ import_react32.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Creating" : void 0,
                ...extraPrimaryProps,
                isDisabled: saveBtnDisabled || saving
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react32.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react32.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react32.default.createElement(TextContent, { title: "Select an attribute to index" }, /* @__PURE__ */ import_react32.default.createElement(Text, { component: TextVariants.h4 }, "Select An Attribute")), /* @__PURE__ */ import_react32.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type a attribute name to index",
            onToggle: onAttributeToggle,
            onClear: onAttributeClear,
            onSelect: onAttributeSelect,
            selections: attributeName,
            isOpen: isAttributeOpen,
            "aria-labelledby": "typeAhead-attr-add",
            placeholderText: "Type a attribute name to index..",
            noResultsFoundText: "There are no matching entries",
            validated: attributeName.length === 0 || attributeName[0] === "" ? "error" : "default"
          },
          availAttrs.map((attr, index) => /* @__PURE__ */ import_react32.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ), /* @__PURE__ */ import_react32.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(Text, { component: TextVariants.h4 }, "Index Types")), /* @__PURE__ */ import_react32.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react32.default.createElement(Grid, null, /* @__PURE__ */ import_react32.default.createElement(GridItem, null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypeEq",
            isChecked: this.props.indexTypeEq,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Equailty Indexing"
          }
        ))), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypePres",
            isChecked: this.props.indexTypePres,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Presence Indexing"
          }
        ))), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypeSub",
            isChecked: this.props.indexTypeSub,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Substring Indexing"
          }
        ))), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypeApprox",
            isChecked: this.props.indexTypeApprox,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Approximate Indexing"
          }
        )))), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, { span: 12, title: "List of matching rules separated by a 'space'" }, /* @__PURE__ */ import_react32.default.createElement(TextContent, null, /* @__PURE__ */ import_react32.default.createElement(Text, { component: TextVariants.h4 }, "Matching Rules")), /* @__PURE__ */ import_react32.default.createElement("div", { className: "ds-indent ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(
          Select,
          {
            id: "addMatchingRules",
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a matching rule name",
            onToggle: onMatchingruleAddToggle,
            onSelect: onMatchingruleSelect,
            onClear: onMatchingruleAddClear,
            selections: mrs,
            isOpen: isMatchingruleOpen,
            "aria-labelledby": "typeAhead-mr-add",
            placeholderText: "Type a matching rule name...",
            noResultsFoundText: "There are no matching entries"
          },
          availMR.map((mrs2, index) => /* @__PURE__ */ import_react32.default.createElement(
            SelectOption,
            {
              key: index,
              value: mrs2
            }
          ))
        )))), /* @__PURE__ */ import_react32.default.createElement(Grid, null, /* @__PURE__ */ import_react32.default.createElement(GridItem, { className: "ds-margin-top", span: 12 }, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "reindexOnAdd",
            isChecked: this.props.reindexOnAdd,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Index attribute after creation"
          }
        ))), /* @__PURE__ */ import_react32.default.createElement("hr", null))
      );
    }
  };
  var EditIndexModal = class extends import_react32.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        mrs: []
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        indexName,
        types,
        mrs,
        matchingRules,
        onMatchingruleEditToggle,
        onMatchingruleEditClear,
        onMatchingruleSelect,
        isMatchingruleOpen,
        saving,
        saveBtnDisabled
      } = this.props;
      let saveBtnName = "Save Index";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Saving index ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let attrTypes = "";
      if (types !== "" && types.length > 0) {
        attrTypes = types.split(",").map((item) => item.trim());
      }
      const currentMrs = mrs;
      const availMR = matchingRules;
      let eq = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
        Checkbox,
        {
          id: "indexTypeEq",
          isChecked: this.props.indexTypeEq,
          onChange: (checked, e) => {
            handleChange(e);
          },
          label: "Equailty Indexing"
        }
      ));
      let pres = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
        Checkbox,
        {
          id: "indexTypePres",
          isChecked: this.props.indexTypePres,
          onChange: (checked, e) => {
            handleChange(e);
          },
          label: "Presence Indexing"
        }
      ));
      let sub = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
        Checkbox,
        {
          id: "indexTypeSub",
          isChecked: this.props.indexTypeSub,
          onChange: (checked, e) => {
            handleChange(e);
          },
          label: "Substring Indexing"
        }
      ));
      let approx = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
        Checkbox,
        {
          id: "indexTypeApprox",
          isChecked: this.props.indexTypeApprox,
          onChange: (checked, e) => {
            handleChange(e);
          },
          label: "Approximate Indexing"
        }
      ));
      if (attrTypes.includes("eq")) {
        eq = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypeEq",
            isChecked: this.props.indexTypeEq,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Equality Indexing"
          }
        ));
      }
      if (attrTypes.includes("pres")) {
        pres = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypePres",
            isChecked: this.props.indexTypePres,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Presence Indexing"
          }
        ));
      }
      if (attrTypes.includes("sub")) {
        sub = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypeSub",
            isChecked: this.props.indexTypeSub,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Substring Indexing"
          }
        ));
      }
      if (attrTypes.includes("approx")) {
        approx = /* @__PURE__ */ import_react32.default.createElement("div", null, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "indexTypeApprox",
            isChecked: this.props.indexTypeApprox,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Approximate Indexing"
          }
        ));
      }
      const title = /* @__PURE__ */ import_react32.default.createElement("div", null, "Edit Database Index (", /* @__PURE__ */ import_react32.default.createElement("b", null, indexName[0]), ")");
      return /* @__PURE__ */ import_react32.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react32.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: saveBtnDisabled || saving
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react32.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react32.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react32.default.createElement(TextContent, null, /* @__PURE__ */ import_react32.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h4 }, "Index Types")), /* @__PURE__ */ import_react32.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react32.default.createElement(Grid, null, /* @__PURE__ */ import_react32.default.createElement(GridItem, { span: 9 }, eq)), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, { span: 9 }, pres)), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, { span: 9 }, sub)), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, { span: 9 }, approx))), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react32.default.createElement(TextContent, null, /* @__PURE__ */ import_react32.default.createElement(Text, { component: TextVariants.h4 }, "Matching Rules")), /* @__PURE__ */ import_react32.default.createElement("div", { className: "ds-indent ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a matching rule name",
            onToggle: onMatchingruleEditToggle,
            onSelect: onMatchingruleSelect,
            onClear: onMatchingruleEditClear,
            selections: currentMrs,
            isOpen: isMatchingruleOpen,
            "aria-labelledby": "typeAhead-mr-edit",
            placeholderText: "Type a matching rule name...",
            noResultsFoundText: "There are no matching entries"
          },
          availMR.map((mr, index) => /* @__PURE__ */ import_react32.default.createElement(
            SelectOption,
            {
              key: index,
              value: mr
            }
          ))
        )))), /* @__PURE__ */ import_react32.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react32.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react32.default.createElement(
          Checkbox,
          {
            id: "reindexOnAdd",
            isChecked: this.props.reindexOnAdd,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Reindex Attribute After Saving"
          }
        ))), /* @__PURE__ */ import_react32.default.createElement("hr", null))
      );
    }
  };
  SuffixIndexes.propTypes = {
    systemIndexRows: import_prop_types27.default.array,
    indexRows: import_prop_types27.default.array,
    serverId: import_prop_types27.default.string,
    suffix: import_prop_types27.default.string,
    addNotification: import_prop_types27.default.func,
    reload: import_prop_types27.default.func
  };
  SuffixIndexes.defaultProps = {
    systemIndexRows: [],
    indexRows: [],
    serverId: "",
    suffix: ""
  };
  AddIndexModal.propTypes = {
    showModal: import_prop_types27.default.bool,
    closeHandler: import_prop_types27.default.func,
    handleChange: import_prop_types27.default.func,
    saveHandler: import_prop_types27.default.func,
    matchingRules: import_prop_types27.default.array,
    attributes: import_prop_types27.default.array,
    mrs: import_prop_types27.default.array,
    attributeName: import_prop_types27.default.array,
    indexTypeEq: import_prop_types27.default.bool,
    indexTypePres: import_prop_types27.default.bool,
    indexTypeSub: import_prop_types27.default.bool,
    indexTypeApprox: import_prop_types27.default.bool,
    reindexOnAdd: import_prop_types27.default.bool
  };
  AddIndexModal.defaultProps = {
    showModal: false,
    matchingRules: [],
    attributes: [],
    mrs: [],
    attributeName: [],
    indexTypeEq: false,
    indexTypePres: false,
    indexTypeSub: false,
    indexTypeApprox: false,
    reindexOnAdd: false
  };
  EditIndexModal.propTypes = {
    showModal: import_prop_types27.default.bool,
    closeHandler: import_prop_types27.default.func,
    handleChange: import_prop_types27.default.func,
    saveHandler: import_prop_types27.default.func,
    matchingRules: import_prop_types27.default.array,
    types: import_prop_types27.default.string,
    mrs: import_prop_types27.default.array,
    indexName: import_prop_types27.default.array,
    indexTypeEq: import_prop_types27.default.bool,
    indexTypePres: import_prop_types27.default.bool,
    indexTypeSub: import_prop_types27.default.bool,
    indexTypeApprox: import_prop_types27.default.bool,
    reindexOnAdd: import_prop_types27.default.bool
  };
  EditIndexModal.defaultProps = {
    showModal: false,
    matchingRules: [],
    types: "",
    mrs: [],
    indexName: [],
    indexTypeEq: false,
    indexTypePres: false,
    indexTypeSub: false,
    indexTypeApprox: false,
    reindexOnAdd: false
  };

  // src/lib/database/vlvIndexes.jsx
  var import_react33 = __toESM(require_react(), 1);
  var import_prop_types28 = __toESM(require_prop_types(), 1);
  var VLVIndexes = class extends import_react33.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSelectToggle", (isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "handleSelectClear", (item) => (event) => {
        this.setState({
          sortValue: [],
          isVlvSortIndexSelectOpen: false
        });
      });
      this.state = {
        vlvItems: [],
        showVLVModal: false,
        showDeleteConfirm: false,
        showReindexConfirm: false,
        isVlvSortIndexSelectOpen: false,
        saving: false,
        saveBtnDisabled: true,
        updating: false,
        modalSpinning: false,
        modalChecked: false,
        showCreateSortIndex: false,
        showDeleteSortIndexConfirm: false,
        createIndexParent: "",
        deleteIndexParent: "",
        deleteIndexName: "",
        deleteVLVName: "",
        errObj: {},
        vlvName: "",
        vlvBase: "",
        vlvScope: "subtree",
        vlvFilter: "",
        vlvSortList: [],
        _vlvName: "",
        _vlvBase: "",
        _vlvScope: "",
        _vlvFilter: "",
        _vlvSortList: []
      };
      this.handleShowVLVModal = this.handleShowVLVModal.bind(this);
      this.closeVLVModal = this.closeVLVModal.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onVLVChange = this.onVLVChange.bind(this);
      this.saveVLV = this.saveVLV.bind(this);
      this.deleteVLV = this.deleteVLV.bind(this);
      this.reindexVLV = this.reindexVLV.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
      this.showReindexConfirm = this.showReindexConfirm.bind(this);
      this.closeReindexConfirm = this.closeReindexConfirm.bind(this);
      this.handleSelectToggle = this.handleSelectToggle.bind(this);
      this.handleSelectClear = this.handleSelectClear.bind(this);
      this.deleteSortIndex = this.deleteSortIndex.bind(this);
      this.createSortIndex = this.createSortIndex.bind(this);
      this.showCreateSortIndex = this.showCreateSortIndex.bind(this);
      this.closeCreateSortIndex = this.closeCreateSortIndex.bind(this);
      this.showDeleteSortIndexConfirm = this.showDeleteSortIndexConfirm.bind(this);
      this.closeDeleteSortIndexConfirm = this.closeDeleteSortIndexConfirm.bind(this);
    }
    //
    // VLV index functions
    //
    handleShowVLVModal() {
      this.setState({
        showVLVModal: true,
        errObj: {},
        vlvName: "",
        vlvBase: "",
        vlvScope: "subtree",
        vlvFilter: "",
        vlvSortList: [],
        saving: false
      });
    }
    closeVLVModal() {
      this.setState({
        showVLVModal: false
      });
    }
    onVLVChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      const attr = e.target.id;
      let saveBtnDisabled = false;
      const vlvCreateAttrs = ["vlvName", "vlvBase", "vlvFilter"];
      for (const createAttr of vlvCreateAttrs) {
        if (attr !== createAttr && this.state[createAttr] === "") {
          saveBtnDisabled = true;
        }
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveBtnDisabled
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    getScopeVal(scope) {
      const mapping = {
        subtree: "2",
        one: "1",
        base: "0"
      };
      return mapping[scope];
    }
    showCreateSortIndex(parent) {
      this.setState({
        showCreateSortIndex: true,
        createIndexParent: parent
      });
    }
    closeCreateSortIndex() {
      this.setState({
        showCreateSortIndex: false,
        createIndexParent: ""
      });
    }
    createSortIndex(index) {
      const index_value = index.join(" ");
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "add-index",
        "--parent-name=" + this.state.createIndexParent,
        "--index-name=" + this.state.createIndexParent + " - " + index_value,
        "--sort=" + index_value,
        this.props.suffix
      ];
      if (this.state.reindexVLV) {
        cmd.push("--index-it");
      }
      this.setState({
        updating: true
      });
      log_cmd("createSortIndex", "Add index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeCreateSortIndex();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully added VLV sort index"
        );
        this.setState({
          updating: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.closeCreateSortIndex();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failed to add VLV index entry - ${errMsg.desc}`
        );
        this.setState({
          updating: false
        });
      });
    }
    showDeleteSortIndexConfirm(parent, name2) {
      this.setState({
        showDeleteSortIndexConfirm: true,
        deleteIndexParent: parent,
        deleteIndexName: name2
      });
    }
    closeDeleteSortIndexConfirm() {
      this.setState({
        showDeleteSortIndexConfirm: false,
        deleteIndexParent: "",
        deleteIndexName: ""
      });
    }
    deleteSortIndex() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "del-index",
        "--parent-name=" + this.state.deleteIndexParent,
        "--sort=" + this.state.deleteIndexName,
        this.props.suffix
      ];
      this.setState({
        updating: true,
        modalSpinning: true
      });
      log_cmd("deleteSortIndex", "delete index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeDeleteSortIndexConfirm();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully removed VLV sort index"
        );
        this.setState({
          updating: false,
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.closeDeleteSortIndexConfirm();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failed to delete VLV sort index - ${errMsg.desc}`
        );
        this.setState({
          updating: false,
          modalSpinning: false
        });
      });
    }
    saveVLV() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "add-search",
        "--name=" + this.state.vlvName,
        "--search-base=" + this.state.vlvBase,
        "--search-filter=" + this.state.vlvFilter,
        "--search-scope=" + this.getScopeVal(this.state.vlvScope),
        this.props.suffix
      ];
      log_cmd("saveVLV", "Add vlv search", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeVLVModal();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully added VLV search: " + this.state.vlvName
        );
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.closeVLVModal();
        this.props.addNotification(
          "error",
          `Failed create VLV search entry - ${errMsg.desc}`
        );
        this.setState({
          saving: false
        });
      });
    }
    showDeleteConfirm(name2) {
      this.setState({
        showDeleteConfirm: true,
        deleteVLVName: name2
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false
      });
    }
    deleteVLV() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "del-search",
        "--name=" + this.state.deleteVLVName,
        this.props.suffix
      ];
      log_cmd("deleteVLV", "delete LV search and indexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          `Successfully deleted VLV index`
        );
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failed to deletre VLV index - ${errMsg.desc}`
        );
        this.setState({
          modalSpinning: false
        });
      });
    }
    showReindexConfirm(name2) {
      this.setState({
        showReindexConfirm: true,
        reindexVLVName: name2
      });
    }
    closeReindexConfirm() {
      this.setState({
        showReindexConfirm: false
      });
    }
    reindexVLV() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "reindex",
        "--parent-name=" + this.state.reindexVLVName,
        this.props.suffix
      ];
      log_cmd("reindexVLV", "reindex VLV indexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          `Successfully completed VLV indexing`
        );
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failed to index VLV index - ${errMsg.desc}`
        );
        this.setState({
          modalSpinning: false
        });
      });
    }
    render() {
      return /* @__PURE__ */ import_react33.default.createElement("div", { className: "ds-tab-table ds-margin-bottom-md" }, /* @__PURE__ */ import_react33.default.createElement(
        VLVTable,
        {
          rows: this.props.vlvItems,
          key: this.props.vlvItems,
          deleteFunc: this.showDeleteConfirm,
          reindexFunc: this.showReindexConfirm,
          deleteSortFunc: this.showDeleteSortIndexConfirm,
          addSortFunc: this.showCreateSortIndex,
          updating: this.state.updating
        }
      ), /* @__PURE__ */ import_react33.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: this.handleShowVLVModal
        },
        "Create VLV Index"
      ), /* @__PURE__ */ import_react33.default.createElement(
        AddVLVIndexModal,
        {
          showModal: this.state.showCreateSortIndex,
          handleClose: this.closeCreateSortIndex,
          handleChange: this.onModalChange,
          saveHandler: this.createSortIndex,
          onSelectToggle: this.handleSelectToggle,
          onSelectClear: this.handleSelectClear,
          handleTypeaheadChange: this.onTypeaheadChange,
          attrs: this.props.attrs,
          reindexVLV: this.state.reindexVLV,
          vlvSortList: this.state.vlvSortList,
          saving: this.state.saving || this.state.updating,
          saveBtnDisabled: this.state.saveBtnDisabled
        }
      ), /* @__PURE__ */ import_react33.default.createElement(
        AddVLVModal,
        {
          showModal: this.state.showVLVModal,
          closeHandler: this.closeVLVModal,
          handleChange: this.onVLVChange,
          saveHandler: this.saveVLV,
          error: this.state.errObj,
          vlvName: this.state.vlvName,
          vlvBase: this.state.vlvBase,
          vlvScope: this.state.vlvScope,
          vlvFilter: this.state.vlvFilter,
          saving: this.state.saving,
          saveBtnDisabled: this.state.saveBtnDisabled
        }
      ), /* @__PURE__ */ import_react33.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDeleteConfirm,
          closeHandler: this.closeDeleteConfirm,
          handleChange: this.onModalChange,
          actionHandler: this.deleteVLV,
          spinning: this.state.modalSpinning,
          item: this.state.deleteVLVName,
          checked: this.state.modalChecked,
          mTitle: "Delete VLV Index",
          mMsg: "Are you sure you want to delete this VLV index??",
          mSpinningMsg: "Deleting Index ...",
          mBtnName: "Delete Index"
        }
      ), /* @__PURE__ */ import_react33.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showReindexConfirm,
          closeHandler: this.closeReindexConfirm,
          handleChange: this.onModalChange,
          actionHandler: this.reindexVLV,
          spinning: this.state.modalSpinning,
          item: this.state.reindexVLVName,
          checked: this.state.modalChecked,
          mTitle: "Reindex VLV Index",
          mMsg: "Are you sure you want to reindex this VLV index??",
          mSpinningMsg: "Reindex ...",
          mBtnName: "Reindex"
        }
      ), /* @__PURE__ */ import_react33.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDeleteSortIndexConfirm,
          closeHandler: this.closeDeleteSortIndexConfirm,
          handleChange: this.onModalChange,
          actionHandler: this.deleteSortIndex,
          spinning: this.state.modalSpinning,
          item: this.state.deleteIndexName,
          checked: this.state.modalChecked,
          mTitle: "Delete VLV Sort Index",
          mMsg: "Are you really sure you want to delete this sorting index?",
          mSpinningMsg: "Deleting Index ...",
          mBtnName: "Delete Index"
        }
      ));
    }
  };
  var AddVLVIndexModal = class extends import_react33.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortValue: [],
        isVLVSortOpen: false
      };
      this.handleVLVSortToggle = (isVLVSortOpen) => {
        this.setState({
          isVLVSortOpen
        });
      };
      this.handleVLVSortClear = () => {
        this.setState({
          sortValue: [],
          isVLVSortOpen: false
        });
      };
      this.onTypeaheadChange = this.onTypeaheadChange.bind(this);
    }
    onTypeaheadChange(e, selection) {
      if (this.state.sortValue.includes(selection)) {
        this.setState(
          (prevState) => ({
            sortValue: prevState.sortValue.filter((item) => item !== selection),
            isVLVSortOpen: false
          })
        );
      } else {
        this.setState(
          (prevState) => ({
            sortValue: [...prevState.sortValue, selection],
            isVLVSortOpen: false
          })
        );
      }
    }
    render() {
      const {
        showModal,
        handleChange,
        attrs,
        saving
      } = this.props;
      let saveBtnName = "Create Sort Index";
      const extraPrimaryProps = {};
      if (this.props.saving) {
        saveBtnName = "Creating Index ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react33.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: "Create VLV Sort Index",
          isOpen: showModal,
          onClose: this.props.handleClose,
          className: this.state.isVLVSortOpen ? "ds-modal-select-tall" : "ds-modal-select",
          actions: [
            /* @__PURE__ */ import_react33.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: () => {
                  this.props.handleSave(this.state.sortValue);
                },
                isLoading: saving,
                spinnerAriaValueText: saving ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.state.sortValue.length === 0 || saving
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react33.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.props.handleClose }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react33.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react33.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react33.default.createElement(GridItem, { className: "ds-label", span: 12 }, 'Build a list of attributes to form the "Sort" index'), /* @__PURE__ */ import_react33.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute names to create a sort index",
            className: "ds-margin-top-lg",
            onToggle: this.handleVLVSortToggle,
            onClear: this.handleVLVSortClear,
            onSelect: this.handleTypeaheadChange,
            maxHeight: 1e3,
            selections: this.state.sortValue,
            isOpen: this.state.isVLVSortOpen,
            "aria-labelledby": "typeAhead-vlv-sort-index",
            placeholderText: "Type an attribute name ...",
            noResultsFoundText: "There are no matching entries"
          },
          attrs.map((attr, index) => /* @__PURE__ */ import_react33.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ), /* @__PURE__ */ import_react33.default.createElement(GridItem, { className: "ds-margin-top-xlg", span: 12 }, /* @__PURE__ */ import_react33.default.createElement(
          Checkbox,
          {
            id: "reindexVLV",
            isChecked: this.props.reindexVLV,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Reindex After Saving"
          }
        ))))
      );
    }
  };
  var AddVLVModal = class extends import_react33.default.Component {
    render() {
      const {
        showModal,
        handleChange,
        saveHandler,
        closeHandler,
        error,
        saving
      } = this.props;
      let saveBtnName = "Save VLV Index";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Saving Index ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react33.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: "Create VLV Search Index",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react33.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.saveBtnDisabled || saving
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react33.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react33.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react33.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react33.default.createElement(GridItem, { className: "ds-label", span: 2 }, "VLV Index Name"), /* @__PURE__ */ import_react33.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react33.default.createElement(
          TextInput,
          {
            value: this.props.vlvName,
            type: "text",
            id: "vlvName",
            "aria-describedby": "vlvName",
            name: "vlvName",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.vlvName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react33.default.createElement(Grid, null, /* @__PURE__ */ import_react33.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Search Base"), /* @__PURE__ */ import_react33.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react33.default.createElement(
          TextInput,
          {
            value: this.props.vlvBase,
            type: "text",
            id: "vlvBase",
            "aria-describedby": "vlvBase",
            name: "vlvBase",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.vlvBase ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react33.default.createElement(Grid, null, /* @__PURE__ */ import_react33.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Search Filter"), /* @__PURE__ */ import_react33.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react33.default.createElement(
          TextInput,
          {
            type: "text",
            id: "vlvFilter",
            "aria-describedby": "vlvFilter",
            name: "vlvFilter",
            onChange: (str, e) => {
              handleChange(e);
            },
            value: this.props.filter,
            validated: error.vlvFilter ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react33.default.createElement(Grid, null, /* @__PURE__ */ import_react33.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Search Scope"), /* @__PURE__ */ import_react33.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react33.default.createElement(
          FormSelect,
          {
            value: this.props.vlvScope,
            onChange: (value, event) => {
              handleChange(event);
            },
            id: "vlvScope",
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react33.default.createElement(FormSelectOption, { key: "0", value: "subtree", label: "subtree" }),
          /* @__PURE__ */ import_react33.default.createElement(FormSelectOption, { key: "1", value: "one", label: "one" }),
          /* @__PURE__ */ import_react33.default.createElement(FormSelectOption, { key: "2", value: "base", label: "base" })
        ))), /* @__PURE__ */ import_react33.default.createElement(Grid, null, /* @__PURE__ */ import_react33.default.createElement(GridItem, { offset: 1, className: "ds-margin-top-lg ds-margin-bottom", span: 10 }, /* @__PURE__ */ import_react33.default.createElement(TextContent, null, /* @__PURE__ */ import_react33.default.createElement(Text, { component: TextVariants.h4 }, "After creating this VLV Search entry you can go to the table and add VLV Sort Indexes to this VLV Search.  After adding the Sort Indexes you will need to ", /* @__PURE__ */ import_react33.default.createElement("i", null, "reindex"), " the VLV Index to make it active.")))))
      );
    }
  };
  VLVIndexes.propTypes = {
    suffix: import_prop_types28.default.string,
    serverId: import_prop_types28.default.string,
    vlvItems: import_prop_types28.default.array,
    addNotification: import_prop_types28.default.func,
    attrs: import_prop_types28.default.array,
    reload: import_prop_types28.default.func
  };
  VLVIndexes.defaultProps = {
    suffix: "",
    serverId: "",
    vlvItems: [],
    attrs: []
  };
  AddVLVModal.propTypes = {
    showModal: import_prop_types28.default.bool,
    closeHandler: import_prop_types28.default.func,
    handleChange: import_prop_types28.default.func,
    handleSortChange: import_prop_types28.default.func,
    saveHandler: import_prop_types28.default.func,
    error: import_prop_types28.default.object,
    attrs: import_prop_types28.default.array,
    vlvName: import_prop_types28.default.string,
    vlvBase: import_prop_types28.default.string,
    vlvScope: import_prop_types28.default.string,
    vlvFilter: import_prop_types28.default.string,
    vlvSortList: import_prop_types28.default.array
  };
  AddVLVModal.defaultProps = {
    showModal: false,
    error: {},
    attrs: [],
    vlvName: "",
    vlvBase: "",
    vlvScope: "",
    vlvFilter: "",
    vlvSortList: []
  };

  // src/lib/database/databaseModal.jsx
  var import_react34 = __toESM(require_react(), 1);
  var import_prop_types29 = __toESM(require_prop_types(), 1);
  var CreateLinkModal = class extends import_react34.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        suffix,
        error,
        saving,
        handleSelectChange,
        starttls_checked,
        bindMech
      } = this.props;
      let saveBtnName = "Create Database Link";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Creating Link ...";
        extraPrimaryProps.spinnerAriaValueText = "Creating";
      }
      return /* @__PURE__ */ import_react34.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Create Database Link",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react34.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Creating Link" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.saveBtnDisabled || saving
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react34.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react34.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react34.default.createElement(Grid, { className: "ds-margin-top", title: "The RDN of the link suffix." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Link Sub-Suffix"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react34.default.createElement("div", null, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            className: "ds-right-align",
            id: "createLinkSuffix",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createLinkSuffix",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.createLinkSuffix ? ValidatedOptions.error : ValidatedOptions.default
          }
        )), /* @__PURE__ */ import_react34.default.createElement("div", { className: "ds-left-margin ds-lower-field-md" }, /* @__PURE__ */ import_react34.default.createElement("b", null, /* @__PURE__ */ import_react34.default.createElement("font", { color: "blue" }, ",", suffix)))), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.createLinkSuffix }, "Required field"))), /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "A name for the backend chaining database link." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Link Database Name"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            id: "createLinkName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createLinkName",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.createLinkName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.createLinkName }, "Required field"))), /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "The LDAP URL for the remote server.  Add additional failover LDAP URLs separated by a space. (nsfarmserverurl)." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Remote Server URL(s)"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            id: "createNsfarmserverurl",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createNsfarmserverurl",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.createNsfarmserverurl ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.createNsfarmserverurl }, "Required field"))), /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "The DN of the entry to authenticate with on the remote server." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Remote Server Bind DN"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            id: "createNsmultiplexorbinddn",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createNsmultiplexorbinddn",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.createNsmultiplexorbinddn ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.createNsmultiplexorbinddn }, "Required field"))), /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "The credentials for the bind DN (nsmultiplexorcredentials)." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN Credentials"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "password",
            id: "createNsmultiplexorcredentials",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createNsmultiplexorcredentials",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.createNsmultiplexorcredentials ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.createNsmultiplexorcredentials }, "Password does not match"))), /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "Confirm credentials for the bind DN (nsmultiplexorcredentials)." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Confirm Password"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "password",
            id: "createNsmultiplexorcredentialsConfirm",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createNsmultiplexorcredentialsConfirm",
            onChange: (checked, e) => {
              handleChange(e);
            },
            validated: error.createNsmultiplexorcredentialsConfirm ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.createNsmultiplexorcredentialsConfirm }, "Password does not match"))), /* @__PURE__ */ import_react34.default.createElement(
          Grid,
          {
            title: "The bind method for contacting the remote server  (nsbindmechanism)."
          },
          /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Method"),
          /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(FormSelect, { value: bindMech, onChange: handleSelectChange, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react34.default.createElement(FormSelectOption, { key: 1, value: "SIMPLE", label: "SIMPLE" }), /* @__PURE__ */ import_react34.default.createElement(FormSelectOption, { key: 2, value: "SASL/DIGEST-MD5", label: "SASL/DIGEST-MD5" }), /* @__PURE__ */ import_react34.default.createElement(FormSelectOption, { key: 3, value: "SASL/GSSAPI", label: "SASL/GSSAPI" })))
        ), /* @__PURE__ */ import_react34.default.createElement(Grid, { className: "ds-margin-top", title: "Use StartTLS for the remote server LDAP URL." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react34.default.createElement(
          Checkbox,
          {
            id: "createUseStartTLS",
            onChange: (checked, e) => {
              handleChange(e);
            },
            isChecked: starttls_checked,
            label: "Use StartTLS"
          }
        ))))
      );
    }
  };
  var CreateSubSuffixModal = class extends import_react34.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        isOpen: false
      };
      this.onToggle = (isOpen) => {
        this.setState({
          isOpen
        });
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        handleSelectChange,
        saveHandler,
        suffix,
        error,
        saving,
        initOption
      } = this.props;
      let saveBtnName = "Create Sub-Suffix";
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = "Creating suffix ...";
        extraPrimaryProps.spinnerAriaValueText = "Creating";
      }
      return /* @__PURE__ */ import_react34.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Create Sub Suffix",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react34.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? "Creating Suffix" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.saveBtnDisabled || saving
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react34.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react34.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react34.default.createElement(Grid, { className: "ds-margin-top", title: "Database suffix, like 'dc=example,dc=com'.  The suffix must be a valid LDAP Distiguished Name (DN)" }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Sub-Suffix DN"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react34.default.createElement("div", null, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            className: "ds-right-align",
            id: "subSuffixValue",
            "aria-describedby": "horizontal-form-name-helper",
            name: "subSuffixValue",
            onChange: (val, e) => {
              handleChange(e);
            },
            validated: error.subSuffixValue ? ValidatedOptions.error : ValidatedOptions.default
          }
        )), /* @__PURE__ */ import_react34.default.createElement("div", { className: "ds-left-margin ds-lower-field-md" }, /* @__PURE__ */ import_react34.default.createElement("b", null, /* @__PURE__ */ import_react34.default.createElement("font", { color: "blue" }, ",", suffix)))), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.subSuffixValue }, "Required field"))), /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "The name for the backend database, like 'userroot'.  The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Database Name"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            id: "subSuffixBeName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "subSuffixBeName",
            onChange: (val, e) => {
              handleChange(e);
            },
            validated: error.subSuffixBeName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react34.default.createElement(FormHelperText, { isError: true, isHidden: !error.subSuffixBeName }, "Required field"))), /* @__PURE__ */ import_react34.default.createElement(
          Grid,
          {
            title: "Database initialization options"
          },
          /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Initialization Option"),
          /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(FormSelect, { value: initOption, onChange: handleSelectChange, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react34.default.createElement(FormSelectOption, { key: 1, value: "noInit", label: "Do Not Initialize Database" }), /* @__PURE__ */ import_react34.default.createElement(FormSelectOption, { key: 2, value: "addSuffix", label: "Create The Top Sub-Suffix Entry" }), /* @__PURE__ */ import_react34.default.createElement(FormSelectOption, { key: 3, value: "addSample", label: "Add Sample Entries" })))
        ))
      );
    }
  };
  var ExportModal = class extends import_react34.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        includeReplData,
        saveHandler,
        spinning,
        error
      } = this.props;
      let saveBtnName = "Export Database";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Exporting ...";
        extraPrimaryProps.spinnerAriaValueText = "Creating";
      }
      return /* @__PURE__ */ import_react34.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Export Database To LDIF File",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react34.default.createElement(
              Button,
              {
                key: "export",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Creating Suffix" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.saveBtnDisabled || spinning
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react34.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react34.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "Name of exported LDIF file." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 3 }, "LDIF File Name"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            id: "ldifLocation",
            "aria-describedby": "horizontal-form-name-helper",
            name: "ldifLocation",
            onChange: (val, e) => {
              handleChange(e);
            },
            validated: error.ldifLocation ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "Include the replication metadata needed to restore or initialize another replica." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react34.default.createElement(
          Checkbox,
          {
            id: "includeReplData",
            onChange: (checked, e) => {
              handleChange(e);
            },
            isChecked: includeReplData,
            label: "Include Replication Data"
          }
        ))))
      );
    }
  };
  var ImportModal = class extends import_react34.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        rows,
        suffix
      } = this.props;
      const suffixRows = [];
      for (const row of rows) {
        if (row[3] === suffix) {
          suffixRows.push(row);
        }
      }
      return /* @__PURE__ */ import_react34.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Initialize Database via LDIF File",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react34.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react34.default.createElement(
          LDIFTable,
          {
            rows: suffixRows,
            confirmImport: this.props.showConfirmImport
          }
        ),
        /* @__PURE__ */ import_react34.default.createElement("hr", null),
        /* @__PURE__ */ import_react34.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react34.default.createElement(Grid, { title: "The full path to the LDIF file.  The server must have permissions to read it." }, /* @__PURE__ */ import_react34.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Or, enter LDIF location"), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react34.default.createElement(
          TextInput,
          {
            type: "text",
            id: "ldifLocation",
            "aria-describedby": "horizontal-form-name-helper",
            name: "ldifLocation",
            onChange: (val, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react34.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react34.default.createElement(
          Button,
          {
            key: "import",
            className: "ds-left-margin",
            variant: "primary",
            onClick: saveHandler,
            isDisabled: this.props.saveBtnDisabled
          },
          "Import"
        ))))
      );
    }
  };
  CreateLinkModal.propTypes = {
    showModal: import_prop_types29.default.bool,
    closeHandler: import_prop_types29.default.func,
    handleChange: import_prop_types29.default.func,
    saveHandler: import_prop_types29.default.func,
    suffix: import_prop_types29.default.string,
    error: import_prop_types29.default.object
  };
  CreateLinkModal.defaultProps = {
    showModal: false,
    suffix: "",
    error: {}
  };
  CreateSubSuffixModal.propTypes = {
    showModal: import_prop_types29.default.bool,
    closeHandler: import_prop_types29.default.func,
    handleChange: import_prop_types29.default.func,
    saveHandler: import_prop_types29.default.func,
    suffix: import_prop_types29.default.string,
    error: import_prop_types29.default.object
  };
  CreateSubSuffixModal.defaultProps = {
    showModal: false,
    suffix: "",
    error: {}
  };
  ExportModal.propTypes = {
    showModal: import_prop_types29.default.bool,
    closeHandler: import_prop_types29.default.func,
    handleChange: import_prop_types29.default.func,
    saveHandler: import_prop_types29.default.func,
    error: import_prop_types29.default.object,
    spinning: import_prop_types29.default.bool
  };
  ExportModal.defaultProps = {
    showModal: false,
    error: {},
    spinning: false
  };
  ImportModal.propTypes = {
    showModal: import_prop_types29.default.bool,
    closeHandler: import_prop_types29.default.func,
    handleChange: import_prop_types29.default.func,
    saveHandler: import_prop_types29.default.func,
    showConfirmImport: import_prop_types29.default.func,
    rows: import_prop_types29.default.array,
    suffix: import_prop_types29.default.string
  };
  ImportModal.defaultProps = {
    showModal: false,
    rows: [],
    suffix: ""
  };

  // src/lib/database/suffix.jsx
  var import_prop_types30 = __toESM(require_prop_types(), 1);
  var Suffix = class extends import_react35.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        activeTabKey: 0,
        notifications: [],
        errObj: {},
        refRows: this.props.data.refRows,
        encAttrsRows: this.props.data.encAttrsRows,
        vlvItems: this.props.data.vlvItems,
        autoTuning: this.props.data.autoTuning,
        dropdownIsOpen: false,
        // Suffix configuration
        cachememsize: this.props.data.cachememsize,
        cachesize: this.props.data.cachesize,
        dncachememsize: this.props.data.dncachememsize,
        readOnly: this.props.data.readOnly,
        requireIndex: this.props.data.requireIndex,
        dbstate: this.props.data.dbstate,
        _cachememsize: this.props.data.cachememsize,
        _cachesize: this.props.data.cachesize,
        _dncachememsize: this.props.data.dncachememsize,
        _readOnly: this.props.data.readOnly,
        _requireIndex: this.props.data.requireIndex,
        _dbstate: this.props.data.dbstate,
        savingConfig: false,
        saveBtnDisabled: true,
        // Import/Export modals
        showImportModal: false,
        showExportModal: false,
        ldifLocation: "",
        attrEncryption: false,
        exportSpinner: false,
        showConfirmLDIFImport: false,
        importLDIFName: "",
        deleleLDIFName: "",
        modalChecked: false,
        modalSpinning: false,
        includeReplData: false,
        // Reindex all
        showReindexConfirm: false,
        // Create Sub Suffix
        showSubSuffixModal: false,
        subSuffixValue: "",
        subSuffixBeName: "",
        createSuffixEntry: false,
        noSuffixInit: true,
        createSampleEntries: false,
        saveSubSuffixBtnDisabled: true,
        subSuffixSaving: false,
        initOption: "noInit",
        // Create Link
        showLinkModal: false,
        createLinkSuffix: "",
        createLinkName: "",
        createNsfarmserverurl: "",
        createNsmultiplexorbinddn: "",
        createNsmultiplexorcredentials: "",
        createNsmultiplexorcredentialsConfirm: "",
        createUseStartTLS: false,
        createNsbindmechanism: "SIMPLE",
        linkSaving: false,
        linkSaveBtnDisabled: true,
        // Delete
        showDeleteConfirm: false
      };
      this.handleToggle = (dropdownIsOpen) => {
        this.setState({
          dropdownIsOpen
        });
      };
      this.handleSelect = (event) => {
        this.setState({
          dropdownIsOpen: !this.state.dropdownIsOpen
        });
        this.onFocus();
      };
      this.onFocus = () => {
        const element = document.getElementById("suffix-dropdown");
        element.focus();
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleShowImportModal = this.handleShowImportModal.bind(this);
      this.closeImportModal = this.closeImportModal.bind(this);
      this.onChange = this.onChange.bind(this);
      this.doImport = this.doImport.bind(this);
      this.importLDIF = this.importLDIF.bind(this);
      this.showConfirmLDIFImport = this.showConfirmLDIFImport.bind(this);
      this.closeConfirmLDIFImport = this.closeConfirmLDIFImport.bind(this);
      this.handleShowExportModal = this.handleShowExportModal.bind(this);
      this.closeExportModal = this.closeExportModal.bind(this);
      this.doExport = this.doExport.bind(this);
      this.onExportChange = this.onExportChange.bind(this);
      this.handleShowReindexConfirm = this.handleShowReindexConfirm.bind(this);
      this.closeReindexConfirm = this.closeReindexConfirm.bind(this);
      this.doReindex = this.doReindex.bind(this);
      this.handleShowSubSuffixModal = this.handleShowSubSuffixModal.bind(this);
      this.closeSubSuffixModal = this.closeSubSuffixModal.bind(this);
      this.createSubSuffix = this.createSubSuffix.bind(this);
      this.onSubSuffixOnSelect = this.onSubSuffixOnSelect.bind(this);
      this.onSubSuffixChange = this.onSubSuffixChange.bind(this);
      this.handleShowLinkModal = this.handleShowLinkModal.bind(this);
      this.closeLinkModal = this.closeLinkModal.bind(this);
      this.createLink = this.createLink.bind(this);
      this.onLinkChange = this.onLinkChange.bind(this);
      this.onLinkOnSelect = this.onLinkOnSelect.bind(this);
      this.saveSuffixConfig = this.saveSuffixConfig.bind(this);
      this.handleShowDeleteConfirm = this.handleShowDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
      this.onConfigChange = this.onConfigChange.bind(this);
      this.doDelete = this.doDelete.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    //
    // Import Modal
    //
    handleShowImportModal() {
      this.setState({
        ldifLocation: "",
        attrEncryption: false,
        showImportModal: true,
        errObj: {}
      });
    }
    closeImportModal() {
      this.setState({
        showImportModal: false
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    onConfigChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      const configAttrs2 = [
        "cachememsize",
        "cachesize",
        "dncachememsize",
        "readOnly",
        "requireIndex",
        "dbstate"
      ];
      for (const check_attr of configAttrs2) {
        if (attr !== check_attr) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        } else if (value !== this.state["_" + check_attr]) {
          saveBtnDisabled = false;
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled
      });
    }
    showConfirmLDIFImport(name2) {
      this.setState({
        showConfirmLDIFImport: true,
        importLDIFName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmLDIFImport() {
      this.setState({
        showConfirmLDIFImport: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    importLDIF() {
      const import_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "import",
        this.props.suffix,
        this.state.importLDIFName,
        "--encrypted"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("doImport", "Do online import", import_cmd);
      cockpit_default.spawn(import_cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Import successfully initiated`
        );
        this.setState({
          modalSpinning: false,
          showConfirmLDIFImport: false,
          showImportModal: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error importing LDIF file - ${errMsg.desc}`
        );
        this.setState({
          modalSpinning: false,
          showConfirmLDIFImport: false
        });
      });
    }
    doImport() {
      if (this.state.ldifLocation !== "") {
        this.setState({
          showConfirmLDIFImport: true,
          importLDIFName: this.state.ldifLocation
        });
      }
    }
    //
    // Export modal
    //
    handleShowExportModal() {
      this.setState({
        ldifLocation: "",
        attrEncryption: false,
        showExportModal: true,
        exportSpinner: false,
        includeReplData: false,
        errObj: {}
      });
    }
    closeExportModal() {
      this.setState({
        showExportModal: false,
        exportSpinner: false
      });
    }
    doExport() {
      const missingArgs = { ldifLocation: false };
      if (this.state.ldifLocation === "") {
        this.props.addNotification(
          "warning",
          `LDIF name is empty`
        );
        missingArgs.ldifLocation = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      if (bad_file_name(this.state.ldifLocation)) {
        this.props.addNotification(
          "warning",
          `LDIF name should not be a path.  All export files are stored in the server's LDIF directory`
        );
        missingArgs.ldifLocation = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      const export_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "export",
        this.props.suffix,
        "--ldif=" + this.state.ldifLocation
      ];
      if (this.state.attrEncryption) {
        export_cmd.push("--encrypted");
      }
      if (this.state.includeReplData) {
        export_cmd.push("--replication");
      }
      this.setState({
        exportSpinner: true
      });
      log_cmd("doExport", "Do online export", export_cmd);
      cockpit_default.spawn(export_cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadLDIFs();
        this.setState({
          showExportModal: false
        });
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "get",
          "nsslapd-ldifdir"
        ];
        log_cmd("doExport", "Get the backup directory", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const config2 = JSON.parse(content2);
          const attrs = config2.attrs;
          this.props.addNotification(
            "success",
            `Database export complete. You can find the LDIF file in ${attrs["nsslapd-ldifdir"][0]} directory on the server machine.`
          );
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "success",
            `Database export complete.`
          );
          this.props.addNotification(
            "error",
            `Error while trying to get the server's LDIF directory- ${errMsg.desc}`
          );
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reloadLDIFs();
        this.props.addNotification(
          "error",
          `Error exporting database - ${errMsg.desc}`
        );
        this.setState({
          showExportModal: false
        });
      });
    }
    //
    // Reindex entire database
    //
    handleShowReindexConfirm() {
      this.setState({
        showReindexConfirm: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeReindexConfirm() {
      this.setState({
        showReindexConfirm: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    doReindex() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "reindex",
        "--wait",
        this.props.suffix
      ];
      log_cmd("doReindex", "Reindex all attributes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Database has successfully been reindexed`
        );
        this.setState({
          modalSpinning: false,
          showReindexConfirm: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to reindex database - ${errMsg.desc}`
        );
        this.setState({
          modalSpinning: false,
          showReindexConfirm: false
        });
      });
    }
    //
    // Create sub suffix
    //
    handleShowSubSuffixModal() {
      this.setState({
        showSubSuffixModal: true,
        errObj: {}
      });
    }
    closeSubSuffixModal() {
      this.setState({
        showSubSuffixModal: false
      });
    }
    createSubSuffix() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "create",
        "--be-name",
        this.state.subSuffixBeName,
        "--suffix=" + this.state.subSuffixValue + "," + this.props.suffix,
        "--parent-suffix=" + this.props.suffix
      ];
      if (this.state.createSampleEntries) {
        cmd.push("--create-entries");
      }
      if (this.state.createSuffixEntry) {
        cmd.push("--create-suffix");
      }
      this.setState({
        subSuffixSaving: true
      });
      log_cmd("createSubSuffix", "Create a sub suffix", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(false);
        this.closeSubSuffixModal();
        this.props.addNotification(
          "success",
          `Successfully created new sub-suffix`
        );
        this.setState({
          subSuffixSaving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.loadSuffixTree(false);
        this.closeSubSuffixModal();
        this.props.addNotification(
          "error",
          `Error creating sub-suffix - ${errMsg.desc}`
        );
        this.setState({
          subSuffixSaving: false
        });
      });
    }
    //
    // Create Chaining Link
    //
    handleShowLinkModal() {
      this.setState({
        showLinkModal: true,
        errObj: {}
      });
    }
    closeLinkModal() {
      this.setState({
        showLinkModal: false
      });
    }
    createLink() {
      this.setState({
        linkSaving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-create",
        "--suffix=" + this.state.createLinkSuffix + "," + this.props.suffix,
        "--server-url=" + this.state.createNsfarmserverurl,
        "--bind-mech=" + this.state.createNsbindmechanism,
        "--bind-dn=" + this.state.createNsmultiplexorbinddn,
        "--bind-pw=" + this.state.createNsmultiplexorcredentials,
        this.state.createLinkName
      ];
      if (this.state.createUseStartTLS) {
        cmd.push("--use-starttls=on");
      }
      log_cmd("createLink", "Create database link", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(false);
        this.closeLinkModal();
        this.props.addNotification(
          "success",
          `Successfully created database link`
        );
        this.setState({
          linkSaving: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.loadSuffixTree(false);
        this.closeLinkModal();
        this.props.addNotification(
          "error",
          `Error creating database link - ${errMsg.desc}`
        );
        this.setState({
          linkSaving: false
        });
      });
    }
    onLinkOnSelect(value, event) {
      this.setState({
        createNsbindmechanism: value
      });
    }
    onLinkChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      let saveBtnDisabled = false;
      const errObj = this.state.errObj;
      const check_attrs = [
        "createLinkSuffix",
        "createLinkName",
        "createNsfarmserverurl",
        "createNsmultiplexorbinddn",
        "createNsmultiplexorcredentials",
        "createNsmultiplexorcredentialsConfirm",
        "createNsbindmechanism"
      ];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr && this.state[check_attr] === "") {
          saveBtnDisabled = true;
        }
      }
      if (attr !== "createNsmultiplexorcredentials" && attr !== "createNsmultiplexorcredentialsConfirm") {
        if (this.state.createNsmultiplexorcredentials !== this.state.createNsmultiplexorcredentialsConfirm) {
          saveBtnDisabled = true;
        }
      } else {
        if (attr === "createNsmultiplexorcredentials") {
          if (value !== this.state.createNsmultiplexorcredentialsConfirm) {
            errObj.createNsmultiplexorcredentials = true;
            errObj.createNsmultiplexorcredentialsConfirm = true;
            saveBtnDisabled = true;
          } else {
            errObj.createNsmultiplexorcredentials = false;
            errObj.createNsmultiplexorcredentialsConfirm = false;
          }
        } else if (attr === "createNsmultiplexorcredentialsConfirm") {
          if (value !== this.state.createNsmultiplexorcredentials) {
            errObj.createNsmultiplexorcredentials = true;
            errObj.createNsmultiplexorcredentialsConfirm = true;
            saveBtnDisabled = true;
          } else {
            errObj.createNsmultiplexorcredentials = false;
            errObj.createNsmultiplexorcredentialsConfirm = false;
          }
        }
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[attr] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        linkSaveBtnDisabled: saveBtnDisabled
      });
    }
    onSubSuffixOnSelect(value, event) {
      let noInit = false;
      let addSuffix = false;
      let addSample = false;
      if (value === "noInit") {
        noInit = true;
      } else if (value === "addSuffix") {
        addSuffix = true;
      } else {
        addSample = true;
      }
      this.setState({
        initOption: value,
        noSuffixInit: noInit,
        createSuffixEntry: addSuffix,
        createSampleEntries: addSample
      });
    }
    onSubSuffixChange(e) {
      const value = e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      let saveBtnDisabled = false;
      const check_attrs = ["subSuffixBeName", "subSuffixValue"];
      for (const check_attr of check_attrs) {
        if (this.state[check_attr] === "") {
          saveBtnDisabled = true;
        }
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveSubSuffixBtnDisabled: saveBtnDisabled
      });
    }
    onExportChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      let saveBtnDisabled = false;
      if (e.target.id !== "ldifLocation" && this.state.ldifLocation === 0) {
        saveBtnDisabled = true;
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveExportBtnDisabled: saveBtnDisabled
      });
    }
    //
    // Delete suffix
    //
    handleShowDeleteConfirm(item) {
      this.setState({
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    doDelete() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "delete",
        this.props.suffix,
        "--do-it"
      ];
      log_cmd("doDelete", "Delete database", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(true);
        this.closeDeleteConfirm();
        this.props.addNotification(
          "success",
          `Successfully deleted database`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.loadSuffixTree(true);
        this.closeDeleteConfirm();
        this.props.addNotification(
          "error",
          `Error deleting database - ${errMsg.desc}`
        );
      });
    }
    // Save config
    saveSuffixConfig() {
      console.log("Save suffix config: ", this.props.suffix);
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "set",
        this.props.suffix
      ];
      let requireRestart = false;
      if (this.state._readOnly !== this.state.readOnly) {
        if (this.state.readOnly) {
          cmd.push("--enable-readonly");
        } else {
          cmd.push("--disable-readonly");
        }
      }
      if (this.state._requireIndex !== this.state.requireIndex) {
        if (this.state.requireIndex) {
          cmd.push("--require-index");
        } else {
          cmd.push("--ignore-index");
        }
      }
      if (this.state._cachememsize !== this.state.cachememsize) {
        cmd.push("--cache-memsize=" + this.state.cachememsize);
        requireRestart = true;
      }
      if (this.state._cachesize !== this.state.cachesize) {
        cmd.push("--cache-size=" + this.state.cachesize);
        requireRestart = true;
      }
      if (this.state._dncachememsize !== this.state.dncachememsize) {
        cmd.push("--dncache-memsize=" + this.state.dncachememsize);
        requireRestart = true;
      }
      if (this.state._dbstate !== this.state.dbstate) {
        cmd.push("--state=" + this.state.dbstate);
        requireRestart = true;
      }
      if (cmd.length > 7) {
        this.setState({
          savingConfig: true
        });
        log_cmd("saveSuffixConfig", "Save suffix config", cmd);
        const msg = "Successfully updated suffix configuration";
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload(this.props.suffix);
          if (requireRestart) {
            this.props.addNotification(
              "warning",
              msg + "You must restart the Directory Server for these changes to take effect."
            );
          }
          this.setState({
            savingConfig: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.reload(this.props.suffix);
          let msg2 = errMsg.desc;
          if ("info" in errMsg) {
            msg2 = errMsg.desc + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            `Error updating suffix configuration - ${msg2}`
          );
          this.setState({
            savingConfig: false
          });
        });
      }
    }
    //
    // Render the component
    //
    render() {
      let suffixIcon = faTree;
      if (this.props.dbtype === "subsuffix") {
        suffixIcon = faLeaf;
      }
      const { dropdownIsOpen, activeTabKey } = this.state;
      const dropdownItems = [
        /* @__PURE__ */ import_react35.default.createElement(DropdownItem, { key: "import", component: "button", onClick: this.handleShowImportModal, title: "Import an LDIF file to initialize the database" }, "Initialize Suffix"),
        /* @__PURE__ */ import_react35.default.createElement(DropdownItem, { key: "export", component: "button", onClick: this.handleShowExportModal, title: "Export the database to an LDIF file" }, "Export Suffix"),
        /* @__PURE__ */ import_react35.default.createElement(DropdownItem, { key: "reindex", component: "button", onClick: this.handleShowReindexConfirm, title: "Reindex the entire database" }, "Reindex Suffix"),
        /* @__PURE__ */ import_react35.default.createElement(DropdownItem, { key: "subSuffix", component: "button", onClick: this.handleShowSubSuffixModal, title: "Create a sub-suffix under this suffix" }, "Create Sub-Suffix"),
        /* @__PURE__ */ import_react35.default.createElement(DropdownItem, { key: "dbLink", component: "button", onClick: this.handleShowLinkModal, title: "Create a database chaining link subtree" }, "Create Database Link"),
        /* @__PURE__ */ import_react35.default.createElement(DropdownSeparator, { key: "separator" }),
        /* @__PURE__ */ import_react35.default.createElement(DropdownItem, { key: "deleteSuffix", component: "button", onClick: this.handleShowDeleteConfirm, title: "This will permanently delete the database" }, "Delete Suffix")
      ];
      return /* @__PURE__ */ import_react35.default.createElement("div", { id: "suffix-page" }, /* @__PURE__ */ import_react35.default.createElement(Grid, null, /* @__PURE__ */ import_react35.default.createElement(GridItem, { className: "ds-suffix-header", span: 9 }, /* @__PURE__ */ import_react35.default.createElement(FontAwesomeIcon, { size: "sm", icon: suffixIcon }), "\xA0\xA0", this.props.suffix, " (", /* @__PURE__ */ import_react35.default.createElement("i", null, this.props.bename), ")", /* @__PURE__ */ import_react35.default.createElement(
        FontAwesomeIcon,
        {
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh suffix",
          onClick: () => this.props.reload(this.props.suffix)
        }
      )), /* @__PURE__ */ import_react35.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react35.default.createElement(
        Dropdown,
        {
          className: "ds-float-right",
          position: DropdownPosition.right,
          onSelect: this.handleSelect,
          toggle: /* @__PURE__ */ import_react35.default.createElement(DropdownToggle, { id: "suffix-dropdown", isPrimary: true, onToggle: this.handleToggle }, "Suffix Tasks"),
          isOpen: dropdownIsOpen,
          dropdownItems
        }
      ))), /* @__PURE__ */ import_react35.default.createElement("div", { className: "ds-sub-header" }, /* @__PURE__ */ import_react35.default.createElement(Tabs, { isFilled: true, activeKey: activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react35.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react35.default.createElement(TabTitleText, null, "Settings") }, /* @__PURE__ */ import_react35.default.createElement(
        SuffixConfig,
        {
          cachememsize: this.state.cachememsize,
          cachesize: this.state.cachesize,
          dncachememsize: this.state.dncachememsize,
          dbstate: this.state.dbstate,
          readOnly: this.state.readOnly,
          requireIndex: this.state.requireIndex,
          autoTuning: this.state.autoTuning,
          handleChange: this.onConfigChange,
          handleSave: this.saveSuffixConfig,
          saving: this.state.savingConfig,
          saveBtnDisabled: this.state.saveBtnDisabled
        }
      )), /* @__PURE__ */ import_react35.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react35.default.createElement(TabTitleText, null, "Referrals") }, /* @__PURE__ */ import_react35.default.createElement(
        SuffixReferrals,
        {
          rows: this.props.data.refRows,
          suffix: this.props.suffix,
          reload: this.props.reloadRefs,
          addNotification: this.props.addNotification,
          serverId: this.props.serverId,
          key: this.state.refRows
        }
      )), /* @__PURE__ */ import_react35.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react35.default.createElement(TabTitleText, null, "Indexes") }, /* @__PURE__ */ import_react35.default.createElement(
        SuffixIndexes,
        {
          systemIndexRows: this.props.data.systemIndexRows,
          indexRows: this.props.data.indexRows,
          suffix: this.props.suffix,
          serverId: this.props.serverId,
          addNotification: this.props.addNotification,
          reload: this.props.reloadIndexes
        }
      )), /* @__PURE__ */ import_react35.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react35.default.createElement(TabTitleText, null, "VLV Indexes") }, /* @__PURE__ */ import_react35.default.createElement(
        VLVIndexes,
        {
          suffix: this.props.suffix,
          serverId: this.props.serverId,
          vlvItems: this.props.data.vlvItems,
          addNotification: this.props.addNotification,
          attrs: this.props.attrs,
          reload: this.props.reloadVLV,
          key: this.props.vlvTableKey
        }
      )), /* @__PURE__ */ import_react35.default.createElement(Tab, { eventKey: 4, title: /* @__PURE__ */ import_react35.default.createElement(TabTitleText, null, "Encrypted Attributes") }, /* @__PURE__ */ import_react35.default.createElement(
        AttrEncryption,
        {
          rows: this.props.data.encAttrsRows,
          suffix: this.props.suffix,
          serverId: this.props.serverId,
          addNotification: this.props.addNotification,
          attrs: this.props.attrs,
          reload: this.props.reloadAttrEnc
        }
      )))), /* @__PURE__ */ import_react35.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDeleteConfirm,
          closeHandler: this.closeDeleteConfirm,
          handleChange: this.onChange,
          actionHandler: this.doDelete,
          spinning: this.state.modalSpinning,
          item: this.props.suffix,
          checked: this.state.modalChecked,
          mTitle: "Delete Suffix",
          mMsg: "Are you really sure you want to delete this suffix?",
          mSpinningMsg: "Deleting suffix ...",
          mBtnName: "Delete Suffix"
        }
      ), /* @__PURE__ */ import_react35.default.createElement(
        CreateLinkModal,
        {
          showModal: this.state.showLinkModal,
          closeHandler: this.closeLinkModal,
          handleChange: this.onLinkChange,
          handleSelectChange: this.onLinkOnSelect,
          saveHandler: this.createLink,
          suffix: this.props.suffix,
          starttls_checked: this.state.createUseStartTLS,
          error: this.state.errObj,
          saving: this.state.linkSaving,
          saveBtnDisabled: this.state.linkSaveBtnDisabled,
          bindMech: this.state.createNsbindmechanism
        }
      ), /* @__PURE__ */ import_react35.default.createElement(
        CreateSubSuffixModal,
        {
          showModal: this.state.showSubSuffixModal,
          closeHandler: this.closeSubSuffixModal,
          handleChange: this.onSubSuffixChange,
          handleSelectChange: this.onSubSuffixOnSelect,
          saveHandler: this.createSubSuffix,
          suffix: this.props.suffix,
          error: this.state.errObj,
          saving: this.state.subSuffixSaving,
          saveBtnDisabled: this.state.saveSubSuffixBtnDisabled,
          initOption: this.state.initOption
        }
      ), /* @__PURE__ */ import_react35.default.createElement(
        ImportModal,
        {
          showModal: this.state.showImportModal,
          closeHandler: this.closeImportModal,
          handleChange: this.onChange,
          saveHandler: this.doImport,
          showConfirmImport: this.showConfirmLDIFImport,
          rows: this.props.LDIFRows,
          suffix: this.props.suffix,
          saveBtnDisabled: this.state.ldifLocation === ""
        }
      ), /* @__PURE__ */ import_react35.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmLDIFImport,
          closeHandler: this.closeConfirmLDIFImport,
          handleChange: this.onChange,
          actionHandler: this.importLDIF,
          spinning: this.state.modalSpinning,
          item: this.state.importLDIFName,
          checked: this.state.modalChecked,
          mTitle: "Initialize Database From LDIF",
          mMsg: "Are you sure you want to initialize the database (it will permanently overwrite the current database)?",
          mSpinningMsg: "Initializing Database ...",
          mBtnName: "Initialize Database"
        }
      ), /* @__PURE__ */ import_react35.default.createElement(
        ExportModal,
        {
          showModal: this.state.showExportModal,
          closeHandler: this.closeExportModal,
          handleChange: this.onExportChange,
          saveHandler: this.doExport,
          spinning: this.state.exportSpinner,
          error: this.state.errObj,
          includeReplData: this.state.includeReplData,
          saveBtnDisabled: this.state.ldifLocation === ""
        }
      ), /* @__PURE__ */ import_react35.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showReindexConfirm,
          closeHandler: this.closeReindexConfirm,
          handleChange: this.onChange,
          actionHandler: this.doReindex,
          spinning: this.state.modalSpinning,
          item: this.props.suffix,
          checked: this.state.modalChecked,
          mTitle: "Reindex All Attributes",
          mMsg: "Are you sure you want to reindex all the attribute indexes?",
          mSpinningMsg: "Reindexing Database ...",
          mBtnName: "Reindex"
        }
      ));
    }
  };
  Suffix.propTypes = {
    serverId: import_prop_types30.default.string,
    suffix: import_prop_types30.default.string,
    bename: import_prop_types30.default.string,
    loadSuffixTree: import_prop_types30.default.func,
    reload: import_prop_types30.default.func,
    reloadRefs: import_prop_types30.default.func,
    reloadIndexes: import_prop_types30.default.func,
    reloadVLV: import_prop_types30.default.func,
    reloadAttrEnc: import_prop_types30.default.func,
    reloadLDIFs: import_prop_types30.default.func,
    addNotification: import_prop_types30.default.func,
    dbtype: import_prop_types30.default.string,
    data: import_prop_types30.default.object,
    attrs: import_prop_types30.default.array,
    LDIFRows: import_prop_types30.default.array,
    enableTree: import_prop_types30.default.func
  };
  Suffix.defaultProps = {
    serverId: "",
    suffix: "",
    bename: "",
    dbtype: "",
    data: {},
    attrs: [],
    LDIFRows: []
  };

  // src/lib/database/backups.jsx
  var import_react36 = __toESM(require_react(), 1);
  var import_prop_types31 = __toESM(require_prop_types(), 1);
  var Backups = class extends import_react36.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        showConfirmBackupDelete: false,
        showConfirmBackup: false,
        showConfirmRestoreReplace: false,
        showConfirmLDIFReplace: false,
        showRestoreSpinningModal: false,
        showDelBackupSpinningModal: false,
        showBackupModal: false,
        backupSpinning: false,
        backupName: "",
        deleteBackup: "",
        // LDIF
        showConfirmLDIFDelete: false,
        showConfirmLDIFImport: false,
        showConfirmRestore: false,
        showLDIFSpinningModal: false,
        showLDIFDeleteSpinningModal: false,
        showExportModal: false,
        exportSpinner: false,
        includeReplData: false,
        ldifName: "",
        ldifSuffix: "",
        errObj: {},
        modalSpinning: false,
        modalChecked: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onChange = this.onChange.bind(this);
      this.onConfirmChange = this.onConfirmChange.bind(this);
      this.doBackup = this.doBackup.bind(this);
      this.deleteBackup = this.deleteBackup.bind(this);
      this.restoreBackup = this.restoreBackup.bind(this);
      this.showConfirmRestore = this.showConfirmRestore.bind(this);
      this.closeConfirmRestore = this.closeConfirmRestore.bind(this);
      this.showConfirmBackup = this.showConfirmBackup.bind(this);
      this.closeConfirmBackup = this.closeConfirmBackup.bind(this);
      this.showConfirmBackupDelete = this.showConfirmBackupDelete.bind(this);
      this.closeConfirmBackupDelete = this.closeConfirmBackupDelete.bind(this);
      this.handleShowBackupModal = this.handleShowBackupModal.bind(this);
      this.closeBackupModal = this.closeBackupModal.bind(this);
      this.validateBackup = this.validateBackup.bind(this);
      this.closeConfirmRestoreReplace = this.closeConfirmRestoreReplace.bind(this);
      this.importLDIF = this.importLDIF.bind(this);
      this.deleteLDIF = this.deleteLDIF.bind(this);
      this.showConfirmLDIFImport = this.showConfirmLDIFImport.bind(this);
      this.closeConfirmLDIFImport = this.closeConfirmLDIFImport.bind(this);
      this.showConfirmLDIFDelete = this.showConfirmLDIFDelete.bind(this);
      this.closeConfirmLDIFDelete = this.closeConfirmLDIFDelete.bind(this);
      this.doExport = this.doExport.bind(this);
      this.handleShowExportModal = this.handleShowExportModal.bind(this);
      this.closeExportModal = this.closeExportModal.bind(this);
      this.validateLDIF = this.validateLDIF.bind(this);
      this.closeConfirmLDIFReplace = this.closeConfirmLDIFReplace.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleShowExportModal() {
      this.setState({
        showExportModal: true,
        exportSpinner: false,
        ldifName: "",
        ldifSuffix: this.props.suffixes[0],
        includeReplData: false
      });
    }
    closeExportModal() {
      this.setState({
        showExportModal: false
      });
    }
    closeConfirmLDIFReplace() {
      this.setState({
        showConfirmLDIFReplace: false
      });
    }
    showRestoreSpinningModal() {
      this.setState({
        showRestoreSpinningModal: true
      });
    }
    closeRestoreSpinningModal() {
      this.setState({
        showRestoreSpinningModal: false
      });
    }
    handleShowBackupModal() {
      this.setState({
        showBackupModal: true,
        backupSpinning: false,
        backupName: ""
      });
    }
    closeBackupModal() {
      this.setState({
        showBackupModal: false
      });
    }
    showConfirmLDIFImport(name2, suffix) {
      this.setState({
        showConfirmLDIFImport: true,
        ldifName: name2,
        ldifSuffix: suffix,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmLDIFImport() {
      this.setState({
        showConfirmLDIFImport: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmLDIFDelete(name2) {
      this.setState({
        showConfirmLDIFDelete: true,
        ldifName: name2,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmLDIFDelete() {
      this.setState({
        showConfirmLDIFDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmBackup(name2) {
      this.setState({
        showConfirmBackup: true,
        backupName: name2,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmBackup() {
      this.setState({
        showConfirmBackup: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmRestore(name2) {
      this.setState({
        showConfirmRestore: true,
        backupName: name2,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmRestore() {
      this.setState({
        showConfirmRestore: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmBackupDelete(name2) {
      this.setState({
        showConfirmBackupDelete: true,
        backupName: name2,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmBackupDelete() {
      this.setState({
        showConfirmBackupDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmRestoreReplace() {
      this.setState({
        showConfirmRestoreReplace: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    onConfirmChange(e) {
      this.setState({
        modalChecked: e.target.checked
      });
    }
    importLDIF() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "import",
        this.state.ldifSuffix,
        this.state.ldifName,
        "--encrypted"
      ];
      log_cmd("importLDIF", "Importing LDIF", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeConfirmLDIFImport();
        this.props.addNotification(
          "success",
          `LDIF was successfully imported`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.closeConfirmLDIFImport();
        this.props.addNotification(
          "error",
          `Failure importing LDIF - ${errMsg.desc}`
        );
      });
    }
    deleteLDIF(e) {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsctl",
        this.props.serverId,
        "ldifs",
        "--delete",
        this.state.ldifName
      ];
      log_cmd("deleteLDIF", "Deleting LDIF", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.handleReload();
        this.closeConfirmLDIFDelete();
        this.props.addNotification(
          "success",
          `LDIF file was successfully deleted`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.handleReload();
        this.closeConfirmLDIFDelete();
        this.props.addNotification(
          "error",
          `Failure deleting LDIF file - ${errMsg.desc}`
        );
      });
    }
    validateBackup() {
      for (let i = 0; i < this.props.backups.length; i++) {
        if (this.state.backupName === this.props.backups[i].name) {
          this.setState({
            showConfirmRestoreReplace: true
          });
          return;
        }
      }
      this.doBackup();
    }
    doBackup() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backup",
        "create"
      ];
      if (this.state.backupName !== "") {
        if (bad_file_name(this.state.backupName)) {
          this.props.addNotification(
            "warning",
            `Backup name should not be a path.  All backups are stored in the server's backup directory`
          );
          return;
        }
        cmd.push(this.state.backupName);
      }
      this.setState({
        backupSpinning: true
      });
      log_cmd("doBackup", "Add backup task", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(
        (content) => {
          this.props.handleReload();
          this.closeBackupModal();
          const cmd2 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "config",
            "get",
            "nsslapd-bakdir"
          ];
          log_cmd("doBackup", "Get the backup directory", cmd2);
          cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content2) => {
            const config2 = JSON.parse(content2);
            const attrs = config2.attrs;
            this.props.addNotification(
              "success",
              `Server has been backed up. You can find the backup in ${attrs["nsslapd-bakdir"][0]} directory on the server machine.`
            );
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.props.addNotification(
              "success",
              `Server has been backed up.`
            );
            this.props.addNotification(
              "error",
              `Error while trying to get the server's backup directory- ${errMsg.desc}`
            );
          });
        }
      ).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.handleReload();
        this.closeBackupModal();
        this.props.addNotification(
          "error",
          `Failure backing up server - ${errMsg.desc}`
        );
      });
    }
    restoreBackup() {
      if (this.props.suffixes.length === 0) {
        this.props.addNotification(
          "error",
          `There are no databases defined to restore`
        );
        return;
      }
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backup",
        "restore",
        this.state.backupName
      ];
      log_cmd("restoreBackup", "Restoring server", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeConfirmRestore();
        this.props.addNotification(
          "success",
          `Server has been restored`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.closeRestoreSpinningModal();
        this.props.addNotification(
          "error",
          `Failure restoring up server - ${errMsg.desc}`
        );
      });
    }
    deleteBackup(e) {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsctl",
        this.props.serverId,
        "backups",
        "--delete",
        this.state.backupName
      ];
      log_cmd("deleteBackup", "Deleting backup", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.handleReload();
        this.closeConfirmBackupDelete();
        this.props.addNotification(
          "success",
          `Backup was successfully deleted`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.handleReload();
        this.closeConfirmBackupDelete();
        this.props.addNotification(
          "error",
          `Failure deleting backup - ${errMsg.desc}`
        );
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    validateLDIF() {
      let ldifname = this.state.ldifName;
      if (!ldifname.endsWith(".ldif")) {
        ldifname = ldifname + ".ldif";
      }
      for (let i = 0; i < this.props.ldifs.length; i++) {
        if (ldifname === this.props.ldifs[i].name) {
          this.setState({
            showConfirmLDIFReplace: true
          });
          return;
        }
      }
      this.doExport();
    }
    doExport() {
      const missingArgs = { ldifName: false };
      if (this.state.ldifName === "") {
        this.props.addNotification(
          "warning",
          `LDIF name is empty`
        );
        missingArgs.ldifName = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      if (bad_file_name(this.state.ldifName)) {
        this.props.addNotification(
          "warning",
          `LDIF name should not be a path.  All export files are stored in the server's LDIF directory`
        );
        missingArgs.ldifLocation = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      const export_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "export",
        this.state.ldifSuffix,
        "--encrypted",
        "--ldif=" + this.state.ldifName
      ];
      if (this.state.includeReplData) {
        export_cmd.push("--replication");
      }
      this.setState({
        exportSpinner: true
      });
      log_cmd("doExport", "Do online export", export_cmd);
      cockpit_default.spawn(export_cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.handleReload();
        this.closeExportModal();
        this.setState({
          showExportModal: false
        });
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "get",
          "nsslapd-ldifdir"
        ];
        log_cmd("doExport", "Get the backup directory", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const config2 = JSON.parse(content2);
          const attrs = config2.attrs;
          this.props.addNotification(
            "success",
            `Database export complete. You can find the LDIF file in ${attrs["nsslapd-ldifdir"][0]} directory on the server machine.`
          );
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "success",
            `Database export complete.`
          );
          this.props.addNotification(
            "error",
            `Error while trying to get the server's LDIF directory- ${errMsg.desc}`
          );
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.handleReload();
        this.closeExportModal();
        this.props.addNotification(
          "error",
          `Error exporting database - ${errMsg.desc}`
        );
        this.setState({
          showExportModal: false
        });
      });
    }
    render() {
      let refreshBtnName = "Refresh";
      const extraPrimaryProps = {};
      if (this.props.refreshing) {
        refreshBtnName = "Refreshing ...";
        extraPrimaryProps.spinnerAriaValueText = "Refreshing";
      }
      return /* @__PURE__ */ import_react36.default.createElement("div", null, /* @__PURE__ */ import_react36.default.createElement(TextContent, null, /* @__PURE__ */ import_react36.default.createElement(Text, { className: "ds-config-header", component: TextVariants.h2 }, "Database Backups & LDIFs")), /* @__PURE__ */ import_react36.default.createElement(Tabs, { className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react36.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react36.default.createElement(TabTitleText, null, "Backups ", /* @__PURE__ */ import_react36.default.createElement("font", { size: "2" }, "(", this.props.backups.length, ")")) }, /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react36.default.createElement(
        BackupTable,
        {
          key: this.props.backups,
          rows: this.props.backups,
          confirmRestore: this.showConfirmRestore,
          confirmDelete: this.showConfirmBackupDelete
        }
      )), /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-inline" }, /* @__PURE__ */ import_react36.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: this.handleShowBackupModal,
          className: "ds-margin-top"
        },
        "Create Backup"
      ), /* @__PURE__ */ import_react36.default.createElement(
        Button,
        {
          variant: "secondary",
          onClick: () => {
            this.props.handleReload(1);
          },
          className: "ds-left-margin ds-margin-top",
          isLoading: this.props.refreshing,
          spinnerAriaValueText: this.props.refreshing ? "Refreshing" : void 0,
          ...extraPrimaryProps
        },
        refreshBtnName
      )))), /* @__PURE__ */ import_react36.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react36.default.createElement(TabTitleText, null, "LDIFs ", /* @__PURE__ */ import_react36.default.createElement("font", { size: "2" }, "(", this.props.ldifs.length, ")")) }, /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react36.default.createElement(
        LDIFManageTable,
        {
          key: this.props.ldifs,
          rows: this.props.ldifs,
          confirmImport: this.showConfirmLDIFImport,
          confirmDelete: this.showConfirmLDIFDelete
        }
      )), /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-inline" }, /* @__PURE__ */ import_react36.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: this.handleShowExportModal,
          className: "ds-margin-top"
        },
        "Create LDIF"
      ), /* @__PURE__ */ import_react36.default.createElement(
        Button,
        {
          variant: "secondary",
          onClick: this.props.handleReload,
          className: "ds-left-margin ds-margin-top",
          isLoading: this.props.refreshing,
          spinnerAriaValueText: this.props.refreshing ? "Refreshing" : void 0,
          ...extraPrimaryProps
        },
        refreshBtnName
      ))))), /* @__PURE__ */ import_react36.default.createElement(
        ExportModal2,
        {
          showModal: this.state.showExportModal,
          closeHandler: this.closeExportModal,
          handleChange: this.onChange,
          saveHandler: this.validateLDIF,
          spinning: this.state.exportSpinner,
          error: this.state.errObj,
          suffixes: this.props.suffixes,
          includeReplData: this.state.includeReplData,
          ldifSuffix: this.state.ldifSuffix,
          ldifName: this.state.ldifName
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        BackupModal,
        {
          showModal: this.state.showBackupModal,
          closeHandler: this.closeBackupModal,
          handleChange: this.onChange,
          saveHandler: this.validateBackup,
          spinning: this.state.backupSpinning,
          error: this.state.errObj
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        ImportingModal,
        {
          showModal: this.state.showLDIFSpinningModal,
          closeHandler: this.closeLDIFSpinningModal,
          msg: this.state.ldifName
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmLDIFDelete,
          closeHandler: this.closeConfirmLDIFDelete,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteLDIF,
          spinning: this.state.modalSpinning,
          item: this.state.ldifName,
          checked: this.state.modalChecked,
          mTitle: "Delete LDIF File",
          mMsg: "Are you sure you want to delete this LDIF?",
          mSpinningMsg: "Deleting LDIF ...",
          mBtnName: "Delete LDIF"
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmLDIFImport,
          closeHandler: this.closeConfirmLDIFImport,
          handleChange: this.onConfirmChange,
          actionHandler: this.importLDIF,
          spinning: this.state.modalSpinning,
          item: this.state.ldifName,
          checked: this.state.modalChecked,
          mTitle: "Import LDIF File",
          mMsg: "Are you sure you want to import this LDIF?",
          mSpinningMsg: "Importing LDIF ...",
          mBtnName: "Import LDIF"
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmRestore,
          closeHandler: this.closeConfirmRestore,
          handleChange: this.onConfirmChange,
          actionHandler: this.restoreBackup,
          spinning: this.state.modalSpinning,
          item: this.state.backupName,
          checked: this.state.modalChecked,
          mTitle: "Restore Database",
          mMsg: "Are you sure you want to restore from this backup?",
          mSpinningMsg: "Restoring ...",
          mBtnName: "Restore"
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmBackupDelete,
          closeHandler: this.closeConfirmBackupDelete,
          handleChange: this.onConfirmChange,
          actionHandler: this.deleteBackup,
          spinning: this.state.modalSpinning,
          item: this.state.backupName,
          checked: this.state.modalChecked,
          mTitle: "Delete Backup",
          mMsg: "Are you sure you want to delete this backup?",
          mSpinningMsg: "Deleting backup ...",
          mBtnName: "Delete Backup"
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmRestoreReplace,
          closeHandler: this.closeConfirmRestoreReplace,
          handleChange: this.onConfirmChange,
          actionHandler: this.doBackup,
          spinning: this.state.modalSpinning,
          item: this.state.backupName,
          checked: this.state.modalChecked,
          mTitle: "Replace Existing Backup",
          mMsg: "A backup already eixsts with the same name, do you want to replace it?",
          mSpinningMsg: "Replacing backup ...",
          mBtnName: "Replace Backup"
        }
      ), /* @__PURE__ */ import_react36.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmLDIFReplace,
          closeHandler: this.closeConfirmLDIFReplace,
          handleChange: this.onConfirmChange,
          actionHandler: this.doExport,
          spinning: this.state.modalSpinning,
          item: this.state.ldifName,
          checked: this.state.modalChecked,
          mTitle: "Replace Existing LDIF File",
          mMsg: "A LDIF file already exists with the same name, do you want to replace it?",
          mSpinningMsg: "Replacing LDIF ...",
          mBtnName: "Replace LDIF"
        }
      ));
    }
  };
  var ExportModal2 = class extends import_react36.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        suffixes,
        spinning,
        error,
        ldifSuffix,
        ldifName
      } = this.props;
      let createBtnName = "Create LDIF";
      const extraPrimaryProps = {};
      let exportMsg = "";
      if (spinning) {
        createBtnName = "Creating ...";
        extraPrimaryProps.spinnerAriaValueText = "Creating";
      }
      if (spinning) {
        exportMsg = /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react36.default.createElement("font", { size: "2" }, "(You can safely close this window)"));
      }
      const suffixList = suffixes.map((suffix) => /* @__PURE__ */ import_react36.default.createElement(FormSelectOption, { key: suffix, value: suffix, label: suffix }));
      return /* @__PURE__ */ import_react36.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Export Database To LDIF File",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react36.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Creating ..." : void 0,
                isDisabled: spinning || ldifName === "",
                ...extraPrimaryProps
              },
              createBtnName
            ),
            /* @__PURE__ */ import_react36.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react36.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react36.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react36.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Select Suffix"), /* @__PURE__ */ import_react36.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react36.default.createElement(FormSelect, { id: "ldifSuffix", value: ldifSuffix, onChange: (value, event) => {
          handleChange(event);
        }, "aria-label": "FormSelect Input" }, suffixList))), /* @__PURE__ */ import_react36.default.createElement(
          Grid,
          {
            title: "Name of exported LDIF file, if left blank the data and time will be used as the file name"
          },
          /* @__PURE__ */ import_react36.default.createElement(GridItem, { className: "ds-label", span: 3 }, "LDIF File Name"),
          /* @__PURE__ */ import_react36.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react36.default.createElement(
            TextInput,
            {
              type: "text",
              id: "ldifName",
              "aria-describedby": "horizontal-form-name-helper",
              name: "ldifName",
              value: ldifName,
              onChange: (value, event) => {
                handleChange(event);
              },
              validated: error.ldifName ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react36.default.createElement(
          Grid,
          {
            title: "Name of exported LDIF file, if left blank the data and time will be used as the file name"
          },
          /* @__PURE__ */ import_react36.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react36.default.createElement(
            Checkbox,
            {
              id: "includeReplData",
              className: "ds-indent ds-margin-top",
              isChecked: this.props.includeReplData,
              onChange: (checked, e) => {
                handleChange(e);
              },
              title: "Include the replication metadata needed to restore or initialize another replica.",
              label: "Include Replication Data"
            }
          ))
        ), exportMsg)
      );
    }
  };
  var BackupModal = class extends import_react36.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        error
      } = this.props;
      let createBtnName = "Create Backup";
      const extraPrimaryProps = {};
      let exportMsg = "";
      if (spinning) {
        createBtnName = "Backing up ...";
        extraPrimaryProps.spinnerAriaValueText = "Backing up";
      }
      if (spinning) {
        exportMsg = /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react36.default.createElement("font", { size: "2" }, "(You can safely close this window)"));
      }
      return /* @__PURE__ */ import_react36.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Backup The Server",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react36.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                isDisabled: spinning,
                spinnerAriaValueText: spinning ? "Creating ..." : void 0,
                ...extraPrimaryProps
              },
              createBtnName
            ),
            /* @__PURE__ */ import_react36.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react36.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react36.default.createElement(
          Grid,
          {
            title: "Backup name, if left blank the date and time will be used as the name",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react36.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Backup Name"),
          /* @__PURE__ */ import_react36.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react36.default.createElement(
            TextInput,
            {
              type: "text",
              id: "backupName",
              "aria-describedby": "horizontal-form-name-helper",
              name: "ldifName",
              onChange: (value, event) => {
                handleChange(event);
              },
              validated: error.backupName ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), exportMsg)
      );
    }
  };
  var ImportingModal = class extends import_react36.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        msg
      } = this.props;
      return /* @__PURE__ */ import_react36.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "Import LDIF File",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react36.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Close")
          ]
        },
        /* @__PURE__ */ import_react36.default.createElement(Form, { horizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react36.default.createElement("div", { className: "ds-modal-spinner" }, /* @__PURE__ */ import_react36.default.createElement(Spinner, { size: "md" }), " Importing LDIF ", /* @__PURE__ */ import_react36.default.createElement("b", null, msg), " ...", /* @__PURE__ */ import_react36.default.createElement("p", { className: "ds-margin-top" }, /* @__PURE__ */ import_react36.default.createElement("font", { size: "2" }, " (You can safely close this window)"))))
      );
    }
  };
  ExportModal2.propTypes = {
    showModal: import_prop_types31.default.bool,
    closeHandler: import_prop_types31.default.func,
    handleChange: import_prop_types31.default.func,
    saveHandler: import_prop_types31.default.func,
    spinning: import_prop_types31.default.bool,
    error: import_prop_types31.default.object,
    suffixes: import_prop_types31.default.array
  };
  BackupModal.propTypes = {
    showModal: import_prop_types31.default.bool,
    closeHandler: import_prop_types31.default.func,
    handleChange: import_prop_types31.default.func,
    saveHandler: import_prop_types31.default.func,
    spinning: import_prop_types31.default.bool,
    error: import_prop_types31.default.object
  };
  ImportingModal.propTypes = {
    showModal: import_prop_types31.default.bool,
    closeHandler: import_prop_types31.default.func,
    msg: import_prop_types31.default.string
  };
  Backups.propTypes = {
    backups: import_prop_types31.default.array,
    ldifs: import_prop_types31.default.array,
    reload: import_prop_types31.default.func,
    enableTree: import_prop_types31.default.func
  };
  Backups.defaultProps = {
    backups: [],
    ldifs: []
  };

  // src/lib/database/globalPwp.jsx
  var import_react37 = __toESM(require_react(), 1);
  var import_prop_types32 = __toESM(require_prop_types(), 1);
  var general_attrs = [
    "nsslapd-pwpolicy-local",
    "passwordstoragescheme",
    "passwordadmindn",
    "passwordadminskipinfoupdate",
    "passwordtrackupdatetime",
    "nsslapd-allow-hashed-passwords",
    "nsslapd-pwpolicy-inherit-global",
    "passwordisglobalpolicy",
    "passwordchange",
    "passwordmustchange",
    "passwordhistory",
    "passwordinhistory",
    "passwordminage"
  ];
  var exp_attrs = [
    "passwordexp",
    "passwordgracelimit",
    "passwordsendexpiringtime",
    "passwordmaxage",
    "passwordwarning"
  ];
  var lockout_attrs = [
    "passwordlockout",
    "passwordunlock",
    "passwordlockoutduration",
    "passwordmaxfailure",
    "passwordresetfailurecount"
  ];
  var syntax_attrs = [
    "passwordchecksyntax",
    "passwordminlength",
    "passwordmindigits",
    "passwordminalphas",
    "passwordminuppers",
    "passwordminlowers",
    "passwordminspecials",
    "passwordmin8bit",
    "passwordmaxrepeats",
    "passwordpalindrome",
    "passwordmaxsequence",
    "passwordmaxseqsets",
    "passwordmaxclasschars",
    "passwordmincategories",
    "passwordmintokenlength",
    "passwordbadwords",
    "passworduserattributes",
    "passworddictcheck"
  ];
  var tpr_attrs = [
    "passwordtprmaxuse",
    "passwordtprdelayexpireat",
    "passwordtprdelayvalidfrom"
  ];
  var GlobalPwPolicy = class extends import_react37.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSyntaxChange", (e, selection, isPlaceholder) => {
        let attr;
        let value;
        if (selection) {
          attr = "passworduserattributes";
          value = selection;
        } else {
          value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
          attr = e.target.id;
        }
        let disableSaveBtn = true;
        for (const syntax_attr of syntax_attrs) {
          if (syntax_attr === "passworduserattributes" && attr === "passworduserattributes") {
            const orig_val = this.state["_" + syntax_attr].join(" ");
            if (orig_val !== value) {
              value = selection;
              disableSaveBtn = false;
              break;
            }
            value = selection;
          } else if (attr === syntax_attr && this.state["_" + syntax_attr] !== value) {
            disableSaveBtn = false;
            break;
          }
        }
        for (const syntax_attr of syntax_attrs) {
          if (syntax_attr === "passworduserattributes" && attr !== "passworduserattributes") {
            const orig_val = this.state["_" + syntax_attr].join(" ");
            const new_val = this.state[syntax_attr].join(" ");
            if (orig_val !== new_val) {
              disableSaveBtn = false;
              break;
            }
          } else if (attr !== syntax_attr && this.state["_" + syntax_attr] !== this.state[syntax_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        if (selection) {
          if (this.state[attr].includes(selection)) {
            this.setState(
              (prevState) => ({
                [attr]: prevState[attr].filter((item) => item !== selection),
                isSelectOpen: false
              })
            );
          } else {
            this.setState(
              (prevState) => ({
                [attr]: [...prevState[attr], selection],
                saveSyntaxDisabled: disableSaveBtn,
                isSelectOpen: false
              })
            );
          }
        } else {
          this.setState({
            [attr]: value,
            saveSyntaxDisabled: disableSaveBtn,
            isSelectOpen: false
          });
        }
      });
      __publicField(this, "handleSelectToggle", (isSelectOpen) => {
        this.setState({
          isSelectOpen
        });
      });
      __publicField(this, "handleSelectClear", () => {
        this.setState({
          passworduserattributes: [],
          isSelectOpen: false
        });
      });
      this.state = {
        loading: true,
        loaded: false,
        saving: false,
        activeKey: 1,
        // Lists of all the attributes for each tab/section.
        // We use the exact attribute name for the ID of
        // each field, so we can loop over them to efficently
        // check for changes, and updating/saving the config.
        saveGeneralDisabled: true,
        saveExpDisabled: true,
        saveLockoutDisabled: true,
        saveSyntaxDisabled: true,
        saveTPRDisabled: true,
        isSelectOpen: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleGeneralChange = this.handleGeneralChange.bind(this);
      this.handleSaveGeneral = this.handleSaveGeneral.bind(this);
      this.handleExpChange = this.handleExpChange.bind(this);
      this.handleSaveExp = this.handleSaveExp.bind(this);
      this.handleLockoutChange = this.handleLockoutChange.bind(this);
      this.handleSaveLockout = this.handleSaveLockout.bind(this);
      this.handleSyntaxChange = this.handleSyntaxChange.bind(this);
      this.handleSaveSyntax = this.handleSaveSyntax.bind(this);
      this.handleTPRChange = this.handleTPRChange.bind(this);
      this.handleSaveTPR = this.handleSaveTPR.bind(this);
      this.handleLoadGlobal = this.handleLoadGlobal.bind(this);
      this.handleSelectToggle = this.handleSelectToggle.bind(this);
      this.handleSelectClear = this.handleSelectClear.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadGlobal();
      } else {
        this.props.enableTree();
      }
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    handleGeneralChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const general_attr of general_attrs) {
        if (attr === general_attr && this.state["_" + general_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const general_attr of general_attrs) {
        if (attr !== general_attr && this.state["_" + general_attr] !== this.state[general_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveGeneralDisabled: disableSaveBtn
      });
    }
    handleSaveGeneral() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of general_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveGeneral", "Saving general pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleUserChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const user_attr of this.state.user_attrs) {
        if (attr === user_attr && this.state["_" + user_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const user_attr of this.state.user_attrs) {
        if (attr !== user_attr && this.state["_" + user_attr] !== this.state[user_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveUserDisabled: disableSaveBtn
      });
    }
    handleExpChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const exp_attr of exp_attrs) {
        if (attr === exp_attr && this.state["_" + exp_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const exp_attr of exp_attrs) {
        if (attr !== exp_attr && this.state["_" + exp_attr] !== this.state[exp_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveExpDisabled: disableSaveBtn
      });
    }
    handleSaveExp() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of exp_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveExp", "Saving Expiration pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleLockoutChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const lockout_attr of lockout_attrs) {
        if (attr === lockout_attr && this.state["_" + lockout_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const lockout_attr of lockout_attrs) {
        if (attr !== lockout_attr && this.state["_" + lockout_attr] !== this.state[lockout_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveLockoutDisabled: disableSaveBtn
      });
    }
    handleSaveLockout() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of lockout_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveLockout", "Saving lockout pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleSaveSyntax() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of syntax_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveSyntax", "Saving syntax checking pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleTPRChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const tpr_attr of tpr_attrs) {
        if (attr === tpr_attr && this.state["_" + tpr_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const tpr_attr of tpr_attrs) {
        if (attr !== tpr_attr && this.state["_" + tpr_attr] !== this.state[tpr_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveTPRDisabled: disableSaveBtn
      });
    }
    handleSaveTPR() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of tpr_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          const val = this.state[attr];
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveTPR", "Saving TPR settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleLoadGlobal() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleLoadGlobal", "Load global password policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let pwpLocal = false;
        let pwIsGlobal = false;
        let pwChange = false;
        let pwMustChange = false;
        let pwHistory = false;
        let pwTrackUpdate = false;
        let pwExpire = false;
        let pwSendExpire = false;
        let pwLockout = false;
        let pwUnlock = false;
        let pwCheckSyntax = false;
        let pwPalindrome = false;
        let pwDictCheck = false;
        let pwAllowHashed = false;
        let pwInheritGlobal = false;
        let pwAdminSkipUpdates = false;
        let pwUserAttrs = [];
        if (attrs["nsslapd-pwpolicy-local"][0] === "on") {
          pwpLocal = true;
        }
        if (attrs.passwordchange[0] === "on") {
          pwChange = true;
        }
        if (attrs.passwordmustchange[0] === "on") {
          pwMustChange = true;
        }
        if (attrs.passwordhistory[0] === "on") {
          pwHistory = true;
        }
        if (attrs.passwordtrackupdatetime[0] === "on") {
          pwTrackUpdate = true;
        }
        if (attrs.passwordisglobalpolicy[0] === "on") {
          pwIsGlobal = true;
        }
        if (attrs.passwordsendexpiringtime[0] === "on") {
          pwSendExpire = true;
        }
        if (attrs.passwordlockout[0] === "on") {
          pwLockout = true;
        }
        if (attrs.passwordunlock[0] === "on") {
          pwUnlock = true;
        }
        if (attrs.passwordexp[0] === "on") {
          pwExpire = true;
        }
        if (attrs.passwordchecksyntax[0] === "on") {
          pwCheckSyntax = true;
        }
        if (attrs.passwordpalindrome[0] === "on") {
          pwPalindrome = true;
        }
        if (attrs.passworddictcheck[0] === "on") {
          pwDictCheck = true;
        }
        if (attrs["nsslapd-allow-hashed-passwords"][0] === "on") {
          pwAllowHashed = true;
        }
        if (attrs["nsslapd-pwpolicy-inherit-global"][0] === "on") {
          pwInheritGlobal = true;
        }
        if (attrs.passwordadminskipinfoupdate[0] === "on") {
          pwAdminSkipUpdates = true;
        }
        if (attrs.passwordbadwords[0] !== "") {
          if (attrs.passwordbadwords.length > 1) {
            attrs.passwordbadwords[0] = attrs.passwordbadwords.join(" ");
          }
        }
        if (attrs.passworduserattributes[0] !== "") {
          if (attrs.passworduserattributes.length > 1) {
            attrs.passworduserattributes[0] = attrs.passworduserattributes.join(" ");
          }
          if (attrs.passworduserattributes[0].indexOf(",") > -1) {
            pwUserAttrs = attrs.passworduserattributes[0].trim();
            pwUserAttrs = pwUserAttrs.split(",");
          } else {
            pwUserAttrs = attrs.passworduserattributes[0].split(" ");
          }
        }
        this.setState(
          () => ({
            loaded: true,
            loading: false,
            saveGeneralDisabled: true,
            saveUserDisabled: true,
            saveExpDisabled: true,
            saveLockoutDisabled: true,
            saveSyntaxDisabled: true,
            saveTPRDisabled: true,
            // Settings
            "nsslapd-pwpolicy-local": pwpLocal,
            passwordisglobalpolicy: pwIsGlobal,
            passwordchange: pwChange,
            passwordmustchange: pwMustChange,
            passwordhistory: pwHistory,
            passwordtrackupdatetime: pwTrackUpdate,
            passwordexp: pwExpire,
            passwordsendexpiringtime: pwSendExpire,
            passwordlockout: pwLockout,
            passwordunlock: pwUnlock,
            passwordchecksyntax: pwCheckSyntax,
            passwordpalindrome: pwPalindrome,
            passworddictcheck: pwDictCheck,
            "nsslapd-allow-hashed-passwords": pwAllowHashed,
            "nsslapd-pwpolicy-inherit-global": pwInheritGlobal,
            passwordstoragescheme: attrs.passwordstoragescheme[0],
            passwordinhistory: attrs.passwordinhistory[0],
            passwordwarning: attrs.passwordwarning[0],
            passwordmaxage: attrs.passwordmaxage[0],
            passwordminage: attrs.passwordminage[0],
            passwordgracelimit: attrs.passwordgracelimit[0],
            passwordlockoutduration: attrs.passwordlockoutduration[0],
            passwordmaxfailure: attrs.passwordmaxfailure[0],
            passwordresetfailurecount: attrs.passwordresetfailurecount[0],
            passwordminlength: attrs.passwordminlength[0],
            passwordmindigits: attrs.passwordmindigits[0],
            passwordminalphas: attrs.passwordminalphas[0],
            passwordminuppers: attrs.passwordminuppers[0],
            passwordminlowers: attrs.passwordminlowers[0],
            passwordminspecials: attrs.passwordminspecials[0],
            passwordmin8bit: attrs.passwordmin8bit[0],
            passwordmaxrepeats: attrs.passwordmaxrepeats[0],
            passwordmaxsequence: attrs.passwordmaxsequence[0],
            passwordmaxseqsets: attrs.passwordmaxseqsets[0],
            passwordmaxclasschars: attrs.passwordmaxclasschars[0],
            passwordmincategories: attrs.passwordmincategories[0],
            passwordmintokenlength: attrs.passwordmintokenlength[0],
            passwordbadwords: attrs.passwordbadwords[0],
            passworduserattributes: pwUserAttrs,
            passwordadmindn: attrs.passwordadmindn[0],
            passwordadminskipinfoupdate: pwAdminSkipUpdates,
            passwordtprmaxuse: attrs.passwordtprmaxuse[0],
            passwordtprdelayexpireat: attrs.passwordtprdelayexpireat[0],
            passwordtprdelayvalidfrom: attrs.passwordtprdelayvalidfrom[0],
            // Record original values
            "_nsslapd-pwpolicy-local": pwpLocal,
            _passwordisglobalpolicy: pwIsGlobal,
            _passwordchange: pwChange,
            _passwordmustchange: pwMustChange,
            _passwordhistory: pwHistory,
            _passwordtrackupdatetime: pwTrackUpdate,
            _passwordexp: pwExpire,
            _passwordsendexpiringtime: pwSendExpire,
            _passwordlockout: pwLockout,
            _passwordunlock: pwUnlock,
            _passwordchecksyntax: pwCheckSyntax,
            _passwordpalindrome: pwPalindrome,
            _passworddictcheck: pwDictCheck,
            "_nsslapd-allow-hashed-passwords": pwAllowHashed,
            "_nsslapd-pwpolicy-inherit-global": pwInheritGlobal,
            _passwordstoragescheme: attrs.passwordstoragescheme[0],
            _passwordinhistory: attrs.passwordinhistory[0],
            _passwordwarning: attrs.passwordwarning[0],
            _passwordmaxage: attrs.passwordmaxage[0],
            _passwordminage: attrs.passwordminage[0],
            _passwordgracelimit: attrs.passwordgracelimit[0],
            _passwordlockoutduration: attrs.passwordlockoutduration[0],
            _passwordmaxfailure: attrs.passwordmaxfailure[0],
            _passwordresetfailurecount: attrs.passwordresetfailurecount[0],
            _passwordminlength: attrs.passwordminlength[0],
            _passwordmindigits: attrs.passwordmindigits[0],
            _passwordminalphas: attrs.passwordminalphas[0],
            _passwordminuppers: attrs.passwordminuppers[0],
            _passwordminlowers: attrs.passwordminlowers[0],
            _passwordminspecials: attrs.passwordminspecials[0],
            _passwordmin8bit: attrs.passwordmin8bit[0],
            _passwordmaxrepeats: attrs.passwordmaxrepeats[0],
            _passwordmaxsequence: attrs.passwordmaxsequence[0],
            _passwordmaxseqsets: attrs.passwordmaxseqsets[0],
            _passwordmaxclasschars: attrs.passwordmaxclasschars[0],
            _passwordmincategories: attrs.passwordmincategories[0],
            _passwordmintokenlength: attrs.passwordmintokenlength[0],
            _passwordbadwords: attrs.passwordbadwords[0],
            _passworduserattributes: pwUserAttrs,
            _passwordadmindn: attrs.passwordadmindn[0],
            _passwordadminskipinfoupdate: pwAdminSkipUpdates,
            _passwordtprmaxuse: attrs.passwordtprmaxuse[0],
            _passwordtprdelayexpireat: attrs.passwordtprdelayexpireat[0],
            _passwordtprdelayvalidfrom: attrs.passwordtprdelayvalidfrom[0]
          }),
          this.props.enableTree()
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loaded: true,
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error loading global password policy - ${errMsg.desc}`
        );
      });
    }
    render() {
      let pwp_element = "";
      let pwExpirationRows = "";
      let pwLockoutRows = "";
      let pwSyntaxRows = "";
      let saveBtnName = "Save";
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = "Saving ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      if (this.state.passwordchecksyntax) {
        pwSyntaxRows = /* @__PURE__ */ import_react37.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Length"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "The minimum number of characters in the password (passwordMinLength).",
            value: this.state.passwordminlength,
            type: "number",
            id: "passwordminlength",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminlength",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Alpha's"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many alpha characters (passwordMinAlphas).",
            value: this.state.passwordminalphas,
            type: "number",
            id: "passwordminalphas",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminalphas",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Digits"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many digit characters (0-9) (passwordMinDigits).",
            value: this.state.passwordmindigits,
            type: "number",
            id: "passwordmindigits",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmindigits",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Special"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many special non-alphanumeric characters (passwordMinSpecials).",
            value: this.state.passwordminspecials,
            type: "number",
            id: "passwordminspecials",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminspecials",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Uppercase"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many uppercase characters (passwordMinUppers).",
            value: this.state.passwordminuppers,
            type: "number",
            id: "passwordminuppers",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminuppers",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Lowercase"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many lowercase characters (passwordMinLowers).",
            value: this.state.passwordminlowers,
            type: "number",
            id: "passwordminlowers",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminlowers",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum 8-bit"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many 8-bit or multi-byte characters (passwordMin8Bit).",
            value: this.state.passwordmin8bit,
            type: "number",
            id: "passwordmin8bit",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmin8bit",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Categories"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "The minimum number of character categories that a password must contain (categories are upper, lower, digit, special, and 8-bit) (passwordMinCategories).",
            value: this.state.passwordmincategories,
            type: "number",
            id: "passwordmincategories",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmincategories",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Sequences"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "The maximum number of allowed monotonic characters sequences (passwordMaxSequence).",
            value: this.state.passwordmaxsequence,
            type: "number",
            id: "passwordmaxsequence",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxsequence",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Max Sequence Sets"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "The maximum number of allowed monotonic characters sequences that can appear more than once (passwordMaxSeqSets).",
            value: this.state.passwordmaxseqsets,
            type: "number",
            id: "passwordmaxseqsets",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxseqsets",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Seq Per Class"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "The maximum number of consecutive characters from the same character class/category (passwordMaxClassChars).",
            value: this.state.passwordmaxclasschars,
            type: "number",
            id: "passwordmaxclasschars",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxclasschars",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Prohibited Words"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            title: "A space-separated list of words that are not allowed to be contained in the new password (passwordBadWords).",
            value: this.state.passwordbadwords,
            type: "text",
            id: "passwordbadwords",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordbadwords",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "A list of entry attributes to compare to the new password (passwordUserAttributes)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Check User Attributes"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute to check",
            onToggle: this.handleSelectToggle,
            onClear: this.handleSelectClear,
            onSelect: this.handleSyntaxChange,
            selections: this.state.passworduserattributes,
            isOpen: this.state.isSelectOpen,
            "aria-labelledby": "typeAhead-user-attr",
            placeholderText: "Type attributes to check...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attrs.map((attr, index) => /* @__PURE__ */ import_react37.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top-lg", title: "Check the password against the system's CrackLib dictionary (passwordDictCheck)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passworddictcheck",
            isChecked: this.state.passworddictcheck,
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            },
            label: "Dictionary Check"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "Check if the password is a palindrome (passwordPalindrome)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordpalindrome",
            isChecked: this.state.passwordpalindrome,
            className: "ds-label",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            },
            label: "Reject Palindromes"
          }
        ))));
      }
      if (this.state.passwordlockout) {
        pwLockoutRows = /* @__PURE__ */ import_react37.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "The maximum number of failed logins before account gets locked (passwordMaxFailure)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Number of Failed Logins That Locks out Account"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            value: this.state.passwordmaxfailure,
            type: "number",
            id: "passwordmaxfailure",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxpasswordmaxfailureclasschars",
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "The number of seconds until an accounts failure count is reset (passwordResetFailureCount)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Time Until ", /* @__PURE__ */ import_react37.default.createElement("i", null, "Failure Count"), " Resets"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            value: this.state.passwordresetfailurecount,
            type: "number",
            id: "passwordresetfailurecount",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordresetfailurecount",
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "The number of seconds, duration, before the account gets unlocked (passwordLockoutDuration)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Time Until Account Unlocked"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            value: this.state.passwordlockoutduration,
            type: "number",
            id: "passwordlockoutduration",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordlockoutduration",
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "Do not lockout the user account forever, instead the account will unlock based on the lockout duration (passwordUnlock)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordunlock",
            isChecked: this.state.passwordunlock,
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            },
            label: "Do Not Lockout Account Forever"
          }
        ))));
      }
      if (this.state.passwordexp) {
        pwExpirationRows = /* @__PURE__ */ import_react37.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "The maxiumum age of a password in seconds before it expires (passwordMaxAge)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Password Expiration Time"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            value: this.state.passwordmaxage,
            type: "number",
            id: "passwordmaxage",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxage",
            onChange: (checked, e) => {
              this.handleExpChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "The number of logins that are allowed after the password has expired (passwordGraceLimit)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Allowed Logins After Password Expires"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            value: this.state.passwordgracelimit,
            type: "number",
            id: "passwordgracelimit",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordgracelimit",
            onChange: (checked, e) => {
              this.handleExpChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "Set the time (in seconds), before a password is about to expire, to send a warning. (passwordWarning)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Send Password Expiring Warning"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            value: this.state.passwordwarning,
            type: "number",
            id: "passwordwarning",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordwarning",
            onChange: (checked, e) => {
              this.handleExpChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "Always return a password expiring control when requested (passwordSendExpiringTime)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 5 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordsendexpiringtime",
            isChecked: this.state.passwordsendexpiringtime,
            onChange: (checked, e) => {
              this.handleExpChange(e);
            },
            label: /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, "Always Send ", /* @__PURE__ */ import_react37.default.createElement("i", null, "Password Expiring"), "\xA0 Control")
          }
        ))));
      }
      if (this.state.loading || !this.state.loaded) {
        pwp_element = /* @__PURE__ */ import_react37.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react37.default.createElement(Spinner, { isSVG: true, size: "xl" }));
      } else {
        pwp_element = /* @__PURE__ */ import_react37.default.createElement("div", { className: this.state.loading ? "ds-fadeout ds-margin-bottom-md" : "ds-fadein ds-left-margin ds-margin-bottom-md" }, /* @__PURE__ */ import_react37.default.createElement(Tabs, { isFilled: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react37.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react37.default.createElement(TabTitleText, null, "General Settings") }, /* @__PURE__ */ import_react37.default.createElement(Form, { className: "ds-margin-left-sm", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top-xlg", title: "Allow subtree/user defined local password policies (nsslapd-pwpolicy-local)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "nsslapd-pwpolicy-local",
            isChecked: this.state["nsslapd-pwpolicy-local"],
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Allow Local Password Policies"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "If a local password policy does not defined any syntax rules then inherit the local policy syntax (nsslapd-pwpolicy-inherit-global)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "nsslapd-pwpolicy-inherit-global",
            isChecked: this.state["nsslapd-pwpolicy-inherit-global"],
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Local Policies Inherit Global Policy"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Allow anyone to add a prehashed password (nsslapd-allow-hashed-passwords)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "nsslapd-allow-hashed-passwords",
            isChecked: this.state["nsslapd-allow-hashed-passwords"],
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Allow Adding Pre-Hashed Passwords"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Allow password policy state attributes to replicate (passwordIsGlobalPolicy)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordisglobalpolicy",
            isChecked: this.state.passwordisglobalpolicy,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Replicate Password Policy State Attributes"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Record a separate timestamp specifically for the last time that the password for an entry was changed. If this is enabled, then it adds the pwdUpdateTime operational attribute to the user account entry (passwordTrackUpdateTime)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordtrackupdatetime",
            isChecked: this.state.passwordtrackupdatetime,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Track Password Update Time"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Allow user's to change their passwords (passwordChange)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordchange",
            isChecked: this.state.passwordchange,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Allow Users To Change Their Passwords"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "User must change its password after its been reset by an administrator (passwordMustChange)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordmustchange",
            isChecked: this.state.passwordmustchange,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "User Must Change Password After Reset"
          }
        ))), /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Maintain a password history for each user (passwordHistory)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement("div", { className: "ds-inline" }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordhistory",
            isChecked: this.state.passwordhistory,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Keep Password History"
          }
        )), /* @__PURE__ */ import_react37.default.createElement("div", { className: "ds-inline ds-left-margin ds-raise-field-md ds-width-sm" }, /* @__PURE__ */ import_react37.default.createElement(
          TextInput,
          {
            value: this.state.passwordinhistory,
            type: "number",
            id: "passwordinhistory",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordinhistory",
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            }
          }
        )))), /* @__PURE__ */ import_react37.default.createElement(Grid, { className: "ds-margin-top", title: "Set the password storage scheme (passwordstoragescheme)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Password Storage Scheme"), /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
          FormSelect,
          {
            id: "passwordstoragescheme",
            value: this.state.passwordstoragescheme,
            onChange: (value, event) => {
              this.handleGeneralChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          this.props.pwdStorageSchemes.map((option, index) => /* @__PURE__ */ import_react37.default.createElement(
            FormSelectOption,
            {
              key: index,
              value: option,
              label: option
            }
          ))
        ))), /* @__PURE__ */ import_react37.default.createElement(
          Grid,
          {
            title: "Indicates the number of seconds that must pass before a user can change their password again. (passwordMinAge)."
          },
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Minimum Age"),
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
            TextInput,
            {
              value: this.state.passwordminage,
              type: "number",
              id: "passwordminage",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordminage",
              onChange: (checked, e) => {
                this.handleGeneralChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react37.default.createElement(
          Grid,
          {
            title: "The DN for a password administrator or administrator group (passwordAdminDN)."
          },
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Administrator"),
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
            TextInput,
            {
              value: this.state.passwordadmindn,
              type: "text",
              id: "passwordadmindn",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordadmindn",
              onChange: (checked, e) => {
                this.handleGeneralChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react37.default.createElement(
          Grid,
          {
            title: "Disable updating password state attributes like passwordExpirationtime, passwordHistory, etc, when setting a user's password as a Password Administrator (passwordAdminSkipInfoUpdate)."
          },
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { offset: 3, span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
            Checkbox,
            {
              id: "passwordadminskipinfoupdate",
              isChecked: this.state.passwordadminskipinfoupdate,
              onChange: (checked, e) => {
                this.handleGeneralChange(e);
              },
              label: "Do not update target entry's password state attributes"
            }
          ))
        )), /* @__PURE__ */ import_react37.default.createElement(
          Button,
          {
            isDisabled: this.state.saveGeneralDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left-sm",
            onClick: this.handleSaveGeneral,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react37.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react37.default.createElement(TabTitleText, null, "Expiration") }, /* @__PURE__ */ import_react37.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Enable a password expiration policy (passwordExp)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordexp",
            isChecked: this.state.passwordexp,
            onChange: (checked, e) => {
              this.handleExpChange(e);
            },
            label: "Enforce Password Expiration"
          }
        ))), pwExpirationRows), /* @__PURE__ */ import_react37.default.createElement(
          Button,
          {
            isDisabled: this.state.saveExpDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left",
            onClick: this.handleSaveExp,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react37.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react37.default.createElement(TabTitleText, null, "Account Lockout") }, /* @__PURE__ */ import_react37.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Enable account lockout (passwordLockout)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordlockout",
            isChecked: this.state.passwordlockout,
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            },
            label: "Enable Account Lockout"
          }
        ))), pwLockoutRows), /* @__PURE__ */ import_react37.default.createElement(
          Button,
          {
            isDisabled: this.state.saveLockoutDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left",
            onClick: this.handleSaveLockout,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react37.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react37.default.createElement(TabTitleText, null, "Syntax Checking") }, /* @__PURE__ */ import_react37.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react37.default.createElement(Grid, { title: "Enable password syntax checking (passwordCheckSyntax)." }, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(
          Checkbox,
          {
            id: "passwordchecksyntax",
            isChecked: this.state.passwordchecksyntax,
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            },
            label: "Enable Password Syntax Checking"
          }
        ))), pwSyntaxRows), /* @__PURE__ */ import_react37.default.createElement(
          Button,
          {
            isDisabled: this.state.saveSyntaxDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left",
            onClick: this.handleSaveSyntax,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react37.default.createElement(Tab, { eventKey: 4, title: /* @__PURE__ */ import_react37.default.createElement(TabTitleText, null, "Temporary Password Rules") }, /* @__PURE__ */ import_react37.default.createElement(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off" }, this.state.passwordmustchange === false && /* @__PURE__ */ import_react37.default.createElement(FormAlert, { className: "ds-margin-top" }, /* @__PURE__ */ import_react37.default.createElement(
          Alert,
          {
            variant: "info",
            title: '"User Must Change Password After Reset" must be enabled in General Settings to activate TPR.',
            "aria-live": "polite",
            isInline: true
          }
        )), /* @__PURE__ */ import_react37.default.createElement(
          Grid,
          {
            title: "Number of times the temporary password can be used to authenticate (passwordTPRMaxUse)."
          },
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Max Use"),
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
            TextInput,
            {
              value: this.state.passwordtprmaxuse,
              type: "number",
              id: "passwordtprmaxuse",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordtprmaxuse",
              isDisabled: !this.state.passwordmustchange,
              onChange: (checked, e) => {
                this.handleTPRChange(e);
              }
            }
          ))
        )), /* @__PURE__ */ import_react37.default.createElement(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react37.default.createElement(
          Grid,
          {
            title: "Number of seconds before the temporary password expires (passwordTPRDelayExpireAt)."
          },
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Expires In"),
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
            TextInput,
            {
              value: this.state.passwordtprdelayexpireat,
              type: "number",
              id: "passwordtprdelayexpireat",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordtprdelayexpireat",
              isDisabled: !this.state.passwordmustchange,
              onChange: (checked, e) => {
                this.handleTPRChange(e);
              }
            }
          ))
        )), /* @__PURE__ */ import_react37.default.createElement(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react37.default.createElement(
          Grid,
          {
            title: "Number of seconds after which temporary password starts to be valid for authentication (passwordTPRDelayValidFrom)."
          },
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Valid From"),
          /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react37.default.createElement(
            TextInput,
            {
              value: this.state.passwordtprdelayvalidfrom,
              type: "number",
              id: "passwordtprdelayvalidfrom",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordtprdelayvalidfrom",
              isDisabled: !this.state.passwordmustchange,
              onChange: (checked, e) => {
                this.handleTPRChange(e);
              }
            }
          ))
        )), /* @__PURE__ */ import_react37.default.createElement(
          Button,
          {
            isDisabled: this.state.saveTPRDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left",
            onClick: this.handleSaveTPR,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        ))));
      }
      return /* @__PURE__ */ import_react37.default.createElement("div", { className: this.state.saving ? "ds-disabled" : "" }, /* @__PURE__ */ import_react37.default.createElement(Grid, null, /* @__PURE__ */ import_react37.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react37.default.createElement(TextContent, null, /* @__PURE__ */ import_react37.default.createElement(Text, { component: TextVariants.h3 }, "Global Password Policy", /* @__PURE__ */ import_react37.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh global password policy settings",
          onClick: this.handleLoadGlobal
        }
      ))))), pwp_element);
    }
  };
  GlobalPwPolicy.propTypes = {
    attrs: import_prop_types32.default.array,
    pwdStorageSchemes: import_prop_types32.default.array
  };
  GlobalPwPolicy.defaultProps = {
    attrs: [],
    pwdStorageSchemes: []
  };

  // src/lib/database/localPwp.jsx
  var import_react38 = __toESM(require_react(), 1);
  var import_prop_types33 = __toESM(require_prop_types(), 1);
  var general_attrs2 = [
    "passwordstoragescheme",
    "passwordtrackupdatetime",
    "passwordchange",
    "passwordmustchange",
    "passwordhistory",
    "passwordinhistory",
    "passwordminage",
    "passwordadmindn",
    "passwordadminskipinfoupdate"
  ];
  var exp_attrs2 = [
    "passwordexp",
    "passwordgracelimit",
    "passwordsendexpiringtime",
    "passwordmaxage",
    "passwordwarning"
  ];
  var lockout_attrs2 = [
    "passwordlockout",
    "passwordunlock",
    "passwordlockoutduration",
    "passwordmaxfailure",
    "passwordresetfailurecount"
  ];
  var syntax_attrs2 = [
    "passwordchecksyntax",
    "passwordminlength",
    "passwordmindigits",
    "passwordminalphas",
    "passwordminuppers",
    "passwordminlowers",
    "passwordminspecials",
    "passwordmin8bit",
    "passwordmaxrepeats",
    "passwordpalindrome",
    "passwordmaxsequence",
    "passwordmaxseqsets",
    "passwordmaxclasschars",
    "passwordmincategories",
    "passwordmintokenlength",
    "passwordbadwords",
    "passworduserattributes",
    "passworddictcheck"
  ];
  var tpr_attrs2 = [
    "passwordtprmaxuse",
    "passwordtprdelayexpireat",
    "passwordtprdelayvalidfrom"
  ];
  var CreatePolicy = class extends import_react38.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        isExpiredExpanded: false,
        isGeneralExpanded: false,
        isLockoutExpanded: false,
        isSyntaxExpanded: false,
        isTPRExpanded: false
      };
      this.handleGeneralToggle = (isGeneralExpanded) => {
        this.setState({
          isGeneralExpanded
        });
      };
      this.handleLockoutToggle = (isLockoutExpanded) => {
        this.setState({
          isLockoutExpanded
        });
      };
      this.handleExpiredToggle = (isExpiredExpanded) => {
        this.setState({
          isExpiredExpanded
        });
      };
      this.handleSyntaxToggle = (isSyntaxExpanded) => {
        this.setState({
          isSyntaxExpanded
        });
      };
      this.handleTPRToggle = (isTPRExpanded) => {
        this.setState({
          isTPRExpanded
        });
      };
    }
    render() {
      let helper_text = "Required field";
      if (this.props.invalid_dn) {
        helper_text = "Invalid DN";
      }
      return /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-bottom-md" }, /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-left ds-margin-top-xlg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react38.default.createElement(TextContent, null, /* @__PURE__ */ import_react38.default.createElement(Text, { className: "ds-center", component: TextVariants.h3 }, "Create A New Local Password Policy")), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Policy Type"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(FormSelect, { value: this.props.createPolicyType, onChange: this.props.handleSelectChange, id: "createPolicyType", "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react38.default.createElement(FormSelectOption, { key: 1, value: "Subtree Policy", label: "Subtree Policy" }), /* @__PURE__ */ import_react38.default.createElement(FormSelectOption, { key: 2, value: "User Policy", label: "User Policy" })))), /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "The DN of the entry to apply this password policy to." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Target DN"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
        TextInput,
        {
          type: "text",
          id: "policyDN",
          "aria-describedby": "horizontal-form-name-helper",
          name: "policyDN",
          onChange: (str, e) => {
            this.props.handleChange(e);
          },
          validated: this.props.invalid_dn ? ValidatedOptions.error : ValidatedOptions.default
        }
      ), /* @__PURE__ */ import_react38.default.createElement(FormHelperText, { isError: true, isHidden: !this.props.invalid_dn && this.props.policyDN !== "" }, helper_text))), /* @__PURE__ */ import_react38.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-top-lg",
          toggleText: this.state.isGeneralExpanded ? "Hide General Settings" : "Show General Settings",
          onToggle: this.handleGeneralToggle,
          isExpanded: this.state.isGeneralExpanded
        },
        /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Set the password storage scheme (passwordstoragescheme)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Storage Scheme"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
          FormSelect,
          {
            id: "create_passwordstoragescheme",
            value: this.props.create_passwordstoragescheme,
            onChange: (value, event) => {
              this.props.handleChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          this.props.pwdStorageSchemes.map((option, index) => /* @__PURE__ */ import_react38.default.createElement(
            FormSelectOption,
            {
              key: index,
              value: option,
              label: option
            }
          ))
        ))), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Indicates the number of seconds that must pass before a user can change their password again. (passwordMinAge).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Minimum Age"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              type: "number",
              id: "create_passwordminage",
              "aria-describedby": "horizontal-form-name-helper",
              name: "create_passwordminage",
              onChange: (checked, e) => {
                this.props.handleChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            className: "ds-margin-top",
            title: "The DN for a password administrator or administrator group (passwordAdminDN)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Administrator"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              value: this.props.passwordadmindn,
              type: "text",
              id: "create_passwordadmindn",
              "aria-describedby": "horizontal-form-name-helper",
              name: "create_passwordadmindn",
              onChange: (checked, e) => {
                this.props.handleChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            className: "ds-margin-top",
            title: "Disable updating password state attributes like passwordExpirationtime, passwordHistory, etc, when setting a user's password as a Password Administrator (passwordAdminSkipInfoUpdate)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { offset: 3, span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            Checkbox,
            {
              id: "create_passwordadminskipinfoupdate",
              isChecked: this.props.create_passwordadminskipinfoupdate,
              onChange: (checked, e) => {
                this.props.handleChange(e);
              },
              label: "Do not update target entry's password state attributes"
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Record a separate timestamp specifically for the last time that the password for an entry was changed. If this is enabled, then it adds the pwdUpdateTime operational attribute to the user account entry (passwordTrackUpdateTime)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordtrackupdatetime",
            isChecked: this.props.create_passwordtrackupdatetime,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            label: "Track Password Update Time"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Allow user's to change their passwords (passwordChange)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordchange",
            isChecked: this.props.create_passwordchange,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            label: "Allow Users To Change Their Passwords"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "User must change its password after its been reset by an administrator (passwordMustChange)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordmustchange",
            isChecked: this.props.create_passwordmustchange,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            label: "User Must Change Password After Reset"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Maintain a password history for each user (passwordHistory)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-inline" }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordhistory",
            isChecked: this.props.create_passwordhistory,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            label: "Keep Password History"
          }
        )), /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-inline ds-left-margin ds-raise-field-md ds-width-sm" }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.props.passwordinhistory,
            type: "number",
            id: "create_passwordinhistory",
            "aria-describedby": "horizontal-form-name-helper",
            name: "create_passwordinhistory",
            onChange: (checked, e) => {
              this.props.handleChange(e);
            }
          }
        )))))
      ), /* @__PURE__ */ import_react38.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-top-lg",
          toggleText: this.state.isExpiredExpanded ? "Hide Expiration Settings" : "Show Expiration Settings",
          onToggle: this.handleExpiredToggle,
          isExpanded: this.state.isExpiredExpanded
        },
        /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Enable a password expiration policy (passwordExp)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordexp",
            isChecked: this.props.create_passwordexp,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            label: "Enforce Password Expiration"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-left-indent" }, /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "The maxiumum age of a password in seconds before it expires (passwordMaxAge).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Password Expiration Time"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              type: "number",
              id: "create_passwordmaxage",
              "aria-describedby": "create_passwordmaxage",
              name: "create_passwordmaxage",
              onChange: (str, e) => {
                this.props.handleChange(e);
              },
              isDisabled: !this.props.passwordexp
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The number of logins that are allowed after the password has expired (passwordGraceLimit)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Allowed Logins After Password Expires"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordgracelimit",
            "aria-describedby": "create_passwordgracelimit",
            name: "create_passwordgracelimit",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordexp
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Set the time (in seconds), before a password is about to expire, to send a warning. (passwordWarning)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Send Password Expiring Warning"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordwarning",
            "aria-describedby": "create_passwordwarning",
            name: "create_passwordwarning",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordexp
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Always return a password expiring control when requested (passwordSendExpiringTime)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Send Password Expiring Warning"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordsendexpiringtime",
            isChecked: this.props.create_passwordsendexpiringtime,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordexp,
            label: /* @__PURE__ */ import_react38.default.createElement(import_react38.default.Fragment, null, "Always Send ", /* @__PURE__ */ import_react38.default.createElement("i", null, "Password Expiring"), " Control"),
            className: "ds-lower-field"
          }
        )))))
      ), /* @__PURE__ */ import_react38.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-top-lg",
          toggleText: this.state.isLockoutExpanded ? "Hide Lockout Settings" : "Show Lockout Settings",
          onToggle: this.handleLockoutToggle,
          isExpanded: this.state.isLockoutExpanded
        },
        /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Enable account lockout (passwordLockout)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordlockout",
            isChecked: this.props.create_passwordlockout,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            label: "Enable Account Lockout"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-left-indent" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The maximum number of failed logins before account gets locked (passwordMaxFailure)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Number of Failed Logins That Locks out Account"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmaxfailure",
            "aria-describedby": "create_passwordmaxfailure",
            name: "create_passwordmaxfailure",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordlockout
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The number of seconds until an accounts failure count is reset (passwordResetFailureCount)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Time Until ", /* @__PURE__ */ import_react38.default.createElement("i", null, "Failure Count"), " Resets"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordresetfailurecount",
            "aria-describedby": "create_passwordresetfailurecount",
            name: "create_passwordresetfailurecount",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordlockout
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The number of seconds, duration, before the account gets unlocked (passwordLockoutDuration)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Time Until Account Unlocked"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordlockoutduration",
            "aria-describedby": "create_passwordlockoutduration",
            name: "create_passwordlockoutduration",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordlockout
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Do not lockout the user account forever, instead the account will unlock based on the lockout duration (passwordUnlock)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordunlock",
            isChecked: this.props.create_passwordunlock,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordlockout,
            label: "Do Not Lockout Account Forever"
          }
        )))))
      ), /* @__PURE__ */ import_react38.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-top-lg",
          toggleText: this.state.isSyntaxExpanded ? "Hide Syntax Settings" : "Show Syntax Settings",
          onToggle: this.handleSyntaxToggle,
          isExpanded: this.state.isSyntaxExpanded
        },
        /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "Enable password syntax checking (passwordCheckSyntax)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordchecksyntax",
            isChecked: this.props.create_passwordchecksyntax,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            label: "Enable Password Syntax Checking"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-left-indent" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Length"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1, title: "The minimum number of characters in the password (passwordMinLength)." }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordminlength",
            "aria-describedby": "create_passwordminlength",
            name: "create_passwordminlength",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 5, span: 3, title: "Reject passwords with fewer than this many alpha characters (passwordMinAlphas)." }, "Minimum Alpha's"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordminalphas",
            "aria-describedby": "create_passwordminalphas",
            name: "create_passwordminalphas",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Digits"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1, title: "Reject passwords with fewer than this many digit characters (0-9) (passwordMinDigits)." }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmindigits",
            "aria-describedby": "create_passwordmindigits",
            name: "create_passwordmindigits",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 5, span: 3, title: "Reject passwords with fewer than this many special non-alphanumeric characters (passwordMinSpecials)." }, "Minimum Special"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordminspecials",
            "aria-describedby": "create_passwordminspecials",
            name: "create_passwordminspecials",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Uppercase"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1, title: "Reject passwords with fewer than this many uppercase characters (passwordMinUppers)." }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordminuppers",
            "aria-describedby": "create_passwordminuppers",
            name: "create_passwordminuppers",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 5, span: 3, title: "Reject passwords with fewer than this many lowercase characters (passwordMinLowers)." }, "Minimum Lowercase"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordminlowers",
            "aria-describedby": "create_passwordminlowers",
            name: "create_passwordminlowers",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum 8-bit"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1, title: "Reject passwords with fewer than this many 8-bit or multi-byte characters (passwordMin8Bit)." }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmin8bit",
            "aria-describedby": "create_passwordmin8bit",
            name: "create_passwordmin8bit",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 5, span: 3, title: "The minimum number of character categories that a password must contain (categories are upper, lower, digit, special, and 8-bit) (passwordMinCategories)." }, "Minimum Categories"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmincategories",
            "aria-describedby": "create_passwordmincategories",
            name: "create_passwordmincategories",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Token Length"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1, title: "The smallest attribute value used when checking if the password contains any of the user's account information (passwordMinTokenLength)." }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmintokenlength",
            "aria-describedby": "create_passwordmintokenlength",
            name: "create_passwordmintokenlength",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 5, span: 3, title: "The maximum number of times the same character can sequentially appear in a password (passwordMaxRepeats)." }, "Max Repeated Chars"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmaxrepeats",
            "aria-describedby": "create_passwordmaxrepeats",
            name: "create_passwordmaxrepeats",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Sequences"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1, title: "The maximum number of allowed monotonic characters sequences (passwordMaxSequence)." }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmaxsequence",
            "aria-describedby": "create_passwordmaxsequence",
            name: "create_passwordmaxsequence",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 5, span: 3, title: "The maximum number of times the same character can sequentially appear in a password (passwordMaxRepeats)." }, "Max Sequence Sets"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmaxseqsets",
            "aria-describedby": "create_passwordmaxseqsets",
            name: "create_passwordmaxseqsets",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Seq Per Class"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1, title: "The maximum number of consecutive characters from the same character class/category (passwordMaxClassChars).." }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            type: "number",
            id: "create_passwordmaxclasschars",
            "aria-describedby": "create_passwordmaxclasschars",
            name: "create_passwordmaxclasschars",
            onChange: (str, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "A space-separated list of words that are not allowed to be contained in the new password (passwordBadWords).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Prohibited Words"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              type: "text",
              id: "create_passwordbadwords",
              "aria-describedby": "create_passwordbadwords",
              name: "create_passwordbadwords",
              onChange: (str, e) => {
                this.handleChange(e);
              },
              isDisabled: !this.props.passwordchecksyntax
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "A list of entry attributes to compare to the new password (passwordUserAttributes)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Check User Attributes"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a attribute name to check",
            onToggle: this.props.onUserAttrsCreateToggle,
            onSelect: this.props.handleChange,
            onClear: this.props.onUserAttrsCreateClear,
            selections: this.props.passworduserattributes,
            isOpen: this.props.isUserAttrsCreateOpen,
            "aria-labelledby": "typeAhead-user-attr-create",
            placeholderText: "Type attributes to check...",
            noResultsFoundText: "There are no matching entries",
            isDisabled: !this.props.passwordchecksyntax
          },
          this.props.attrs.map((attr, index) => /* @__PURE__ */ import_react38.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Check the password against the system's CrackLib dictionary (passwordDictCheck)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passworddictcheck",
            isChecked: this.props.create_passworddictcheck,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax,
            label: "Dictionary Check"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Reject a password if it is a palindrome (passwordPalindrome)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "create_passwordpalindrome",
            isChecked: this.props.create_passwordpalindrome,
            onChange: (checked, e) => {
              this.props.handleChange(e);
            },
            isDisabled: !this.props.passwordchecksyntax,
            label: "Reject Palindromes"
          }
        )))))
      ), /* @__PURE__ */ import_react38.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-top-lg",
          toggleText: this.state.isTPRExpanded ? "Hide Temporary Password Settings" : "Show Temporary Password Settings",
          onToggle: this.handleTPRToggle,
          isExpanded: this.state.isTPRExpanded
        },
        /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, this.props.create_passwordmustchange === false && /* @__PURE__ */ import_react38.default.createElement(FormAlert, null, /* @__PURE__ */ import_react38.default.createElement(
          Alert,
          {
            variant: "info",
            title: '"User Must Change Password After Reset" must be enabled in General Settings to activate TPR.',
            "aria-live": "polite",
            isInline: true
          }
        )), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Number of times the temporary password can be used to authenticate (passwordTPRMaxUse).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Max Use"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              type: "number",
              id: "create_passwordtprmaxuse",
              "aria-describedby": "horizontal-form-name-helper",
              name: "create_passwordtprmaxuse",
              isDisabled: !this.props.create_passwordmustchange,
              onChange: (checked, e) => {
                this.props.handleChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Number of seconds before the temporary password expires (passwordTPRDelayExpireAt).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Expires In"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              type: "number",
              id: "create_passwordtprdelayexpireat",
              "aria-describedby": "horizontal-form-name-helper",
              name: "create_passwordtprdelayexpireat",
              isDisabled: !this.props.create_passwordmustchange,
              onChange: (checked, e) => {
                this.props.handleChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Number of seconds after which temporary password starts to be valid for authentication (passwordTPRDelayValidFrom).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Valid From"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              type: "number",
              id: "create_passwordtprdelayvalidfrom",
              "aria-describedby": "horizontal-form-name-helper",
              name: "create_passwordtprdelayvalidfrom",
              isDisabled: !this.props.create_passwordmustchange,
              onChange: (checked, e) => {
                this.props.handleChange(e);
              }
            }
          ))
        ))
      )), /* @__PURE__ */ import_react38.default.createElement(
        Button,
        {
          isDisabled: this.props.createDisabled,
          variant: "primary",
          className: "ds-margin-top-lg ds-margin-left",
          onClick: this.props.handleCreatePolicy
        },
        "Create New Policy"
      ));
    }
  };
  var LocalPwPolicy = class extends import_react38.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        loaded: false,
        activeTabKey: 0,
        localActiveTabKey: 0,
        modalChecked: false,
        editPolicy: false,
        tableLoading: false,
        // Create policy
        policyType: "",
        policyDN: "",
        policyName: "",
        deleteName: "",
        createDisabled: true,
        createPolicyType: "Subtree Policy",
        // Lists of all the attributes for each tab/section.
        // We use the exact attribute name for the ID of
        // each field, so we can loop over them to efficently
        // check for changes, and updating/saving the config.
        rows: [],
        saveGeneralDisabled: true,
        saveUserDisabled: true,
        saveExpDisabled: true,
        saveLockoutDisabled: true,
        saveSyntaxDisabled: true,
        saveTPRDisabled: true,
        showDeletePolicy: false,
        // Edit policy
        passwordchange: false,
        passwordmustchange: false,
        passwordhistory: false,
        passwordtrackupdatetime: false,
        passwordexp: false,
        passwordsendexpiringtime: false,
        passwordlockout: false,
        passwordunlock: "0",
        passwordchecksyntax: false,
        passwordpalindrome: false,
        passworddictcheck: false,
        passwordstoragescheme: "",
        passwordinhistory: "0",
        passwordwarning: "0",
        passwordmaxage: "0",
        passwordminage: "0",
        passwordgracelimit: "0",
        passwordlockoutduration: "0",
        passwordmaxfailure: "0",
        passwordresetfailurecount: "0",
        passwordminlength: "0",
        passwordmindigits: "0",
        passwordminalphas: "0",
        passwordminuppers: "0",
        passwordminlowers: "0",
        passwordminspecials: "0",
        passwordmin8bit: "0",
        passwordmaxrepeats: "0",
        passwordmaxsequence: "0",
        passwordmaxseqsets: "0",
        passwordmaxclasschars: "0",
        passwordmincategories: "0",
        passwordmintokenlength: "0",
        passwordbadwords: "",
        passworduserattributes: [],
        passwordtprmaxuse: "-1",
        passwordtprdelayexpireat: "-1",
        passwordtprdelayvalidfrom: "-1",
        passwordadmindn: "",
        passwordadminskipinfoupdate: false,
        _passwordchange: false,
        _passwordmustchange: false,
        _passwordhistory: false,
        _passwordtrackupdatetime: false,
        _passwordexp: false,
        _passwordsendexpiringtime: false,
        _passwordlockout: false,
        _passwordunlock: "0",
        _passwordchecksyntax: false,
        _passwordpalindrome: false,
        _passworddictcheck: false,
        _passwordstoragescheme: "",
        _passwordinhistory: "0",
        _passwordwarning: "0",
        _passwordmaxage: "0",
        _passwordminage: "0",
        _passwordgracelimit: "0",
        _passwordlockoutduration: "0",
        _passwordmaxfailure: "0",
        _passwordresetfailurecount: "0",
        _passwordminlength: "0",
        _passwordmindigits: "0",
        _passwordminalphas: "0",
        _passwordminuppers: "0",
        _passwordminlowers: "0",
        _passwordminspecials: "0",
        _passwordmin8bit: "0",
        _passwordmaxrepeats: "0",
        _passwordmaxsequence: "0",
        _passwordmaxseqsets: "0",
        _passwordmaxclasschars: "0",
        _passwordmincategories: "0",
        _passwordmintokenlength: "0",
        _passwordbadwords: "",
        _passworduserattributes: [],
        _passwordtprmaxuse: "-1",
        _passwordtprdelayexpireat: "-1",
        _passwordtprdelayvalidfrom: "-1",
        _passwordadmindn: "",
        _passwordadminskipinfoupdate: false,
        // Create policy
        create_passwordchange: false,
        create_passwordmustchange: false,
        create_passwordhistory: false,
        create_passwordtrackupdatetime: false,
        create_passwordexp: false,
        create_passwordsendexpiringtime: false,
        create_passwordlockout: false,
        create_passwordunlock: false,
        create_passwordchecksyntax: false,
        create_passwordpalindrome: false,
        create_passworddictcheck: false,
        create_passwordstoragescheme: "",
        create_passwordinhistory: "0",
        create_passwordwarning: "0",
        create_passwordmaxage: "0",
        create_passwordminage: "0",
        create_passwordgracelimit: "0",
        create_passwordlockoutduration: "0",
        create_passwordmaxfailure: "0",
        create_passwordresetfailurecount: "0",
        create_passwordminlength: "0",
        create_passwordmindigits: "0",
        create_passwordminalphas: "0",
        create_passwordminuppers: "0",
        create_passwordminlowers: "0",
        create_passwordminspecials: "0",
        create_passwordmin8bit: "0",
        create_passwordmaxrepeats: "0",
        create_passwordmaxsequence: "0",
        create_passwordmaxseqsets: "0",
        create_passwordmaxclasschars: "0",
        create_passwordmincategories: "0",
        create_passwordmintokenlength: "0",
        create_passwordbadwords: "",
        create_passworduserattributes: [],
        create_passwordtprmaxuse: "-1",
        create_passwordtprdelayexpireat: "-1",
        create_passwordtprdelayvalidfrom: "-1",
        create_passwordadmindn: "",
        create_passwordadminskipinfoupdate: false,
        _create_passwordchange: false,
        _create_passwordmustchange: false,
        _create_passwordhistory: false,
        _create_passwordtrackupdatetime: false,
        _create_passwordexp: false,
        _create_passwordsendexpiringtime: false,
        _create_passwordlockout: false,
        _create_passwordunlock: false,
        _create_passwordchecksyntax: false,
        _create_passwordpalindrome: false,
        _create_passworddictcheck: false,
        _create_passwordstoragescheme: "",
        _create_passwordinhistory: "0",
        _create_passwordwarning: "0",
        _create_passwordmaxage: "0",
        _create_passwordminage: "0",
        _create_passwordgracelimit: "0",
        _create_passwordlockoutduration: "0",
        _create_passwordmaxfailure: "0",
        _create_passwordresetfailurecount: "0",
        _create_passwordminlength: "0",
        _create_passwordmindigits: "0",
        _create_passwordminalphas: "0",
        _create_passwordminuppers: "0",
        _create_passwordminlowers: "0",
        _create_passwordminspecials: "0",
        _create_passwordmin8bit: "0",
        _create_passwordmaxrepeats: "0",
        _create_passwordmaxsequence: "0",
        _create_passwordmaxseqsets: "0",
        _create_passwordmaxclasschars: "0",
        _create_passwordmincategories: "0",
        _create_passwordmintokenlength: "0",
        _create_passwordbadwords: "",
        _create_passworduserattributes: [],
        _create_passwordtprmaxuse: "-1",
        _create_passwordtprdelayexpireat: "-1",
        _create_passwordtprdelayvalidfrom: "-1",
        _create_passwordadmindn: "",
        _create_passwordadminskipinfoupdate: false,
        // Select typeahead
        isUserAttrsCreateOpen: false,
        isUserAttrsEditOpen: false,
        attrMap: {
          passwordstoragescheme: "--pwdscheme",
          passwordtrackupdatetime: "--pwdtrack",
          passwordchange: "--pwdchange",
          passwordmustchange: "--pwdmustchange",
          passwordhistory: "--pwdhistory",
          passwordinhistory: "--pwdhistorycount",
          passwordminage: "--pwdminage",
          passwordexp: "--pwdexpire",
          passwordgracelimit: "--pwdgracelimit",
          passwordsendexpiringtime: "--pwdsendexpiring",
          passwordmaxage: "--pwdmaxage",
          passwordwarning: "--pwdwarning",
          passwordlockout: "--pwdlockout",
          passwordunlock: "--pwdunlock",
          passwordlockoutduration: "--pwdlockoutduration",
          passwordmaxfailure: "--pwdmaxfailures",
          passwordresetfailurecount: "--pwdresetfailcount",
          passwordchecksyntax: "--pwdchecksyntax",
          passwordminlength: "--pwdminlen",
          passwordmindigits: "--pwdmindigits",
          passwordminalphas: "--pwdminalphas",
          passwordminuppers: "--pwdminuppers",
          passwordminlowers: "--pwdminlowers",
          passwordminspecials: "--pwdminspecials",
          passwordmin8bit: "--pwdmin8bits",
          passwordmaxrepeats: "--pwdmaxrepeats",
          passwordpalindrome: "--pwdpalindrome",
          passwordmaxsequence: "--pwdmaxseq",
          passwordmaxseqsets: "--pwdmaxseqsets",
          passwordmaxclasschars: "--pwdmaxclasschars",
          passwordmincategories: "--pwdmincatagories",
          passwordmintokenlength: "--pwdmintokenlen",
          passwordbadwords: "--pwdbadwords",
          passworduserattributes: "--pwduserattrs",
          passworddictcheck: "--pwddictcheck",
          passwordadmindn: "--pwdadmin",
          passwordadminskipinfoupdate: "--pwdadminskipupdates",
          passwordtprmaxuse: "--pwptprmaxuse",
          passwordtprdelayexpireat: "--pwptprdelayexpireat",
          passwordtprdelayvalidfrom: "--pwptprdelayvalidfrom"
        }
      };
      this.handleUserAttrsCreateToggle = (isUserAttrsCreateOpen) => {
        this.setState({
          isUserAttrsCreateOpen
        });
      };
      this.handleUserAttrsCreateClear = () => {
        this.setState({
          create_passworduserattributes: [],
          isUserAttrsCreateOpen: false
        });
      };
      this.onUserAttrsEditToggle = (isUserAttrsEditOpen) => {
        this.setState({
          isUserAttrsEditOpen
        });
      };
      this.onUserAttrsEditClear = () => {
        this.setState({
          passworduserattributes: [],
          isUserAttrsEditOpen: false
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleLocalNavSelect = (event, tabIndex) => {
        this.setState({
          localActiveTabKey: tabIndex
        });
      };
      this.handleSelectToggle = (isSelectOpen) => {
        this.setState({
          isSelectOpen
        });
      };
      this.handleSelectClear = () => {
        this.setState({
          passworduserattributes: []
        });
      };
      this.createPolicy = this.createPolicy.bind(this);
      this.closeDeletePolicy = this.closeDeletePolicy.bind(this);
      this.deletePolicy = this.deletePolicy.bind(this);
      this.onCreateChange = this.onCreateChange.bind(this);
      this.onCreateSelectChange = this.onCreateSelectChange.bind(this);
      this.handleExpChange = this.handleExpChange.bind(this);
      this.handleGeneralChange = this.handleGeneralChange.bind(this);
      this.handleLockoutChange = this.handleLockoutChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSyntaxChange = this.handleSyntaxChange.bind(this);
      this.handleTPRChange = this.handleTPRChange.bind(this);
      this.loadLocal = this.loadLocal.bind(this);
      this.handleLoadPolicies = this.handleLoadPolicies.bind(this);
      this.handleResetTab = this.handleResetTab.bind(this);
      this.handleSaveExp = this.handleSaveExp.bind(this);
      this.handleSaveGeneral = this.handleSaveGeneral.bind(this);
      this.handleSaveLockout = this.handleSaveLockout.bind(this);
      this.handleSaveSyntax = this.handleSaveSyntax.bind(this);
      this.handleSaveTPR = this.handleSaveTPR.bind(this);
      this.showDeletePolicy = this.showDeletePolicy.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadPolicies();
      } else {
        this.props.enableTree();
      }
    }
    showDeletePolicy(name2) {
      this.setState({
        showDeletePolicy: true,
        modalChecked: false,
        deleteName: name2
      });
    }
    closeDeletePolicy() {
      this.setState({
        showDeletePolicy: false,
        deleteName: ""
      });
    }
    handleResetTab() {
      this.setState({ localActiveTabKey: 0 });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      });
    }
    onCreateSelectChange(value) {
      this.setState({
        createPolicyType: value
      });
    }
    onCreateChange(e, selection) {
      let attr;
      let value;
      let disableSaveBtn = true;
      let invalid_dn = false;
      const all_attrs = general_attrs2.concat(exp_attrs2, lockout_attrs2, syntax_attrs2, tpr_attrs2);
      if (selection) {
        attr = "create_passworduserattributes";
        value = selection;
      } else {
        value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
        attr = e.target.id;
      }
      for (const all_attr of all_attrs) {
        if (all_attr === "passworduserattributes" && attr === "create_passworduserattributes") {
          const orig_val = this.state["_" + all_attr].join(" ");
          if (orig_val !== value) {
            value = selection;
            disableSaveBtn = false;
            break;
          }
          value = selection;
        } else if (attr === "create_" + all_attr && this.state["_create_" + all_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const all_attr of all_attrs) {
        if (all_attr === "passworduserattributes" && attr !== "create_passworduserattributes") {
          const orig_val = this.state["_" + all_attr].join(" ");
          const new_val = this.state[all_attr].join(" ");
          if (orig_val !== new_val) {
            disableSaveBtn = false;
            break;
          }
        } else if (attr !== "create_" + all_attr && this.state["_create_" + all_attr] !== this.state["create_" + all_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (attr === "policyDN") {
        if (valid_dn(value)) {
          disableSaveBtn = false;
        } else {
          if (value !== "") {
            invalid_dn = true;
          }
          disableSaveBtn = true;
        }
      } else {
        if (this.state.policyDN === "") {
          disableSaveBtn = true;
        } else {
          disableSaveBtn = false;
        }
      }
      if (selection) {
        if (this.state[attr].includes(selection)) {
          this.setState(
            (prevState) => ({
              [attr]: prevState[attr].filter((item) => item !== selection),
              createDisabled: disableSaveBtn,
              invalid_dn,
              isUserAttrsCreateOpen: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              [attr]: [...prevState[attr], selection],
              createDisabled: disableSaveBtn,
              invalid_dn,
              isUserAttrsCreateOpen: false
            })
          );
        }
      } else {
        this.setState({
          [attr]: value,
          createDisabled: disableSaveBtn,
          invalid_dn
        });
      }
    }
    createPolicy() {
      const all_attrs = general_attrs2.concat(exp_attrs2, lockout_attrs2, syntax_attrs2, tpr_attrs2);
      let action = "adduser";
      this.setState({
        loading: true
      });
      if (this.state.createPolicyType === "Subtree Policy") {
        action = "addsubtree";
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        action,
        this.state.policyDN
      ];
      for (const attr of all_attrs) {
        let old_val = this.state["_create_" + attr];
        let new_val = this.state["create_" + attr];
        if (new_val !== old_val) {
          if (typeof new_val === "boolean") {
            if (new_val) {
              new_val = "on";
            } else {
              new_val = "off";
            }
          } else if (attr === "passworduserattributes") {
            old_val = this.state._create_passworduserattributes.join(" ");
            new_val = this.state.create_passworduserattributes.join(" ");
            if (old_val === new_val) {
              continue;
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + new_val);
        }
      }
      log_cmd("createPolicy", "Create a local password policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadPolicies();
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          "Successfully created new password policy"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadPolicies();
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error creating password policy - ${errMsg.desc}`
        );
      });
    }
    handleGeneralChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const general_attr of general_attrs2) {
        if (attr === general_attr && this.state["_" + general_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const general_attr of general_attrs2) {
        if (attr !== general_attr && this.state["_" + general_attr] !== this.state[general_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveGeneralDisabled: disableSaveBtn
      });
    }
    handleSaveGeneral() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of general_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveGeneral", "Saving general pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleExpChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const exp_attr of exp_attrs2) {
        if (attr === exp_attr && this.state["_" + exp_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const exp_attr of exp_attrs2) {
        if (attr !== exp_attr && this.state["_" + exp_attr] !== this.state[exp_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveExpDisabled: disableSaveBtn
      });
    }
    handleSaveExp() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of exp_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveExp", "Saving Expiration pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleLockoutChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const lockout_attr of lockout_attrs2) {
        if (attr === lockout_attr && this.state["_" + lockout_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const lockout_attr of lockout_attrs2) {
        if (attr !== lockout_attr && this.state["_" + lockout_attr] !== this.state[lockout_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveLockoutDisabled: disableSaveBtn
      });
    }
    handleSaveLockout() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of lockout_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveLockout", "Saving lockout pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleSyntaxChange(e, selection) {
      let attr;
      let value;
      if (selection) {
        attr = "passworduserattributes";
        value = selection;
      } else {
        value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
        attr = e.target.id;
      }
      let disableSaveBtn = true;
      for (const syntax_attr of syntax_attrs2) {
        if (syntax_attr === "passworduserattributes" && attr === "passworduserattributes") {
          const orig_val = this.state["_" + syntax_attr].join(" ");
          if (orig_val !== value) {
            value = selection;
            disableSaveBtn = false;
            break;
          }
          value = selection;
        } else if (attr === syntax_attr && this.state["_" + syntax_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const syntax_attr of syntax_attrs2) {
        if (syntax_attr === "passworduserattributes" && attr !== "passworduserattributes") {
          const orig_val = this.state["_" + syntax_attr].join(" ");
          const new_val = this.state[syntax_attr].join(" ");
          if (orig_val !== new_val) {
            disableSaveBtn = false;
            break;
          }
        } else if (attr !== syntax_attr && this.state["_" + syntax_attr] !== this.state[syntax_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (selection) {
        if (this.state[attr].includes(selection)) {
          this.setState(
            (prevState) => ({
              [attr]: prevState[attr].filter((item) => item !== selection),
              isSelectOpen: false,
              isUserAttrsEditOpen: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              [attr]: [...prevState[attr], selection],
              saveSyntaxDisabled: disableSaveBtn,
              isUserAttrsEditOpen: false
            })
          );
        }
      } else {
        this.setState({
          [attr]: value,
          saveSyntaxDisabled: disableSaveBtn,
          isUserAttrsEditOpen: false
        });
      }
    }
    handleSaveSyntax() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of syntax_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveSyntax", "Saving syntax checking pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    handleTPRChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const tpr_attr of tpr_attrs2) {
        if (attr === tpr_attr && this.state["_" + tpr_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const tpr_attr of tpr_attrs2) {
        if (attr !== tpr_attr && this.state["_" + tpr_attr] !== this.state[tpr_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveTPRDisabled: disableSaveBtn
      });
    }
    handleSaveTPR() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of tpr_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          const val = this.state[attr];
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveTPR", "Saving TPR pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          "Successfully updated password policy configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          `Error updating password policy configuration - ${errMsg.desc}`
        );
      });
    }
    deletePolicy() {
      this.setState({
        loading: true,
        editPolicy: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "remove",
        this.state.deleteName
      ];
      log_cmd("deletePolicy", "delete policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadPolicies();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadPolicies();
        this.props.addNotification(
          "error",
          `Error deleting local password policy - ${errMsg.desc}`
        );
      });
    }
    handleLoadPolicies() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "list"
      ];
      log_cmd("handleLoadPolicies", "Load all the local password policies for the table", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const policy_obj = JSON.parse(content);
        const pwpRows = [];
        for (const row of policy_obj.items) {
          pwpRows.push([row.targetdn, row.pwp_type, row.basedn]);
        }
        this.setState({
          localActiveTabKey: 0,
          activeKey: 0,
          rows: pwpRows,
          loaded: true,
          loading: false,
          editPolicy: false,
          policyDN: "",
          createPolicyType: "Subtree Policy",
          policyName: "",
          deleteName: "",
          showDeletePolicy: false,
          // Reset edit and create tab
          saveGeneralDisabled: true,
          saveUserDisabled: true,
          saveExpDisabled: true,
          saveLockoutDisabled: true,
          saveSyntaxDisabled: true,
          // Edit policy
          passwordchange: false,
          passwordmustchange: false,
          passwordhistory: false,
          passwordtrackupdatetime: false,
          passwordexp: false,
          passwordsendexpiringtime: false,
          passwordlockout: false,
          passwordunlock: "0",
          passwordchecksyntax: false,
          passwordpalindrome: false,
          passworddictcheck: false,
          passwordstoragescheme: "",
          passwordinhistory: "0",
          passwordwarning: "0",
          passwordmaxage: "0",
          passwordminage: "0",
          passwordgracelimit: "0",
          passwordlockoutduration: "0",
          passwordmaxfailure: "0",
          passwordresetfailurecount: "0",
          passwordminlength: "0",
          passwordmindigits: "0",
          passwordminalphas: "0",
          passwordminuppers: "0",
          passwordminlowers: "0",
          passwordminspecials: "0",
          passwordmin8bit: "0",
          passwordmaxrepeats: "0",
          passwordmaxsequence: "0",
          passwordmaxseqsets: "0",
          passwordmaxclasschars: "0",
          passwordmincategories: "0",
          passwordmintokenlength: "0",
          passwordbadwords: "",
          passworduserattributes: [],
          passwordadmindn: "",
          passwordadminskipinfoupdate: false,
          _passwordchange: false,
          _passwordmustchange: false,
          _passwordhistory: false,
          _passwordtrackupdatetime: false,
          _passwordexp: false,
          _passwordsendexpiringtime: false,
          _passwordlockout: false,
          _passwordunlock: "0",
          _passwordchecksyntax: false,
          _passwordpalindrome: false,
          _passworddictcheck: false,
          _passwordstoragescheme: "",
          _passwordinhistory: "0",
          _passwordwarning: "0",
          _passwordmaxage: "0",
          _passwordminage: "0",
          _passwordgracelimit: "0",
          _passwordlockoutduration: "0",
          _passwordmaxfailure: "0",
          _passwordresetfailurecount: "0",
          _passwordminlength: "0",
          _passwordmindigits: "0",
          _passwordminalphas: "0",
          _passwordminuppers: "0",
          _passwordminlowers: "0",
          _passwordminspecials: "0",
          _passwordmin8bit: "0",
          _passwordmaxrepeats: "0",
          _passwordmaxsequence: "0",
          _passwordmaxseqsets: "0",
          _passwordmaxclasschars: "0",
          _passwordmincategories: "0",
          _passwordmintokenlength: "0",
          _passwordbadwords: "",
          _passworduserattributes: [],
          _passwordadmindn: "",
          _passwordadminskipinfoupdate: false,
          // Create policy
          create_passwordchange: false,
          create_passwordmustchange: false,
          create_passwordhistory: false,
          create_passwordtrackupdatetime: false,
          create_passwordexp: false,
          create_passwordsendexpiringtime: false,
          create_passwordlockout: false,
          create_passwordunlock: false,
          create_passwordchecksyntax: false,
          create_passwordpalindrome: false,
          create_passworddictcheck: false,
          create_passwordstoragescheme: "",
          create_passwordinhistory: "0",
          create_passwordwarning: "0",
          create_passwordmaxage: "0",
          create_passwordminage: "0",
          create_passwordgracelimit: "0",
          create_passwordlockoutduration: "0",
          create_passwordmaxfailure: "0",
          create_passwordresetfailurecount: "0",
          create_passwordminlength: "0",
          create_passwordmindigits: "0",
          create_passwordminalphas: "0",
          create_passwordminuppers: "0",
          create_passwordminlowers: "0",
          create_passwordminspecials: "0",
          create_passwordmin8bit: "0",
          create_passwordmaxrepeats: "0",
          create_passwordmaxsequence: "0",
          create_passwordmaxseqsets: "0",
          create_passwordmaxclasschars: "0",
          create_passwordmincategories: "0",
          create_passwordmintokenlength: "0",
          create_passwordbadwords: "",
          create_passworduserattributes: [],
          create_passwordadmindn: "",
          create_passwordadminskipinfoupdate: false,
          _create_passwordchange: false,
          _create_passwordmustchange: false,
          _create_passwordhistory: false,
          _create_passwordtrackupdatetime: false,
          _create_passwordexp: false,
          _create_passwordsendexpiringtime: false,
          _create_passwordlockout: false,
          _create_passwordunlock: false,
          _create_passwordchecksyntax: false,
          _create_passwordpalindrome: false,
          _create_passworddictcheck: false,
          _create_passwordstoragescheme: "",
          _create_passwordinhistory: "0",
          _create_passwordwarning: "0",
          _create_passwordmaxage: "0",
          _create_passwordminage: "0",
          _create_passwordgracelimit: "0",
          _create_passwordlockoutduration: "0",
          _create_passwordmaxfailure: "0",
          _create_passwordresetfailurecount: "0",
          _create_passwordminlength: "0",
          _create_passwordmindigits: "0",
          _create_passwordminalphas: "0",
          _create_passwordminuppers: "0",
          _create_passwordminlowers: "0",
          _create_passwordminspecials: "0",
          _create_passwordmin8bit: "0",
          _create_passwordmaxrepeats: "0",
          _create_passwordmaxsequence: "0",
          _create_passwordmaxseqsets: "0",
          _create_passwordmaxclasschars: "0",
          _create_passwordmincategories: "0",
          _create_passwordmintokenlength: "0",
          _create_passwordbadwords: "",
          _create_passworduserattributes: [],
          _create_passwordadmindn: "",
          _create_passwordadminskipinfoupdate: false
        }, () => {
          const gcmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "config",
            "get",
            "passwordstoragescheme"
          ];
          log_cmd("handleLoadPolicies", "Load global password policy password scheme", gcmd);
          cockpit_default.spawn(gcmd, { superuser: true, err: "message" }).done((content2) => {
            const config2 = JSON.parse(content2);
            const attrs = config2.attrs;
            const defaultStorageScheme = attrs.passwordstoragescheme[0];
            this.setState({
              create_passwordstoragescheme: defaultStorageScheme,
              _create_passwordstoragescheme: defaultStorageScheme
            }, this.props.enableTree);
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.setState({
              loaded: true,
              loading: false
            });
            this.props.addNotification(
              "error",
              `Error loading global password storage scheme - ${errMsg.desc}`
            );
          });
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loaded: true,
          loading: false
        }, this.props.enableTree);
        console.log(
          `Error loading local password policies - ${errMsg.desc}`
        );
      });
    }
    loadLocal(name2) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "get",
        name2
      ];
      log_cmd("loadLocal", "Load a local password policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let pwChange = false;
        let pwMustChange = false;
        let pwHistory = false;
        let pwTrackUpdate = false;
        let pwExpire = false;
        let pwSendExpire = false;
        let pwLockout = false;
        let pwUnlock = false;
        let pwCheckSyntax = false;
        let pwPalindrome = false;
        let pwDictCheck = false;
        let pwUserAttrs = [];
        let pwInHistory = "0";
        let pwBadWords = "";
        let pwScheme = this.state.create_passwordstoragescheme;
        let pwWarning = "0";
        let pwMaxAge = "0";
        let pwMinAge = "0";
        let pwGraceLimit = "0";
        let pwLockoutDur = "0";
        let pwMaxFailure = "0";
        let pwFailCount = "0";
        let pwMinLen = "0";
        let pwMinDigits = "0";
        let pwMinAlphas = "0";
        let pwMinUppers = "0";
        let pwMinLowers = "0";
        let pwMinSpecials = "0";
        let pwMin8bit = "0";
        let pwMaxRepeats = "0";
        let pwMaxSeq = "0";
        let pwMaxSeqSets = "0";
        let pwMaxClassChars = "0";
        let pwMinCat = "0";
        let pwMinTokenLen = "0";
        let pwTPRMaxUse = "-1";
        let pwTPRDelayExpireAt = "-1";
        let pwTPRDelayValidFrom = "-1";
        let pwAdminDN = "";
        let pwAdminSkipUpdates = false;
        if ("passwordmintokenlength" in attrs) {
          pwMinTokenLen = attrs.passwordmintokenlength[0];
        }
        if ("passwordmincategories" in attrs) {
          pwMinCat = attrs.passwordmincategories[0];
        }
        if ("passwordmaxclasschars" in attrs) {
          pwMaxClassChars = attrs.passwordmaxclasschars[0];
        }
        if ("passwordmaxseqsets" in attrs) {
          pwMaxSeqSets = attrs.passwordmaxseqsets[0];
        }
        if ("passwordmaxsequence" in attrs) {
          pwMaxSeq = attrs.passwordmaxsequence[0];
        }
        if ("passwordmaxrepeats" in attrs) {
          pwMaxRepeats = attrs.passwordmaxrepeats[0];
        }
        if ("passwordmin8bit" in attrs) {
          pwMin8bit = attrs.passwordmin8bit[0];
        }
        if ("passwordminspecials" in attrs) {
          pwMinSpecials = attrs.passwordminspecials[0];
        }
        if ("passwordminlowers" in attrs) {
          pwMinLowers = attrs.passwordminlowers[0];
        }
        if ("passwordminuppers" in attrs) {
          pwMinUppers = attrs.passwordminuppers[0];
        }
        if ("passwordminalphas" in attrs) {
          pwMinAlphas = attrs.passwordminalphas[0];
        }
        if ("passwordmindigits" in attrs) {
          pwMinDigits = attrs.passwordmindigits[0];
        }
        if ("passwordminlength" in attrs) {
          pwMinLen = attrs.passwordminlength[0];
        }
        if ("passwordresetfailurecount" in attrs) {
          pwFailCount = attrs.passwordresetfailurecount[0];
        }
        if ("passwordmaxfailure" in attrs) {
          pwMaxFailure = attrs.passwordmaxfailure[0];
        }
        if ("passwordlockoutduration" in attrs) {
          pwLockoutDur = attrs.passwordlockoutduration[0];
        }
        if ("passwordgracelimit" in attrs) {
          pwGraceLimit = attrs.passwordgracelimit[0];
        }
        if ("passwordmaxage" in attrs) {
          pwMaxAge = attrs.passwordmaxage[0];
        }
        if ("passwordminage" in attrs) {
          pwMinAge = attrs.passwordminage[0];
        }
        if ("passwordwarning" in attrs) {
          pwWarning = attrs.passwordwarning[0];
        }
        if ("passwordstoragescheme" in attrs) {
          pwScheme = attrs.passwordstoragescheme[0];
        }
        if ("passwordinhistory" in attrs) {
          pwInHistory = attrs.passwordinhistory[0];
        }
        if ("passwordchange" in attrs && attrs.passwordchange[0] === "on") {
          pwChange = true;
        }
        if ("passwordmustchange" in attrs && attrs.passwordmustchange[0] === "on") {
          pwMustChange = true;
        }
        if ("passwordhistory" in attrs && attrs.passwordhistory[0] === "on") {
          pwHistory = true;
        }
        if ("passwordtrackupdatetime" in attrs && attrs.passwordtrackupdatetime[0] === "on") {
          pwTrackUpdate = true;
        }
        if ("passwordsendexpiringtime" in attrs && attrs.passwordsendexpiringtime[0] === "on") {
          pwSendExpire = true;
        }
        if ("passwordlockout" in attrs && attrs.passwordlockout[0] === "on") {
          pwLockout = true;
        }
        if ("passwordunlock" in attrs && attrs.passwordunlock[0] === "on") {
          pwUnlock = true;
        }
        if ("passwordexp" in attrs && attrs.passwordexp[0] === "on") {
          pwExpire = true;
        }
        if ("passwordchecksyntax" in attrs && attrs.passwordchecksyntax[0] === "on") {
          pwCheckSyntax = true;
        }
        if ("passwordpalindrome" in attrs && attrs.passwordpalindrome[0] === "on") {
          pwPalindrome = true;
        }
        if ("passworddictcheck" in attrs && attrs.passworddictcheck[0] === "on") {
          pwDictCheck = true;
        }
        if ("passwordbadwords" in attrs && attrs.passwordbadwords[0] !== "") {
          if (attrs.passwordbadwords.length > 1) {
            pwBadWords = attrs.passwordbadwords.join(" ");
          } else {
            pwBadWords = attrs.passwordbadwords[0];
          }
        }
        if ("passworduserattributes" in attrs && attrs.passworduserattributes[0] !== "") {
          if (attrs.passworduserattributes.length > 1) {
            attrs.passworduserattributes[0] = attrs.passworduserattributes.join(" ");
          }
          if (attrs.passworduserattributes[0].indexOf(",") > -1) {
            pwUserAttrs = attrs.passworduserattributes[0].trim();
            pwUserAttrs = pwUserAttrs.split(",");
          } else {
            pwUserAttrs = attrs.passworduserattributes[0].split(" ");
          }
        }
        if ("passwordTPRMaxUse" in attrs) {
          pwTPRMaxUse = attrs.passwordTPRMaxUse[0];
        }
        if ("passwordTPRDelayExpireAt" in attrs) {
          pwTPRDelayExpireAt = attrs.passwordTPRDelayExpireAt[0];
        }
        if ("passwordTPRDelayValidFrom" in attrs) {
          pwTPRDelayValidFrom = attrs.passwordTPRDelayValidFrom[0];
        }
        if ("passwordadmindn" in attrs) {
          pwAdminDN = attrs.passwordadmindn[0];
        }
        if ("passwordadminskipinfoupdate" in attrs && attrs.passwordadminskipinfoupdate[0] === "on") {
          pwAdminSkipUpdates = true;
        }
        this.setState({
          editPolicy: true,
          loading: false,
          localActiveTabKey: 1,
          activeKey: 0,
          policyName: name2,
          policyType: config2.pwp_type,
          saveGeneralDisabled: true,
          saveUserDisabled: true,
          saveExpDisabled: true,
          saveLockoutDisabled: true,
          saveSyntaxDisabled: true,
          // Settings
          passwordchange: pwChange,
          passwordmustchange: pwMustChange,
          passwordhistory: pwHistory,
          passwordtrackupdatetime: pwTrackUpdate,
          passwordexp: pwExpire,
          passwordsendexpiringtime: pwSendExpire,
          passwordlockout: pwLockout,
          passwordunlock: pwUnlock,
          passwordchecksyntax: pwCheckSyntax,
          passwordpalindrome: pwPalindrome,
          passworddictcheck: pwDictCheck,
          passwordstoragescheme: pwScheme,
          passwordinhistory: pwInHistory,
          passwordwarning: pwWarning,
          passwordmaxage: pwMaxAge,
          passwordminage: pwMinAge,
          passwordgracelimit: pwGraceLimit,
          passwordlockoutduration: pwLockoutDur,
          passwordmaxfailure: pwMaxFailure,
          passwordresetfailurecount: pwFailCount,
          passwordminlength: pwMinLen,
          passwordmindigits: pwMinDigits,
          passwordminalphas: pwMinAlphas,
          passwordminuppers: pwMinUppers,
          passwordminlowers: pwMinLowers,
          passwordminspecials: pwMinSpecials,
          passwordmin8bit: pwMin8bit,
          passwordmaxrepeats: pwMaxRepeats,
          passwordmaxsequence: pwMaxSeq,
          passwordmaxseqsets: pwMaxSeqSets,
          passwordmaxclasschars: pwMaxClassChars,
          passwordmincategories: pwMinCat,
          passwordmintokenlength: pwMinTokenLen,
          passwordbadwords: pwBadWords,
          passworduserattributes: pwUserAttrs,
          passwordtprmaxuse: pwTPRMaxUse,
          passwordtprdelayexpireat: pwTPRDelayExpireAt,
          passwordtprdelayvalidfrom: pwTPRDelayValidFrom,
          passwordadmindn: pwAdminDN,
          passwordadminskipinfoupdate: pwAdminSkipUpdates,
          // Record original values
          _passwordchange: pwChange,
          _passwordmustchange: pwMustChange,
          _passwordhistory: pwHistory,
          _passwordtrackupdatetime: pwTrackUpdate,
          _passwordexp: pwExpire,
          _passwordsendexpiringtime: pwSendExpire,
          _passwordlockout: pwLockout,
          _passwordunlock: pwUnlock,
          _passwordchecksyntax: pwCheckSyntax,
          _passwordpalindrome: pwPalindrome,
          _passworddictcheck: pwDictCheck,
          _passwordstoragescheme: pwScheme,
          _passwordinhistory: pwInHistory,
          _passwordwarning: pwWarning,
          _passwordmaxage: pwMaxAge,
          _passwordminage: pwMinAge,
          _passwordgracelimit: pwGraceLimit,
          _passwordlockoutduration: pwLockoutDur,
          _passwordmaxfailure: pwMaxFailure,
          _passwordresetfailurecount: pwFailCount,
          _passwordminlength: pwMinLen,
          _passwordmindigits: pwMinDigits,
          _passwordminalphas: pwMinAlphas,
          _passwordminuppers: pwMinUppers,
          _passwordminlowers: pwMinLowers,
          _passwordminspecials: pwMinSpecials,
          _passwordmin8bit: pwMin8bit,
          _passwordmaxrepeats: pwMaxRepeats,
          _passwordmaxsequence: pwMaxSeq,
          _passwordmaxseqsets: pwMaxSeqSets,
          _passwordmaxclasschars: pwMaxClassChars,
          _passwordmincategories: pwMinCat,
          _passwordmintokenlength: pwMinTokenLen,
          _passwordbadwords: pwBadWords,
          _passworduserattributes: pwUserAttrs,
          _passwordtprmaxuse: pwTPRMaxUse,
          _passwordtprdelayexpireat: pwTPRDelayExpireAt,
          _passwordtprdelayvalidfrom: pwTPRDelayValidFrom,
          _passwordadmindn: pwAdminDN,
          _passwordadminskipinfoupdate: pwAdminSkipUpdates
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loaded: true,
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error loading local password policy - ${errMsg.desc}`
        );
      });
    }
    render() {
      let edit_tab = "";
      let pwExpirationRows = "";
      let pwLockoutRows = "";
      let pwSyntaxRows = "";
      let saveBtnName = "Save";
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = "Saving ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      if (this.state.passwordchecksyntax) {
        pwSyntaxRows = /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Length"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "The minimum number of characters in the password (passwordMinLength).",
            value: this.state.passwordminlength,
            type: "number",
            id: "passwordminlength",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminlength",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Alpha's"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many alpha characters (passwordMinAlphas).",
            value: this.state.passwordminalphas,
            type: "number",
            id: "passwordminalphas",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminalphas",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Digits"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many digit characters (0-9) (passwordMinDigits).",
            value: this.state.passwordmindigits,
            type: "number",
            id: "passwordmindigits",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmindigits",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Special"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many special non-alphanumeric characters (passwordMinSpecials).",
            value: this.state.passwordminspecials,
            type: "number",
            id: "passwordminspecials",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminspecials",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum Uppercase"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many uppercase characters (passwordMinUppers).",
            value: this.state.passwordminuppers,
            type: "number",
            id: "passwordminuppers",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminuppers",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Lowercase"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many lowercase characters (passwordMinLowers).",
            value: this.state.passwordminlowers,
            type: "number",
            id: "passwordminlowers",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordminlowers",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum 8-bit"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "Reject passwords with fewer than this many 8-bit or multi-byte characters (passwordMin8Bit).",
            value: this.state.passwordmin8bit,
            type: "number",
            id: "passwordmin8bit",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmin8bit",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Minimum Categories"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "The minimum number of character categories that a password must contain (categories are upper, lower, digit, special, and 8-bit) (passwordMinCategories).",
            value: this.state.passwordmincategories,
            type: "number",
            id: "passwordmincategories",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmincategories",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Sequences"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "The maximum number of allowed monotonic characters sequences (passwordMaxSequence).",
            value: this.state.passwordmaxsequence,
            type: "number",
            id: "passwordmaxsequence",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxsequence",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        )), /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", offset: 6, span: 3 }, "Max Sequence Sets"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "The maximum number of allowed monotonic characters sequences that can appear more than once (passwordMaxSeqSets).",
            value: this.state.passwordmaxseqsets,
            type: "number",
            id: "passwordmaxseqsets",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxseqsets",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max Seq Per Class"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "The maximum number of consecutive characters from the same character class/category (passwordMaxClassChars).",
            value: this.state.passwordmaxclasschars,
            type: "number",
            id: "passwordmaxclasschars",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxclasschars",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Prohibited Words"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            title: "A space-separated list of words that are not allowed to be contained in the new password (passwordBadWords).",
            value: this.state.passwordbadwords,
            type: "text",
            id: "passwordbadwords",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordbadwords",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "A list of entry attributes to compare to the new password (passwordUserAttributes)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Check User Attributes"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute to check",
            onToggle: this.handleSelectToggle,
            onSelect: this.handleSyntaxChange,
            onClear: this.handleSelectClear,
            selections: this.state.passworduserattributes,
            isOpen: this.state.isSelectOpen,
            "aria-labelledby": "typeAhead-user-attr",
            placeholderText: "Type attributes to check...",
            noResultsFoundText: "There are no matching entries"
          },
          this.props.attrs.map((attr, index) => /* @__PURE__ */ import_react38.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top-lg", title: "Check the password against the system's CrackLib dictionary (passwordDictCheck)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passworddictcheck",
            isChecked: this.state.passworddictcheck,
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            },
            label: "Dictionary Check"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Check if the password is a palindrome (passwordPalindrome)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordpalindrome",
            isChecked: this.state.passwordpalindrome,
            className: "ds-label",
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            },
            label: "Reject Palindromes"
          }
        ))));
      }
      if (this.state.passwordlockout) {
        pwLockoutRows = /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The maximum number of failed logins before account gets locked (passwordMaxFailure)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Number of Failed Logins That Locks out Account"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.state.passwordmaxfailure,
            type: "number",
            id: "passwordmaxfailure",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxpasswordmaxfailureclasschars",
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The number of seconds until an accounts failure count is reset (passwordResetFailureCount)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Time Until ", /* @__PURE__ */ import_react38.default.createElement("i", null, "Failure Count"), " Resets"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.state.passwordresetfailurecount,
            type: "number",
            id: "passwordresetfailurecount",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordresetfailurecount",
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The number of seconds, duration, before the account gets unlocked (passwordLockoutDuration)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Time Until Account Unlocked"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.state.passwordlockoutduration,
            type: "number",
            id: "passwordlockoutduration",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordlockoutduration",
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Do not lockout the user account forever, instead the account will unlock based on the lockout duration (passwordUnlock)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordunlock",
            isChecked: this.state.passwordunlock,
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            },
            label: "Do Not Lockout Account Forever"
          }
        ))));
      }
      if (this.state.passwordexp) {
        pwExpirationRows = /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The maxiumum age of a password in seconds before it expires (passwordMaxAge)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Password Expiration Time"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.state.passwordmaxage,
            type: "number",
            id: "passwordmaxage",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordmaxage",
            onChange: (checked, e) => {
              this.handleExpChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "The number of logins that are allowed after the password has expired (passwordGraceLimit)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Allowed Logins After Password Expires"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.state.passwordgracelimit,
            type: "number",
            id: "passwordgracelimit",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordgracelimit",
            onChange: (checked, e) => {
              this.handleExpChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Set the time (in seconds), before a password is about to expire, to send a warning. (passwordWarning)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, "Send Password Expiring Warning"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.state.passwordwarning,
            type: "number",
            id: "passwordwarning",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordwarning",
            onChange: (checked, e) => {
              this.handleExpChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Always return a password expiring control when requested (passwordSendExpiringTime)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 5 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordsendexpiringtime",
            isChecked: this.state.passwordsendexpiringtime,
            onChange: (checked, e) => {
              this.handleExpChange(e);
            },
            label: /* @__PURE__ */ import_react38.default.createElement(import_react38.default.Fragment, null, "Always Send ", /* @__PURE__ */ import_react38.default.createElement("i", null, "Password Expiring"), " Control")
          }
        ))));
      }
      if (!this.state.editPolicy) {
        edit_tab = /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react38.default.createElement(TextContent, null, /* @__PURE__ */ import_react38.default.createElement(Text, { className: "ds-center", component: TextVariants.h3 }, "Please choose a policy from the ", /* @__PURE__ */ import_react38.default.createElement("a", { onClick: this.handleResetTab }, "Local Policy Table"), ".")));
      } else {
        edit_tab = /* @__PURE__ */ import_react38.default.createElement("div", { className: this.state.loading ? "ds-fadeout ds-left-margin" : "ds-fadein ds-left-margin" }, /* @__PURE__ */ import_react38.default.createElement(TextContent, null, /* @__PURE__ */ import_react38.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h4 }, /* @__PURE__ */ import_react38.default.createElement("b", null, this.state.policyName), " ", /* @__PURE__ */ import_react38.default.createElement("font", { size: "2" }, "(", this.state.policyType, ")"))), /* @__PURE__ */ import_react38.default.createElement(Tabs, { className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "General Settings") }, /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-left-sm ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "Record a separate timestamp specifically for the last time that the password for an entry was changed. If this is enabled, then it adds the pwdUpdateTime operational attribute to the user account entry (passwordTrackUpdateTime)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordtrackupdatetime",
            isChecked: this.state.passwordtrackupdatetime,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Track Password Update Time"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "Allow user's to change their passwords (passwordChange)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordchange",
            isChecked: this.state.passwordchange,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Allow Users To Change Their Passwords"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "User must change its password after its been reset by an administrator (passwordMustChange)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordmustchange",
            isChecked: this.state.passwordmustchange,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "User Must Change Password After Reset"
          }
        ))), /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "Maintain a password history for each user (passwordHistory)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-inline" }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordhistory",
            isChecked: this.state.passwordhistory,
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            },
            label: "Keep Password History"
          }
        )), /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-inline ds-left-margin ds-raise-field-md ds-width-sm" }, /* @__PURE__ */ import_react38.default.createElement(
          TextInput,
          {
            value: this.state.passwordinhistory,
            type: "number",
            id: "passwordinhistory",
            "aria-describedby": "horizontal-form-name-helper",
            name: "passwordinhistory",
            onChange: (checked, e) => {
              this.handleGeneralChange(e);
            }
          }
        )))), /* @__PURE__ */ import_react38.default.createElement(Grid, { className: "ds-margin-top", title: "Set the password storage scheme (passwordstoragescheme)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Password Storage Scheme"), /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
          FormSelect,
          {
            id: "passwordstoragescheme",
            value: this.state.passwordstoragescheme,
            onChange: (value, event) => {
              this.handleGeneralChange(event);
            },
            "aria-label": "FormSelect Input"
          },
          this.props.pwdStorageSchemes.map((option, index) => /* @__PURE__ */ import_react38.default.createElement(
            FormSelectOption,
            {
              key: index,
              value: option,
              label: option
            }
          ))
        ))), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Indicates the number of seconds that must pass before a user can change their password again. (passwordMinAge)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Minimum Age"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              value: this.state.passwordminage,
              type: "number",
              id: "passwordminage",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordminage",
              onChange: (checked, e) => {
                this.handleGeneralChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "The DN for a password administrator or administrator group (passwordAdminDN)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Administrator"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              value: this.state.passwordadmindn,
              type: "text",
              id: "passwordadmindn",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordadmindn",
              onChange: (checked, e) => {
                this.handleGeneralChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Disable updating password state attributes like passwordExpirationtime, passwordHistory, etc, when setting a user's password as a Password Administrator (passwordAdminSkipInfoUpdate)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { offset: 3, span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            Checkbox,
            {
              id: "passwordadminskipinfoupdate",
              isChecked: this.state.passwordadminskipinfoupdate,
              onChange: (checked, e) => {
                this.handleGeneralChange(e);
              },
              label: "Do not update target entry's password state attributes"
            }
          ))
        )), /* @__PURE__ */ import_react38.default.createElement(
          Button,
          {
            isDisabled: this.state.saveGeneralDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left-sm ds-margin-bottom-md",
            onClick: this.handleSaveGeneral,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "Expiration") }, /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "Enable a password expiration policy (passwordExp)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordexp",
            isChecked: this.state.passwordexp,
            onChange: (checked, e) => {
              this.handleExpChange(e);
            },
            label: "Enforce Password Expiration"
          }
        ))), pwExpirationRows), /* @__PURE__ */ import_react38.default.createElement(
          Button,
          {
            isDisabled: this.state.saveExpDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-lg ds-margin-left",
            onClick: this.handleSaveExp,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "Account Lockout") }, /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "Enable account lockout (passwordLockout)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordlockout",
            isChecked: this.state.passwordlockout,
            onChange: (checked, e) => {
              this.handleLockoutChange(e);
            },
            label: "Enable Account Lockout"
          }
        ))), pwLockoutRows), /* @__PURE__ */ import_react38.default.createElement(
          Button,
          {
            isDisabled: this.state.saveLockoutDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-lg ds-margin-left",
            onClick: this.handleSaveLockout,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "Syntax Checking") }, /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react38.default.createElement(Grid, { title: "Enable password syntax checking (passwordCheckSyntax)." }, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(
          Checkbox,
          {
            id: "passwordchecksyntax",
            isChecked: this.state.passwordchecksyntax,
            onChange: (checked, e) => {
              this.handleSyntaxChange(e);
            },
            label: "Enable Password Syntax Checking"
          }
        ))), pwSyntaxRows), /* @__PURE__ */ import_react38.default.createElement(
          Button,
          {
            isDisabled: this.state.saveSyntaxDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left ds-margin-bottom-md",
            onClick: this.handleSaveSyntax,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 4, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "Temporary Password Rules") }, /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off" }, this.state.passwordmustchange === false && /* @__PURE__ */ import_react38.default.createElement(FormAlert, { className: "ds-margin-top" }, /* @__PURE__ */ import_react38.default.createElement(
          Alert,
          {
            variant: "info",
            title: '"User Must Change Password After Reset" must be enabled in General Settings to activate TPR.',
            "aria-live": "polite",
            isInline: true
          }
        )), /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Number of times the temporary password can be used to authenticate (passwordTPRMaxUse)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Max Use"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              value: this.state.passwordtprmaxuse,
              type: "number",
              id: "passwordtprmaxuse",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordtprmaxuse",
              isDisabled: !this.state.passwordmustchange,
              onChange: (checked, e) => {
                this.handleTPRChange(e);
              }
            }
          ))
        )), /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Number of seconds before the temporary password expires (passwordTPRDelayExpireAt)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Expires In"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              value: this.state.passwordtprdelayexpireat,
              type: "number",
              id: "passwordtprdelayexpireat",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordtprdelayexpireat",
              isDisabled: !this.state.passwordmustchange,
              onChange: (checked, e) => {
                this.handleTPRChange(e);
              }
            }
          ))
        )), /* @__PURE__ */ import_react38.default.createElement(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react38.default.createElement(
          Grid,
          {
            title: "Number of seconds after which temporary password starts to be valid for authentication (passwordTPRDelayValidFrom)."
          },
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Valid From"),
          /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react38.default.createElement(
            TextInput,
            {
              value: this.state.passwordtprdelayvalidfrom,
              type: "number",
              id: "passwordtprdelayvalidfrom",
              "aria-describedby": "horizontal-form-name-helper",
              name: "passwordtprdelayvalidfrom",
              isDisabled: !this.state.passwordmustchange,
              onChange: (checked, e) => {
                this.handleTPRChange(e);
              }
            }
          ))
        )), /* @__PURE__ */ import_react38.default.createElement(
          Button,
          {
            isDisabled: this.state.saveTPRDisabled || this.state.saving,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left ds-margin-bottom-md",
            onClick: this.handleSaveTPR,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        ))));
      }
      let body = /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react38.default.createElement(Tabs, { activeKey: this.state.localActiveTabKey, onSelect: this.handleLocalNavSelect }, /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "Local Policy Table") }, /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react38.default.createElement(
        PwpTable,
        {
          key: this.state.rows,
          rows: this.state.rows,
          editPolicy: this.loadLocal,
          deletePolicy: this.showDeletePolicy
        }
      ))), /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "Edit Policy") }, edit_tab), /* @__PURE__ */ import_react38.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react38.default.createElement(TabTitleText, null, "Create A Policy") }, /* @__PURE__ */ import_react38.default.createElement(
        CreatePolicy,
        {
          handleChange: this.onCreateChange,
          handleSelectChange: this.onCreateSelectChange,
          attrs: this.props.attrs,
          passwordexp: this.state.create_passwordexp,
          passwordchecksyntax: this.state.create_passwordchecksyntax,
          passwordlockout: this.state.create_passwordlockout,
          createDisabled: this.state.createDisabled,
          passworduserattributes: this.state.create_passworduserattributes,
          handleCreatePolicy: this.createPolicy,
          invalid_dn: this.state.invalid_dn,
          key: this.state.rows,
          policyDN: this.state.policyDN,
          createPolicyType: this.state.createPolicyType,
          create_passwordtrackupdatetime: this.state.create_passwordtrackupdatetime,
          create_passwordchange: this.state.create_passwordchange,
          create_passwordmustchange: this.state.create_passwordmustchange,
          create_passwordhistory: this.state.create_passwordhistory,
          create_passwordexp: this.state.create_passwordexp,
          create_passwordsendexpiringtime: this.state.create_passwordsendexpiringtime,
          create_passwordlockout: this.state.create_passwordlockout,
          create_passwordunlock: this.state.create_passwordunlock,
          create_passwordchecksyntax: this.state.create_passwordchecksyntax,
          create_passworddictcheck: this.state.create_passworddictcheck,
          create_passwordpalindrome: this.state.create_passwordpalindrome,
          create_passwordstoragescheme: this.state.create_passwordstoragescheme,
          create_passwordadmindn: this.state.create_passwordadmindn,
          create_passwordadminskipinfoupdate: this.state.create_passwordadminskipinfoupdate,
          onUserAttrsCreateToggle: this.handleUserAttrsCreateToggle,
          onUserAttrsCreateClear: this.handleUserAttrsCreateClear,
          isUserAttrsCreateOpen: this.state.isUserAttrsCreateOpen,
          pwdStorageSchemes: this.props.pwdStorageSchemes
        }
      ))));
      if (this.state.loading || !this.state.loaded) {
        body = /* @__PURE__ */ import_react38.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react38.default.createElement(Spinner, { isSVG: true, size: "xl" }));
      }
      return /* @__PURE__ */ import_react38.default.createElement("div", { className: this.state.saving ? "ds-disabled" : "" }, /* @__PURE__ */ import_react38.default.createElement(Grid, null, /* @__PURE__ */ import_react38.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react38.default.createElement(TextContent, null, /* @__PURE__ */ import_react38.default.createElement(Text, { component: TextVariants.h3 }, "Local Password Policies", /* @__PURE__ */ import_react38.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh the local password policies",
          onClick: this.handleLoadPolicies
        }
      ))))), body, /* @__PURE__ */ import_react38.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDeletePolicy,
          closeHandler: this.closeDeletePolicy,
          handleChange: this.onModalChange,
          actionHandler: this.deletePolicy,
          item: this.state.deleteName,
          checked: this.state.modalChecked,
          spinning: this.state.tableLoading,
          mTitle: "Delete Local Password Policy",
          mMsg: "Are you sure you want to delete this local password policy?",
          mSpinningMsg: "Deleting local password policy ...",
          mBtnName: "Delete Policy"
        }
      ));
    }
  };
  LocalPwPolicy.propTypes = {
    attrs: import_prop_types33.default.array,
    pwdStorageSchemes: import_prop_types33.default.array
  };
  LocalPwPolicy.defaultProps = {
    attrs: [],
    pwdStorageSchemes: []
  };

  // src/database.jsx
  var import_prop_types34 = __toESM(require_prop_types(), 1);
  var import_exclamation_circle_icon6 = __toESM(require_exclamation_circle_icon(), 1);
  var import_plus_icon3 = __toESM(require_plus_icon(), 1);
  var DB_CONFIG = "dbconfig";
  var CHAINING_CONFIG = "chaining-config";
  var BACKUP_CONFIG = "backups";
  var PWP_CONFIG = "pwpolicy";
  var LOCAL_PWP_CONFIG = "localpwpolicy";
  var Database = class extends import_react39.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        errObj: {},
        nodes: [],
        node_name: "",
        node_text: "",
        dbtype: "",
        activeItems: [
          {
            name: "Global Database Configuration",
            icon: /* @__PURE__ */ import_react39.default.createElement(CogIcon, null),
            id: "dbconfig"
          }
        ],
        showSuffixModal: false,
        createSuffix: "",
        createBeName: "",
        createNotOK: true,
        createSuffixEntry: false,
        createSampleEntries: false,
        noSuffixInit: true,
        disableTree: false,
        createInitOption: "noInit",
        // DB config
        globalDBConfig: {
          activeTab: 0
        },
        configUpdated: 0,
        // Chaining Config
        chainingConfig: {},
        chainingUpdated: 0,
        chainingActiveKey: 0,
        // Chaining Link
        chainingLoading: false,
        // Suffix
        suffixLoading: false,
        modalSpinning: false,
        attributes: [],
        // Loaded suffix configurations
        suffix: {},
        // Other
        vlvTableKey: 0,
        LDIFRows: [],
        BackupRows: [],
        backupRefreshing: false,
        suffixList: [],
        pwdStorageSchemes: [],
        loaded: false
      };
      this.handleTreeClick = this.handleTreeClick.bind(this);
      this.onHandleChange = this.onHandleChange.bind(this);
      this.onHandleSelectChange = this.onHandleSelectChange.bind(this);
      this.loadGlobalConfig = this.loadGlobalConfig.bind(this);
      this.loadLDIFs = this.loadLDIFs.bind(this);
      this.loadBackups = this.loadBackups.bind(this);
      this.loadSuffixList = this.loadSuffixList.bind(this);
      this.loadPwdStorageSchemes = this.loadPwdStorageSchemes.bind(this);
      this.handleShowSuffixModal = this.handleShowSuffixModal.bind(this);
      this.closeSuffixModal = this.closeSuffixModal.bind(this);
      this.createSuffix = this.createSuffix.bind(this);
      this.loadSuffix = this.loadSuffix.bind(this);
      this.loadIndexes = this.loadIndexes.bind(this);
      this.loadVLV = this.loadVLV.bind(this);
      this.loadAttrEncrypt = this.loadAttrEncrypt.bind(this);
      this.loadReferrals = this.loadReferrals.bind(this);
      this.getAutoTuning = this.getAutoTuning.bind(this);
      this.loadAttrs = this.loadAttrs.bind(this);
      this.loadChainingLink = this.loadChainingLink.bind(this);
      this.loadChainingConfig = this.loadChainingConfig.bind(this);
      this.loadAvailableControls = this.loadAvailableControls.bind(this);
      this.loadDefaultConfig = this.loadDefaultConfig.bind(this);
      this.loadSuffixTree = this.loadSuffixTree.bind(this);
      this.enableTree = this.enableTree.bind(this);
    }
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(2)) {
        if (this.state.firstLoad) {
          if (!this.state.loaded) {
            this.loadGlobalConfig();
            this.loadChainingConfig();
            this.loadLDIFs();
            this.loadBackups();
            this.loadSuffixList();
            this.loadPwdStorageSchemes();
          }
          this.loadSuffixTree(false);
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.loadSuffixTree(false);
          }
        }
      }
    }
    loadSuffixList() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "list",
        "--suffix"
      ];
      log_cmd("loadSuffixList", "Get a list of all the suffixes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const suffixList = JSON.parse(content);
        this.setState(() => ({ suffixList: suffixList.items }));
      });
    }
    loadPwdStorageSchemes() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "pwpolicy",
        "list-schemes"
      ];
      log_cmd("loadPwdStorageSchemes", "Get a list of all the password storage sehemes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const schemes = JSON.parse(content);
        this.setState(() => ({ pwdStorageSchemes: schemes.items }));
      });
    }
    loadNDN() {
      this.setState({
        loaded: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get",
        "nsslapd-ndn-cache-max-size"
      ];
      log_cmd("loadNDN", "Load NDN cache size", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        this.setState((prevState) => ({
          globalDBConfig: {
            ...prevState.globalDBConfig,
            ndncachemaxsize: attrs["nsslapd-ndn-cache-max-size"][0]
          },
          configUpdated: 0,
          loaded: true
        }));
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading server configuration for database- ${errMsg.desc}`
        );
        this.setState({
          loaded: true
        });
      });
    }
    loadGlobalConfig(activeTab) {
      if (this.state.firstLoad) {
        this.setState({ firstLoad: false });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "get"
      ];
      log_cmd("loadGlobalConfig", "Load the database global configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let db_cache_auto = false;
        let import_cache_auto = false;
        let dblocksMonitoring = false;
        let dbhome = "";
        if ("nsslapd-db-home-directory" in attrs) {
          dbhome = attrs["nsslapd-db-home-directory"][0];
        }
        if (attrs["nsslapd-cache-autosize"][0] !== "0") {
          db_cache_auto = true;
        }
        if (attrs["nsslapd-import-cache-autosize"][0] !== "0") {
          import_cache_auto = true;
        }
        if (attrs["nsslapd-db-locks-monitoring-enabled"][0] === "on") {
          dblocksMonitoring = true;
        }
        this.setState(() => ({
          globalDBConfig: {
            loading: false,
            activeTab,
            db_cache_auto,
            import_cache_auto,
            looklimit: attrs["nsslapd-lookthroughlimit"][0],
            idscanlimit: attrs["nsslapd-idlistscanlimit"][0],
            pagelooklimit: attrs["nsslapd-pagedlookthroughlimit"][0],
            pagescanlimit: attrs["nsslapd-pagedidlistscanlimit"][0],
            rangelooklimit: attrs["nsslapd-rangelookthroughlimit"][0],
            autosize: attrs["nsslapd-cache-autosize"][0],
            autosizesplit: attrs["nsslapd-cache-autosize-split"][0],
            dbcachesize: attrs["nsslapd-dbcachesize"][0],
            txnlogdir: attrs["nsslapd-db-logdirectory"][0],
            dbhomedir: dbhome,
            dblocks: attrs["nsslapd-db-locks"][0],
            dblocksMonitoring,
            dblocksMonitoringThreshold: attrs["nsslapd-db-locks-monitoring-threshold"][0],
            dblocksMonitoringPause: attrs["nsslapd-db-locks-monitoring-pause"][0],
            chxpoint: attrs["nsslapd-db-checkpoint-interval"][0],
            compactinterval: attrs["nsslapd-db-compactdb-interval"][0],
            compacttime: attrs["nsslapd-db-compactdb-time"][0],
            importcacheauto: attrs["nsslapd-import-cache-autosize"][0],
            importcachesize: attrs["nsslapd-import-cachesize"][0]
          },
          configUpdated: 1
        }), () => {
          this.loadNDN();
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading database configuration - ${errMsg.desc}`
        );
      });
    }
    loadAvailableControls() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-get",
        "--avail-controls"
      ];
      log_cmd("loadAvailableControls", "Get available controls", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const availableOids = config2.items.filter((el) => !this.state.chainingConfig.oidList.includes(el));
        this.setState(
          (prevState) => ({
            chainingConfig: {
              ...this.state.chainingConfig,
              availableOids
            },
            chainingUpdated: 1
          }),
          this.setState({ chainingUpdated: 0 })
        );
      });
    }
    loadDefaultConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-get-def"
      ];
      log_cmd("loadDefaultConfig", "Load chaining default configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attr = config2.attrs;
        let checkAci = false;
        let proxy = false;
        let refOnScope = false;
        let useStartTLS = false;
        if (attr.nschecklocalaci === "on") {
          checkAci = true;
        }
        if (attr.nsproxiedauthorization === "on") {
          proxy = true;
        }
        if (attr.nsreferralonscopedsearch === "on") {
          refOnScope = true;
        }
        if (attr.nsusestarttls === "on") {
          useStartTLS = true;
        }
        this.setState(() => ({
          chainingConfig: {
            ...this.state.chainingConfig,
            defSearchCheck: attr.nsabandonedsearchcheckinterval,
            defBindConnLimit: attr.nsbindconnectionslimit,
            defBindTimeout: attr.nsbindtimeout,
            defBindRetryLimit: attr.nsbindretrylimit,
            defConcurLimit: attr.nsconcurrentbindlimit,
            defConcurOpLimit: attr.nsconcurrentoperationslimit,
            defConnLife: attr.nsconnectionlife,
            defHopLimit: attr.nshoplimit,
            defDelay: attr.nsmaxresponsedelay,
            defTestDelay: attr.nsmaxtestresponsedelay,
            defOpConnLimit: attr.nsoperationconnectionslimit,
            defSizeLimit: attr["nsslapd-sizelimit"],
            defTimeLimit: attr["nsslapd-timelimit"],
            defProxy: proxy,
            defRefOnScoped: refOnScope,
            defCheckAci: checkAci,
            defUseStartTLS: useStartTLS
          }
        }), this.loadAvailableControls());
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading default chaining configuration - ${errMsg.desc}`
        );
        this.setState({
          loading: false
        });
      });
    }
    loadChainingConfig(tabIdx) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-get"
      ];
      log_cmd("loadChainingConfig", "Load chaining OIDs and Controls", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let availableComps = config2.attrs.nspossiblechainingcomponents;
        let compList = [];
        let oidList = [];
        let activeKey = 0;
        if ("nsactivechainingcomponents" in config2.attrs) {
          availableComps = config2.attrs.nspossiblechainingcomponents.filter((el) => !config2.attrs.nsactivechainingcomponents.includes(el));
          compList = config2.attrs.nsactivechainingcomponents;
        }
        if ("nstransmittedcontrols" in config2.attrs) {
          oidList = config2.attrs.nstransmittedcontrols;
        }
        if (tabIdx) {
          activeKey = tabIdx;
        }
        this.setState(() => ({
          chainingConfig: {
            ...this.state.chainingConfig,
            oidList,
            compList,
            availableComps
          },
          chainingActiveKey: activeKey
        }), this.loadDefaultConfig());
      });
    }
    processTree(suffixData) {
      for (const suffix of suffixData) {
        if (suffix.type === "suffix") {
          suffix.icon = /* @__PURE__ */ import_react39.default.createElement(FontAwesomeIcon, { size: "sm", icon: faTree });
        } else if (suffix.type === "subsuffix") {
          suffix.icon = /* @__PURE__ */ import_react39.default.createElement(FontAwesomeIcon, { size: "sm", icon: faLeaf });
        } else {
          suffix.icon = /* @__PURE__ */ import_react39.default.createElement(FontAwesomeIcon, { size: "sm", icon: faLink });
        }
        if (suffix.children.length === 0) {
          delete suffix.children;
        } else {
          this.processTree(suffix.children);
        }
      }
    }
    loadSuffixTree(fullReset) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "get-tree"
      ];
      log_cmd("loadSuffixTree", "Start building the suffix tree", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        let suffixData = [];
        if (content !== "") {
          suffixData = JSON.parse(content);
          this.processTree(suffixData);
        }
        const treeData = [
          {
            name: "Global Database Configuration",
            icon: /* @__PURE__ */ import_react39.default.createElement(CogIcon, null),
            id: "dbconfig"
          },
          {
            name: "Chaining Configuration",
            icon: /* @__PURE__ */ import_react39.default.createElement(ExternalLinkAltIcon, null),
            id: "chaining-config"
          },
          {
            name: "Backups & LDIFs",
            icon: /* @__PURE__ */ import_react39.default.createElement(CopyIcon, null),
            id: "backups"
          },
          {
            name: "Password Policies",
            id: "pwp",
            icon: /* @__PURE__ */ import_react39.default.createElement(KeyIcon, null),
            children: [
              {
                name: "Global Policy",
                icon: /* @__PURE__ */ import_react39.default.createElement(HomeIcon, null),
                id: "pwpolicy"
              },
              {
                name: "Local Policies",
                icon: /* @__PURE__ */ import_react39.default.createElement(UsersIcon, null),
                id: "localpwpolicy"
              }
            ],
            defaultExpanded: true
          },
          {
            name: "Suffixes",
            icon: /* @__PURE__ */ import_react39.default.createElement(CatalogIcon, null),
            id: "suffixes-tree",
            children: suffixData,
            defaultExpanded: true,
            action: /* @__PURE__ */ import_react39.default.createElement(
              Button,
              {
                onClick: this.handleShowSuffixModal,
                variant: "plain",
                "aria-label": "Create new suffix",
                title: "Create new suffix"
              },
              /* @__PURE__ */ import_react39.default.createElement(import_plus_icon3.PlusIcon, null)
            )
          }
        ];
        let current_node = this.state.node_name;
        if (fullReset) {
          current_node = DB_CONFIG;
        }
        this.setState(() => ({
          nodes: treeData,
          node_name: current_node
        }), this.loadAttrs);
      });
    }
    loadChainingLink(suffix) {
      this.setState({
        chainingLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-get",
        suffix
      ];
      log_cmd("loadChainingLink", "Load chaining link configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let bindmech = "SIMPLE";
        let usestarttls = false;
        let refOnScope = false;
        let proxiedAuth = false;
        let checkLocalAci = false;
        if (config2.attrs.nsreferralonscopedsearch[0] === "on") {
          refOnScope = true;
        }
        if (config2.attrs.nsproxiedauthorization[0] === "on") {
          proxiedAuth = true;
        }
        if (config2.attrs.nschecklocalaci[0] === "on") {
          checkLocalAci = true;
        }
        if (config2.attrs.nsusestarttls[0] === "on") {
          usestarttls = true;
        }
        if (config2.attrs.nsbindmechanism !== void 0) {
          bindmech = config2.attrs.nsbindmechanism[0];
        }
        this.setState({
          [suffix]: {
            nsfarmserverurl: attrs.nsfarmserverurl[0],
            nsmultiplexorbinddn: attrs.nsmultiplexorbinddn[0],
            nsmultiplexorcredentials: attrs.nsmultiplexorcredentials[0],
            nsmultiplexorcredentials_confirm: attrs.nsmultiplexorcredentials[0],
            sizelimit: attrs["nsslapd-sizelimit"][0],
            timelimit: attrs["nsslapd-timelimit"][0],
            bindconnlimit: attrs.nsbindconnectionslimit[0],
            opconnlimit: attrs.nsoperationconnectionslimit[0],
            concurrbindlimit: attrs.nsconcurrentbindlimit[0],
            bindtimeout: attrs.nsbindtimeout[0],
            bindretrylimit: attrs.nsbindretrylimit[0],
            concurroplimit: attrs.nsconcurrentoperationslimit[0],
            connlifetime: attrs.nsconnectionlife[0],
            searchcheckinterval: attrs.nsabandonedsearchcheckinterval[0],
            hoplimit: attrs.nshoplimit[0],
            nsbindmechanism: bindmech,
            nsusestarttls: usestarttls,
            nsreferralonscopedsearch: refOnScope,
            nsproxiedauthorization: proxiedAuth,
            nschecklocalaci: checkLocalAci
          },
          chainingLoading: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error getting chaining link configuration - ${errMsg.desc}`
        );
      });
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (this.state.activeItems.length === 0 || treeViewItem === this.state.activeItems[0]) {
        this.setState({
          activeItems: [treeViewItem]
        });
        return;
      }
      if (treeViewItem.id === "dbconfig" || treeViewItem.id === "chaining-config" || treeViewItem.id === "pwpolicy" || treeViewItem.id === "localpwpolicy" || treeViewItem.id === "backups") {
        this.setState((prevState) => {
          return {
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            dbtype: treeViewItem.type,
            bename: "",
            activeItems: [treeViewItem, parentItem]
          };
        });
      } else if (treeViewItem.id !== "pwp" && treeViewItem.id !== "suffixes-tree") {
        if (treeViewItem.id in this.state) {
          this.setState((prevState) => {
            return {
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              dbtype: treeViewItem.type,
              bename: treeViewItem.be,
              activeItems: [treeViewItem, parentItem]
            };
          });
        } else {
          this.setState({
            disableTree: true
            // Disable the tree to allow node to be fully loaded
          });
          if (treeViewItem.type === "dblink") {
            this.loadChainingLink(treeViewItem.id);
          } else {
            this.loadSuffix(treeViewItem.id);
          }
          this.setState((prevState) => {
            return {
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              dbtype: treeViewItem.type,
              bename: treeViewItem.be,
              activeItems: [treeViewItem, parentItem]
            };
          });
        }
      }
    }
    update_tree_nodes() {
      this.setState({
        disableTree: false,
        loaded: true
      }, () => {
        const className = "pf-c-tree-view__list-item";
        const element = document.getElementById("suffixes-tree");
        if (element) {
          const elements = element.getElementsByClassName(className);
          for (const el of elements) {
            el.setAttribute("title", el.innerText);
          }
        }
      });
    }
    handleShowSuffixModal() {
      this.setState({
        showSuffixModal: true,
        createSuffixEntry: false,
        createSampleEntries: false,
        noSuffixInit: true,
        errObj: {}
      });
    }
    onHandleSelectChange(value, event) {
      let noInit = false;
      let addSuffix = false;
      let addSample = false;
      if (value === "noInit") {
        noInit = true;
      } else if (value === "addSuffix") {
        addSuffix = true;
      } else {
        addSample = true;
      }
      this.setState({
        createInitOption: value,
        noSuffixInit: noInit,
        createSuffixEntry: addSuffix,
        createSampleEntries: addSample
      });
    }
    onHandleChange(str, e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      let createNotOK = false;
      if (value === "") {
        valueErr = true;
        createNotOK = true;
      } else if (e.target.id === "createSuffix" && !valid_dn(str)) {
        valueErr = true;
        createNotOK = true;
      }
      if (e.target.id !== "createSuffix") {
        if (!valid_dn(this.state.createSuffix)) {
          errObj.createSuffix = true;
          createNotOK = true;
        }
      }
      if (e.target.id !== "createBeName") {
        if (this.state.createBeName === "") {
          errObj.createBeName = true;
          createNotOK = true;
        }
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        createNotOK
      });
    }
    closeSuffixModal() {
      this.setState({
        showSuffixModal: false,
        createNotOK: true
      });
    }
    createSuffix() {
      let errors = false;
      const missingArgs = {
        createSuffix: false,
        createBeName: false
      };
      if (this.state.createSuffix === "") {
        this.props.addNotification(
          "warning",
          `Missing the suffix DN`
        );
        missingArgs.createSuffix = true;
        errors = true;
      }
      if (this.state.createBeName === "") {
        this.props.addNotification(
          "warning",
          `Missing the suffix backend name`
        );
        missingArgs.createBeName = true;
        errors = true;
      }
      if (errors) {
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "create",
        "--be-name",
        this.state.createBeName,
        "--suffix",
        this.state.createSuffix
      ];
      if (this.state.createSampleEntries) {
        cmd.push("--create-entries");
      }
      if (this.state.createSuffixEntry) {
        cmd.push("--create-suffix");
      }
      log_cmd("createSuffix", "Create a new backend", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeSuffixModal();
        this.props.addNotification(
          "success",
          `Successfully create new suffix`
        );
        this.loadSuffixTree(false);
        this.loadSuffixList();
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error creating suffix - ${errMsg.desc}`
        );
        this.closeSuffixModal();
        this.setState({
          modalSpinning: false
        });
      });
    }
    getAutoTuning(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "get"
      ];
      log_cmd("getAutoTuning", "Check cache auto tuning", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        if ("nsslapd-cache-autosize" in config2.attrs && config2.attrs["nsslapd-cache-autosize"][0] !== "0") {
          this.setState({
            [suffix]: {
              ...this.state[suffix],
              autoTuning: true
            }
          });
        }
      });
    }
    loadVLV(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "list",
        suffix
      ];
      const tableKey = this.state.vlvTableKey + 1;
      log_cmd("loadVLV", "Load VLV indexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            vlvItems: config2.items
          },
          vlvTableKey: tableKey
        });
      });
    }
    loadAttrEncrypt(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "attr-encrypt",
        "--list",
        "--just-names",
        suffix
      ];
      log_cmd("loadAttrEncrypt", "Load encrypted attrs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const rows = [];
        for (const row of config2.items) {
          rows.push(row);
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            encAttrsRows: rows
          }
        });
      });
    }
    loadIndexes(suffix) {
      const index_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "list",
        suffix
      ];
      log_cmd("loadIndexes", "Load backend indexes", index_cmd);
      cockpit_default.spawn(index_cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const rows = [];
        const systemRows = [];
        for (const item of config2.items) {
          const index = item.attrs;
          let types = [];
          let mrs = "";
          if (index.nsindextype.length > 1) {
            types = index.nsindextype.join(", ");
          } else {
            types = index.nsindextype[0];
          }
          if ("nsmatchingrule" in index) {
            if (index.nsmatchingrule.length > 1) {
              mrs = index.nsmatchingrule.join(", ");
            } else {
              mrs = index.nsmatchingrule[0];
            }
          }
          if (index.nssystemindex[0] === "true") {
            systemRows.push([index.cn[0], types, mrs]);
          } else {
            rows.push([index.cn[0], types, mrs]);
          }
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            indexRows: rows,
            systemIndexRows: systemRows
          }
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading indexes for ${suffix} - ${errMsg.desc}`
        );
      });
    }
    loadReferrals(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "get",
        suffix
      ];
      log_cmd("loadReferrals", "get referrals", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let refs = [];
        if ("nsslapd-referral" in config2.attrs) {
          refs = config2.attrs["nsslapd-referral"];
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            refRows: refs
          }
        });
      });
    }
    loadSuffix(suffix) {
      this.setState({
        activeKey: 1,
        suffixLoading: true
      }, this.loadAttrs());
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "get",
        suffix
      ];
      log_cmd("loadSuffix", "Load suffix config", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let refs = [];
        let readonly = false;
        let requireindex = false;
        if ("nsslapd-referral" in config2.attrs) {
          refs = config2.attrs["nsslapd-referral"];
        }
        if ("nsslapd-readonly" in config2.attrs) {
          if (config2.attrs["nsslapd-readonly"][0] === "on") {
            readonly = true;
          }
        }
        if ("nsslapd-require-index" in config2.attrs) {
          if (config2.attrs["nsslapd-require-index"][0] === "on") {
            requireindex = true;
          }
        }
        this.setState({
          [suffix]: {
            refRows: refs,
            cachememsize: config2.attrs["nsslapd-cachememsize"][0],
            cachesize: config2.attrs["nsslapd-cachesize"][0],
            dncachememsize: config2.attrs["nsslapd-dncachememsize"][0],
            dbstate: config2.attrs["nsslapd-state"][0],
            readOnly: readonly,
            requireIndex: requireindex
          }
        }, this.getAutoTuning(suffix));
        const cmd2 = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "backend",
          "vlv-index",
          "list",
          suffix
        ];
        log_cmd("loadSuffix", "Load VLV indexes", cmd2);
        cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content2) => {
          const config3 = JSON.parse(content2);
          this.setState({
            [suffix]: {
              ...this.state[suffix],
              vlvItems: config3.items
            }
          });
          const cmd3 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "backend",
            "attr-encrypt",
            "--list",
            "--just-names",
            suffix
          ];
          log_cmd("loadAttrEncrypt", "Load encrypted attrs", cmd3);
          cockpit_default.spawn(cmd3, { superuser: true, err: "message" }).done((content3) => {
            const config4 = JSON.parse(content3);
            const rows = [];
            for (const row of config4.items) {
              rows.push(row);
            }
            this.setState({
              [suffix]: {
                ...this.state[suffix],
                encAttrsRows: rows
              }
            });
            const index_cmd = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
              "backend",
              "index",
              "list",
              suffix
            ];
            log_cmd("loadIndexes", "Load backend indexes", index_cmd);
            cockpit_default.spawn(index_cmd, { superuser: true, err: "message" }).done((content4) => {
              const config5 = JSON.parse(content4);
              const rows2 = [];
              const systemRows = [];
              for (const item of config5.items) {
                const index = item.attrs;
                let types = [];
                let mrs = [];
                if (index.nsindextype.length > 1) {
                  types = index.nsindextype.join(", ");
                } else {
                  types = index.nsindextype[0];
                }
                if ("nsmatchingrule" in index) {
                  if (index.nsmatchingrule.length > 1) {
                    mrs = index.nsmatchingrule.join(", ");
                  } else {
                    mrs = index.nsmatchingrule[0];
                  }
                }
                if (index.nssystemindex[0] === "true") {
                  systemRows.push([index.cn[0], types, mrs]);
                } else {
                  rows2.push([index.cn[0], types, mrs]);
                }
              }
              this.setState({
                [suffix]: {
                  ...this.state[suffix],
                  indexRows: rows2,
                  systemIndexRows: systemRows
                },
                suffixLoading: false
              });
            }).fail((err) => {
              const errMsg = JSON.parse(err);
              this.props.addNotification(
                "error",
                `Error loading indexes for ${suffix} - ${errMsg.desc}`
              );
              this.setState({
                suffixLoading: false
              });
            });
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.props.addNotification(
              "error",
              `Error attribute encryption for ${suffix} - ${errMsg.desc}`
            );
            this.setState({
              suffixLoading: false
            });
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Error loading VLV indexes for ${suffix} - ${errMsg.desc}`
          );
          this.setState({
            suffixLoading: false
          });
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading config for ${suffix} - ${errMsg.desc}`
        );
        this.setState({
          suffixLoading: false
        });
      });
    }
    loadLDIFs() {
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "ldifs"
      ];
      log_cmd("loadLDIFs", "Load LDIF Files", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const rows = [];
        for (const row of config2.items) {
          rows.push([row[0], row[1], row[2], row[3]]);
        }
        this.setState({
          LDIFRows: rows,
          backupRefreshing: false
        });
      });
    }
    loadBackups(refreshing) {
      if (refreshing) {
        this.setState({
          backupRefreshing: true
        });
      }
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "backups"
      ];
      log_cmd("loadBackupsDatabase", "Load Backups", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const rows = [];
        for (const row of config2.items) {
          rows.push([row[0], row[1], row[2]]);
        }
        this.setState({
          BackupRows: rows
        }, this.loadLDIFs());
      });
    }
    loadAttrs() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("loadAttrs", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs,
          loaded: true
        }, this.update_tree_nodes);
      });
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    render() {
      let db_element = "";
      let body = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (this.state.loaded) {
        if (this.state.node_name === DB_CONFIG || this.state.node_name === "") {
          db_element = /* @__PURE__ */ import_react39.default.createElement(
            GlobalDatabaseConfig,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              reload: this.loadGlobalConfig,
              data: this.state.globalDBConfig,
              enableTree: this.enableTree,
              key: this.state.configUpdated
            }
          );
        } else if (this.state.node_name === CHAINING_CONFIG) {
          db_element = /* @__PURE__ */ import_react39.default.createElement(
            ChainingDatabaseConfig,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              reload: this.loadChainingConfig,
              data: this.state.chainingConfig,
              enableTree: this.enableTree,
              activeKey: this.state.chainingActiveKey,
              key: this.state.chainingUpdated
            }
          );
        } else if (this.state.node_name === PWP_CONFIG) {
          db_element = /* @__PURE__ */ import_react39.default.createElement(
            GlobalPwPolicy,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              attrs: this.state.attributes,
              pwdStorageSchemes: this.state.pwdStorageSchemes,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === LOCAL_PWP_CONFIG) {
          db_element = /* @__PURE__ */ import_react39.default.createElement(
            LocalPwPolicy,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              attrs: this.state.attributes,
              pwdStorageSchemes: this.state.pwdStorageSchemes,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === BACKUP_CONFIG) {
          db_element = /* @__PURE__ */ import_react39.default.createElement(
            Backups,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              backups: this.state.BackupRows,
              suffixes: this.state.suffixList,
              ldifs: this.state.LDIFRows,
              enableTree: this.enableTree,
              handleReload: this.loadBackups,
              refreshing: this.state.backupRefreshing
            }
          );
        } else if (this.state.node_name !== "") {
          if (this.state.dbtype === "suffix" || this.state.dbtype === "subsuffix") {
            if (this.state.suffixLoading) {
              db_element = /* @__PURE__ */ import_react39.default.createElement("div", { className: "ds-margin-top-xlg ds-loading-spinner ds-center" }, /* @__PURE__ */ import_react39.default.createElement(TextContent, null, /* @__PURE__ */ import_react39.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h3 }, "Loading suffix configuration for ", /* @__PURE__ */ import_react39.default.createElement("b", null, this.state.node_text, " ..."))), /* @__PURE__ */ import_react39.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
            } else {
              db_element = /* @__PURE__ */ import_react39.default.createElement(
                Suffix,
                {
                  serverId: this.props.serverId,
                  suffix: this.state.node_text,
                  bename: this.state.bename,
                  loadSuffixTree: this.loadSuffixTree,
                  reload: this.loadSuffix,
                  reloadRefs: this.loadReferrals,
                  reloadIndexes: this.loadIndexes,
                  reloadVLV: this.loadVLV,
                  vlvTableKey: this.state.vlvTableKey,
                  reloadAttrEnc: this.loadAttrEncrypt,
                  addNotification: this.props.addNotification,
                  reloadLDIFs: this.loadLDIFs,
                  LDIFRows: this.state.LDIFRows,
                  dbtype: this.state.dbtype,
                  data: this.state[this.state.node_text],
                  attrs: this.state.attributes,
                  enableTree: this.enableTree,
                  key: this.state.node_text
                }
              );
            }
          } else {
            if (this.state.chainingLoading) {
              db_element = /* @__PURE__ */ import_react39.default.createElement("div", { className: "ds-margin-top ds-loading-spinner ds-center" }, /* @__PURE__ */ import_react39.default.createElement(TextContent, null, /* @__PURE__ */ import_react39.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h2 }, "Loading Chaining configuration for ", /* @__PURE__ */ import_react39.default.createElement("b", null, this.state.node_text, " ..."))), /* @__PURE__ */ import_react39.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
            } else {
              db_element = /* @__PURE__ */ import_react39.default.createElement(
                ChainingConfig,
                {
                  serverId: this.props.serverId,
                  suffix: this.state.node_text,
                  bename: this.state.bename,
                  loadSuffixTree: this.loadSuffixTree,
                  addNotification: this.props.addNotification,
                  data: this.state[this.state.node_text],
                  enableTree: this.enableTree,
                  reload: this.loadChainingLink
                }
              );
            }
          }
        }
        body = /* @__PURE__ */ import_react39.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react39.default.createElement("div", null, /* @__PURE__ */ import_react39.default.createElement("div", { className: "ds-tree" }, /* @__PURE__ */ import_react39.default.createElement("div", { className: disabled, id: "db-tree" }, /* @__PURE__ */ import_react39.default.createElement(
          TreeView,
          {
            hasSelectableNodes: true,
            data: this.state.nodes,
            activeItems: this.state.activeItems,
            onSelect: this.handleTreeClick
          }
        )))), /* @__PURE__ */ import_react39.default.createElement("div", { className: "ds-tree-content" }, db_element));
      } else {
        body = /* @__PURE__ */ import_react39.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react39.default.createElement(TextContent, null, /* @__PURE__ */ import_react39.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h3 }, "Loading Database Configuration ...")), /* @__PURE__ */ import_react39.default.createElement(Spinner, { className: "ds-margin-top", size: "xl" }));
      }
      return /* @__PURE__ */ import_react39.default.createElement("div", { className: "container-fluid" }, body, /* @__PURE__ */ import_react39.default.createElement(
        CreateSuffixModal,
        {
          showModal: this.state.showSuffixModal,
          closeHandler: this.closeSuffixModal,
          handleChange: this.onHandleChange,
          handleSelectChange: this.onHandleSelectChange,
          saveHandler: this.createSuffix,
          initOption: this.state.createInitOption,
          createNotOK: this.state.createNotOK,
          modalSpinning: this.state.modalSpinning,
          error: this.state.errObj
        }
      ));
    }
  };
  var CreateSuffixModal = class extends import_react39.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        handleSelectChange,
        saveHandler,
        createNotOK,
        initOption,
        modalSpinning,
        error
      } = this.props;
      let saveBtnName = "Create Suffix";
      const extraPrimaryProps = {};
      if (modalSpinning) {
        saveBtnName = "Creating ...";
        extraPrimaryProps.spinnerAriaValueText = "Creating";
      }
      return /* @__PURE__ */ import_react39.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Create New Suffix",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react39.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isDisabled: createNotOK || modalSpinning,
                isLoading: modalSpinning,
                spinnerAriaValueText: modalSpinning ? "Creating Suffix" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react39.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react39.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react39.default.createElement(
          FormGroup,
          {
            label: "Suffix DN",
            fieldId: "createSuffix",
            title: "Database suffix, like 'dc=example,dc=com'.  The suffix must be a valid LDAP Distiguished Name (DN).",
            helperTextInvalid: "The DN of the suffix is invalid",
            helperTextInvalidIcon: /* @__PURE__ */ import_react39.default.createElement(import_exclamation_circle_icon6.ExclamationCircleIcon, null),
            validated: error.createSuffix ? "error" : "noval"
          },
          /* @__PURE__ */ import_react39.default.createElement(
            TextInput,
            {
              isRequired: true,
              type: "text",
              id: "createSuffix",
              "aria-describedby": "createSuffix",
              name: "createSuffix",
              onChange: handleChange,
              validated: error.createSuffix ? "error" : "noval"
            }
          ),
          /* @__PURE__ */ import_react39.default.createElement(FormHelperText, { isError: true, isHidden: !error.createSuffix }, "Required field")
        ), /* @__PURE__ */ import_react39.default.createElement(
          FormGroup,
          {
            label: "Database Name",
            fieldId: "suffixName",
            title: "The name for the backend database, like 'userroot'.  The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends.",
            helperTextInvalid: "You must enter a name for the database",
            helperTextInvalidIcon: /* @__PURE__ */ import_react39.default.createElement(import_exclamation_circle_icon6.ExclamationCircleIcon, null),
            validated: error.createBeName ? "error" : "noval"
          },
          /* @__PURE__ */ import_react39.default.createElement(
            TextInput,
            {
              isRequired: true,
              type: "text",
              id: "createBeName",
              "aria-describedby": "createSuffix",
              name: "suffixName",
              onChange: handleChange,
              validated: error.createBeName ? "error" : "noval"
            }
          ),
          /* @__PURE__ */ import_react39.default.createElement(FormHelperText, { isError: true, isHidden: !error.createBeName }, "Required field")
        ), /* @__PURE__ */ import_react39.default.createElement(
          FormGroup,
          {
            label: "Initialization Option",
            fieldId: "initOptions"
          },
          /* @__PURE__ */ import_react39.default.createElement(FormSelect, { value: initOption, onChange: handleSelectChange, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react39.default.createElement(FormSelectOption, { key: 1, value: "noInit", label: "Do Not Initialize Database" }), /* @__PURE__ */ import_react39.default.createElement(FormSelectOption, { key: 2, value: "addSuffix", label: "Create The Top Suffix Entry" }), /* @__PURE__ */ import_react39.default.createElement(FormSelectOption, { key: 3, value: "addSample", label: "Add Sample Entries" }))
        ))
      );
    }
  };
  Database.propTypes = {
    addNotification: import_prop_types34.PropTypes.func,
    serverId: import_prop_types34.PropTypes.string
  };
  Database.defaultProps = {
    serverId: ""
  };
  CreateSuffixModal.propTypes = {
    showModal: import_prop_types34.PropTypes.bool,
    closeHandler: import_prop_types34.PropTypes.func,
    handleChange: import_prop_types34.PropTypes.func,
    handleSelectChange: import_prop_types34.PropTypes.func,
    saveHandler: import_prop_types34.PropTypes.func,
    modalSpinning: import_prop_types34.PropTypes.bool,
    error: import_prop_types34.PropTypes.object
  };
  CreateSuffixModal.defaultProps = {
    showModal: false,
    modalSpinning: false,
    error: {}
  };

  // src/monitor.jsx
  var import_react100 = __toESM(require_react(), 1);
  var import_prop_types78 = __toESM(require_prop_types(), 1);

  // src/lib/monitor/serverMonitor.jsx
  var import_react85 = __toESM(require_react(), 1);
  var import_prop_types63 = __toESM(require_prop_types(), 1);

  // src/lib/monitor/monitorTables.jsx
  var import_react40 = __toESM(require_react(), 1);
  var import_exclamation_triangle_icon7 = __toESM(require_exclamation_triangle_icon(), 1);
  var import_prop_types35 = __toESM(require_prop_types(), 1);
  var AbortCleanALLRUVTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Task", transforms: [sortable], cellFormatters: [expandable] },
          { title: "Created", transforms: [sortable] },
          { title: "Replica ID", transforms: [sortable] },
          { title: "Status", transforms: [sortable] },
          { title: "" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getLog = this.getLog.bind(this);
    }
    getLog(log3) {
      return /* @__PURE__ */ import_react40.default.createElement(TextContent, null, /* @__PURE__ */ import_react40.default.createElement(Text, { component: TextVariants.h5 }, log3));
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const task of this.props.tasks) {
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getLog(task.attrs.nstasklog[0]) }]
        });
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Tasks"] }];
        columns = [{ title: "Abort CleanAllRUV Tasks" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_tasks = [];
      const rows = [];
      let count = 0;
      for (const task of this.props.tasks) {
        sorted_tasks.push({
          task,
          1: task.attrs.cn[0],
          2: get_date_string(task.attrs.nstaskcreated[0]),
          3: task.attrs["replica-id"][0],
          4: task.attrs.nstaskstatus[0]
        });
      }
      sorted_tasks.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_tasks.reverse();
      }
      for (let task of sorted_tasks) {
        task = task.task;
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getLog(task.attrs.nstasklog[0]) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable table",
          cells: columns,
          rows: tableRows,
          onCollapse: this.handleCollapse,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react40.default.createElement(
        Pagination,
        {
          itemCount: this.props.tasks.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var CleanALLRUVTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Task", transforms: [sortable], cellFormatters: [expandable] },
          { title: "Created", transforms: [sortable] },
          { title: "Replica ID", transforms: [sortable] },
          { title: "Status", transforms: [sortable] },
          { title: "" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getLog = this.getLog.bind(this);
    }
    getLog(log3) {
      return /* @__PURE__ */ import_react40.default.createElement(TextContent, null, /* @__PURE__ */ import_react40.default.createElement(Text, { component: TextVariants.h5 }, log3));
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const task of this.props.tasks) {
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getLog(task.attrs.nstasklog[0]) }]
        });
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Tasks"] }];
        columns = [{ title: "CleanAllRUV Tasks" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_tasks = [];
      const rows = [];
      let count = 0;
      for (const task of this.props.tasks) {
        sorted_tasks.push({
          task,
          1: task.attrs.cn[0],
          2: get_date_string(task.attrs.nstaskcreated[0]),
          3: task.attrs["replica-id"][0],
          4: task.attrs.nstaskstatus[0]
        });
      }
      sorted_tasks.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_tasks.reverse();
      }
      for (let task of sorted_tasks) {
        task = task.task;
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getLog(task.attrs.nstasklog[0]) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable table",
          cells: columns,
          rows: tableRows,
          onCollapse: this.handleCollapse,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react40.default.createElement(
        Pagination,
        {
          itemCount: this.props.tasks.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var WinsyncAgmtTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Agreement", transforms: [sortable], cellFormatters: [expandable] },
          { title: "Replica", transforms: [sortable] },
          { title: "Enabled", transforms: [sortable] },
          { title: "" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      return /* @__PURE__ */ import_react40.default.createElement(Grid, { className: "ds-indent" }, /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Session In Progress:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["update-in-progress"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Changes Sent:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["number-changes-sent"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-init-status"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Updated Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-update-status"][0])));
    }
    getWakeupButton(name2) {
      return /* @__PURE__ */ import_react40.default.createElement(
        Button,
        {
          id: name2,
          variant: "primary",
          onClick: this.props.handlePokeAgmt,
          title: "Awaken the winsync replication agreement",
          isSmall: true
        },
        "Poke"
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const agmt of this.props.agmts) {
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Agreements"] }];
        columns = [{ title: "Winsync Agreements" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      let count = 0;
      for (const agmt of this.props.agmts) {
        sorted_agmts.push({
          agmt,
          1: agmt["agmt-name"][0],
          2: agmt.replica[0],
          3: agmt["replica-enabled"][0]
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        agmt = agmt.agmt;
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable table",
          cells: columns,
          rows: tableRows,
          onCollapse: this.handleCollapse,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react40.default.createElement(
        Pagination,
        {
          itemCount: this.props.agmts.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var AgmtTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Agreement", transforms: [sortable], cellFormatters: [expandable] },
          { title: "Replica", transforms: [sortable] },
          { title: "Enabled", transforms: [sortable] },
          { title: "" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      return /* @__PURE__ */ import_react40.default.createElement(Grid, { className: "ds-indent" }, /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Session In Progress:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["update-in-progress"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Changes Sent:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["number-changes-sent"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Changes Skipped:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["number-changes-skipped"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Reap Active:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["reap-active"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-init-status"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Updated Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-update-status"][0])));
    }
    getWakeupButton(name2) {
      return /* @__PURE__ */ import_react40.default.createElement(
        Button,
        {
          id: name2,
          variant: "primary",
          onClick: this.props.handlePokeAgmt,
          title: "Awaken the replication agreement",
          isSmall: true
        },
        "Poke"
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const agmt of this.props.agmts) {
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Agreements"] }];
        columns = [{ title: "Replication Agreements" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      let count = 0;
      for (const agmt of this.props.agmts) {
        sorted_agmts.push({
          agmt,
          1: agmt["agmt-name"][0],
          2: agmt.replica[0],
          3: agmt["replica-enabled"][0]
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        agmt = agmt.agmt;
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable table",
          cells: columns,
          rows: tableRows,
          onCollapse: this.handleCollapse,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react40.default.createElement(
        Pagination,
        {
          itemCount: this.props.agmts.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var ConnectionTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          {
            title: "Connection Opened",
            cellFormatters: [expandable],
            transforms: [sortable]
          },
          { title: "IP Address", transforms: [sortable] },
          { title: "Conn ID", transforms: [sortable] },
          { title: "Bind DN", transforms: [sortable] },
          {
            title: "Max Threads",
            transforms: [
              info({
                tooltip: 'If connection is currently at "Max Threads" then it will block new operations'
              }),
              sortable
            ]
          }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(ip, conn_date, parts) {
      return /* @__PURE__ */ import_react40.default.createElement(Grid, { className: "ds-indent" }, /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "IP Address:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react40.default.createElement("b", null, ip)), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "File Descriptor:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Connection Opened:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react40.default.createElement("b", null, conn_date)), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Operations Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[2])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Connection ID:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[9])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Operations Finished:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[3])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Bind DN:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[5])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Read/write Blocked:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[4])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 6 }, "Connection Currently At Max Threads:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[6] === "1" ? "Yes" : "No")), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 6 }, "Number Of Times Connection Hit Max Threads:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[7])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 6 }, "Number Of Operations Blocked By Max Threads:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react40.default.createElement("b", null, parts[8])));
    }
    componentDidMount() {
      const rows = [];
      let count = 0;
      for (const conn of this.props.conns) {
        const ip_parts = conn.split(":ip=");
        const parts = conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        rows.push({
          isOpen: false,
          cells: [
            conn_date,
            ip,
            parts[9],
            parts[5],
            parts[6] === "1" ? "Yes" : "No"
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(ip, conn_date, parts) }]
        });
        count += 2;
      }
      this.setState({
        rows
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const conn of this.props.conns) {
        const ip_parts = conn.split(":ip=");
        const parts = conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        const val = value.toLowerCase();
        const conn_raw = conn.toLowerCase();
        if (val !== "" && conn_raw.indexOf(val) === -1 && ip.toLowerCase().indexOf(val) === -1 && conn_date.indexOf(value) === -1) {
          continue;
        }
        rows.push({
          isOpen: false,
          cells: [
            conn_date,
            ip,
            parts[9],
            parts[5],
            parts[6] === "1" ? "Yes" : "No"
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(ip, conn_date, parts) }]
        });
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    handleSort(_event, index, direction) {
      const sorted_conns = [];
      const rows = [];
      let count = 0;
      for (const conn of this.props.conns) {
        const ip_parts = conn.split(":ip=");
        const parts = conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        sorted_conns.push({
          raw: conn,
          1: conn_date,
          2: ip,
          3: parts[9],
          4: parts[5],
          5: parts[6]
        });
      }
      sorted_conns.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_conns.reverse();
      }
      for (const conn of sorted_conns) {
        const raw_conn = conn.raw;
        const ip_parts = raw_conn.split(":ip=");
        const parts = raw_conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        rows.push({
          isOpen: false,
          cells: [
            conn_date,
            ip,
            parts[9],
            parts[5],
            parts[6] === "1" ? "Yes" : "No"
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(ip, conn_date, parts) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(TextContent, null, /* @__PURE__ */ import_react40.default.createElement(Text, { component: TextVariants.h4 }, "Client Connections:", /* @__PURE__ */ import_react40.default.createElement("b", { className: "ds-left-margin" }, this.props.conns.length))), /* @__PURE__ */ import_react40.default.createElement(
        SearchInput,
        {
          className: "ds-margin-top-xlg",
          placeholder: "Search connections",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable table",
          cells: columns,
          rows: tableRows,
          onCollapse: this.handleCollapse,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react40.default.createElement(
        Pagination,
        {
          itemCount: this.props.conns.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var GlueTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        dropdownIsOpen: false,
        columns: [
          { title: "Glue Entry", transforms: [sortable, cellWidth(12)] },
          { title: "Description", transforms: [sortable] },
          { title: "Created", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      const rows = [];
      const columns = this.state.columns;
      for (const glue of this.props.glues) {
        rows.push({
          cells: [
            glue.dn,
            glue.attrs.nsds5replconflict[0],
            get_date_string(glue.attrs.createtimestamp[0])
          ]
        });
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_glues = [];
      const rows = [];
      for (const glue of this.props.glues) {
        sorted_glues.push({
          1: glue.dn,
          2: glue.attrs.nsds5replconflict[0],
          3: get_date_string(glue.attrs.createtimestamp[0])
        });
      }
      sorted_glues.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_glues.reverse();
      }
      for (const glue of sorted_glues) {
        rows.push({
          isOpen: false,
          cells: [
            glue["1"],
            glue["2"],
            glue["3"]
          ]
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Convert Glue Entry",
          onClick: (event, rowId, rowData, extra) => this.props.convertGlue(rowData.cells[0])
        },
        {
          title: "Delete Glue Entry",
          onClick: (event, rowId, rowData, extra) => this.props.deleteGlue(rowData.cells[0])
        }
      ];
    }
    render() {
      const { perPage, page, sortBy } = this.state;
      let rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      if (rows.length === 0) {
        has_rows = false;
        rows = [{ cells: ["No Glue Entries"] }];
        columns = [{ title: "Replication Conflict Glue Entries" }];
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "glue table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react40.default.createElement(
        Pagination,
        {
          itemCount: this.props.glues.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var ConflictTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Conflict DN", transforms: [sortable] },
          { title: "Description", transforms: [sortable] },
          { title: "Created", transforms: [sortable] },
          { title: "" }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getResolveButton = this.getResolveButton.bind(this);
    }
    getResolveButton(name2) {
      return /* @__PURE__ */ import_react40.default.createElement(
        Button,
        {
          id: name2,
          variant: "primary",
          isSmall: true,
          onClick: () => {
            this.props.resolveConflict(name2);
          }
        },
        "Resolve"
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const conflict of this.props.conflicts) {
        rows.push({
          isOpen: false,
          cells: [
            conflict.dn,
            conflict.attrs.nsds5replconflict[0],
            get_date_string(conflict.attrs.createtimestamp[0]),
            { title: this.getResolveButton(conflict.dn) }
          ]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Conflict Entries"] }];
        columns = [{ title: "Replication Conflict Entries" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sorted_conflicts = [];
      const rows = [];
      for (const conflict of this.props.conflicts) {
        sorted_conflicts.push({
          1: conflict.dn,
          2: conflict.attrs.nsds5replconflict[0],
          3: get_date_string(conflict.attrs.createtimestamp[0])
        });
      }
      sorted_conflicts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_conflicts.reverse();
      }
      for (const conflict of sorted_conflicts) {
        rows.push({
          isOpen: false,
          cells: [
            conflict["1"],
            conflict["2"],
            conflict["3"],
            { title: this.getResolveButton(conflict["1"]) }
          ]
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "conflict table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react40.default.createElement(
        Pagination,
        {
          itemCount: this.props.conflicts.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var DiskTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        columns: [
          { title: "Disk Partition", transforms: [sortable] },
          { title: "Disk Size", transforms: [sortable] },
          { title: "Used Space", transforms: [sortable] },
          { title: "Available Space", transforms: [sortable] }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.props.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const { columns, sortBy } = this.state;
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(Table, { "aria-label": "Sortable Table", sortBy, onSort: this.handleSort, cells: columns, rows: this.props.rows }, /* @__PURE__ */ import_react40.default.createElement(TableHeader, null), /* @__PURE__ */ import_react40.default.createElement(TableBody, null)));
    }
  };
  var ReportAliasesTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        dropdownIsOpen: false,
        columns: [
          { title: "Alias", transforms: [sortable] },
          { title: "Connection Data", transforms: [sortable] }
        ]
      };
    }
    actions() {
      return [
        {
          title: "Edit Alias",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData[0], rowData[1])
        },
        {
          title: "Delete Alias",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      let columns = this.state.columns;
      let rows = JSON.parse(JSON.stringify(this.props.rows));
      let has_rows = true;
      if (rows.length === 0) {
        has_rows = false;
        rows = [{ cells: ["No Aliases"] }];
        columns = [{ title: "Instance Aliases" }];
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(TextContent, null, /* @__PURE__ */ import_react40.default.createElement(Text, { className: "ds-center ds-margin-bottom", component: TextVariants.h4 }, "Replica Naming Aliases")), /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          variant: TableVariant.compact,
          "aria-label": "Sortable Table",
          sortBy: this.props.sortBy,
          onSort: this.props.handleSort,
          cells: columns,
          rows,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ));
    }
  };
  var ReportCredentialsTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        dropdownIsOpen: false,
        columns: [
          { title: "Connection Data", transforms: [sortable] },
          // connData
          { title: "Bind DN", transforms: [sortable] },
          // credsBinddn
          { title: "Password", transforms: [sortable] }
          // credsBindpw
        ]
      };
    }
    actions() {
      return [
        {
          title: "Edit Connection",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData.cells[0], rowData.cells[1], rowData.credsBindpw, rowData.pwInteractive)
        },
        {
          title: "Delete Connection",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData.cells[0])
        }
      ];
    }
    render() {
      let columns = this.state.columns;
      let rows = [];
      let has_rows = true;
      if (this.props.rows.length === 0) {
        has_rows = false;
        rows = [{ cells: ["No Credentials"] }];
        columns = [{ title: "Credentials Table" }];
      } else {
        for (let row of this.props.rows) {
          row = JSON.parse(JSON.stringify(row));
          const pwInteractive = row.pwInputInterractive;
          let pwField = /* @__PURE__ */ import_react40.default.createElement("i", null, "Interactive Input is set");
          if (!pwInteractive) {
            if (row.credsBindpw === "") {
              pwField = /* @__PURE__ */ import_react40.default.createElement("i", null, "Both Password or Interactive Input flag are not set");
            } else {
              pwField = "********";
            }
          }
          rows.push(
            {
              cells: [
                row.connData,
                row.credsBinddn,
                { title: pwField }
              ],
              credsBindpw: row.credsBindpw,
              pwInteractive
            }
          );
        }
      }
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react40.default.createElement(TextContent, null, /* @__PURE__ */ import_react40.default.createElement(Text, { className: "ds-center ds-margin-bottom", component: TextVariants.h4 }, "Replication Report Credentials")), /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          variant: TableVariant.compact,
          "aria-label": "Cred Table",
          sortBy: this.props.sortBy,
          onSort: this.props.handleSort,
          cells: columns,
          rows,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ));
    }
  };
  var ReportSingleTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Supplier", transforms: [sortable], cellFormatters: [expandable] },
          { title: "Agreement", transforms: [sortable] },
          { title: "Status", transforms: [sortable] },
          { title: "Lag", transforms: [sortable] }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      if (agmt["agmt-name"][0] === "-") {
        return /* @__PURE__ */ import_react40.default.createElement(TextContent, null, /* @__PURE__ */ import_react40.default.createElement(Text, { component: TextVariants.h4 }, "No agreement information"));
      }
      let replEnabled;
      if (agmt["replica-enabled"] === "off") {
        replEnabled = /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-warning-icon" }, agmt["replica-enabled"][0], " ", /* @__PURE__ */ import_react40.default.createElement(import_exclamation_triangle_icon7.ExclamationTriangleIcon, null));
      } else {
        replEnabled = agmt["replica-enabled"][0];
      }
      return /* @__PURE__ */ import_react40.default.createElement(Grid, { className: "ds-indent" }, /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Suffix & Replica ID:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt.replicaName[0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Replica Server Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt.replicaStatus[0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Replication Enabled:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, replEnabled)), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Session In Progress:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["update-in-progress"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Consumer:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt.replica[0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Changes Sent:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["number-changes-sent"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Changes Skipped:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["number-changes-skipped"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Reap Active:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["reap-active"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-init-status"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Updated Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-update-status"][0])));
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let agmtName;
      let count = 0;
      for (const replica of this.props.rows) {
        if (!("agmt-name" in replica)) {
          replica["agmt-name"] = ["-"];
        }
        if (!("replica" in replica)) {
          replica.replica = ["-"];
        }
        if (!("replica-enabled" in replica)) {
          replica["replica-enabled"] = ["-"];
        }
        if (!("replication-lag-time" in replica)) {
          replica["replication-lag-time"] = ["-"];
        }
        if (!("replication-status" in replica)) {
          replica["replication-status"] = ["-"];
        }
        if (replica["replica-enabled"][0] === "off") {
          agmtName = /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-warning-icon", title: "Agreement is disabled" }, replica["agmt-name"][0], " ", /* @__PURE__ */ import_react40.default.createElement(import_exclamation_triangle_icon7.ExclamationTriangleIcon, null));
        } else {
          agmtName = replica["agmt-name"][0];
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              replica.supplierName[0],
              { title: agmtName },
              replica["replication-status"][0],
              replica["replication-lag-time"][0]
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(replica) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Agreements"] }];
        columns = [{ title: "Replication Agreements" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows } = this.state;
      rows[rowKey].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      let count = 0;
      for (const agmt of this.props.rows) {
        sorted_agmts.push({
          agmt,
          1: agmt.supplierName[0],
          2: agmt["agmt-name"][0],
          3: ["replication-status"][0],
          4: agmt["replication-lag-time"][0],
          enabled: agmt["replica-enabled"] !== "off"
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        let agmtName;
        if (agmt["replica-enabled"] === "off") {
          agmtName = /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-warning-icon", title: "Agreement is disabled" }, agmt["agmt-name"][0], " ", /* @__PURE__ */ import_react40.default.createElement(import_exclamation_triangle_icon7.ExclamationTriangleIcon, null));
        } else {
          agmtName = agmt["agmt-name"][0];
        }
        agmt = agmt.agmt;
        rows.push({
          isOpen: false,
          cells: [
            agmt.supplierName[0],
            { title: agmtName },
            agmt["replication-status"][0],
            agmt["replication-lag-time"][0]
          ],
          enabled: agmt.enabled
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable table",
          cells: columns,
          rows,
          onCollapse: this.handleCollapse,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ));
    }
  };
  var ReportConsumersTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        rows: [],
        columns: [
          { title: "Agreement Name", transforms: [sortable], cellFormatters: [expandable] },
          { title: "Enabled", transforms: [sortable] },
          { title: "Status", transforms: [sortable] },
          { title: "Lag", transforms: [sortable] }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      let replEnabled;
      if (agmt["agmt-name"][0] === "-") {
        return /* @__PURE__ */ import_react40.default.createElement(TextContent, null, /* @__PURE__ */ import_react40.default.createElement(Text, { component: TextVariants.h4 }, "No agreement information"));
      }
      if (agmt["replica-enabled"] === "off") {
        replEnabled = /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-warning-icon" }, agmt["replica-enabled"][0], " ", /* @__PURE__ */ import_react40.default.createElement(import_exclamation_triangle_icon7.ExclamationTriangleIcon, null));
      } else {
        replEnabled = agmt["replica-enabled"][0];
      }
      return /* @__PURE__ */ import_react40.default.createElement(Grid, { className: "ds-margin-left" }, /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Suffix & Replica ID:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt.replicaName[0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Replica Server Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt.replicaStatus[0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Replication Enabled:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, replEnabled)), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Session In Progress:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["update-in-progress"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Consumer:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt.replica[0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Changes Sent:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["number-changes-sent"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Changes Skipped:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["number-changes-skipped"][0])), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Reap Active:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["reap-active"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-init-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Init Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-init-status"][0])), /* @__PURE__ */ import_react40.default.createElement("hr", null), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Updated Started:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-start"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Ended:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, get_date_string(agmt["last-update-end"][0]))), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 3 }, "Last Update Status:"), /* @__PURE__ */ import_react40.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react40.default.createElement("b", null, agmt["last-update-status"][0])));
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const replica of this.props.rows) {
        let replEnabled;
        if (!("agmt-name" in replica)) {
          replica["agmt-name"] = ["-"];
        }
        if (!("replica-enabled" in replica)) {
          replica["replica-enabled"] = ["-"];
        }
        if (!("replication-lag-time" in replica)) {
          replica["replication-lag-time"] = ["-"];
        }
        if (!("replication-status" in replica)) {
          replica["replication-status"] = ["-"];
        }
        if (replica["replica-enabled"] === "off") {
          replEnabled = /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-warning-icon", title: "Agreement is disabled" }, replica["replica-enabled"][0], " ", /* @__PURE__ */ import_react40.default.createElement(import_exclamation_triangle_icon7.ExclamationTriangleIcon, null));
        } else {
          replEnabled = replica["replica-enabled"][0];
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              replica["agmt-name"][0],
              { title: replEnabled },
              replica["replication-status"][0],
              replica["replication-lag-time"][0]
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(replica) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Agreements"] }];
        columns = [{ title: "Replication Agreements" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows } = this.state;
      rows[rowKey].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      let count = 0;
      for (const agmt of this.props.rows) {
        sorted_agmts.push({
          agmt,
          1: agmt["agmt-name"][0],
          2: agmt["agmt-enabled"][0],
          3: agmt["replication-status"][0],
          4: agmt["replication-lag-time"][0]
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        let replEnabled;
        agmt = agmt.agmt;
        if (agmt["replica-enabled"] === "off") {
          replEnabled = /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-warning-icon", title: "Agreement is disabled" }, agmt["replica-enabled"][0], " ", /* @__PURE__ */ import_react40.default.createElement(import_exclamation_triangle_icon7.ExclamationTriangleIcon, null));
        } else {
          replEnabled = agmt["replica-enabled"][0];
        }
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            { title: replEnabled },
            agmt["replication-status"][0],
            agmt["replication-lag-time"][0]
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable consumer table",
          cells: columns,
          rows,
          onCollapse: this.handleCollapse,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ));
    }
  };
  var ReplDSRCTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        columns: [
          { title: "Name", transforms: [sortable] },
          { title: "Connection Data", transforms: [sortable] },
          { title: "Bind DN", transforms: [sortable] },
          { title: "Password", transforms: [sortable] },
          { title: "" }
        ],
        rows: []
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let columns = [...this.state.columns];
      let rows = [];
      for (const conn of this.props.rows) {
        let cred = conn[4];
        if (conn[4] === "*") {
          const desc = /* @__PURE__ */ import_react40.default.createElement("i", null, "Prompt");
          cred = { title: desc };
        } else if (!conn[4].startsWith("[")) {
          cred = "**********";
        }
        rows.push({
          cells: [
            conn[0],
            conn[1] + ":" + conn[2],
            conn[3],
            cred,
            { props: { textCenter: true }, title: this.props.getDeleteButton(conn[0]) }
          ]
        });
      }
      if (this.props.rows.length === 0) {
        rows = [{ cells: ["There is no saved replication monitor connections"] }];
        columns = [{ title: "Replication Connections" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [...this.state.rows];
      const sortedRows = rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          "aria-label": "Sortable DSRC Table",
          sortBy,
          onSort: this.handleSort,
          cells: columns,
          rows,
          variant: TableVariant.compact
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ));
    }
  };
  var ReplDSRCAliasTable = class extends import_react40.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        columns: [
          { title: "Alias", transforms: [sortable] },
          { title: "Connection Data", transforms: [sortable] },
          { title: "" }
        ],
        rows: []
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let columns = [...this.state.columns];
      let rows = [];
      for (const alias of this.props.rows) {
        rows.push({
          cells: [
            alias[0],
            alias[1] + ":" + alias[2],
            { props: { textCenter: true }, title: this.props.getDeleteButton(alias[0]) }
          ]
        });
      }
      if (this.props.rows.length === 0) {
        rows = [{ cells: ["There are no saved replication monitor aliases"] }];
        columns = [{ title: "Replication Monitoring Aliases" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [...this.state.rows];
      const sortedRows = rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ import_react40.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react40.default.createElement(
        Table,
        {
          "aria-label": "Sortable DSRC Table",
          sortBy,
          onSort: this.handleSort,
          cells: columns,
          rows,
          variant: TableVariant.compact
        },
        /* @__PURE__ */ import_react40.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react40.default.createElement(TableBody, null)
      ));
    }
  };
  ReplDSRCAliasTable.defaultProps = {
    rows: import_prop_types35.default.array
  };
  ReplDSRCAliasTable.defaultProps = {
    rows: []
  };
  ReplDSRCTable.defaultProps = {
    rows: import_prop_types35.default.array
  };
  ReplDSRCTable.defaultProps = {
    rows: []
  };
  AgmtTable.propTypes = {
    agmts: import_prop_types35.default.array,
    handlePokeAgmt: import_prop_types35.default.func
  };
  AgmtTable.defaultProps = {
    agmts: []
  };
  WinsyncAgmtTable.propTypes = {
    agmts: import_prop_types35.default.array,
    handlePokeAgmt: import_prop_types35.default.func
  };
  WinsyncAgmtTable.defaultProps = {
    agmts: []
  };
  ConnectionTable.propTypes = {
    conns: import_prop_types35.default.array
  };
  ConnectionTable.defaultProps = {
    conns: []
  };
  CleanALLRUVTable.propTypes = {
    tasks: import_prop_types35.default.array
  };
  CleanALLRUVTable.defaultProps = {
    tasks: []
  };
  AbortCleanALLRUVTable.propTypes = {
    tasks: import_prop_types35.default.array
  };
  AbortCleanALLRUVTable.defaultProps = {
    tasks: []
  };
  ConflictTable.propTypes = {
    conflicts: import_prop_types35.default.array,
    resolveConflict: import_prop_types35.default.func
  };
  ConflictTable.defaultProps = {
    conflicts: []
  };
  GlueTable.propTypes = {
    glues: import_prop_types35.default.array,
    convertGlue: import_prop_types35.default.func,
    deleteGlue: import_prop_types35.default.func
  };
  GlueTable.defaultProps = {
    glues: import_prop_types35.default.array
  };
  ReportCredentialsTable.propTypes = {
    rows: import_prop_types35.default.array,
    editConfig: import_prop_types35.default.func,
    deleteConfig: import_prop_types35.default.func
  };
  ReportCredentialsTable.defaultProps = {
    rows: []
  };
  ReportAliasesTable.propTypes = {
    rows: import_prop_types35.default.array,
    editConfig: import_prop_types35.default.func,
    deleteConfig: import_prop_types35.default.func
  };
  ReportAliasesTable.defaultProps = {
    rows: []
  };
  ReportConsumersTable.propTypes = {
    rows: import_prop_types35.default.array
  };
  ReportConsumersTable.defaultProps = {
    rows: []
  };
  ReportSingleTable.propTypes = {
    rows: import_prop_types35.default.array
  };
  ReportSingleTable.defaultProps = {
    rows: []
  };
  DiskTable.defaultProps = {
    rows: import_prop_types35.default.array
  };
  DiskTable.defaultProps = {
    rows: []
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/Chart/Chart.js
  init_tslib_es6();
  var React311 = __toESM(require_react());
  var import_hoist_non_react_statics5 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_Margin.js
  var chart_legend_Margin = {
    "name": "--pf-chart-legend--Margin",
    "value": 16,
    "var": "var(--pf-chart-legend--Margin, 16)"
  };
  var chart_legend_Margin_default = chart_legend_Margin;

  // node_modules/victory-chart/es/victory-chart.js
  var import_isEmpty8 = __toESM(require_isEmpty());
  var import_assign25 = __toESM(require_assign());
  var import_defaults18 = __toESM(require_defaults());
  var import_prop_types55 = __toESM(require_prop_types());
  var import_react75 = __toESM(require_react());

  // node_modules/victory-core/es/victory-animation/victory-animation.js
  var import_react42 = __toESM(require_react());
  var import_prop_types36 = __toESM(require_prop_types());

  // node_modules/victory-vendor/es/d3-ease.js
  var d3_ease_exports = {};
  __export(d3_ease_exports, {
    easeBack: () => backInOut,
    easeBackIn: () => backIn,
    easeBackInOut: () => backInOut,
    easeBackOut: () => backOut,
    easeBounce: () => bounceOut,
    easeBounceIn: () => bounceIn,
    easeBounceInOut: () => bounceInOut,
    easeBounceOut: () => bounceOut,
    easeCircle: () => circleInOut,
    easeCircleIn: () => circleIn,
    easeCircleInOut: () => circleInOut,
    easeCircleOut: () => circleOut,
    easeCubic: () => cubicInOut,
    easeCubicIn: () => cubicIn,
    easeCubicInOut: () => cubicInOut,
    easeCubicOut: () => cubicOut,
    easeElastic: () => elasticOut,
    easeElasticIn: () => elasticIn,
    easeElasticInOut: () => elasticInOut,
    easeElasticOut: () => elasticOut,
    easeExp: () => expInOut,
    easeExpIn: () => expIn,
    easeExpInOut: () => expInOut,
    easeExpOut: () => expOut,
    easeLinear: () => linear,
    easePoly: () => polyInOut,
    easePolyIn: () => polyIn,
    easePolyInOut: () => polyInOut,
    easePolyOut: () => polyOut,
    easeQuad: () => quadInOut,
    easeQuadIn: () => quadIn,
    easeQuadInOut: () => quadInOut,
    easeQuadOut: () => quadOut,
    easeSin: () => sinInOut,
    easeSinIn: () => sinIn,
    easeSinInOut: () => sinInOut,
    easeSinOut: () => sinOut
  });

  // node_modules/d3-ease/src/linear.js
  var linear = (t) => +t;

  // node_modules/d3-ease/src/quad.js
  function quadIn(t) {
    return t * t;
  }
  function quadOut(t) {
    return t * (2 - t);
  }
  function quadInOut(t) {
    return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
  }

  // node_modules/d3-ease/src/cubic.js
  function cubicIn(t) {
    return t * t * t;
  }
  function cubicOut(t) {
    return --t * t * t + 1;
  }
  function cubicInOut(t) {
    return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
  }

  // node_modules/d3-ease/src/poly.js
  var exponent = 3;
  var polyIn = function custom(e) {
    e = +e;
    function polyIn2(t) {
      return Math.pow(t, e);
    }
    polyIn2.exponent = custom;
    return polyIn2;
  }(exponent);
  var polyOut = function custom2(e) {
    e = +e;
    function polyOut2(t) {
      return 1 - Math.pow(1 - t, e);
    }
    polyOut2.exponent = custom2;
    return polyOut2;
  }(exponent);
  var polyInOut = function custom3(e) {
    e = +e;
    function polyInOut2(t) {
      return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
    }
    polyInOut2.exponent = custom3;
    return polyInOut2;
  }(exponent);

  // node_modules/d3-ease/src/sin.js
  var pi = Math.PI;
  var halfPi = pi / 2;
  function sinIn(t) {
    return +t === 1 ? 1 : 1 - Math.cos(t * halfPi);
  }
  function sinOut(t) {
    return Math.sin(t * halfPi);
  }
  function sinInOut(t) {
    return (1 - Math.cos(pi * t)) / 2;
  }

  // node_modules/d3-ease/src/math.js
  function tpmt(x2) {
    return (Math.pow(2, -10 * x2) - 9765625e-10) * 1.0009775171065494;
  }

  // node_modules/d3-ease/src/exp.js
  function expIn(t) {
    return tpmt(1 - +t);
  }
  function expOut(t) {
    return 1 - tpmt(t);
  }
  function expInOut(t) {
    return ((t *= 2) <= 1 ? tpmt(1 - t) : 2 - tpmt(t - 1)) / 2;
  }

  // node_modules/d3-ease/src/circle.js
  function circleIn(t) {
    return 1 - Math.sqrt(1 - t * t);
  }
  function circleOut(t) {
    return Math.sqrt(1 - --t * t);
  }
  function circleInOut(t) {
    return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
  }

  // node_modules/d3-ease/src/bounce.js
  var b1 = 4 / 11;
  var b2 = 6 / 11;
  var b3 = 8 / 11;
  var b4 = 3 / 4;
  var b5 = 9 / 11;
  var b6 = 10 / 11;
  var b7 = 15 / 16;
  var b8 = 21 / 22;
  var b9 = 63 / 64;
  var b0 = 1 / b1 / b1;
  function bounceIn(t) {
    return 1 - bounceOut(1 - t);
  }
  function bounceOut(t) {
    return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
  }
  function bounceInOut(t) {
    return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
  }

  // node_modules/d3-ease/src/back.js
  var overshoot = 1.70158;
  var backIn = function custom4(s2) {
    s2 = +s2;
    function backIn2(t) {
      return (t = +t) * t * (s2 * (t - 1) + t);
    }
    backIn2.overshoot = custom4;
    return backIn2;
  }(overshoot);
  var backOut = function custom5(s2) {
    s2 = +s2;
    function backOut2(t) {
      return --t * t * ((t + 1) * s2 + t) + 1;
    }
    backOut2.overshoot = custom5;
    return backOut2;
  }(overshoot);
  var backInOut = function custom6(s2) {
    s2 = +s2;
    function backInOut2(t) {
      return ((t *= 2) < 1 ? t * t * ((s2 + 1) * t - s2) : (t -= 2) * t * ((s2 + 1) * t + s2) + 2) / 2;
    }
    backInOut2.overshoot = custom6;
    return backInOut2;
  }(overshoot);

  // node_modules/d3-ease/src/elastic.js
  var tau = 2 * Math.PI;
  var amplitude = 1;
  var period = 0.3;
  var elasticIn = function custom7(a2, p2) {
    var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p2 /= tau);
    function elasticIn2(t) {
      return a2 * tpmt(- --t) * Math.sin((s2 - t) / p2);
    }
    elasticIn2.amplitude = function(a3) {
      return custom7(a3, p2 * tau);
    };
    elasticIn2.period = function(p3) {
      return custom7(a2, p3);
    };
    return elasticIn2;
  }(amplitude, period);
  var elasticOut = function custom8(a2, p2) {
    var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p2 /= tau);
    function elasticOut2(t) {
      return 1 - a2 * tpmt(t = +t) * Math.sin((t + s2) / p2);
    }
    elasticOut2.amplitude = function(a3) {
      return custom8(a3, p2 * tau);
    };
    elasticOut2.period = function(p3) {
      return custom8(a2, p3);
    };
    return elasticOut2;
  }(amplitude, period);
  var elasticInOut = function custom9(a2, p2) {
    var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p2 /= tau);
    function elasticInOut2(t) {
      return ((t = t * 2 - 1) < 0 ? a2 * tpmt(-t) * Math.sin((s2 - t) / p2) : 2 - a2 * tpmt(t) * Math.sin((s2 + t) / p2)) / 2;
    }
    elasticInOut2.amplitude = function(a3) {
      return custom9(a3, p2 * tau);
    };
    elasticInOut2.period = function(p3) {
      return custom9(a2, p3);
    };
    return elasticInOut2;
  }(amplitude, period);

  // node_modules/victory-core/es/victory-animation/util.js
  var import_orderBy = __toESM(require_orderBy());
  var import_isPlainObject = __toESM(require_isPlainObject());

  // node_modules/d3-color/src/define.js
  function define_default(constructor, factory2, prototype) {
    constructor.prototype = factory2.prototype = prototype;
    prototype.constructor = constructor;
  }
  function extend(parent, definition) {
    var prototype = Object.create(parent.prototype);
    for (var key in definition)
      prototype[key] = definition[key];
    return prototype;
  }

  // node_modules/d3-color/src/color.js
  function Color() {
  }
  var darker = 0.7;
  var brighter = 1 / darker;
  var reI = "\\s*([+-]?\\d+)\\s*";
  var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
  var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
  var reHex = /^#([0-9a-f]{3,8})$/;
  var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`);
  var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`);
  var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`);
  var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`);
  var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`);
  var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
  var named = {
    aliceblue: 15792383,
    antiquewhite: 16444375,
    aqua: 65535,
    aquamarine: 8388564,
    azure: 15794175,
    beige: 16119260,
    bisque: 16770244,
    black: 0,
    blanchedalmond: 16772045,
    blue: 255,
    blueviolet: 9055202,
    brown: 10824234,
    burlywood: 14596231,
    cadetblue: 6266528,
    chartreuse: 8388352,
    chocolate: 13789470,
    coral: 16744272,
    cornflowerblue: 6591981,
    cornsilk: 16775388,
    crimson: 14423100,
    cyan: 65535,
    darkblue: 139,
    darkcyan: 35723,
    darkgoldenrod: 12092939,
    darkgray: 11119017,
    darkgreen: 25600,
    darkgrey: 11119017,
    darkkhaki: 12433259,
    darkmagenta: 9109643,
    darkolivegreen: 5597999,
    darkorange: 16747520,
    darkorchid: 10040012,
    darkred: 9109504,
    darksalmon: 15308410,
    darkseagreen: 9419919,
    darkslateblue: 4734347,
    darkslategray: 3100495,
    darkslategrey: 3100495,
    darkturquoise: 52945,
    darkviolet: 9699539,
    deeppink: 16716947,
    deepskyblue: 49151,
    dimgray: 6908265,
    dimgrey: 6908265,
    dodgerblue: 2003199,
    firebrick: 11674146,
    floralwhite: 16775920,
    forestgreen: 2263842,
    fuchsia: 16711935,
    gainsboro: 14474460,
    ghostwhite: 16316671,
    gold: 16766720,
    goldenrod: 14329120,
    gray: 8421504,
    green: 32768,
    greenyellow: 11403055,
    grey: 8421504,
    honeydew: 15794160,
    hotpink: 16738740,
    indianred: 13458524,
    indigo: 4915330,
    ivory: 16777200,
    khaki: 15787660,
    lavender: 15132410,
    lavenderblush: 16773365,
    lawngreen: 8190976,
    lemonchiffon: 16775885,
    lightblue: 11393254,
    lightcoral: 15761536,
    lightcyan: 14745599,
    lightgoldenrodyellow: 16448210,
    lightgray: 13882323,
    lightgreen: 9498256,
    lightgrey: 13882323,
    lightpink: 16758465,
    lightsalmon: 16752762,
    lightseagreen: 2142890,
    lightskyblue: 8900346,
    lightslategray: 7833753,
    lightslategrey: 7833753,
    lightsteelblue: 11584734,
    lightyellow: 16777184,
    lime: 65280,
    limegreen: 3329330,
    linen: 16445670,
    magenta: 16711935,
    maroon: 8388608,
    mediumaquamarine: 6737322,
    mediumblue: 205,
    mediumorchid: 12211667,
    mediumpurple: 9662683,
    mediumseagreen: 3978097,
    mediumslateblue: 8087790,
    mediumspringgreen: 64154,
    mediumturquoise: 4772300,
    mediumvioletred: 13047173,
    midnightblue: 1644912,
    mintcream: 16121850,
    mistyrose: 16770273,
    moccasin: 16770229,
    navajowhite: 16768685,
    navy: 128,
    oldlace: 16643558,
    olive: 8421376,
    olivedrab: 7048739,
    orange: 16753920,
    orangered: 16729344,
    orchid: 14315734,
    palegoldenrod: 15657130,
    palegreen: 10025880,
    paleturquoise: 11529966,
    palevioletred: 14381203,
    papayawhip: 16773077,
    peachpuff: 16767673,
    peru: 13468991,
    pink: 16761035,
    plum: 14524637,
    powderblue: 11591910,
    purple: 8388736,
    rebeccapurple: 6697881,
    red: 16711680,
    rosybrown: 12357519,
    royalblue: 4286945,
    saddlebrown: 9127187,
    salmon: 16416882,
    sandybrown: 16032864,
    seagreen: 3050327,
    seashell: 16774638,
    sienna: 10506797,
    silver: 12632256,
    skyblue: 8900331,
    slateblue: 6970061,
    slategray: 7372944,
    slategrey: 7372944,
    snow: 16775930,
    springgreen: 65407,
    steelblue: 4620980,
    tan: 13808780,
    teal: 32896,
    thistle: 14204888,
    tomato: 16737095,
    turquoise: 4251856,
    violet: 15631086,
    wheat: 16113331,
    white: 16777215,
    whitesmoke: 16119285,
    yellow: 16776960,
    yellowgreen: 10145074
  };
  define_default(Color, color, {
    copy(channels) {
      return Object.assign(new this.constructor(), this, channels);
    },
    displayable() {
      return this.rgb().displayable();
    },
    hex: color_formatHex,
    // Deprecated! Use color.formatHex.
    formatHex: color_formatHex,
    formatHex8: color_formatHex8,
    formatHsl: color_formatHsl,
    formatRgb: color_formatRgb,
    toString: color_formatRgb
  });
  function color_formatHex() {
    return this.rgb().formatHex();
  }
  function color_formatHex8() {
    return this.rgb().formatHex8();
  }
  function color_formatHsl() {
    return hslConvert(this).formatHsl();
  }
  function color_formatRgb() {
    return this.rgb().formatRgb();
  }
  function color(format2) {
    var m, l;
    format2 = (format2 + "").trim().toLowerCase();
    return (m = reHex.exec(format2)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format2)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format2)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format2)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format2)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
  }
  function rgbn(n) {
    return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
  }
  function rgba(r, g, b, a2) {
    if (a2 <= 0)
      r = g = b = NaN;
    return new Rgb(r, g, b, a2);
  }
  function rgbConvert(o) {
    if (!(o instanceof Color))
      o = color(o);
    if (!o)
      return new Rgb();
    o = o.rgb();
    return new Rgb(o.r, o.g, o.b, o.opacity);
  }
  function rgb(r, g, b, opacity) {
    return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
  }
  function Rgb(r, g, b, opacity) {
    this.r = +r;
    this.g = +g;
    this.b = +b;
    this.opacity = +opacity;
  }
  define_default(Rgb, rgb, extend(Color, {
    brighter(k2) {
      k2 = k2 == null ? brighter : Math.pow(brighter, k2);
      return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
    },
    darker(k2) {
      k2 = k2 == null ? darker : Math.pow(darker, k2);
      return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
    },
    rgb() {
      return this;
    },
    clamp() {
      return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
    },
    displayable() {
      return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
    },
    hex: rgb_formatHex,
    // Deprecated! Use color.formatHex.
    formatHex: rgb_formatHex,
    formatHex8: rgb_formatHex8,
    formatRgb: rgb_formatRgb,
    toString: rgb_formatRgb
  }));
  function rgb_formatHex() {
    return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
  }
  function rgb_formatHex8() {
    return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
  }
  function rgb_formatRgb() {
    const a2 = clampa(this.opacity);
    return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
  }
  function clampa(opacity) {
    return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
  }
  function clampi(value) {
    return Math.max(0, Math.min(255, Math.round(value) || 0));
  }
  function hex(value) {
    value = clampi(value);
    return (value < 16 ? "0" : "") + value.toString(16);
  }
  function hsla(h, s2, l, a2) {
    if (a2 <= 0)
      h = s2 = l = NaN;
    else if (l <= 0 || l >= 1)
      h = s2 = NaN;
    else if (s2 <= 0)
      h = NaN;
    return new Hsl(h, s2, l, a2);
  }
  function hslConvert(o) {
    if (o instanceof Hsl)
      return new Hsl(o.h, o.s, o.l, o.opacity);
    if (!(o instanceof Color))
      o = color(o);
    if (!o)
      return new Hsl();
    if (o instanceof Hsl)
      return o;
    o = o.rgb();
    var r = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r, g, b), max3 = Math.max(r, g, b), h = NaN, s2 = max3 - min3, l = (max3 + min3) / 2;
    if (s2) {
      if (r === max3)
        h = (g - b) / s2 + (g < b) * 6;
      else if (g === max3)
        h = (b - r) / s2 + 2;
      else
        h = (r - g) / s2 + 4;
      s2 /= l < 0.5 ? max3 + min3 : 2 - max3 - min3;
      h *= 60;
    } else {
      s2 = l > 0 && l < 1 ? 0 : h;
    }
    return new Hsl(h, s2, l, o.opacity);
  }
  function hsl(h, s2, l, opacity) {
    return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity == null ? 1 : opacity);
  }
  function Hsl(h, s2, l, opacity) {
    this.h = +h;
    this.s = +s2;
    this.l = +l;
    this.opacity = +opacity;
  }
  define_default(Hsl, hsl, extend(Color, {
    brighter(k2) {
      k2 = k2 == null ? brighter : Math.pow(brighter, k2);
      return new Hsl(this.h, this.s, this.l * k2, this.opacity);
    },
    darker(k2) {
      k2 = k2 == null ? darker : Math.pow(darker, k2);
      return new Hsl(this.h, this.s, this.l * k2, this.opacity);
    },
    rgb() {
      var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2;
      return new Rgb(
        hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
        hsl2rgb(h, m1, m2),
        hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
        this.opacity
      );
    },
    clamp() {
      return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
    },
    displayable() {
      return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
    },
    formatHsl() {
      const a2 = clampa(this.opacity);
      return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
    }
  }));
  function clamph(value) {
    value = (value || 0) % 360;
    return value < 0 ? value + 360 : value;
  }
  function clampt(value) {
    return Math.max(0, Math.min(1, value || 0));
  }
  function hsl2rgb(h, m1, m2) {
    return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
  }

  // node_modules/d3-interpolate/src/basis.js
  function basis(t12, v0, v1, v2, v3) {
    var t2 = t12 * t12, t3 = t2 * t12;
    return ((1 - 3 * t12 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t12 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
  }
  function basis_default(values) {
    var n = values.length - 1;
    return function(t) {
      var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), v1 = values[i], v2 = values[i + 1], v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
      return basis((t - i / n) * n, v0, v1, v2, v3);
    };
  }

  // node_modules/d3-interpolate/src/basisClosed.js
  function basisClosed_default(values) {
    var n = values.length;
    return function(t) {
      var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), v0 = values[(i + n - 1) % n], v1 = values[i % n], v2 = values[(i + 1) % n], v3 = values[(i + 2) % n];
      return basis((t - i / n) * n, v0, v1, v2, v3);
    };
  }

  // node_modules/d3-interpolate/src/constant.js
  var constant_default = (x2) => () => x2;

  // node_modules/d3-interpolate/src/color.js
  function linear2(a2, d) {
    return function(t) {
      return a2 + t * d;
    };
  }
  function exponential(a2, b, y2) {
    return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t) {
      return Math.pow(a2 + t * b, y2);
    };
  }
  function gamma(y2) {
    return (y2 = +y2) === 1 ? nogamma : function(a2, b) {
      return b - a2 ? exponential(a2, b, y2) : constant_default(isNaN(a2) ? b : a2);
    };
  }
  function nogamma(a2, b) {
    var d = b - a2;
    return d ? linear2(a2, d) : constant_default(isNaN(a2) ? b : a2);
  }

  // node_modules/d3-interpolate/src/rgb.js
  var rgb_default = function rgbGamma(y2) {
    var color2 = gamma(y2);
    function rgb2(start2, end2) {
      var r = color2((start2 = rgb(start2)).r, (end2 = rgb(end2)).r), g = color2(start2.g, end2.g), b = color2(start2.b, end2.b), opacity = nogamma(start2.opacity, end2.opacity);
      return function(t) {
        start2.r = r(t);
        start2.g = g(t);
        start2.b = b(t);
        start2.opacity = opacity(t);
        return start2 + "";
      };
    }
    rgb2.gamma = rgbGamma;
    return rgb2;
  }(1);
  function rgbSpline(spline) {
    return function(colors3) {
      var n = colors3.length, r = new Array(n), g = new Array(n), b = new Array(n), i, color2;
      for (i = 0; i < n; ++i) {
        color2 = rgb(colors3[i]);
        r[i] = color2.r || 0;
        g[i] = color2.g || 0;
        b[i] = color2.b || 0;
      }
      r = spline(r);
      g = spline(g);
      b = spline(b);
      color2.opacity = 1;
      return function(t) {
        color2.r = r(t);
        color2.g = g(t);
        color2.b = b(t);
        return color2 + "";
      };
    };
  }
  var rgbBasis = rgbSpline(basis_default);
  var rgbBasisClosed = rgbSpline(basisClosed_default);

  // node_modules/d3-interpolate/src/numberArray.js
  function numberArray_default(a2, b) {
    if (!b)
      b = [];
    var n = a2 ? Math.min(b.length, a2.length) : 0, c2 = b.slice(), i;
    return function(t) {
      for (i = 0; i < n; ++i)
        c2[i] = a2[i] * (1 - t) + b[i] * t;
      return c2;
    };
  }
  function isNumberArray(x2) {
    return ArrayBuffer.isView(x2) && !(x2 instanceof DataView);
  }

  // node_modules/d3-interpolate/src/array.js
  function genericArray(a2, b) {
    var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c2 = new Array(nb), i;
    for (i = 0; i < na; ++i)
      x2[i] = value_default(a2[i], b[i]);
    for (; i < nb; ++i)
      c2[i] = b[i];
    return function(t) {
      for (i = 0; i < na; ++i)
        c2[i] = x2[i](t);
      return c2;
    };
  }

  // node_modules/d3-interpolate/src/date.js
  function date_default(a2, b) {
    var d = /* @__PURE__ */ new Date();
    return a2 = +a2, b = +b, function(t) {
      return d.setTime(a2 * (1 - t) + b * t), d;
    };
  }

  // node_modules/d3-interpolate/src/number.js
  function number_default(a2, b) {
    return a2 = +a2, b = +b, function(t) {
      return a2 * (1 - t) + b * t;
    };
  }

  // node_modules/d3-interpolate/src/object.js
  function object_default(a2, b) {
    var i = {}, c2 = {}, k2;
    if (a2 === null || typeof a2 !== "object")
      a2 = {};
    if (b === null || typeof b !== "object")
      b = {};
    for (k2 in b) {
      if (k2 in a2) {
        i[k2] = value_default(a2[k2], b[k2]);
      } else {
        c2[k2] = b[k2];
      }
    }
    return function(t) {
      for (k2 in i)
        c2[k2] = i[k2](t);
      return c2;
    };
  }

  // node_modules/d3-interpolate/src/string.js
  var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
  var reB = new RegExp(reA.source, "g");
  function zero(b) {
    return function() {
      return b;
    };
  }
  function one(b) {
    return function(t) {
      return b(t) + "";
    };
  }
  function string_default(a2, b) {
    var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s2 = [], q = [];
    a2 = a2 + "", b = b + "";
    while ((am = reA.exec(a2)) && (bm = reB.exec(b))) {
      if ((bs = bm.index) > bi) {
        bs = b.slice(bi, bs);
        if (s2[i])
          s2[i] += bs;
        else
          s2[++i] = bs;
      }
      if ((am = am[0]) === (bm = bm[0])) {
        if (s2[i])
          s2[i] += bm;
        else
          s2[++i] = bm;
      } else {
        s2[++i] = null;
        q.push({ i, x: number_default(am, bm) });
      }
      bi = reB.lastIndex;
    }
    if (bi < b.length) {
      bs = b.slice(bi);
      if (s2[i])
        s2[i] += bs;
      else
        s2[++i] = bs;
    }
    return s2.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
      for (var i2 = 0, o; i2 < b; ++i2)
        s2[(o = q[i2]).i] = o.x(t);
      return s2.join("");
    });
  }

  // node_modules/d3-interpolate/src/value.js
  function value_default(a2, b) {
    var t = typeof b, c2;
    return b == null || t === "boolean" ? constant_default(b) : (t === "number" ? number_default : t === "string" ? (c2 = color(b)) ? (b = c2, rgb_default) : string_default : b instanceof color ? rgb_default : b instanceof Date ? date_default : isNumberArray(b) ? numberArray_default : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object_default : number_default)(a2, b);
  }

  // node_modules/d3-interpolate/src/round.js
  function round_default(a2, b) {
    return a2 = +a2, b = +b, function(t) {
      return Math.round(a2 * (1 - t) + b * t);
    };
  }

  // node_modules/d3-interpolate/src/piecewise.js
  function piecewise(interpolate, values) {
    if (values === void 0)
      values = interpolate, interpolate = value_default;
    var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
    while (i < n)
      I[i] = interpolate(v, v = values[++i]);
    return function(t) {
      var i2 = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
      return I[i2](t - i2);
    };
  }

  // node_modules/victory-core/es/victory-animation/util.js
  var isInterpolatable = function(obj) {
    if (obj !== null) {
      switch (typeof obj) {
        case "undefined":
          return false;
        case "number":
          return !isNaN(obj) && obj !== Number.POSITIVE_INFINITY && obj !== Number.NEGATIVE_INFINITY;
        case "string":
          return true;
        case "boolean":
          return false;
        case "object":
          return obj instanceof Date || Array.isArray(obj) || (0, import_isPlainObject.default)(obj);
        case "function":
          return true;
      }
    }
    return false;
  };
  var interpolateImmediate = function(a2, b) {
    var when = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
    return function(t) {
      return t < when ? a2 : b;
    };
  };
  var interpolateFunction = function(a2, b) {
    return function(t) {
      if (t >= 1) {
        return b;
      }
      return function() {
        var aval = typeof a2 === "function" ? a2.apply(this, arguments) : a2;
        var bval = typeof b === "function" ? b.apply(this, arguments) : b;
        return value_default(aval, bval)(t);
      };
    };
  };
  var interpolateObject = function(a2, b) {
    var interpolateTypes = function(x2, y2) {
      if (x2 === y2 || !isInterpolatable(x2) || !isInterpolatable(y2)) {
        return interpolateImmediate(x2, y2);
      }
      if (typeof x2 === "function" || typeof y2 === "function") {
        return interpolateFunction(x2, y2);
      }
      if (typeof x2 === "object" && (0, import_isPlainObject.default)(x2) || typeof y2 === "object" && (0, import_isPlainObject.default)(y2)) {
        return interpolateObject(x2, y2);
      }
      return value_default(x2, y2);
    };
    var keyData = function(val) {
      return Array.isArray(val) ? (0, import_orderBy.default)(val, "key") : val;
    };
    var i = {};
    var c2 = {};
    var k2;
    if (a2 === null || typeof a2 !== "object") {
      a2 = {};
    }
    if (b === null || typeof b !== "object") {
      b = {};
    }
    for (k2 in b) {
      if (k2 in a2) {
        i[k2] = interpolateTypes(keyData(a2[k2]), keyData(b[k2]));
      } else {
        c2[k2] = b[k2];
      }
    }
    return function(t) {
      for (k2 in i) {
        c2[k2] = i[k2](t);
      }
      return c2;
    };
  };
  var interpolateString = function(a2, b) {
    var format2 = function(val) {
      return typeof val === "string" ? val.replace(/,/g, "") : val;
    };
    return value_default(format2(a2), format2(b));
  };
  var victoryInterpolator = function(a2, b) {
    if (a2 === b || !isInterpolatable(a2) || !isInterpolatable(b)) {
      return interpolateImmediate(a2, b);
    }
    if (typeof a2 === "function" || typeof b === "function") {
      return interpolateFunction(a2, b);
    }
    if ((0, import_isPlainObject.default)(a2) || (0, import_isPlainObject.default)(b)) {
      return interpolateObject(a2, b);
    }
    if (typeof a2 === "string" || typeof b === "string") {
      return interpolateString(a2, b);
    }
    return value_default(a2, b);
  };

  // node_modules/victory-core/es/victory-util/timer-context.js
  var import_react41 = __toESM(require_react());

  // node_modules/d3-timer/src/timer.js
  var frame = 0;
  var timeout = 0;
  var interval = 0;
  var pokeDelay = 1e3;
  var taskHead;
  var taskTail;
  var clockLast = 0;
  var clockNow = 0;
  var clockSkew = 0;
  var clock = typeof performance === "object" && performance.now ? performance : Date;
  var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
    setTimeout(f, 17);
  };
  function now() {
    return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
  }
  function clearNow() {
    clockNow = 0;
  }
  function Timer() {
    this._call = this._time = this._next = null;
  }
  Timer.prototype = timer.prototype = {
    constructor: Timer,
    restart: function(callback, delay3, time2) {
      if (typeof callback !== "function")
        throw new TypeError("callback is not a function");
      time2 = (time2 == null ? now() : +time2) + (delay3 == null ? 0 : +delay3);
      if (!this._next && taskTail !== this) {
        if (taskTail)
          taskTail._next = this;
        else
          taskHead = this;
        taskTail = this;
      }
      this._call = callback;
      this._time = time2;
      sleep();
    },
    stop: function() {
      if (this._call) {
        this._call = null;
        this._time = Infinity;
        sleep();
      }
    }
  };
  function timer(callback, delay3, time2) {
    var t = new Timer();
    t.restart(callback, delay3, time2);
    return t;
  }
  function timerFlush() {
    now();
    ++frame;
    var t = taskHead, e;
    while (t) {
      if ((e = clockNow - t._time) >= 0)
        t._call.call(void 0, e);
      t = t._next;
    }
    --frame;
  }
  function wake() {
    clockNow = (clockLast = clock.now()) + clockSkew;
    frame = timeout = 0;
    try {
      timerFlush();
    } finally {
      frame = 0;
      nap();
      clockNow = 0;
    }
  }
  function poke() {
    var now2 = clock.now(), delay3 = now2 - clockLast;
    if (delay3 > pokeDelay)
      clockSkew -= delay3, clockLast = now2;
  }
  function nap() {
    var t02, t12 = taskHead, t2, time2 = Infinity;
    while (t12) {
      if (t12._call) {
        if (time2 > t12._time)
          time2 = t12._time;
        t02 = t12, t12 = t12._next;
      } else {
        t2 = t12._next, t12._next = null;
        t12 = t02 ? t02._next = t2 : taskHead = t2;
      }
    }
    taskTail = t02;
    sleep(time2);
  }
  function sleep(time2) {
    if (frame)
      return;
    if (timeout)
      timeout = clearTimeout(timeout);
    var delay3 = time2 - clockNow;
    if (delay3 > 24) {
      if (time2 < Infinity)
        timeout = setTimeout(wake, time2 - clock.now() - clockSkew);
      if (interval)
        interval = clearInterval(interval);
    } else {
      if (!interval)
        clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
      frame = 1, setFrame(wake);
    }
  }

  // node_modules/victory-core/es/victory-util/timer.js
  function _classCallCheck3(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties2(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass3(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties2(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties2(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  var Timer2 = /* @__PURE__ */ function() {
    function Timer3() {
      var _this = this;
      _classCallCheck3(this, Timer3);
      this.shouldAnimate = void 0;
      this.subscribers = void 0;
      this.activeSubscriptions = void 0;
      this.timer = void 0;
      this.loop = function() {
        _this.subscribers.forEach(function(s2) {
          s2.callback(now() - s2.startTime, s2.duration);
        });
      };
      this.shouldAnimate = true;
      this.subscribers = [];
      this.timer = null;
      this.activeSubscriptions = 0;
    }
    _createClass3(Timer3, [{
      key: "bypassAnimation",
      value: function bypassAnimation() {
        this.shouldAnimate = false;
      }
    }, {
      key: "resumeAnimation",
      value: function resumeAnimation() {
        this.shouldAnimate = true;
      }
    }, {
      key: "start",
      value: function start2() {
        if (!this.timer) {
          this.timer = timer(this.loop);
        }
      }
    }, {
      key: "stop",
      value: function stop() {
        if (this.timer) {
          this.timer.stop();
          this.timer = null;
        }
      }
    }, {
      key: "subscribe",
      value: function subscribe(callback, duration) {
        duration = this.shouldAnimate ? duration : 0;
        var subscriptionID = this.subscribers.push({
          startTime: now(),
          callback,
          duration
        });
        this.activeSubscriptions++;
        this.start();
        return subscriptionID;
      }
    }, {
      key: "unsubscribe",
      value: function unsubscribe(id) {
        if (id !== null && this.subscribers[id - 1]) {
          delete this.subscribers[id - 1];
          this.activeSubscriptions--;
        }
        if (this.activeSubscriptions === 0) {
          this.stop();
        }
      }
    }]);
    return Timer3;
  }();

  // node_modules/victory-core/es/victory-util/timer-context.js
  var TimerContext = /* @__PURE__ */ import_react41.default.createContext({
    transitionTimer: new Timer2(),
    animationTimer: new Timer2()
  });
  TimerContext.displayName = "TimerContext";
  var timer_context_default = TimerContext;

  // node_modules/victory-core/es/victory-animation/victory-animation.js
  var import_react_fast_compare = __toESM(require_react_fast_compare());
  function _toConsumableArray3(arr) {
    return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread2();
  }
  function _nonIterableSpread2() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray2(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray2(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray2(o, minLen);
  }
  function _iterableToArray2(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles2(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray2(arr);
  }
  function _arrayLikeToArray2(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _classCallCheck4(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties3(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass4(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties3(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties3(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits2(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf(subClass, superClass);
  }
  function _setPrototypeOf(o, p2) {
    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf(o, p2);
  }
  function _createSuper(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn2(this, result);
    };
  }
  function _possibleConstructorReturn2(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized(self2);
  }
  function _assertThisInitialized(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf(o) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf(o);
  }
  var VictoryAnimation = /* @__PURE__ */ function(_React$Component) {
    _inherits2(VictoryAnimation2, _React$Component);
    var _super = _createSuper(VictoryAnimation2);
    function VictoryAnimation2(props, context) {
      var _this;
      _classCallCheck4(this, VictoryAnimation2);
      _this = _super.call(this, props, context);
      _this.interpolator = void 0;
      _this.queue = void 0;
      _this.ease = void 0;
      _this.timer = void 0;
      _this.loopID = void 0;
      _this.functionToBeRunEachFrame = function(elapsed, duration) {
        duration = duration !== void 0 ? duration : _this.props.duration;
        var step = duration ? elapsed / duration : 1;
        if (step >= 1) {
          _this.setState({
            data: _this.interpolator(1),
            animationInfo: {
              progress: 1,
              animating: false,
              terminating: true
            }
          });
          if (_this.loopID) {
            _this.timer.unsubscribe(_this.loopID);
          }
          _this.queue.shift();
          _this.traverseQueue();
          return;
        }
        _this.setState({
          data: _this.interpolator(_this.ease(step)),
          animationInfo: {
            progress: step,
            animating: step < 1
          }
        });
      };
      _this.state = {
        data: Array.isArray(_this.props.data) ? _this.props.data[0] : _this.props.data,
        animationInfo: {
          progress: 0,
          animating: false
        }
      };
      _this.interpolator = null;
      _this.queue = Array.isArray(_this.props.data) ? _this.props.data.slice(1) : [];
      _this.ease = d3_ease_exports[_this.toNewName(_this.props.easing)];
      _this.timer = _this.context.animationTimer;
      return _this;
    }
    _createClass4(VictoryAnimation2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        if (this.queue.length) {
          this.traverseQueue();
        }
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate(prevProps) {
        var equalProps = (0, import_react_fast_compare.default)(this.props, prevProps);
        if (!equalProps) {
          if (this.interpolator && this.state.animationInfo && this.state.animationInfo.progress < 1) {
            this.setState({
              data: this.interpolator(1),
              animationInfo: {
                progress: 1,
                animating: false,
                terminating: true
              }
            });
          } else {
            this.timer.unsubscribe(this.loopID);
            if (!Array.isArray(this.props.data)) {
              this.queue.length = 0;
              this.queue.push(this.props.data);
            } else {
              var _this$queue;
              (_this$queue = this.queue).push.apply(_this$queue, _toConsumableArray3(this.props.data));
            }
            this.traverseQueue();
          }
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        if (this.loopID) {
          this.timer.unsubscribe(this.loopID);
        } else {
          this.timer.stop();
        }
      }
    }, {
      key: "toNewName",
      value: function toNewName3(ease) {
        var capitalize4 = function(s2) {
          return s2 && s2[0].toUpperCase() + s2.slice(1);
        };
        return "ease".concat(capitalize4(ease));
      }
      /* Traverse the tween queue */
    }, {
      key: "traverseQueue",
      value: function traverseQueue() {
        var _this2 = this;
        if (this.queue.length) {
          var data = this.queue[0];
          this.interpolator = victoryInterpolator(this.state.data, data);
          if (this.props.delay) {
            setTimeout(function() {
              _this2.loopID = _this2.timer.subscribe(_this2.functionToBeRunEachFrame, _this2.props.duration);
            }, this.props.delay);
          } else {
            this.loopID = this.timer.subscribe(this.functionToBeRunEachFrame, this.props.duration);
          }
        } else if (this.props.onEnd) {
          this.props.onEnd();
        }
      }
      /* every frame we... */
    }, {
      key: "render",
      value: function render() {
        return this.props.children(this.state.data, this.state.animationInfo);
      }
    }]);
    return VictoryAnimation2;
  }(import_react42.default.Component);
  VictoryAnimation.displayName = "VictoryAnimation";
  VictoryAnimation.propTypes = {
    children: import_prop_types36.default.func,
    data: import_prop_types36.default.oneOfType([import_prop_types36.default.object, import_prop_types36.default.array]),
    delay: import_prop_types36.default.number,
    duration: import_prop_types36.default.number,
    easing: import_prop_types36.default.oneOf(["back", "backIn", "backOut", "backInOut", "bounce", "bounceIn", "bounceOut", "bounceInOut", "circle", "circleIn", "circleOut", "circleInOut", "linear", "linearIn", "linearOut", "linearInOut", "cubic", "cubicIn", "cubicOut", "cubicInOut", "elastic", "elasticIn", "elasticOut", "elasticInOut", "exp", "expIn", "expOut", "expInOut", "poly", "polyIn", "polyOut", "polyInOut", "quad", "quadIn", "quadOut", "quadInOut", "sin", "sinIn", "sinOut", "sinInOut"]),
    onEnd: import_prop_types36.default.func
  };
  VictoryAnimation.defaultProps = {
    data: {},
    delay: 0,
    duration: 1e3,
    easing: "quadInOut"
  };
  VictoryAnimation.contextType = timer_context_default;

  // node_modules/victory-core/es/victory-container/victory-container.js
  var import_isFunction3 = __toESM(require_isFunction());
  var import_isObject = __toESM(require_isObject());
  var import_uniqueId = __toESM(require_uniqueId());
  var import_defaults2 = __toESM(require_defaults());
  var import_assign2 = __toESM(require_assign());
  var import_react46 = __toESM(require_react());
  var import_prop_types39 = __toESM(require_prop_types());

  // node_modules/victory-core/es/victory-util/prop-types.js
  var prop_types_exports = {};
  __export(prop_types_exports, {
    allOfType: () => allOfType,
    deprecated: () => deprecated,
    domain: () => domain,
    greaterThanZero: () => greaterThanZero,
    homogeneousArray: () => homogeneousArray,
    integer: () => integer,
    matchDataLength: () => matchDataLength,
    nonNegative: () => nonNegative,
    regExp: () => regExp,
    scale: () => scale
  });
  var import_isRegExp = __toESM(require_isRegExp());
  var import_find = __toESM(require_find());

  // node_modules/victory-core/es/victory-util/log.js
  function warn(message) {
    if (true) {
      if (console && console.warn) {
        console.warn(message);
      }
    }
  }

  // node_modules/victory-core/es/victory-util/prop-types.js
  var import_prop_types37 = __toESM(require_prop_types());

  // node_modules/victory-core/es/victory-util/scale.js
  var scale_exports = {};
  __export(scale_exports, {
    getBaseScale: () => getBaseScale,
    getDefaultScale: () => getDefaultScale,
    getScaleFromName: () => getScaleFromName,
    getScaleFromProps: () => getScaleFromProps,
    getScaleType: () => getScaleType,
    getType: () => getType,
    validScale: () => validScale
  });
  var import_isPlainObject2 = __toESM(require_isPlainObject());
  var import_isFunction2 = __toESM(require_isFunction());
  var import_includes = __toESM(require_includes());

  // node_modules/victory-core/es/victory-util/helpers.js
  var helpers_exports = {};
  __export(helpers_exports, {
    createAccessor: () => createAccessor,
    degreesToRadians: () => degreesToRadians,
    evaluateProp: () => evaluateProp,
    evaluateStyle: () => evaluateStyle,
    getCurrentAxis: () => getCurrentAxis,
    getDefaultStyles: () => getDefaultStyles,
    getPadding: () => getPadding,
    getPoint: () => getPoint,
    getPolarOrigin: () => getPolarOrigin,
    getRadius: () => getRadius,
    getRange: () => getRange,
    getStyles: () => getStyles,
    isHorizontal: () => isHorizontal,
    isTooltip: () => isTooltip,
    modifyProps: () => modifyProps,
    omit: () => omit,
    radiansToDegrees: () => radiansToDegrees,
    reduceChildren: () => reduceChildren,
    scalePoint: () => scalePoint
  });
  var import_keys = __toESM(require_keys());
  var import_assign = __toESM(require_assign());
  var import_pick = __toESM(require_pick());
  var import_property = __toESM(require_property());
  var import_isFunction = __toESM(require_isFunction());
  var import_defaults = __toESM(require_defaults());
  var import_react43 = __toESM(require_react());
  function getCartesianRange(props, axis) {
    var vertical = axis !== "x";
    var padding2 = getPadding(props);
    if (vertical) {
      return [props.height - padding2.bottom, padding2.top];
    }
    return [padding2.left, props.width - padding2.right];
  }
  function getPolarRange(props, axis) {
    if (axis === "x") {
      var startAngle = degreesToRadians(props.startAngle || 0);
      var endAngle = degreesToRadians(props.endAngle || 360);
      return [startAngle, endAngle];
    }
    return [props.innerRadius || 0, getRadius(props)];
  }
  function omit(originalObject) {
    var ks = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var newObject = {};
    for (var key in originalObject) {
      if (ks.indexOf(key) >= 0) {
        continue;
      }
      if (!Object.prototype.hasOwnProperty.call(originalObject, key)) {
        continue;
      }
      newObject[key] = originalObject[key];
    }
    return newObject;
  }
  function getPoint(datum) {
    var exists2 = function(val) {
      return val !== void 0;
    };
    var _x = datum._x, _x1 = datum._x1, _x0 = datum._x0, _voronoiX = datum._voronoiX, _y = datum._y, _y1 = datum._y1, _y0 = datum._y0, _voronoiY = datum._voronoiY;
    var defaultX = exists2(_x1) ? _x1 : _x;
    var defaultY = exists2(_y1) ? _y1 : _y;
    var point6 = {
      x: exists2(_voronoiX) ? _voronoiX : defaultX,
      x0: exists2(_x0) ? _x0 : _x,
      y: exists2(_voronoiY) ? _voronoiY : defaultY,
      y0: exists2(_y0) ? _y0 : _y
    };
    return (0, import_defaults.default)({}, point6, datum);
  }
  function scalePoint(props, datum) {
    var scale2 = props.scale, polar = props.polar, horizontal = props.horizontal;
    var d = getPoint(datum);
    var origin = props.origin || {
      x: 0,
      y: 0
    };
    var x2 = horizontal ? scale2.y(d.y) : scale2.x(d.x);
    var x0 = horizontal ? scale2.y(d.y0) : scale2.x(d.x0);
    var y2 = horizontal ? scale2.x(d.x) : scale2.y(d.y);
    var y0 = horizontal ? scale2.x(d.x0) : scale2.y(d.y0);
    return {
      x: polar ? y2 * Math.cos(x2) + origin.x : x2,
      x0: polar ? y0 * Math.cos(x0) + origin.x : x0,
      y: polar ? -y2 * Math.sin(x2) + origin.y : y2,
      y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
    };
  }
  function getPadding(props) {
    var name2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "padding";
    var padding2 = props[name2];
    var paddingVal = typeof padding2 === "number" ? padding2 : 0;
    var paddingObj = typeof padding2 === "object" ? padding2 : {};
    return {
      top: paddingObj.top || paddingVal,
      bottom: paddingObj.bottom || paddingVal,
      left: paddingObj.left || paddingVal,
      right: paddingObj.right || paddingVal
    };
  }
  function isTooltip(component) {
    var labelRole = component && component.type && component.type.role;
    return labelRole === "tooltip";
  }
  function getDefaultStyles(props, role) {
    var _props$theme = props.theme, theme = _props$theme === void 0 ? {} : _props$theme, labelComponent = props.labelComponent;
    var defaultStyles2 = theme[role] && theme[role].style || {};
    if (!isTooltip(labelComponent)) {
      return defaultStyles2;
    }
    var tooltipStyle = theme.tooltip && theme.tooltip.style || {};
    var labelStyle = (0, import_defaults.default)({}, tooltipStyle, defaultStyles2.labels);
    return (0, import_defaults.default)({}, {
      labels: labelStyle
    }, defaultStyles2);
  }
  function getStyles(style, defaultStyles2) {
    var width = "100%";
    var height = "100%";
    if (!style) {
      return (0, import_defaults.default)({
        parent: {
          height,
          width
        }
      }, defaultStyles2);
    }
    var data = style.data, labels = style.labels, parent = style.parent;
    var defaultParent = defaultStyles2 && defaultStyles2.parent || {};
    var defaultLabels = defaultStyles2 && defaultStyles2.labels || {};
    var defaultData = defaultStyles2 && defaultStyles2.data || {};
    return {
      parent: (0, import_defaults.default)({}, parent, defaultParent, {
        width,
        height
      }),
      labels: (0, import_defaults.default)({}, labels, defaultLabels),
      data: (0, import_defaults.default)({}, data, defaultData)
    };
  }
  function evaluateProp(prop, props) {
    return (0, import_isFunction.default)(prop) ? prop(props) : prop;
  }
  function evaluateStyle(style, props) {
    if (props.disableInlineStyles) {
      return {};
    }
    if (!style || !(0, import_keys.default)(style).some(function(value) {
      return (0, import_isFunction.default)(style[value]);
    })) {
      return style;
    }
    return (0, import_keys.default)(style).reduce(function(prev, curr) {
      prev[curr] = evaluateProp(style[curr], props);
      return prev;
    }, {});
  }
  function degreesToRadians(degrees) {
    return typeof degrees === "number" ? degrees * (Math.PI / 180) : degrees;
  }
  function radiansToDegrees(radians) {
    return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
  }
  function getRadius(props) {
    var _getPadding = getPadding(props), left2 = _getPadding.left, right2 = _getPadding.right, top2 = _getPadding.top, bottom2 = _getPadding.bottom;
    var width = props.width, height = props.height;
    return Math.min(width - left2 - right2, height - top2 - bottom2) / 2;
  }
  function getPolarOrigin(props) {
    var width = props.width, height = props.height;
    var _getPadding2 = getPadding(props), top2 = _getPadding2.top, bottom2 = _getPadding2.bottom, left2 = _getPadding2.left, right2 = _getPadding2.right;
    var radius = Math.min(width - left2 - right2, height - top2 - bottom2) / 2;
    var offsetWidth = width / 2 + left2 - right2;
    var offsetHeight = height / 2 + top2 - bottom2;
    return {
      x: offsetWidth + radius > width ? radius + left2 - right2 : offsetWidth,
      y: offsetHeight + radius > height ? radius + top2 - bottom2 : offsetHeight
    };
  }
  function getRange(props, axis) {
    if (props.range && props.range[axis]) {
      return props.range[axis];
    } else if (props.range && Array.isArray(props.range)) {
      return props.range;
    }
    return props.polar ? getPolarRange(props, axis) : getCartesianRange(props, axis);
  }
  function createAccessor(key) {
    if ((0, import_isFunction.default)(key)) {
      return key;
    } else if (key === null || key === void 0) {
      return function(x2) {
        return x2;
      };
    }
    return (0, import_property.default)(key);
  }
  function modifyProps(props, fallbackProps10, role) {
    var theme = props.theme && props.theme[role] ? props.theme[role] : {};
    var themeProps = omit(theme, ["style"]);
    var horizontal = isHorizontal(props);
    var defaultObject = horizontal === void 0 ? {} : {
      horizontal
    };
    return (0, import_defaults.default)(defaultObject, props, themeProps, fallbackProps10);
  }
  function getCurrentAxis(axis, horizontal) {
    var otherAxis = axis === "x" ? "y" : "x";
    return horizontal ? otherAxis : axis;
  }
  function reduceChildren(children, iteratee) {
    var parentProps = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    var initialMemo = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : [];
    var combine = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function(memo2, item) {
      return (
        // @ts-expect-error These defaults are hard to type
        memo2.concat(item)
      );
    };
    var sharedProps = ["data", "domain", "categories", "polar", "startAngle", "endAngle", "minDomain", "maxDomain", "horizontal"];
    var traverseChildren = function(childArray, names, parent) {
      return childArray.reduce(function(memo2, child, index) {
        var childRole = child.type && child.type.role;
        var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
        if (child.props && child.props.children) {
          var childProps = (0, import_assign.default)({}, child.props, (0, import_pick.default)(parentProps, sharedProps));
          var nestedChildren = child.type && child.type.role === "stack" && (0, import_isFunction.default)(child.type.getChildren) ? child.type.getChildren(childProps) : import_react43.default.Children.toArray(child.props.children).map(function(c2) {
            var nestedChildProps = (0, import_assign.default)({}, c2.props, (0, import_pick.default)(childProps, sharedProps));
            return /* @__PURE__ */ import_react43.default.cloneElement(c2, nestedChildProps);
          });
          var _childNames = nestedChildren.map(function(c2, i) {
            return "".concat(childName, "-").concat(i);
          });
          var nestedResults = traverseChildren(nestedChildren, _childNames, child);
          memo2 = combine(memo2, nestedResults);
        } else {
          var result = iteratee(child, childName, parent);
          if (result) {
            memo2 = combine(memo2, result);
          }
        }
        return memo2;
      }, initialMemo);
    };
    var childNames = children.map(function(c2, i) {
      return i;
    });
    return traverseChildren(children, childNames);
  }
  function isHorizontal(props) {
    if (props.horizontal !== void 0 || !props.children) {
      return props.horizontal;
    }
    var traverseChildren = function(childArray) {
      return childArray.reduce(function(memo2, child) {
        var childProps = child.props || {};
        if (memo2 || childProps.horizontal || !childProps.children) {
          memo2 = memo2 || childProps.horizontal;
          return memo2;
        }
        return traverseChildren(import_react43.default.Children.toArray(childProps.children));
      }, false);
    };
    return traverseChildren(import_react43.default.Children.toArray(props.children));
  }

  // node_modules/victory-core/es/victory-util/collection.js
  var collection_exports = {};
  __export(collection_exports, {
    containsDates: () => containsDates,
    containsNumbers: () => containsNumbers,
    containsOnlyStrings: () => containsOnlyStrings,
    containsStrings: () => containsStrings,
    getMaxValue: () => getMaxValue,
    getMinValue: () => getMinValue,
    isArrayOfArrays: () => isArrayOfArrays,
    removeUndefined: () => removeUndefined
  });
  function _toConsumableArray4(arr) {
    return _arrayWithoutHoles3(arr) || _iterableToArray3(arr) || _unsupportedIterableToArray3(arr) || _nonIterableSpread3();
  }
  function _nonIterableSpread3() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray3(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray3(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray3(o, minLen);
  }
  function _iterableToArray3(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles3(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray3(arr);
  }
  function _arrayLikeToArray3(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function isNonEmptyArray(collection) {
    return Array.isArray(collection) && collection.length > 0;
  }
  function containsStrings(collection) {
    return Array.isArray(collection) && collection.some(function(value) {
      return typeof value === "string";
    });
  }
  function containsDates(collection) {
    return Array.isArray(collection) && collection.some(function(value) {
      return value instanceof Date;
    });
  }
  function containsNumbers(collection) {
    return Array.isArray(collection) && collection.some(function(value) {
      return typeof value === "number";
    });
  }
  function containsOnlyStrings(collection) {
    return isNonEmptyArray(collection) && collection.every(function(value) {
      return typeof value === "string";
    });
  }
  function isArrayOfArrays(collection) {
    return isNonEmptyArray(collection) && collection.every(Array.isArray);
  }
  function removeUndefined(arr) {
    return arr.filter(function(el) {
      return el !== void 0;
    });
  }
  function getMaxValue(arr) {
    for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      values[_key - 1] = arguments[_key];
    }
    var array = arr.concat(values);
    return containsDates(array) ? new Date(Math.max.apply(Math, _toConsumableArray4(array))) : Math.max.apply(Math, _toConsumableArray4(array));
  }
  function getMinValue(arr) {
    for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      values[_key2 - 1] = arguments[_key2];
    }
    var array = arr.concat(values);
    return containsDates(array) ? new Date(Math.min.apply(Math, _toConsumableArray4(array))) : Math.min.apply(Math, _toConsumableArray4(array));
  }

  // node_modules/victory-vendor/es/d3-scale.js
  var d3_scale_exports = {};
  __export(d3_scale_exports, {
    scaleBand: () => band,
    scaleDiverging: () => diverging,
    scaleDivergingLog: () => divergingLog,
    scaleDivergingPow: () => divergingPow,
    scaleDivergingSqrt: () => divergingSqrt,
    scaleDivergingSymlog: () => divergingSymlog,
    scaleIdentity: () => identity2,
    scaleImplicit: () => implicit,
    scaleLinear: () => linear3,
    scaleLog: () => log2,
    scaleOrdinal: () => ordinal,
    scalePoint: () => point,
    scalePow: () => pow,
    scaleQuantile: () => quantile2,
    scaleQuantize: () => quantize,
    scaleRadial: () => radial,
    scaleSequential: () => sequential,
    scaleSequentialLog: () => sequentialLog,
    scaleSequentialPow: () => sequentialPow,
    scaleSequentialQuantile: () => sequentialQuantile,
    scaleSequentialSqrt: () => sequentialSqrt,
    scaleSequentialSymlog: () => sequentialSymlog,
    scaleSqrt: () => sqrt,
    scaleSymlog: () => symlog,
    scaleThreshold: () => threshold,
    scaleTime: () => time,
    scaleUtc: () => utcTime,
    tickFormat: () => tickFormat
  });

  // node_modules/d3-array/src/ascending.js
  function ascending(a2, b) {
    return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
  }

  // node_modules/d3-array/src/descending.js
  function descending(a2, b) {
    return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN;
  }

  // node_modules/d3-array/src/bisector.js
  function bisector(f) {
    let compare1, compare2, delta;
    if (f.length !== 2) {
      compare1 = ascending;
      compare2 = (d, x2) => ascending(f(d), x2);
      delta = (d, x2) => f(d) - x2;
    } else {
      compare1 = f === ascending || f === descending ? f : zero2;
      compare2 = f;
      delta = f;
    }
    function left2(a2, x2, lo = 0, hi = a2.length) {
      if (lo < hi) {
        if (compare1(x2, x2) !== 0)
          return hi;
        do {
          const mid = lo + hi >>> 1;
          if (compare2(a2[mid], x2) < 0)
            lo = mid + 1;
          else
            hi = mid;
        } while (lo < hi);
      }
      return lo;
    }
    function right2(a2, x2, lo = 0, hi = a2.length) {
      if (lo < hi) {
        if (compare1(x2, x2) !== 0)
          return hi;
        do {
          const mid = lo + hi >>> 1;
          if (compare2(a2[mid], x2) <= 0)
            lo = mid + 1;
          else
            hi = mid;
        } while (lo < hi);
      }
      return lo;
    }
    function center(a2, x2, lo = 0, hi = a2.length) {
      const i = left2(a2, x2, lo, hi - 1);
      return i > lo && delta(a2[i - 1], x2) > -delta(a2[i], x2) ? i - 1 : i;
    }
    return { left: left2, center, right: right2 };
  }
  function zero2() {
    return 0;
  }

  // node_modules/d3-array/src/number.js
  function number(x2) {
    return x2 === null ? NaN : +x2;
  }
  function* numbers(values, valueof) {
    if (valueof === void 0) {
      for (let value of values) {
        if (value != null && (value = +value) >= value) {
          yield value;
        }
      }
    } else {
      let index = -1;
      for (let value of values) {
        if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
          yield value;
        }
      }
    }
  }

  // node_modules/d3-array/src/bisect.js
  var ascendingBisect = bisector(ascending);
  var bisectRight = ascendingBisect.right;
  var bisectLeft = ascendingBisect.left;
  var bisectCenter = bisector(number).center;
  var bisect_default = bisectRight;

  // node_modules/internmap/src/index.js
  var InternMap = class extends Map {
    constructor(entries, key = keyof) {
      super();
      Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
      if (entries != null)
        for (const [key2, value] of entries)
          this.set(key2, value);
    }
    get(key) {
      return super.get(intern_get(this, key));
    }
    has(key) {
      return super.has(intern_get(this, key));
    }
    set(key, value) {
      return super.set(intern_set(this, key), value);
    }
    delete(key) {
      return super.delete(intern_delete(this, key));
    }
  };
  function intern_get({ _intern, _key }, value) {
    const key = _key(value);
    return _intern.has(key) ? _intern.get(key) : value;
  }
  function intern_set({ _intern, _key }, value) {
    const key = _key(value);
    if (_intern.has(key))
      return _intern.get(key);
    _intern.set(key, value);
    return value;
  }
  function intern_delete({ _intern, _key }, value) {
    const key = _key(value);
    if (_intern.has(key)) {
      value = _intern.get(key);
      _intern.delete(key);
    }
    return value;
  }
  function keyof(value) {
    return value !== null && typeof value === "object" ? value.valueOf() : value;
  }

  // node_modules/d3-array/src/sort.js
  function compareDefined(compare = ascending) {
    if (compare === ascending)
      return ascendingDefined;
    if (typeof compare !== "function")
      throw new TypeError("compare is not a function");
    return (a2, b) => {
      const x2 = compare(a2, b);
      if (x2 || x2 === 0)
        return x2;
      return (compare(b, b) === 0) - (compare(a2, a2) === 0);
    };
  }
  function ascendingDefined(a2, b) {
    return (a2 == null || !(a2 >= a2)) - (b == null || !(b >= b)) || (a2 < b ? -1 : a2 > b ? 1 : 0);
  }

  // node_modules/d3-array/src/ticks.js
  var e10 = Math.sqrt(50);
  var e5 = Math.sqrt(10);
  var e2 = Math.sqrt(2);
  function tickSpec(start2, stop, count) {
    const step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
    let i1, i2, inc;
    if (power < 0) {
      inc = Math.pow(10, -power) / factor;
      i1 = Math.round(start2 * inc);
      i2 = Math.round(stop * inc);
      if (i1 / inc < start2)
        ++i1;
      if (i2 / inc > stop)
        --i2;
      inc = -inc;
    } else {
      inc = Math.pow(10, power) * factor;
      i1 = Math.round(start2 / inc);
      i2 = Math.round(stop / inc);
      if (i1 * inc < start2)
        ++i1;
      if (i2 * inc > stop)
        --i2;
    }
    if (i2 < i1 && 0.5 <= count && count < 2)
      return tickSpec(start2, stop, count * 2);
    return [i1, i2, inc];
  }
  function ticks(start2, stop, count) {
    stop = +stop, start2 = +start2, count = +count;
    if (!(count > 0))
      return [];
    if (start2 === stop)
      return [start2];
    const reverse = stop < start2, [i1, i2, inc] = reverse ? tickSpec(stop, start2, count) : tickSpec(start2, stop, count);
    if (!(i2 >= i1))
      return [];
    const n = i2 - i1 + 1, ticks2 = new Array(n);
    if (reverse) {
      if (inc < 0)
        for (let i = 0; i < n; ++i)
          ticks2[i] = (i2 - i) / -inc;
      else
        for (let i = 0; i < n; ++i)
          ticks2[i] = (i2 - i) * inc;
    } else {
      if (inc < 0)
        for (let i = 0; i < n; ++i)
          ticks2[i] = (i1 + i) / -inc;
      else
        for (let i = 0; i < n; ++i)
          ticks2[i] = (i1 + i) * inc;
    }
    return ticks2;
  }
  function tickIncrement(start2, stop, count) {
    stop = +stop, start2 = +start2, count = +count;
    return tickSpec(start2, stop, count)[2];
  }
  function tickStep(start2, stop, count) {
    stop = +stop, start2 = +start2, count = +count;
    const reverse = stop < start2, inc = reverse ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count);
    return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
  }

  // node_modules/d3-array/src/max.js
  function max(values, valueof) {
    let max3;
    if (valueof === void 0) {
      for (const value of values) {
        if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
          max3 = value;
        }
      }
    } else {
      let index = -1;
      for (let value of values) {
        if ((value = valueof(value, ++index, values)) != null && (max3 < value || max3 === void 0 && value >= value)) {
          max3 = value;
        }
      }
    }
    return max3;
  }

  // node_modules/d3-array/src/min.js
  function min(values, valueof) {
    let min3;
    if (valueof === void 0) {
      for (const value of values) {
        if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
          min3 = value;
        }
      }
    } else {
      let index = -1;
      for (let value of values) {
        if ((value = valueof(value, ++index, values)) != null && (min3 > value || min3 === void 0 && value >= value)) {
          min3 = value;
        }
      }
    }
    return min3;
  }

  // node_modules/d3-array/src/quickselect.js
  function quickselect(array, k2, left2 = 0, right2 = Infinity, compare) {
    k2 = Math.floor(k2);
    left2 = Math.floor(Math.max(0, left2));
    right2 = Math.floor(Math.min(array.length - 1, right2));
    if (!(left2 <= k2 && k2 <= right2))
      return array;
    compare = compare === void 0 ? ascendingDefined : compareDefined(compare);
    while (right2 > left2) {
      if (right2 - left2 > 600) {
        const n = right2 - left2 + 1;
        const m = k2 - left2 + 1;
        const z = Math.log(n);
        const s2 = 0.5 * Math.exp(2 * z / 3);
        const sd = 0.5 * Math.sqrt(z * s2 * (n - s2) / n) * (m - n / 2 < 0 ? -1 : 1);
        const newLeft = Math.max(left2, Math.floor(k2 - m * s2 / n + sd));
        const newRight = Math.min(right2, Math.floor(k2 + (n - m) * s2 / n + sd));
        quickselect(array, k2, newLeft, newRight, compare);
      }
      const t = array[k2];
      let i = left2;
      let j = right2;
      swap(array, left2, k2);
      if (compare(array[right2], t) > 0)
        swap(array, left2, right2);
      while (i < j) {
        swap(array, i, j), ++i, --j;
        while (compare(array[i], t) < 0)
          ++i;
        while (compare(array[j], t) > 0)
          --j;
      }
      if (compare(array[left2], t) === 0)
        swap(array, left2, j);
      else
        ++j, swap(array, j, right2);
      if (j <= k2)
        left2 = j + 1;
      if (k2 <= j)
        right2 = j - 1;
    }
    return array;
  }
  function swap(array, i, j) {
    const t = array[i];
    array[i] = array[j];
    array[j] = t;
  }

  // node_modules/d3-array/src/quantile.js
  function quantile(values, p2, valueof) {
    values = Float64Array.from(numbers(values, valueof));
    if (!(n = values.length) || isNaN(p2 = +p2))
      return;
    if (p2 <= 0 || n < 2)
      return min(values);
    if (p2 >= 1)
      return max(values);
    var n, i = (n - 1) * p2, i0 = Math.floor(i), value0 = max(quickselect(values, i0).subarray(0, i0 + 1)), value1 = min(values.subarray(i0 + 1));
    return value0 + (value1 - value0) * (i - i0);
  }
  function quantileSorted(values, p2, valueof = number) {
    if (!(n = values.length) || isNaN(p2 = +p2))
      return;
    if (p2 <= 0 || n < 2)
      return +valueof(values[0], 0, values);
    if (p2 >= 1)
      return +valueof(values[n - 1], n - 1, values);
    var n, i = (n - 1) * p2, i0 = Math.floor(i), value0 = +valueof(values[i0], i0, values), value1 = +valueof(values[i0 + 1], i0 + 1, values);
    return value0 + (value1 - value0) * (i - i0);
  }

  // node_modules/d3-array/src/range.js
  function range(start2, stop, step) {
    start2 = +start2, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n < 3 ? 1 : +step;
    var i = -1, n = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range2 = new Array(n);
    while (++i < n) {
      range2[i] = start2 + i * step;
    }
    return range2;
  }

  // node_modules/d3-scale/src/init.js
  function initRange(domain2, range2) {
    switch (arguments.length) {
      case 0:
        break;
      case 1:
        this.range(domain2);
        break;
      default:
        this.range(range2).domain(domain2);
        break;
    }
    return this;
  }
  function initInterpolator(domain2, interpolator) {
    switch (arguments.length) {
      case 0:
        break;
      case 1: {
        if (typeof domain2 === "function")
          this.interpolator(domain2);
        else
          this.range(domain2);
        break;
      }
      default: {
        this.domain(domain2);
        if (typeof interpolator === "function")
          this.interpolator(interpolator);
        else
          this.range(interpolator);
        break;
      }
    }
    return this;
  }

  // node_modules/d3-scale/src/ordinal.js
  var implicit = Symbol("implicit");
  function ordinal() {
    var index = new InternMap(), domain2 = [], range2 = [], unknown = implicit;
    function scale2(d) {
      let i = index.get(d);
      if (i === void 0) {
        if (unknown !== implicit)
          return unknown;
        index.set(d, i = domain2.push(d) - 1);
      }
      return range2[i % range2.length];
    }
    scale2.domain = function(_) {
      if (!arguments.length)
        return domain2.slice();
      domain2 = [], index = new InternMap();
      for (const value of _) {
        if (index.has(value))
          continue;
        index.set(value, domain2.push(value) - 1);
      }
      return scale2;
    };
    scale2.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), scale2) : range2.slice();
    };
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    scale2.copy = function() {
      return ordinal(domain2, range2).unknown(unknown);
    };
    initRange.apply(scale2, arguments);
    return scale2;
  }

  // node_modules/d3-scale/src/band.js
  function band() {
    var scale2 = ordinal().unknown(void 0), domain2 = scale2.domain, ordinalRange = scale2.range, r0 = 0, r1 = 1, step, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
    delete scale2.unknown;
    function rescale() {
      var n = domain2().length, reverse = r1 < r0, start2 = reverse ? r1 : r0, stop = reverse ? r0 : r1;
      step = (stop - start2) / Math.max(1, n - paddingInner + paddingOuter * 2);
      if (round)
        step = Math.floor(step);
      start2 += (stop - start2 - step * (n - paddingInner)) * align;
      bandwidth = step * (1 - paddingInner);
      if (round)
        start2 = Math.round(start2), bandwidth = Math.round(bandwidth);
      var values = range(n).map(function(i) {
        return start2 + step * i;
      });
      return ordinalRange(reverse ? values.reverse() : values);
    }
    scale2.domain = function(_) {
      return arguments.length ? (domain2(_), rescale()) : domain2();
    };
    scale2.range = function(_) {
      return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
    };
    scale2.rangeRound = function(_) {
      return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
    };
    scale2.bandwidth = function() {
      return bandwidth;
    };
    scale2.step = function() {
      return step;
    };
    scale2.round = function(_) {
      return arguments.length ? (round = !!_, rescale()) : round;
    };
    scale2.padding = function(_) {
      return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
    };
    scale2.paddingInner = function(_) {
      return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
    };
    scale2.paddingOuter = function(_) {
      return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
    };
    scale2.align = function(_) {
      return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
    };
    scale2.copy = function() {
      return band(domain2(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
    };
    return initRange.apply(rescale(), arguments);
  }
  function pointish(scale2) {
    var copy3 = scale2.copy;
    scale2.padding = scale2.paddingOuter;
    delete scale2.paddingInner;
    delete scale2.paddingOuter;
    scale2.copy = function() {
      return pointish(copy3());
    };
    return scale2;
  }
  function point() {
    return pointish(band.apply(null, arguments).paddingInner(1));
  }

  // node_modules/d3-scale/src/constant.js
  function constants(x2) {
    return function() {
      return x2;
    };
  }

  // node_modules/d3-scale/src/number.js
  function number2(x2) {
    return +x2;
  }

  // node_modules/d3-scale/src/continuous.js
  var unit = [0, 1];
  function identity(x2) {
    return x2;
  }
  function normalize(a2, b) {
    return (b -= a2 = +a2) ? function(x2) {
      return (x2 - a2) / b;
    } : constants(isNaN(b) ? NaN : 0.5);
  }
  function clamper(a2, b) {
    var t;
    if (a2 > b)
      t = a2, a2 = b, b = t;
    return function(x2) {
      return Math.max(a2, Math.min(b, x2));
    };
  }
  function bimap(domain2, range2, interpolate) {
    var d0 = domain2[0], d1 = domain2[1], r0 = range2[0], r1 = range2[1];
    if (d1 < d0)
      d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
    else
      d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
    return function(x2) {
      return r0(d0(x2));
    };
  }
  function polymap(domain2, range2, interpolate) {
    var j = Math.min(domain2.length, range2.length) - 1, d = new Array(j), r = new Array(j), i = -1;
    if (domain2[j] < domain2[0]) {
      domain2 = domain2.slice().reverse();
      range2 = range2.slice().reverse();
    }
    while (++i < j) {
      d[i] = normalize(domain2[i], domain2[i + 1]);
      r[i] = interpolate(range2[i], range2[i + 1]);
    }
    return function(x2) {
      var i2 = bisect_default(domain2, x2, 1, j) - 1;
      return r[i2](d[i2](x2));
    };
  }
  function copy(source, target) {
    return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
  }
  function transformer() {
    var domain2 = unit, range2 = unit, interpolate = value_default, transform2, untransform, unknown, clamp = identity, piecewise2, output, input;
    function rescale() {
      var n = Math.min(domain2.length, range2.length);
      if (clamp !== identity)
        clamp = clamper(domain2[0], domain2[n - 1]);
      piecewise2 = n > 2 ? polymap : bimap;
      output = input = null;
      return scale2;
    }
    function scale2(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise2(domain2.map(transform2), range2, interpolate)))(transform2(clamp(x2)));
    }
    scale2.invert = function(y2) {
      return clamp(untransform((input || (input = piecewise2(range2, domain2.map(transform2), number_default)))(y2)));
    };
    scale2.domain = function(_) {
      return arguments.length ? (domain2 = Array.from(_, number2), rescale()) : domain2.slice();
    };
    scale2.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), rescale()) : range2.slice();
    };
    scale2.rangeRound = function(_) {
      return range2 = Array.from(_), interpolate = round_default, rescale();
    };
    scale2.clamp = function(_) {
      return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
    };
    scale2.interpolate = function(_) {
      return arguments.length ? (interpolate = _, rescale()) : interpolate;
    };
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    return function(t, u) {
      transform2 = t, untransform = u;
      return rescale();
    };
  }
  function continuous() {
    return transformer()(identity, identity);
  }

  // node_modules/d3-format/src/formatDecimal.js
  function formatDecimal_default(x2) {
    return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
  }
  function formatDecimalParts(x2, p2) {
    if ((i = (x2 = p2 ? x2.toExponential(p2 - 1) : x2.toExponential()).indexOf("e")) < 0)
      return null;
    var i, coefficient = x2.slice(0, i);
    return [
      coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
      +x2.slice(i + 1)
    ];
  }

  // node_modules/d3-format/src/exponent.js
  function exponent_default(x2) {
    return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
  }

  // node_modules/d3-format/src/formatGroup.js
  function formatGroup_default(grouping, thousands) {
    return function(value, width) {
      var i = value.length, t = [], j = 0, g = grouping[0], length = 0;
      while (i > 0 && g > 0) {
        if (length + g + 1 > width)
          g = Math.max(1, width - length);
        t.push(value.substring(i -= g, i + g));
        if ((length += g + 1) > width)
          break;
        g = grouping[j = (j + 1) % grouping.length];
      }
      return t.reverse().join(thousands);
    };
  }

  // node_modules/d3-format/src/formatNumerals.js
  function formatNumerals_default(numerals) {
    return function(value) {
      return value.replace(/[0-9]/g, function(i) {
        return numerals[+i];
      });
    };
  }

  // node_modules/d3-format/src/formatSpecifier.js
  var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
  function formatSpecifier(specifier) {
    if (!(match = re.exec(specifier)))
      throw new Error("invalid format: " + specifier);
    var match;
    return new FormatSpecifier({
      fill: match[1],
      align: match[2],
      sign: match[3],
      symbol: match[4],
      zero: match[5],
      width: match[6],
      comma: match[7],
      precision: match[8] && match[8].slice(1),
      trim: match[9],
      type: match[10]
    });
  }
  formatSpecifier.prototype = FormatSpecifier.prototype;
  function FormatSpecifier(specifier) {
    this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
    this.align = specifier.align === void 0 ? ">" : specifier.align + "";
    this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
    this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
    this.zero = !!specifier.zero;
    this.width = specifier.width === void 0 ? void 0 : +specifier.width;
    this.comma = !!specifier.comma;
    this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
    this.trim = !!specifier.trim;
    this.type = specifier.type === void 0 ? "" : specifier.type + "";
  }
  FormatSpecifier.prototype.toString = function() {
    return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
  };

  // node_modules/d3-format/src/formatTrim.js
  function formatTrim_default(s2) {
    out:
      for (var n = s2.length, i = 1, i0 = -1, i1; i < n; ++i) {
        switch (s2[i]) {
          case ".":
            i0 = i1 = i;
            break;
          case "0":
            if (i0 === 0)
              i0 = i;
            i1 = i;
            break;
          default:
            if (!+s2[i])
              break out;
            if (i0 > 0)
              i0 = 0;
            break;
        }
      }
    return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
  }

  // node_modules/d3-format/src/formatPrefixAuto.js
  var prefixExponent;
  function formatPrefixAuto_default(x2, p2) {
    var d = formatDecimalParts(x2, p2);
    if (!d)
      return x2 + "";
    var coefficient = d[0], exponent2 = d[1], i = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n = coefficient.length;
    return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x2, Math.max(0, p2 + i - 1))[0];
  }

  // node_modules/d3-format/src/formatRounded.js
  function formatRounded_default(x2, p2) {
    var d = formatDecimalParts(x2, p2);
    if (!d)
      return x2 + "";
    var coefficient = d[0], exponent2 = d[1];
    return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0");
  }

  // node_modules/d3-format/src/formatTypes.js
  var formatTypes_default = {
    "%": (x2, p2) => (x2 * 100).toFixed(p2),
    "b": (x2) => Math.round(x2).toString(2),
    "c": (x2) => x2 + "",
    "d": formatDecimal_default,
    "e": (x2, p2) => x2.toExponential(p2),
    "f": (x2, p2) => x2.toFixed(p2),
    "g": (x2, p2) => x2.toPrecision(p2),
    "o": (x2) => Math.round(x2).toString(8),
    "p": (x2, p2) => formatRounded_default(x2 * 100, p2),
    "r": formatRounded_default,
    "s": formatPrefixAuto_default,
    "X": (x2) => Math.round(x2).toString(16).toUpperCase(),
    "x": (x2) => Math.round(x2).toString(16)
  };

  // node_modules/d3-format/src/identity.js
  function identity_default(x2) {
    return x2;
  }

  // node_modules/d3-format/src/locale.js
  var map = Array.prototype.map;
  var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
  function locale_default(locale3) {
    var group = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default : formatGroup_default(map.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default : formatNumerals_default(map.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus2 = locale3.minus === void 0 ? "\u2212" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + "";
    function newFormat(specifier) {
      specifier = formatSpecifier(specifier);
      var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type;
      if (type === "n")
        comma = true, type = "g";
      else if (!formatTypes_default[type])
        precision === void 0 && (precision = 12), trim = true, type = "g";
      if (zero3 || fill === "0" && align === "=")
        zero3 = true, fill = "0", align = "=";
      var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
      var formatType = formatTypes_default[type], maybeSuffix = /[defgprs%]/.test(type);
      precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
      function format2(value) {
        var valuePrefix = prefix, valueSuffix = suffix, i, n, c2;
        if (type === "c") {
          valueSuffix = formatType(value) + valueSuffix;
          value = "";
        } else {
          value = +value;
          var valueNegative = value < 0 || 1 / value < 0;
          value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
          if (trim)
            value = formatTrim_default(value);
          if (valueNegative && +value === 0 && sign2 !== "+")
            valueNegative = false;
          valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus2 : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
          valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
          if (maybeSuffix) {
            i = -1, n = value.length;
            while (++i < n) {
              if (c2 = value.charCodeAt(i), 48 > c2 || c2 > 57) {
                valueSuffix = (c2 === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
                value = value.slice(0, i);
                break;
              }
            }
          }
        }
        if (comma && !zero3)
          value = group(value, Infinity);
        var length = valuePrefix.length + value.length + valueSuffix.length, padding2 = length < width ? new Array(width - length + 1).join(fill) : "";
        if (comma && zero3)
          value = group(padding2 + value, padding2.length ? width - valueSuffix.length : Infinity), padding2 = "";
        switch (align) {
          case "<":
            value = valuePrefix + value + valueSuffix + padding2;
            break;
          case "=":
            value = valuePrefix + padding2 + value + valueSuffix;
            break;
          case "^":
            value = padding2.slice(0, length = padding2.length >> 1) + valuePrefix + value + valueSuffix + padding2.slice(length);
            break;
          default:
            value = padding2 + valuePrefix + value + valueSuffix;
            break;
        }
        return numerals(value);
      }
      format2.toString = function() {
        return specifier + "";
      };
      return format2;
    }
    function formatPrefix2(specifier, value) {
      var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k2 = Math.pow(10, -e), prefix = prefixes[8 + e / 3];
      return function(value2) {
        return f(k2 * value2) + prefix;
      };
    }
    return {
      format: newFormat,
      formatPrefix: formatPrefix2
    };
  }

  // node_modules/d3-format/src/defaultLocale.js
  var locale;
  var format;
  var formatPrefix;
  defaultLocale({
    thousands: ",",
    grouping: [3],
    currency: ["$", ""]
  });
  function defaultLocale(definition) {
    locale = locale_default(definition);
    format = locale.format;
    formatPrefix = locale.formatPrefix;
    return locale;
  }

  // node_modules/d3-format/src/precisionFixed.js
  function precisionFixed_default(step) {
    return Math.max(0, -exponent_default(Math.abs(step)));
  }

  // node_modules/d3-format/src/precisionPrefix.js
  function precisionPrefix_default(step, value) {
    return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
  }

  // node_modules/d3-format/src/precisionRound.js
  function precisionRound_default(step, max3) {
    step = Math.abs(step), max3 = Math.abs(max3) - step;
    return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1;
  }

  // node_modules/d3-scale/src/tickFormat.js
  function tickFormat(start2, stop, count, specifier) {
    var step = tickStep(start2, stop, count), precision;
    specifier = formatSpecifier(specifier == null ? ",f" : specifier);
    switch (specifier.type) {
      case "s": {
        var value = Math.max(Math.abs(start2), Math.abs(stop));
        if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step, value)))
          specifier.precision = precision;
        return formatPrefix(specifier, value);
      }
      case "":
      case "e":
      case "g":
      case "p":
      case "r": {
        if (specifier.precision == null && !isNaN(precision = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop)))))
          specifier.precision = precision - (specifier.type === "e");
        break;
      }
      case "f":
      case "%": {
        if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step)))
          specifier.precision = precision - (specifier.type === "%") * 2;
        break;
      }
    }
    return format(specifier);
  }

  // node_modules/d3-scale/src/linear.js
  function linearish(scale2) {
    var domain2 = scale2.domain;
    scale2.ticks = function(count) {
      var d = domain2();
      return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
    };
    scale2.tickFormat = function(count, specifier) {
      var d = domain2();
      return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
    };
    scale2.nice = function(count) {
      if (count == null)
        count = 10;
      var d = domain2();
      var i0 = 0;
      var i1 = d.length - 1;
      var start2 = d[i0];
      var stop = d[i1];
      var prestep;
      var step;
      var maxIter = 10;
      if (stop < start2) {
        step = start2, start2 = stop, stop = step;
        step = i0, i0 = i1, i1 = step;
      }
      while (maxIter-- > 0) {
        step = tickIncrement(start2, stop, count);
        if (step === prestep) {
          d[i0] = start2;
          d[i1] = stop;
          return domain2(d);
        } else if (step > 0) {
          start2 = Math.floor(start2 / step) * step;
          stop = Math.ceil(stop / step) * step;
        } else if (step < 0) {
          start2 = Math.ceil(start2 * step) / step;
          stop = Math.floor(stop * step) / step;
        } else {
          break;
        }
        prestep = step;
      }
      return scale2;
    };
    return scale2;
  }
  function linear3() {
    var scale2 = continuous();
    scale2.copy = function() {
      return copy(scale2, linear3());
    };
    initRange.apply(scale2, arguments);
    return linearish(scale2);
  }

  // node_modules/d3-scale/src/identity.js
  function identity2(domain2) {
    var unknown;
    function scale2(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : x2;
    }
    scale2.invert = scale2;
    scale2.domain = scale2.range = function(_) {
      return arguments.length ? (domain2 = Array.from(_, number2), scale2) : domain2.slice();
    };
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    scale2.copy = function() {
      return identity2(domain2).unknown(unknown);
    };
    domain2 = arguments.length ? Array.from(domain2, number2) : [0, 1];
    return linearish(scale2);
  }

  // node_modules/d3-scale/src/nice.js
  function nice(domain2, interval2) {
    domain2 = domain2.slice();
    var i0 = 0, i1 = domain2.length - 1, x0 = domain2[i0], x1 = domain2[i1], t;
    if (x1 < x0) {
      t = i0, i0 = i1, i1 = t;
      t = x0, x0 = x1, x1 = t;
    }
    domain2[i0] = interval2.floor(x0);
    domain2[i1] = interval2.ceil(x1);
    return domain2;
  }

  // node_modules/d3-scale/src/log.js
  function transformLog(x2) {
    return Math.log(x2);
  }
  function transformExp(x2) {
    return Math.exp(x2);
  }
  function transformLogn(x2) {
    return -Math.log(-x2);
  }
  function transformExpn(x2) {
    return -Math.exp(-x2);
  }
  function pow10(x2) {
    return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2;
  }
  function powp(base) {
    return base === 10 ? pow10 : base === Math.E ? Math.exp : (x2) => Math.pow(base, x2);
  }
  function logp(base) {
    return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), (x2) => Math.log(x2) / base);
  }
  function reflect(f) {
    return (x2, k2) => -f(-x2, k2);
  }
  function loggish(transform2) {
    const scale2 = transform2(transformLog, transformExp);
    const domain2 = scale2.domain;
    let base = 10;
    let logs;
    let pows;
    function rescale() {
      logs = logp(base), pows = powp(base);
      if (domain2()[0] < 0) {
        logs = reflect(logs), pows = reflect(pows);
        transform2(transformLogn, transformExpn);
      } else {
        transform2(transformLog, transformExp);
      }
      return scale2;
    }
    scale2.base = function(_) {
      return arguments.length ? (base = +_, rescale()) : base;
    };
    scale2.domain = function(_) {
      return arguments.length ? (domain2(_), rescale()) : domain2();
    };
    scale2.ticks = (count) => {
      const d = domain2();
      let u = d[0];
      let v = d[d.length - 1];
      const r = v < u;
      if (r)
        [u, v] = [v, u];
      let i = logs(u);
      let j = logs(v);
      let k2;
      let t;
      const n = count == null ? 10 : +count;
      let z = [];
      if (!(base % 1) && j - i < n) {
        i = Math.floor(i), j = Math.ceil(j);
        if (u > 0)
          for (; i <= j; ++i) {
            for (k2 = 1; k2 < base; ++k2) {
              t = i < 0 ? k2 / pows(-i) : k2 * pows(i);
              if (t < u)
                continue;
              if (t > v)
                break;
              z.push(t);
            }
          }
        else
          for (; i <= j; ++i) {
            for (k2 = base - 1; k2 >= 1; --k2) {
              t = i > 0 ? k2 / pows(-i) : k2 * pows(i);
              if (t < u)
                continue;
              if (t > v)
                break;
              z.push(t);
            }
          }
        if (z.length * 2 < n)
          z = ticks(u, v, n);
      } else {
        z = ticks(i, j, Math.min(j - i, n)).map(pows);
      }
      return r ? z.reverse() : z;
    };
    scale2.tickFormat = (count, specifier) => {
      if (count == null)
        count = 10;
      if (specifier == null)
        specifier = base === 10 ? "s" : ",";
      if (typeof specifier !== "function") {
        if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null)
          specifier.trim = true;
        specifier = format(specifier);
      }
      if (count === Infinity)
        return specifier;
      const k2 = Math.max(1, base * count / scale2.ticks().length);
      return (d) => {
        let i = d / pows(Math.round(logs(d)));
        if (i * base < base - 0.5)
          i *= base;
        return i <= k2 ? specifier(d) : "";
      };
    };
    scale2.nice = () => {
      return domain2(nice(domain2(), {
        floor: (x2) => pows(Math.floor(logs(x2))),
        ceil: (x2) => pows(Math.ceil(logs(x2)))
      }));
    };
    return scale2;
  }
  function log2() {
    const scale2 = loggish(transformer()).domain([1, 10]);
    scale2.copy = () => copy(scale2, log2()).base(scale2.base());
    initRange.apply(scale2, arguments);
    return scale2;
  }

  // node_modules/d3-scale/src/symlog.js
  function transformSymlog(c2) {
    return function(x2) {
      return Math.sign(x2) * Math.log1p(Math.abs(x2 / c2));
    };
  }
  function transformSymexp(c2) {
    return function(x2) {
      return Math.sign(x2) * Math.expm1(Math.abs(x2)) * c2;
    };
  }
  function symlogish(transform2) {
    var c2 = 1, scale2 = transform2(transformSymlog(c2), transformSymexp(c2));
    scale2.constant = function(_) {
      return arguments.length ? transform2(transformSymlog(c2 = +_), transformSymexp(c2)) : c2;
    };
    return linearish(scale2);
  }
  function symlog() {
    var scale2 = symlogish(transformer());
    scale2.copy = function() {
      return copy(scale2, symlog()).constant(scale2.constant());
    };
    return initRange.apply(scale2, arguments);
  }

  // node_modules/d3-scale/src/pow.js
  function transformPow(exponent2) {
    return function(x2) {
      return x2 < 0 ? -Math.pow(-x2, exponent2) : Math.pow(x2, exponent2);
    };
  }
  function transformSqrt(x2) {
    return x2 < 0 ? -Math.sqrt(-x2) : Math.sqrt(x2);
  }
  function transformSquare(x2) {
    return x2 < 0 ? -x2 * x2 : x2 * x2;
  }
  function powish(transform2) {
    var scale2 = transform2(identity, identity), exponent2 = 1;
    function rescale() {
      return exponent2 === 1 ? transform2(identity, identity) : exponent2 === 0.5 ? transform2(transformSqrt, transformSquare) : transform2(transformPow(exponent2), transformPow(1 / exponent2));
    }
    scale2.exponent = function(_) {
      return arguments.length ? (exponent2 = +_, rescale()) : exponent2;
    };
    return linearish(scale2);
  }
  function pow() {
    var scale2 = powish(transformer());
    scale2.copy = function() {
      return copy(scale2, pow()).exponent(scale2.exponent());
    };
    initRange.apply(scale2, arguments);
    return scale2;
  }
  function sqrt() {
    return pow.apply(null, arguments).exponent(0.5);
  }

  // node_modules/d3-scale/src/radial.js
  function square(x2) {
    return Math.sign(x2) * x2 * x2;
  }
  function unsquare(x2) {
    return Math.sign(x2) * Math.sqrt(Math.abs(x2));
  }
  function radial() {
    var squared = continuous(), range2 = [0, 1], round = false, unknown;
    function scale2(x2) {
      var y2 = unsquare(squared(x2));
      return isNaN(y2) ? unknown : round ? Math.round(y2) : y2;
    }
    scale2.invert = function(y2) {
      return squared.invert(square(y2));
    };
    scale2.domain = function(_) {
      return arguments.length ? (squared.domain(_), scale2) : squared.domain();
    };
    scale2.range = function(_) {
      return arguments.length ? (squared.range((range2 = Array.from(_, number2)).map(square)), scale2) : range2.slice();
    };
    scale2.rangeRound = function(_) {
      return scale2.range(_).round(true);
    };
    scale2.round = function(_) {
      return arguments.length ? (round = !!_, scale2) : round;
    };
    scale2.clamp = function(_) {
      return arguments.length ? (squared.clamp(_), scale2) : squared.clamp();
    };
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    scale2.copy = function() {
      return radial(squared.domain(), range2).round(round).clamp(squared.clamp()).unknown(unknown);
    };
    initRange.apply(scale2, arguments);
    return linearish(scale2);
  }

  // node_modules/d3-scale/src/quantile.js
  function quantile2() {
    var domain2 = [], range2 = [], thresholds = [], unknown;
    function rescale() {
      var i = 0, n = Math.max(1, range2.length);
      thresholds = new Array(n - 1);
      while (++i < n)
        thresholds[i - 1] = quantileSorted(domain2, i / n);
      return scale2;
    }
    function scale2(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : range2[bisect_default(thresholds, x2)];
    }
    scale2.invertExtent = function(y2) {
      var i = range2.indexOf(y2);
      return i < 0 ? [NaN, NaN] : [
        i > 0 ? thresholds[i - 1] : domain2[0],
        i < thresholds.length ? thresholds[i] : domain2[domain2.length - 1]
      ];
    };
    scale2.domain = function(_) {
      if (!arguments.length)
        return domain2.slice();
      domain2 = [];
      for (let d of _)
        if (d != null && !isNaN(d = +d))
          domain2.push(d);
      domain2.sort(ascending);
      return rescale();
    };
    scale2.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), rescale()) : range2.slice();
    };
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    scale2.quantiles = function() {
      return thresholds.slice();
    };
    scale2.copy = function() {
      return quantile2().domain(domain2).range(range2).unknown(unknown);
    };
    return initRange.apply(scale2, arguments);
  }

  // node_modules/d3-scale/src/quantize.js
  function quantize() {
    var x0 = 0, x1 = 1, n = 1, domain2 = [0.5], range2 = [0, 1], unknown;
    function scale2(x2) {
      return x2 != null && x2 <= x2 ? range2[bisect_default(domain2, x2, 0, n)] : unknown;
    }
    function rescale() {
      var i = -1;
      domain2 = new Array(n);
      while (++i < n)
        domain2[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);
      return scale2;
    }
    scale2.domain = function(_) {
      return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];
    };
    scale2.range = function(_) {
      return arguments.length ? (n = (range2 = Array.from(_)).length - 1, rescale()) : range2.slice();
    };
    scale2.invertExtent = function(y2) {
      var i = range2.indexOf(y2);
      return i < 0 ? [NaN, NaN] : i < 1 ? [x0, domain2[0]] : i >= n ? [domain2[n - 1], x1] : [domain2[i - 1], domain2[i]];
    };
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : scale2;
    };
    scale2.thresholds = function() {
      return domain2.slice();
    };
    scale2.copy = function() {
      return quantize().domain([x0, x1]).range(range2).unknown(unknown);
    };
    return initRange.apply(linearish(scale2), arguments);
  }

  // node_modules/d3-scale/src/threshold.js
  function threshold() {
    var domain2 = [0.5], range2 = [0, 1], unknown, n = 1;
    function scale2(x2) {
      return x2 != null && x2 <= x2 ? range2[bisect_default(domain2, x2, 0, n)] : unknown;
    }
    scale2.domain = function(_) {
      return arguments.length ? (domain2 = Array.from(_), n = Math.min(domain2.length, range2.length - 1), scale2) : domain2.slice();
    };
    scale2.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), n = Math.min(domain2.length, range2.length - 1), scale2) : range2.slice();
    };
    scale2.invertExtent = function(y2) {
      var i = range2.indexOf(y2);
      return [domain2[i - 1], domain2[i]];
    };
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    scale2.copy = function() {
      return threshold().domain(domain2).range(range2).unknown(unknown);
    };
    return initRange.apply(scale2, arguments);
  }

  // node_modules/d3-time/src/interval.js
  var t0 = /* @__PURE__ */ new Date();
  var t1 = /* @__PURE__ */ new Date();
  function timeInterval(floori, offseti, count, field) {
    function interval2(date2) {
      return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
    }
    interval2.floor = (date2) => {
      return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
    };
    interval2.ceil = (date2) => {
      return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
    };
    interval2.round = (date2) => {
      const d0 = interval2(date2), d1 = interval2.ceil(date2);
      return date2 - d0 < d1 - date2 ? d0 : d1;
    };
    interval2.offset = (date2, step) => {
      return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2;
    };
    interval2.range = (start2, stop, step) => {
      const range2 = [];
      start2 = interval2.ceil(start2);
      step = step == null ? 1 : Math.floor(step);
      if (!(start2 < stop) || !(step > 0))
        return range2;
      let previous;
      do
        range2.push(previous = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2);
      while (previous < start2 && start2 < stop);
      return range2;
    };
    interval2.filter = (test) => {
      return timeInterval((date2) => {
        if (date2 >= date2)
          while (floori(date2), !test(date2))
            date2.setTime(date2 - 1);
      }, (date2, step) => {
        if (date2 >= date2) {
          if (step < 0)
            while (++step <= 0) {
              while (offseti(date2, -1), !test(date2)) {
              }
            }
          else
            while (--step >= 0) {
              while (offseti(date2, 1), !test(date2)) {
              }
            }
        }
      });
    };
    if (count) {
      interval2.count = (start2, end2) => {
        t0.setTime(+start2), t1.setTime(+end2);
        floori(t0), floori(t1);
        return Math.floor(count(t0, t1));
      };
      interval2.every = (step) => {
        step = Math.floor(step);
        return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field ? (d) => field(d) % step === 0 : (d) => interval2.count(0, d) % step === 0);
      };
    }
    return interval2;
  }

  // node_modules/d3-time/src/millisecond.js
  var millisecond = timeInterval(() => {
  }, (date2, step) => {
    date2.setTime(+date2 + step);
  }, (start2, end2) => {
    return end2 - start2;
  });
  millisecond.every = (k2) => {
    k2 = Math.floor(k2);
    if (!isFinite(k2) || !(k2 > 0))
      return null;
    if (!(k2 > 1))
      return millisecond;
    return timeInterval((date2) => {
      date2.setTime(Math.floor(date2 / k2) * k2);
    }, (date2, step) => {
      date2.setTime(+date2 + step * k2);
    }, (start2, end2) => {
      return (end2 - start2) / k2;
    });
  };
  var milliseconds = millisecond.range;

  // node_modules/d3-time/src/duration.js
  var durationSecond = 1e3;
  var durationMinute = durationSecond * 60;
  var durationHour = durationMinute * 60;
  var durationDay = durationHour * 24;
  var durationWeek = durationDay * 7;
  var durationMonth = durationDay * 30;
  var durationYear = durationDay * 365;

  // node_modules/d3-time/src/second.js
  var second = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds());
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationSecond);
  }, (start2, end2) => {
    return (end2 - start2) / durationSecond;
  }, (date2) => {
    return date2.getUTCSeconds();
  });
  var seconds = second.range;

  // node_modules/d3-time/src/minute.js
  var timeMinute = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationMinute);
  }, (start2, end2) => {
    return (end2 - start2) / durationMinute;
  }, (date2) => {
    return date2.getMinutes();
  });
  var timeMinutes = timeMinute.range;
  var utcMinute = timeInterval((date2) => {
    date2.setUTCSeconds(0, 0);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationMinute);
  }, (start2, end2) => {
    return (end2 - start2) / durationMinute;
  }, (date2) => {
    return date2.getUTCMinutes();
  });
  var utcMinutes = utcMinute.range;

  // node_modules/d3-time/src/hour.js
  var timeHour = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationHour);
  }, (start2, end2) => {
    return (end2 - start2) / durationHour;
  }, (date2) => {
    return date2.getHours();
  });
  var timeHours = timeHour.range;
  var utcHour = timeInterval((date2) => {
    date2.setUTCMinutes(0, 0, 0);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationHour);
  }, (start2, end2) => {
    return (end2 - start2) / durationHour;
  }, (date2) => {
    return date2.getUTCHours();
  });
  var utcHours = utcHour.range;

  // node_modules/d3-time/src/day.js
  var timeDay = timeInterval(
    (date2) => date2.setHours(0, 0, 0, 0),
    (date2, step) => date2.setDate(date2.getDate() + step),
    (start2, end2) => (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationDay,
    (date2) => date2.getDate() - 1
  );
  var timeDays = timeDay.range;
  var utcDay = timeInterval((date2) => {
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCDate(date2.getUTCDate() + step);
  }, (start2, end2) => {
    return (end2 - start2) / durationDay;
  }, (date2) => {
    return date2.getUTCDate() - 1;
  });
  var utcDays = utcDay.range;
  var unixDay = timeInterval((date2) => {
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCDate(date2.getUTCDate() + step);
  }, (start2, end2) => {
    return (end2 - start2) / durationDay;
  }, (date2) => {
    return Math.floor(date2 / durationDay);
  });
  var unixDays = unixDay.range;

  // node_modules/d3-time/src/week.js
  function timeWeekday(i) {
    return timeInterval((date2) => {
      date2.setDate(date2.getDate() - (date2.getDay() + 7 - i) % 7);
      date2.setHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setDate(date2.getDate() + step * 7);
    }, (start2, end2) => {
      return (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationWeek;
    });
  }
  var timeSunday = timeWeekday(0);
  var timeMonday = timeWeekday(1);
  var timeTuesday = timeWeekday(2);
  var timeWednesday = timeWeekday(3);
  var timeThursday = timeWeekday(4);
  var timeFriday = timeWeekday(5);
  var timeSaturday = timeWeekday(6);
  var timeSundays = timeSunday.range;
  var timeMondays = timeMonday.range;
  var timeTuesdays = timeTuesday.range;
  var timeWednesdays = timeWednesday.range;
  var timeThursdays = timeThursday.range;
  var timeFridays = timeFriday.range;
  var timeSaturdays = timeSaturday.range;
  function utcWeekday(i) {
    return timeInterval((date2) => {
      date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i) % 7);
      date2.setUTCHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setUTCDate(date2.getUTCDate() + step * 7);
    }, (start2, end2) => {
      return (end2 - start2) / durationWeek;
    });
  }
  var utcSunday = utcWeekday(0);
  var utcMonday = utcWeekday(1);
  var utcTuesday = utcWeekday(2);
  var utcWednesday = utcWeekday(3);
  var utcThursday = utcWeekday(4);
  var utcFriday = utcWeekday(5);
  var utcSaturday = utcWeekday(6);
  var utcSundays = utcSunday.range;
  var utcMondays = utcMonday.range;
  var utcTuesdays = utcTuesday.range;
  var utcWednesdays = utcWednesday.range;
  var utcThursdays = utcThursday.range;
  var utcFridays = utcFriday.range;
  var utcSaturdays = utcSaturday.range;

  // node_modules/d3-time/src/month.js
  var timeMonth = timeInterval((date2) => {
    date2.setDate(1);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setMonth(date2.getMonth() + step);
  }, (start2, end2) => {
    return end2.getMonth() - start2.getMonth() + (end2.getFullYear() - start2.getFullYear()) * 12;
  }, (date2) => {
    return date2.getMonth();
  });
  var timeMonths = timeMonth.range;
  var utcMonth = timeInterval((date2) => {
    date2.setUTCDate(1);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCMonth(date2.getUTCMonth() + step);
  }, (start2, end2) => {
    return end2.getUTCMonth() - start2.getUTCMonth() + (end2.getUTCFullYear() - start2.getUTCFullYear()) * 12;
  }, (date2) => {
    return date2.getUTCMonth();
  });
  var utcMonths = utcMonth.range;

  // node_modules/d3-time/src/year.js
  var timeYear = timeInterval((date2) => {
    date2.setMonth(0, 1);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setFullYear(date2.getFullYear() + step);
  }, (start2, end2) => {
    return end2.getFullYear() - start2.getFullYear();
  }, (date2) => {
    return date2.getFullYear();
  });
  timeYear.every = (k2) => {
    return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
      date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2);
      date2.setMonth(0, 1);
      date2.setHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setFullYear(date2.getFullYear() + step * k2);
    });
  };
  var timeYears = timeYear.range;
  var utcYear = timeInterval((date2) => {
    date2.setUTCMonth(0, 1);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCFullYear(date2.getUTCFullYear() + step);
  }, (start2, end2) => {
    return end2.getUTCFullYear() - start2.getUTCFullYear();
  }, (date2) => {
    return date2.getUTCFullYear();
  });
  utcYear.every = (k2) => {
    return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
      date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2);
      date2.setUTCMonth(0, 1);
      date2.setUTCHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setUTCFullYear(date2.getUTCFullYear() + step * k2);
    });
  };
  var utcYears = utcYear.range;

  // node_modules/d3-time/src/ticks.js
  function ticker(year, month, week, day, hour, minute) {
    const tickIntervals = [
      [second, 1, durationSecond],
      [second, 5, 5 * durationSecond],
      [second, 15, 15 * durationSecond],
      [second, 30, 30 * durationSecond],
      [minute, 1, durationMinute],
      [minute, 5, 5 * durationMinute],
      [minute, 15, 15 * durationMinute],
      [minute, 30, 30 * durationMinute],
      [hour, 1, durationHour],
      [hour, 3, 3 * durationHour],
      [hour, 6, 6 * durationHour],
      [hour, 12, 12 * durationHour],
      [day, 1, durationDay],
      [day, 2, 2 * durationDay],
      [week, 1, durationWeek],
      [month, 1, durationMonth],
      [month, 3, 3 * durationMonth],
      [year, 1, durationYear]
    ];
    function ticks2(start2, stop, count) {
      const reverse = stop < start2;
      if (reverse)
        [start2, stop] = [stop, start2];
      const interval2 = count && typeof count.range === "function" ? count : tickInterval(start2, stop, count);
      const ticks3 = interval2 ? interval2.range(start2, +stop + 1) : [];
      return reverse ? ticks3.reverse() : ticks3;
    }
    function tickInterval(start2, stop, count) {
      const target = Math.abs(stop - start2) / count;
      const i = bisector(([, , step2]) => step2).right(tickIntervals, target);
      if (i === tickIntervals.length)
        return year.every(tickStep(start2 / durationYear, stop / durationYear, count));
      if (i === 0)
        return millisecond.every(Math.max(tickStep(start2, stop, count), 1));
      const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
      return t.every(step);
    }
    return [ticks2, tickInterval];
  }
  var [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
  var [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);

  // node_modules/d3-time-format/src/locale.js
  function localDate(d) {
    if (0 <= d.y && d.y < 100) {
      var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
      date2.setFullYear(d.y);
      return date2;
    }
    return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
  }
  function utcDate(d) {
    if (0 <= d.y && d.y < 100) {
      var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
      date2.setUTCFullYear(d.y);
      return date2;
    }
    return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
  }
  function newDate(y2, m, d) {
    return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 };
  }
  function formatLocale(locale3) {
    var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths;
    var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
    var formats = {
      "a": formatShortWeekday,
      "A": formatWeekday,
      "b": formatShortMonth,
      "B": formatMonth,
      "c": null,
      "d": formatDayOfMonth,
      "e": formatDayOfMonth,
      "f": formatMicroseconds,
      "g": formatYearISO,
      "G": formatFullYearISO,
      "H": formatHour24,
      "I": formatHour12,
      "j": formatDayOfYear,
      "L": formatMilliseconds,
      "m": formatMonthNumber,
      "M": formatMinutes,
      "p": formatPeriod,
      "q": formatQuarter,
      "Q": formatUnixTimestamp,
      "s": formatUnixTimestampSeconds,
      "S": formatSeconds,
      "u": formatWeekdayNumberMonday,
      "U": formatWeekNumberSunday,
      "V": formatWeekNumberISO,
      "w": formatWeekdayNumberSunday,
      "W": formatWeekNumberMonday,
      "x": null,
      "X": null,
      "y": formatYear,
      "Y": formatFullYear,
      "Z": formatZone,
      "%": formatLiteralPercent
    };
    var utcFormats = {
      "a": formatUTCShortWeekday,
      "A": formatUTCWeekday,
      "b": formatUTCShortMonth,
      "B": formatUTCMonth,
      "c": null,
      "d": formatUTCDayOfMonth,
      "e": formatUTCDayOfMonth,
      "f": formatUTCMicroseconds,
      "g": formatUTCYearISO,
      "G": formatUTCFullYearISO,
      "H": formatUTCHour24,
      "I": formatUTCHour12,
      "j": formatUTCDayOfYear,
      "L": formatUTCMilliseconds,
      "m": formatUTCMonthNumber,
      "M": formatUTCMinutes,
      "p": formatUTCPeriod,
      "q": formatUTCQuarter,
      "Q": formatUnixTimestamp,
      "s": formatUnixTimestampSeconds,
      "S": formatUTCSeconds,
      "u": formatUTCWeekdayNumberMonday,
      "U": formatUTCWeekNumberSunday,
      "V": formatUTCWeekNumberISO,
      "w": formatUTCWeekdayNumberSunday,
      "W": formatUTCWeekNumberMonday,
      "x": null,
      "X": null,
      "y": formatUTCYear,
      "Y": formatUTCFullYear,
      "Z": formatUTCZone,
      "%": formatLiteralPercent
    };
    var parses = {
      "a": parseShortWeekday,
      "A": parseWeekday,
      "b": parseShortMonth,
      "B": parseMonth,
      "c": parseLocaleDateTime,
      "d": parseDayOfMonth,
      "e": parseDayOfMonth,
      "f": parseMicroseconds,
      "g": parseYear,
      "G": parseFullYear,
      "H": parseHour24,
      "I": parseHour24,
      "j": parseDayOfYear,
      "L": parseMilliseconds,
      "m": parseMonthNumber,
      "M": parseMinutes,
      "p": parsePeriod,
      "q": parseQuarter,
      "Q": parseUnixTimestamp,
      "s": parseUnixTimestampSeconds,
      "S": parseSeconds,
      "u": parseWeekdayNumberMonday,
      "U": parseWeekNumberSunday,
      "V": parseWeekNumberISO,
      "w": parseWeekdayNumberSunday,
      "W": parseWeekNumberMonday,
      "x": parseLocaleDate,
      "X": parseLocaleTime,
      "y": parseYear,
      "Y": parseFullYear,
      "Z": parseZone,
      "%": parseLiteralPercent
    };
    formats.x = newFormat(locale_date, formats);
    formats.X = newFormat(locale_time, formats);
    formats.c = newFormat(locale_dateTime, formats);
    utcFormats.x = newFormat(locale_date, utcFormats);
    utcFormats.X = newFormat(locale_time, utcFormats);
    utcFormats.c = newFormat(locale_dateTime, utcFormats);
    function newFormat(specifier, formats2) {
      return function(date2) {
        var string = [], i = -1, j = 0, n = specifier.length, c2, pad2, format2;
        if (!(date2 instanceof Date))
          date2 = /* @__PURE__ */ new Date(+date2);
        while (++i < n) {
          if (specifier.charCodeAt(i) === 37) {
            string.push(specifier.slice(j, i));
            if ((pad2 = pads[c2 = specifier.charAt(++i)]) != null)
              c2 = specifier.charAt(++i);
            else
              pad2 = c2 === "e" ? " " : "0";
            if (format2 = formats2[c2])
              c2 = format2(date2, pad2);
            string.push(c2);
            j = i + 1;
          }
        }
        string.push(specifier.slice(j, i));
        return string.join("");
      };
    }
    function newParse(specifier, Z) {
      return function(string) {
        var d = newDate(1900, void 0, 1), i = parseSpecifier(d, specifier, string += "", 0), week, day;
        if (i != string.length)
          return null;
        if ("Q" in d)
          return new Date(d.Q);
        if ("s" in d)
          return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
        if (Z && !("Z" in d))
          d.Z = 0;
        if ("p" in d)
          d.H = d.H % 12 + d.p * 12;
        if (d.m === void 0)
          d.m = "q" in d ? d.q : 0;
        if ("V" in d) {
          if (d.V < 1 || d.V > 53)
            return null;
          if (!("w" in d))
            d.w = 1;
          if ("Z" in d) {
            week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
            week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
            week = utcDay.offset(week, (d.V - 1) * 7);
            d.y = week.getUTCFullYear();
            d.m = week.getUTCMonth();
            d.d = week.getUTCDate() + (d.w + 6) % 7;
          } else {
            week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
            week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
            week = timeDay.offset(week, (d.V - 1) * 7);
            d.y = week.getFullYear();
            d.m = week.getMonth();
            d.d = week.getDate() + (d.w + 6) % 7;
          }
        } else if ("W" in d || "U" in d) {
          if (!("w" in d))
            d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
          day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
          d.m = 0;
          d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
        }
        if ("Z" in d) {
          d.H += d.Z / 100 | 0;
          d.M += d.Z % 100;
          return utcDate(d);
        }
        return localDate(d);
      };
    }
    function parseSpecifier(d, specifier, string, j) {
      var i = 0, n = specifier.length, m = string.length, c2, parse2;
      while (i < n) {
        if (j >= m)
          return -1;
        c2 = specifier.charCodeAt(i++);
        if (c2 === 37) {
          c2 = specifier.charAt(i++);
          parse2 = parses[c2 in pads ? specifier.charAt(i++) : c2];
          if (!parse2 || (j = parse2(d, string, j)) < 0)
            return -1;
        } else if (c2 != string.charCodeAt(j++)) {
          return -1;
        }
      }
      return j;
    }
    function parsePeriod(d, string, i) {
      var n = periodRe.exec(string.slice(i));
      return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseShortWeekday(d, string, i) {
      var n = shortWeekdayRe.exec(string.slice(i));
      return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseWeekday(d, string, i) {
      var n = weekdayRe.exec(string.slice(i));
      return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseShortMonth(d, string, i) {
      var n = shortMonthRe.exec(string.slice(i));
      return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseMonth(d, string, i) {
      var n = monthRe.exec(string.slice(i));
      return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseLocaleDateTime(d, string, i) {
      return parseSpecifier(d, locale_dateTime, string, i);
    }
    function parseLocaleDate(d, string, i) {
      return parseSpecifier(d, locale_date, string, i);
    }
    function parseLocaleTime(d, string, i) {
      return parseSpecifier(d, locale_time, string, i);
    }
    function formatShortWeekday(d) {
      return locale_shortWeekdays[d.getDay()];
    }
    function formatWeekday(d) {
      return locale_weekdays[d.getDay()];
    }
    function formatShortMonth(d) {
      return locale_shortMonths[d.getMonth()];
    }
    function formatMonth(d) {
      return locale_months[d.getMonth()];
    }
    function formatPeriod(d) {
      return locale_periods[+(d.getHours() >= 12)];
    }
    function formatQuarter(d) {
      return 1 + ~~(d.getMonth() / 3);
    }
    function formatUTCShortWeekday(d) {
      return locale_shortWeekdays[d.getUTCDay()];
    }
    function formatUTCWeekday(d) {
      return locale_weekdays[d.getUTCDay()];
    }
    function formatUTCShortMonth(d) {
      return locale_shortMonths[d.getUTCMonth()];
    }
    function formatUTCMonth(d) {
      return locale_months[d.getUTCMonth()];
    }
    function formatUTCPeriod(d) {
      return locale_periods[+(d.getUTCHours() >= 12)];
    }
    function formatUTCQuarter(d) {
      return 1 + ~~(d.getUTCMonth() / 3);
    }
    return {
      format: function(specifier) {
        var f = newFormat(specifier += "", formats);
        f.toString = function() {
          return specifier;
        };
        return f;
      },
      parse: function(specifier) {
        var p2 = newParse(specifier += "", false);
        p2.toString = function() {
          return specifier;
        };
        return p2;
      },
      utcFormat: function(specifier) {
        var f = newFormat(specifier += "", utcFormats);
        f.toString = function() {
          return specifier;
        };
        return f;
      },
      utcParse: function(specifier) {
        var p2 = newParse(specifier += "", true);
        p2.toString = function() {
          return specifier;
        };
        return p2;
      }
    };
  }
  var pads = { "-": "", "_": " ", "0": "0" };
  var numberRe = /^\s*\d+/;
  var percentRe = /^%/;
  var requoteRe = /[\\^$*+?|[\]().{}]/g;
  function pad(value, fill, width) {
    var sign2 = value < 0 ? "-" : "", string = (sign2 ? -value : value) + "", length = string.length;
    return sign2 + (length < width ? new Array(width - length + 1).join(fill) + string : string);
  }
  function requote(s2) {
    return s2.replace(requoteRe, "\\$&");
  }
  function formatRe(names) {
    return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
  }
  function formatLookup(names) {
    return new Map(names.map((name2, i) => [name2.toLowerCase(), i]));
  }
  function parseWeekdayNumberSunday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 1));
    return n ? (d.w = +n[0], i + n[0].length) : -1;
  }
  function parseWeekdayNumberMonday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 1));
    return n ? (d.u = +n[0], i + n[0].length) : -1;
  }
  function parseWeekNumberSunday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.U = +n[0], i + n[0].length) : -1;
  }
  function parseWeekNumberISO(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.V = +n[0], i + n[0].length) : -1;
  }
  function parseWeekNumberMonday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.W = +n[0], i + n[0].length) : -1;
  }
  function parseFullYear(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 4));
    return n ? (d.y = +n[0], i + n[0].length) : -1;
  }
  function parseYear(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1;
  }
  function parseZone(d, string, i) {
    var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
    return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
  }
  function parseQuarter(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 1));
    return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
  }
  function parseMonthNumber(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
  }
  function parseDayOfMonth(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.d = +n[0], i + n[0].length) : -1;
  }
  function parseDayOfYear(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 3));
    return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
  }
  function parseHour24(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.H = +n[0], i + n[0].length) : -1;
  }
  function parseMinutes(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.M = +n[0], i + n[0].length) : -1;
  }
  function parseSeconds(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.S = +n[0], i + n[0].length) : -1;
  }
  function parseMilliseconds(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 3));
    return n ? (d.L = +n[0], i + n[0].length) : -1;
  }
  function parseMicroseconds(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 6));
    return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1;
  }
  function parseLiteralPercent(d, string, i) {
    var n = percentRe.exec(string.slice(i, i + 1));
    return n ? i + n[0].length : -1;
  }
  function parseUnixTimestamp(d, string, i) {
    var n = numberRe.exec(string.slice(i));
    return n ? (d.Q = +n[0], i + n[0].length) : -1;
  }
  function parseUnixTimestampSeconds(d, string, i) {
    var n = numberRe.exec(string.slice(i));
    return n ? (d.s = +n[0], i + n[0].length) : -1;
  }
  function formatDayOfMonth(d, p2) {
    return pad(d.getDate(), p2, 2);
  }
  function formatHour24(d, p2) {
    return pad(d.getHours(), p2, 2);
  }
  function formatHour12(d, p2) {
    return pad(d.getHours() % 12 || 12, p2, 2);
  }
  function formatDayOfYear(d, p2) {
    return pad(1 + timeDay.count(timeYear(d), d), p2, 3);
  }
  function formatMilliseconds(d, p2) {
    return pad(d.getMilliseconds(), p2, 3);
  }
  function formatMicroseconds(d, p2) {
    return formatMilliseconds(d, p2) + "000";
  }
  function formatMonthNumber(d, p2) {
    return pad(d.getMonth() + 1, p2, 2);
  }
  function formatMinutes(d, p2) {
    return pad(d.getMinutes(), p2, 2);
  }
  function formatSeconds(d, p2) {
    return pad(d.getSeconds(), p2, 2);
  }
  function formatWeekdayNumberMonday(d) {
    var day = d.getDay();
    return day === 0 ? 7 : day;
  }
  function formatWeekNumberSunday(d, p2) {
    return pad(timeSunday.count(timeYear(d) - 1, d), p2, 2);
  }
  function dISO(d) {
    var day = d.getDay();
    return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
  }
  function formatWeekNumberISO(d, p2) {
    d = dISO(d);
    return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p2, 2);
  }
  function formatWeekdayNumberSunday(d) {
    return d.getDay();
  }
  function formatWeekNumberMonday(d, p2) {
    return pad(timeMonday.count(timeYear(d) - 1, d), p2, 2);
  }
  function formatYear(d, p2) {
    return pad(d.getFullYear() % 100, p2, 2);
  }
  function formatYearISO(d, p2) {
    d = dISO(d);
    return pad(d.getFullYear() % 100, p2, 2);
  }
  function formatFullYear(d, p2) {
    return pad(d.getFullYear() % 1e4, p2, 4);
  }
  function formatFullYearISO(d, p2) {
    var day = d.getDay();
    d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
    return pad(d.getFullYear() % 1e4, p2, 4);
  }
  function formatZone(d) {
    var z = d.getTimezoneOffset();
    return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2);
  }
  function formatUTCDayOfMonth(d, p2) {
    return pad(d.getUTCDate(), p2, 2);
  }
  function formatUTCHour24(d, p2) {
    return pad(d.getUTCHours(), p2, 2);
  }
  function formatUTCHour12(d, p2) {
    return pad(d.getUTCHours() % 12 || 12, p2, 2);
  }
  function formatUTCDayOfYear(d, p2) {
    return pad(1 + utcDay.count(utcYear(d), d), p2, 3);
  }
  function formatUTCMilliseconds(d, p2) {
    return pad(d.getUTCMilliseconds(), p2, 3);
  }
  function formatUTCMicroseconds(d, p2) {
    return formatUTCMilliseconds(d, p2) + "000";
  }
  function formatUTCMonthNumber(d, p2) {
    return pad(d.getUTCMonth() + 1, p2, 2);
  }
  function formatUTCMinutes(d, p2) {
    return pad(d.getUTCMinutes(), p2, 2);
  }
  function formatUTCSeconds(d, p2) {
    return pad(d.getUTCSeconds(), p2, 2);
  }
  function formatUTCWeekdayNumberMonday(d) {
    var dow = d.getUTCDay();
    return dow === 0 ? 7 : dow;
  }
  function formatUTCWeekNumberSunday(d, p2) {
    return pad(utcSunday.count(utcYear(d) - 1, d), p2, 2);
  }
  function UTCdISO(d) {
    var day = d.getUTCDay();
    return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
  }
  function formatUTCWeekNumberISO(d, p2) {
    d = UTCdISO(d);
    return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p2, 2);
  }
  function formatUTCWeekdayNumberSunday(d) {
    return d.getUTCDay();
  }
  function formatUTCWeekNumberMonday(d, p2) {
    return pad(utcMonday.count(utcYear(d) - 1, d), p2, 2);
  }
  function formatUTCYear(d, p2) {
    return pad(d.getUTCFullYear() % 100, p2, 2);
  }
  function formatUTCYearISO(d, p2) {
    d = UTCdISO(d);
    return pad(d.getUTCFullYear() % 100, p2, 2);
  }
  function formatUTCFullYear(d, p2) {
    return pad(d.getUTCFullYear() % 1e4, p2, 4);
  }
  function formatUTCFullYearISO(d, p2) {
    var day = d.getUTCDay();
    d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
    return pad(d.getUTCFullYear() % 1e4, p2, 4);
  }
  function formatUTCZone() {
    return "+0000";
  }
  function formatLiteralPercent() {
    return "%";
  }
  function formatUnixTimestamp(d) {
    return +d;
  }
  function formatUnixTimestampSeconds(d) {
    return Math.floor(+d / 1e3);
  }

  // node_modules/d3-time-format/src/defaultLocale.js
  var locale2;
  var timeFormat;
  var timeParse;
  var utcFormat;
  var utcParse;
  defaultLocale2({
    dateTime: "%x, %X",
    date: "%-m/%-d/%Y",
    time: "%-I:%M:%S %p",
    periods: ["AM", "PM"],
    days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
    shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
    shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
  });
  function defaultLocale2(definition) {
    locale2 = formatLocale(definition);
    timeFormat = locale2.format;
    timeParse = locale2.parse;
    utcFormat = locale2.utcFormat;
    utcParse = locale2.utcParse;
    return locale2;
  }

  // node_modules/d3-scale/src/time.js
  function date(t) {
    return new Date(t);
  }
  function number3(t) {
    return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);
  }
  function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2) {
    var scale2 = continuous(), invert = scale2.invert, domain2 = scale2.domain;
    var formatMillisecond = format2(".%L"), formatSecond = format2(":%S"), formatMinute = format2("%I:%M"), formatHour = format2("%I %p"), formatDay = format2("%a %d"), formatWeek = format2("%b %d"), formatMonth = format2("%B"), formatYear2 = format2("%Y");
    function tickFormat2(date2) {
      return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2);
    }
    scale2.invert = function(y2) {
      return new Date(invert(y2));
    };
    scale2.domain = function(_) {
      return arguments.length ? domain2(Array.from(_, number3)) : domain2().map(date);
    };
    scale2.ticks = function(interval2) {
      var d = domain2();
      return ticks2(d[0], d[d.length - 1], interval2 == null ? 10 : interval2);
    };
    scale2.tickFormat = function(count, specifier) {
      return specifier == null ? tickFormat2 : format2(specifier);
    };
    scale2.nice = function(interval2) {
      var d = domain2();
      if (!interval2 || typeof interval2.range !== "function")
        interval2 = tickInterval(d[0], d[d.length - 1], interval2 == null ? 10 : interval2);
      return interval2 ? domain2(nice(d, interval2)) : scale2;
    };
    scale2.copy = function() {
      return copy(scale2, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2));
    };
    return scale2;
  }
  function time() {
    return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
  }

  // node_modules/d3-scale/src/utcTime.js
  function utcTime() {
    return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
  }

  // node_modules/d3-scale/src/sequential.js
  function transformer2() {
    var x0 = 0, x1 = 1, t02, t12, k10, transform2, interpolator = identity, clamp = false, unknown;
    function scale2(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : interpolator(k10 === 0 ? 0.5 : (x2 = (transform2(x2) - t02) * k10, clamp ? Math.max(0, Math.min(1, x2)) : x2));
    }
    scale2.domain = function(_) {
      return arguments.length ? ([x0, x1] = _, t02 = transform2(x0 = +x0), t12 = transform2(x1 = +x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02), scale2) : [x0, x1];
    };
    scale2.clamp = function(_) {
      return arguments.length ? (clamp = !!_, scale2) : clamp;
    };
    scale2.interpolator = function(_) {
      return arguments.length ? (interpolator = _, scale2) : interpolator;
    };
    function range2(interpolate) {
      return function(_) {
        var r0, r1;
        return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale2) : [interpolator(0), interpolator(1)];
      };
    }
    scale2.range = range2(value_default);
    scale2.rangeRound = range2(round_default);
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    return function(t) {
      transform2 = t, t02 = t(x0), t12 = t(x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02);
      return scale2;
    };
  }
  function copy2(source, target) {
    return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown());
  }
  function sequential() {
    var scale2 = linearish(transformer2()(identity));
    scale2.copy = function() {
      return copy2(scale2, sequential());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function sequentialLog() {
    var scale2 = loggish(transformer2()).domain([1, 10]);
    scale2.copy = function() {
      return copy2(scale2, sequentialLog()).base(scale2.base());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function sequentialSymlog() {
    var scale2 = symlogish(transformer2());
    scale2.copy = function() {
      return copy2(scale2, sequentialSymlog()).constant(scale2.constant());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function sequentialPow() {
    var scale2 = powish(transformer2());
    scale2.copy = function() {
      return copy2(scale2, sequentialPow()).exponent(scale2.exponent());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function sequentialSqrt() {
    return sequentialPow.apply(null, arguments).exponent(0.5);
  }

  // node_modules/d3-scale/src/sequentialQuantile.js
  function sequentialQuantile() {
    var domain2 = [], interpolator = identity;
    function scale2(x2) {
      if (x2 != null && !isNaN(x2 = +x2))
        return interpolator((bisect_default(domain2, x2, 1) - 1) / (domain2.length - 1));
    }
    scale2.domain = function(_) {
      if (!arguments.length)
        return domain2.slice();
      domain2 = [];
      for (let d of _)
        if (d != null && !isNaN(d = +d))
          domain2.push(d);
      domain2.sort(ascending);
      return scale2;
    };
    scale2.interpolator = function(_) {
      return arguments.length ? (interpolator = _, scale2) : interpolator;
    };
    scale2.range = function() {
      return domain2.map((d, i) => interpolator(i / (domain2.length - 1)));
    };
    scale2.quantiles = function(n) {
      return Array.from({ length: n + 1 }, (_, i) => quantile(domain2, i / n));
    };
    scale2.copy = function() {
      return sequentialQuantile(interpolator).domain(domain2);
    };
    return initInterpolator.apply(scale2, arguments);
  }

  // node_modules/d3-scale/src/diverging.js
  function transformer3() {
    var x0 = 0, x1 = 0.5, x2 = 1, s2 = 1, t02, t12, t2, k10, k21, interpolator = identity, transform2, clamp = false, unknown;
    function scale2(x3) {
      return isNaN(x3 = +x3) ? unknown : (x3 = 0.5 + ((x3 = +transform2(x3)) - t12) * (s2 * x3 < s2 * t12 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x3)) : x3));
    }
    scale2.domain = function(_) {
      return arguments.length ? ([x0, x1, x2] = _, t02 = transform2(x0 = +x0), t12 = transform2(x1 = +x1), t2 = transform2(x2 = +x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t2 ? 0 : 0.5 / (t2 - t12), s2 = t12 < t02 ? -1 : 1, scale2) : [x0, x1, x2];
    };
    scale2.clamp = function(_) {
      return arguments.length ? (clamp = !!_, scale2) : clamp;
    };
    scale2.interpolator = function(_) {
      return arguments.length ? (interpolator = _, scale2) : interpolator;
    };
    function range2(interpolate) {
      return function(_) {
        var r0, r1, r2;
        return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale2) : [interpolator(0), interpolator(0.5), interpolator(1)];
      };
    }
    scale2.range = range2(value_default);
    scale2.rangeRound = range2(round_default);
    scale2.unknown = function(_) {
      return arguments.length ? (unknown = _, scale2) : unknown;
    };
    return function(t) {
      transform2 = t, t02 = t(x0), t12 = t(x1), t2 = t(x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t2 ? 0 : 0.5 / (t2 - t12), s2 = t12 < t02 ? -1 : 1;
      return scale2;
    };
  }
  function diverging() {
    var scale2 = linearish(transformer3()(identity));
    scale2.copy = function() {
      return copy2(scale2, diverging());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function divergingLog() {
    var scale2 = loggish(transformer3()).domain([0.1, 1, 10]);
    scale2.copy = function() {
      return copy2(scale2, divergingLog()).base(scale2.base());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function divergingSymlog() {
    var scale2 = symlogish(transformer3());
    scale2.copy = function() {
      return copy2(scale2, divergingSymlog()).constant(scale2.constant());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function divergingPow() {
    var scale2 = powish(transformer3());
    scale2.copy = function() {
      return copy2(scale2, divergingPow()).exponent(scale2.exponent());
    };
    return initInterpolator.apply(scale2, arguments);
  }
  function divergingSqrt() {
    return divergingPow.apply(null, arguments).exponent(0.5);
  }

  // node_modules/victory-core/es/victory-util/scale.js
  var supportedScaleStrings = ["linear", "time", "log", "sqrt"];
  function toNewName(scale2) {
    var capitalize4 = function(s2) {
      return s2 && s2[0].toUpperCase() + s2.slice(1);
    };
    return "scale".concat(capitalize4(scale2));
  }
  function validScale(scale2) {
    if (typeof scale2 === "function") {
      return (0, import_isFunction2.default)(scale2.copy) && (0, import_isFunction2.default)(scale2.domain) && (0, import_isFunction2.default)(scale2.range);
    } else if (typeof scale2 === "string") {
      return (0, import_includes.default)(supportedScaleStrings, scale2);
    }
    return false;
  }
  function isScaleDefined(props, axis) {
    if (!props.scale) {
      return false;
    } else if (props.scale.x || props.scale.y) {
      return !!props.scale[axis];
    }
    return true;
  }
  function getScaleTypeFromProps(props, axis) {
    if (!isScaleDefined(props, axis)) {
      return void 0;
    }
    var scale2 = props.scale[axis] || props.scale;
    return typeof scale2 === "string" ? scale2 : getType(scale2);
  }
  function getScaleFromDomain(props, axis) {
    var domain2;
    if (props.domain && props.domain[axis]) {
      domain2 = props.domain[axis];
    } else if (props.domain && Array.isArray(props.domain)) {
      domain2 = props.domain;
    }
    if (!domain2) {
      return void 0;
    }
    return containsDates(domain2) ? "time" : "linear";
  }
  function getScaleTypeFromData(props, axis) {
    if (!props.data) {
      return "linear";
    }
    var accessor = createAccessor(props[axis]);
    var axisData = props.data.map(function(datum) {
      var processedData = (0, import_isPlainObject2.default)(accessor(datum)) ? accessor(datum)[axis] : accessor(datum);
      return processedData !== void 0 ? processedData : datum[axis];
    });
    return containsDates(axisData) ? "time" : "linear";
  }
  function getScaleFromName(name2) {
    if (validScale(name2)) {
      var methodName = toNewName(name2);
      return d3_scale_exports[methodName]();
    }
    return linear3();
  }
  function getBaseScale(props, axis) {
    var scale2 = getScaleFromProps(props, axis);
    if (scale2) {
      return typeof scale2 === "string" ? getScaleFromName(scale2) : scale2;
    }
    var defaultScale = getScaleFromDomain(props, axis) || getScaleTypeFromData(props, axis);
    return getScaleFromName(defaultScale);
  }
  function getDefaultScale() {
    return linear3();
  }
  function getScaleFromProps(props, axis) {
    if (!isScaleDefined(props, axis)) {
      return void 0;
    }
    var scale2 = props.scale[axis] || props.scale;
    if (validScale(scale2)) {
      return (0, import_isFunction2.default)(scale2) ? scale2 : getScaleFromName(scale2);
    }
    return void 0;
  }
  function getScaleType(props, axis) {
    return getScaleTypeFromProps(props, axis) || getScaleTypeFromData(props, axis);
  }
  var DUCK_TYPES = [
    {
      name: "quantile",
      method: "quantiles"
    },
    {
      name: "log",
      method: "base"
    }
    // TODO(2214): Re-evaluate (1) duck typing approach, and (2) if duck typing,
    //   do we need a different approach? (Multiple keys? Stringifying functions?)
    // https://github.com/FormidableLabs/victory/issues/2214
    // Below are matches that don't seem to otherwise occur in Victory code base.
    // { name: "ordinal", method: "unknown" },
    // { name: "pow-sqrt", method: "exponent" },
    // { name: "quantize-threshold", method: "invertExtent" }
  ];
  function getType(scale2) {
    if (typeof scale2 === "string") {
      return scale2;
    }
    var scaleType = DUCK_TYPES.filter(function(type) {
      return scale2[type.method] !== void 0;
    })[0];
    return scaleType ? scaleType.name : void 0;
  }

  // node_modules/victory-core/es/victory-util/prop-types.js
  function _defineProperty5(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var makeChainable = function(validator) {
    var createChainable = function(isRequired) {
      return function(props, propName, componentName) {
        var value = props[propName];
        if (value === void 0 || value === null) {
          if (isRequired) {
            return new Error("Required `".concat(propName, "` was not specified in `").concat(componentName, "`."));
          }
          return null;
        }
        for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
          rest[_key - 3] = arguments[_key];
        }
        return validator.apply(void 0, [props, propName, componentName].concat(rest));
      };
    };
    var chainable = Object.assign(createChainable(false), {
      isRequired: createChainable(true)
    });
    return chainable;
  };
  var nullConstructor = function() {
    return null;
  };
  var undefinedConstructor = function() {
    return void 0;
  };
  var getConstructor = function(value) {
    if (value === void 0) {
      return undefinedConstructor;
    } else if (value === null) {
      return nullConstructor;
    }
    return value.constructor;
  };
  var getConstructorName = function(value) {
    if (value === void 0) {
      return "undefined";
    } else if (value === null) {
      return "null";
    }
    return Object.prototype.toString.call(value).slice(8, -1);
  };
  function deprecated(propType, explanation) {
    return function(props, propName, componentName) {
      var value = props[propName];
      if (value !== null && value !== void 0) {
        warn('"'.concat(propName, '" property of "').concat(componentName, '" has been deprecated ').concat(explanation));
      }
      import_prop_types37.default.checkPropTypes(_defineProperty5({}, propName, propType), props, propName, componentName);
      return null;
    };
  }
  function allOfType(validators) {
    return makeChainable(function(props, propName, componentName) {
      for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
        rest[_key2 - 3] = arguments[_key2];
      }
      return validators.reduce(function(result, validator) {
        return result || validator.apply(void 0, [props, propName, componentName].concat(rest));
      }, null);
    });
  }
  var nonNegative = makeChainable(function(props, propName, componentName) {
    var value = props[propName];
    if (typeof value !== "number" || value < 0) {
      return new Error("`".concat(propName, "` in `").concat(componentName, "` must be a non-negative number."));
    }
    return null;
  });
  var integer = makeChainable(function(props, propName, componentName) {
    var value = props[propName];
    if (typeof value !== "number" || value % 1 !== 0) {
      return new Error("`".concat(propName, "` in `").concat(componentName, "` must be an integer."));
    }
    return null;
  });
  var greaterThanZero = makeChainable(function(props, propName, componentName) {
    var value = props[propName];
    if (typeof value !== "number" || value <= 0) {
      return new Error("`".concat(propName, "` in `").concat(componentName, "` must be a number greater than zero."));
    }
    return null;
  });
  var domain = makeChainable(function(props, propName, componentName) {
    var value = props[propName];
    if (!Array.isArray(value) || value.length !== 2 || value[1] === value[0]) {
      return new Error("`".concat(propName, "` in `").concat(componentName, "` must be an array of two unique numeric values."));
    }
    return null;
  });
  var scale = makeChainable(function(props, propName, componentName) {
    var value = props[propName];
    if (!validScale(value)) {
      return new Error("`".concat(propName, "` in `").concat(componentName, "` must be a d3 scale."));
    }
    return null;
  });
  var homogeneousArray = makeChainable(function(props, propName, componentName) {
    var values = props[propName];
    if (!Array.isArray(values)) {
      return new Error("`".concat(propName, "` in `").concat(componentName, "` must be an array."));
    }
    if (values.length < 2) {
      return null;
    }
    var comparisonConstructor = getConstructor(values[0]);
    var typeMismatchedValue = (0, import_find.default)(values, function(value) {
      return comparisonConstructor !== getConstructor(value);
    });
    if (typeMismatchedValue) {
      var constructorName = getConstructorName(values[0]);
      var otherConstructorName = getConstructorName(typeMismatchedValue);
      return new Error("Expected `".concat(propName, "` in `").concat(componentName, "` to be a ") + "homogeneous array, but found types `".concat(constructorName, "` and ") + "`".concat(otherConstructorName, "`."));
    }
    return null;
  });
  var matchDataLength = makeChainable(function(props, propName) {
    if (props[propName] && Array.isArray(props[propName]) && props[propName].length !== props.data.length) {
      return new Error("Length of data and ".concat(propName, " arrays must match."));
    }
    return null;
  });
  var regExp = makeChainable(function(props, propName, componentName) {
    if (props[propName] && !(0, import_isRegExp.default)(props[propName])) {
      return new Error("`".concat(propName, "` in `").concat(componentName, "` must be a regular expression."));
    }
    return null;
  });

  // node_modules/victory-core/es/victory-portal/portal.js
  var import_keys2 = __toESM(require_keys());
  var import_react44 = __toESM(require_react());
  var import_prop_types38 = __toESM(require_prop_types());
  function _classCallCheck5(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties4(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass5(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties4(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties4(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits3(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf2(subClass, superClass);
  }
  function _setPrototypeOf2(o, p2) {
    _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf2(o, p2);
  }
  function _createSuper2(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct2();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf2(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf2(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn3(this, result);
    };
  }
  function _possibleConstructorReturn3(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized2(self2);
  }
  function _assertThisInitialized2(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct2() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf2(o) {
    _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf2(o);
  }
  var Portal = /* @__PURE__ */ function(_ref2) {
    _inherits3(Portal2, _ref2);
    var _super = _createSuper2(Portal2);
    function Portal2(props) {
      var _this;
      _classCallCheck5(this, Portal2);
      _this = _super.call(this, props);
      _this.map = void 0;
      _this.index = void 0;
      _this.portalRegister = function() {
        return ++_this.index;
      };
      _this.portalUpdate = function(key, element) {
        _this.map[key] = element;
        _this.forceUpdate();
      };
      _this.portalDeregister = function(key) {
        delete _this.map[key];
        _this.forceUpdate();
      };
      _this.map = {};
      _this.index = 1;
      return _this;
    }
    _createClass5(Portal2, [{
      key: "getChildren",
      value: function getChildren3() {
        var _this2 = this;
        return (0, import_keys2.default)(this.map).map(function(key) {
          var el = _this2.map[key];
          return el ? /* @__PURE__ */ import_react44.default.cloneElement(el, {
            key
          }) : el;
        });
      }
      // Overridden in victory-core-native
    }, {
      key: "render",
      value: function render() {
        return /* @__PURE__ */ import_react44.default.createElement("svg", this.props, this.getChildren());
      }
    }]);
    return Portal2;
  }(import_react44.default.Component);
  Portal.displayName = "Portal";
  Portal.propTypes = {
    className: import_prop_types38.default.string,
    height: nonNegative,
    style: import_prop_types38.default.object,
    viewBox: import_prop_types38.default.string,
    width: nonNegative
  };

  // node_modules/victory-core/es/victory-portal/portal-context.js
  var import_react45 = __toESM(require_react());
  var PortalContext = /* @__PURE__ */ import_react45.default.createContext({});
  PortalContext.displayName = "PortalContext";

  // node_modules/victory-core/es/victory-util/user-props.js
  var user_props_exports = {};
  __export(user_props_exports, {
    getSafeUserProps: () => getSafeUserProps,
    withSafeUserProps: () => withSafeUserProps
  });
  var React268 = __toESM(require_react());
  function _slicedToArray2(arr, i) {
    return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray4(arr, i) || _nonIterableRest2();
  }
  function _nonIterableRest2() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray4(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray4(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray4(o, minLen);
  }
  function _arrayLikeToArray4(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _iterableToArrayLimit2(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null)
      return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i)
          break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null)
          _i["return"]();
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
  function _arrayWithHoles2(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function ownKeys3(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread3(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys3(Object(source), true).forEach(function(key) {
        _defineProperty6(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys3(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty6(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var USER_PROPS_SAFELIST = {
    startsWith: ["data-", "aria-"],
    exactMatch: []
  };
  var doesPropStartWith = function(key) {
    var startsWith = false;
    USER_PROPS_SAFELIST.startsWith.forEach(function(starterString) {
      var regex = new RegExp("\\b(".concat(starterString, ")(\\w|-)+"), "g");
      if (regex.test(key))
        startsWith = true;
    });
    return startsWith;
  };
  var isExactMatch = function(key) {
    return USER_PROPS_SAFELIST.exactMatch.includes(key);
  };
  var testIfSafeProp = function(key) {
    if (doesPropStartWith(key) || isExactMatch(key))
      return true;
    return false;
  };
  var getValue = function(value, props) {
    if (typeof value === "function") {
      return value(props);
    }
    return value;
  };
  var getSafeUserProps = function(props) {
    var propsToFilter = _objectSpread3({}, props);
    return Object.fromEntries(Object.entries(propsToFilter).filter(function(_ref2) {
      var _ref22 = _slicedToArray2(_ref2, 1), key = _ref22[0];
      return testIfSafeProp(key);
    }).map(function(_ref3) {
      var _ref4 = _slicedToArray2(_ref3, 2), key = _ref4[0], value = _ref4[1];
      return [key, getValue(value, props)];
    }));
  };
  var withSafeUserProps = function(component, props) {
    return /* @__PURE__ */ React268.cloneElement(component, getSafeUserProps(props));
  };

  // node_modules/victory-core/es/victory-container/victory-container.js
  function _extends2() {
    _extends2 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends2.apply(this, arguments);
  }
  function ownKeys4(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread4(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys4(Object(source), true).forEach(function(key) {
        _defineProperty7(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys4(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty7(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _classCallCheck6(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties5(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass6(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties5(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties5(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits4(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf3(subClass, superClass);
  }
  function _setPrototypeOf3(o, p2) {
    _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf3(o, p2);
  }
  function _createSuper3(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct3();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf3(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf3(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn4(this, result);
    };
  }
  function _possibleConstructorReturn4(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized3(self2);
  }
  function _assertThisInitialized3(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct3() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf3(o) {
    _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf3(o);
  }
  var VictoryContainer = /* @__PURE__ */ function(_React$Component) {
    _inherits4(VictoryContainer2, _React$Component);
    var _super = _createSuper3(VictoryContainer2);
    function VictoryContainer2(props) {
      var _this;
      _classCallCheck6(this, VictoryContainer2);
      _this = _super.call(this, props);
      _this.containerId = void 0;
      _this.portalRef = void 0;
      _this.containerRef = void 0;
      _this.shouldHandleWheel = void 0;
      _this.savePortalRef = function(portal) {
        _this.portalRef = portal;
        return portal;
      };
      _this.portalUpdate = function(key, el) {
        return _this.portalRef.portalUpdate(key, el);
      };
      _this.portalRegister = function() {
        return _this.portalRef.portalRegister();
      };
      _this.portalDeregister = function(key) {
        return _this.portalRef.portalDeregister(key);
      };
      _this.saveContainerRef = function(container) {
        if ((0, import_isFunction3.default)(_this.props.containerRef)) {
          _this.props.containerRef(container);
        }
        _this.containerRef = container;
        return container;
      };
      _this.handleWheel = function(e) {
        return e.preventDefault();
      };
      _this.containerId = !(0, import_isObject.default)(props) || props.containerId === void 0 ? (0, import_uniqueId.default)("victory-container-") : props.containerId;
      _this.shouldHandleWheel = !!(props && props.events && props.events.onWheel);
      return _this;
    }
    _createClass6(VictoryContainer2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        if (this.shouldHandleWheel && this.containerRef) {
          this.containerRef.addEventListener("wheel", this.handleWheel);
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        if (this.shouldHandleWheel && this.containerRef) {
          this.containerRef.removeEventListener("wheel", this.handleWheel);
        }
      }
    }, {
      key: "getIdForElement",
      value: function getIdForElement(elementName) {
        return "".concat(this.containerId, "-").concat(elementName);
      }
      // overridden in custom containers
    }, {
      key: "getChildren",
      value: function getChildren3(props) {
        return props.children;
      }
      // Get props defined by the Open UI Automation (OUIA) 1.0-RC spec
      // See https://ouia.readthedocs.io/en/latest/README.html#ouia-component
    }, {
      key: "getOUIAProps",
      value: function getOUIAProps2(props) {
        var ouiaId = props.ouiaId, ouiaSafe = props.ouiaSafe, ouiaType = props.ouiaType;
        return _objectSpread4(_objectSpread4(_objectSpread4({}, ouiaId && {
          "data-ouia-component-id": ouiaId
        }), ouiaType && {
          "data-ouia-component-type": ouiaType
        }), ouiaSafe !== void 0 && {
          "data-ouia-safe": ouiaSafe
        });
      }
    }, {
      key: "renderContainer",
      value: function renderContainer(props, svgProps, style) {
        var title = props.title, desc = props.desc, portalComponent = props.portalComponent, className = props.className, width = props.width, height = props.height, portalZIndex = props.portalZIndex, responsive = props.responsive;
        var children = this.getChildren(props);
        var dimensions = responsive ? {
          width: "100%",
          height: "100%"
        } : {
          width,
          height
        };
        var divStyle = (0, import_assign2.default)({
          pointerEvents: "none",
          touchAction: "none",
          position: "relative"
        }, dimensions);
        var portalDivStyle = (0, import_assign2.default)({
          zIndex: portalZIndex,
          position: "absolute",
          top: 0,
          left: 0
        }, dimensions);
        var svgStyle = (0, import_assign2.default)({
          pointerEvents: "all"
        }, dimensions);
        var portalSvgStyle = (0, import_assign2.default)({
          overflow: "visible"
        }, dimensions);
        var portalProps = {
          width,
          height,
          viewBox: svgProps.viewBox,
          preserveAspectRatio: svgProps.preserveAspectRatio,
          style: portalSvgStyle
        };
        return /* @__PURE__ */ import_react46.default.createElement(PortalContext.Provider, {
          value: {
            portalUpdate: this.portalUpdate,
            portalRegister: this.portalRegister,
            portalDeregister: this.portalDeregister
          }
        }, /* @__PURE__ */ import_react46.default.createElement("div", _extends2({
          style: (0, import_defaults2.default)({}, style, divStyle),
          className,
          ref: this.saveContainerRef
        }, this.getOUIAProps(props)), /* @__PURE__ */ import_react46.default.createElement("svg", _extends2({}, svgProps, {
          style: svgStyle
        }), title ? /* @__PURE__ */ import_react46.default.createElement("title", {
          id: this.getIdForElement("title")
        }, title) : null, desc ? /* @__PURE__ */ import_react46.default.createElement("desc", {
          id: this.getIdForElement("desc")
        }, desc) : null, children), /* @__PURE__ */ import_react46.default.createElement("div", {
          style: portalDivStyle
        }, /* @__PURE__ */ import_react46.default.cloneElement(portalComponent, _objectSpread4(_objectSpread4({}, portalProps), {}, {
          ref: this.savePortalRef
        })))));
      }
    }, {
      key: "render",
      value: function render() {
        var _this$props = this.props, width = _this$props.width, height = _this$props.height, responsive = _this$props.responsive, events = _this$props.events, title = _this$props.title, desc = _this$props.desc, tabIndex = _this$props.tabIndex, preserveAspectRatio = _this$props.preserveAspectRatio, role = _this$props.role;
        var style = responsive ? this.props.style : omit(this.props.style, ["height", "width"]);
        var userProps = getSafeUserProps(this.props);
        var svgProps = (0, import_assign2.default)(_objectSpread4({
          width,
          height,
          tabIndex,
          role,
          "aria-labelledby": [title && this.getIdForElement("title"), this.props["aria-labelledby"]].filter(Boolean).join(" ") || void 0,
          "aria-describedby": [desc && this.getIdForElement("desc"), this.props["aria-describedby"]].filter(Boolean).join(" ") || void 0,
          viewBox: responsive ? "0 0 ".concat(width, " ").concat(height) : void 0,
          preserveAspectRatio: responsive ? preserveAspectRatio : void 0
        }, userProps), events);
        return this.renderContainer(this.props, svgProps, style);
      }
    }]);
    return VictoryContainer2;
  }(import_react46.default.Component);
  VictoryContainer.displayName = "VictoryContainer";
  VictoryContainer.role = "container";
  VictoryContainer.propTypes = {
    "aria-describedby": import_prop_types39.default.string,
    "aria-labelledby": import_prop_types39.default.string,
    children: import_prop_types39.default.oneOfType([import_prop_types39.default.arrayOf(import_prop_types39.default.node), import_prop_types39.default.node]),
    className: import_prop_types39.default.string,
    containerId: import_prop_types39.default.oneOfType([import_prop_types39.default.number, import_prop_types39.default.string]),
    containerRef: import_prop_types39.default.func,
    desc: import_prop_types39.default.string,
    events: import_prop_types39.default.object,
    height: nonNegative,
    name: import_prop_types39.default.string,
    origin: import_prop_types39.default.shape({
      x: nonNegative,
      y: nonNegative
    }),
    ouiaId: import_prop_types39.default.oneOfType([import_prop_types39.default.number, import_prop_types39.default.string]),
    ouiaSafe: import_prop_types39.default.bool,
    ouiaType: import_prop_types39.default.string,
    polar: import_prop_types39.default.bool,
    portalComponent: import_prop_types39.default.element,
    portalZIndex: integer,
    preserveAspectRatio: import_prop_types39.default.string,
    responsive: import_prop_types39.default.bool,
    role: import_prop_types39.default.string,
    style: import_prop_types39.default.object,
    tabIndex: import_prop_types39.default.number,
    theme: import_prop_types39.default.object,
    title: import_prop_types39.default.string,
    width: nonNegative
  };
  VictoryContainer.defaultProps = {
    className: "VictoryContainer",
    portalComponent: /* @__PURE__ */ import_react46.default.createElement(Portal, null),
    portalZIndex: 99,
    responsive: true,
    role: "img"
  };
  VictoryContainer.contextType = timer_context_default;

  // node_modules/victory-core/es/victory-label/victory-label.js
  var import_isEmpty = __toESM(require_isEmpty());
  var import_defaults6 = __toESM(require_defaults());
  var import_assign4 = __toESM(require_assign());
  var import_prop_types42 = __toESM(require_prop_types());
  var import_react51 = __toESM(require_react());

  // node_modules/victory-core/es/victory-portal/victory-portal.js
  var import_defaults3 = __toESM(require_defaults());
  var import_react47 = __toESM(require_react());
  var import_prop_types40 = __toESM(require_prop_types());
  function _classCallCheck7(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties6(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass7(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties6(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties6(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits5(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf4(subClass, superClass);
  }
  function _setPrototypeOf4(o, p2) {
    _setPrototypeOf4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf4(o, p2);
  }
  function _createSuper4(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct4();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf4(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf4(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn5(this, result);
    };
  }
  function _possibleConstructorReturn5(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized4(self2);
  }
  function _assertThisInitialized4(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct4() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf4(o) {
    _getPrototypeOf4 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf4(o);
  }
  var VictoryPortal = /* @__PURE__ */ function(_React$Component) {
    _inherits5(VictoryPortal2, _React$Component);
    var _super = _createSuper4(VictoryPortal2);
    function VictoryPortal2() {
      var _this;
      _classCallCheck7(this, VictoryPortal2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _super.call.apply(_super, [this].concat(args));
      _this.checkedContext = void 0;
      _this.renderInPlace = void 0;
      _this.element = void 0;
      _this.portalKey = void 0;
      return _this;
    }
    _createClass7(VictoryPortal2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        if (!this.checkedContext) {
          if (typeof this.context.portalUpdate !== "function") {
            var msg = "`renderInPortal` is not supported outside of `VictoryContainer`. Component will be rendered in place";
            warn(msg);
            this.renderInPlace = true;
          }
          this.checkedContext = true;
        }
        this.forceUpdate();
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate() {
        if (!this.renderInPlace) {
          this.portalKey = this.portalKey || this.context.portalRegister();
          this.context.portalUpdate(this.portalKey, this.element);
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        if (this.context && this.context.portalDeregister) {
          this.context.portalDeregister(this.portalKey);
        }
      }
      // Overridden in victory-core-native
    }, {
      key: "renderPortal",
      value: function renderPortal(child) {
        if (this.renderInPlace) {
          return child;
        }
        this.element = child;
        return null;
      }
    }, {
      key: "render",
      value: function render() {
        var children = Array.isArray(this.props.children) ? this.props.children[0] : this.props.children;
        var groupComponent = this.props.groupComponent;
        var childProps = children && children.props || {};
        var standardProps = childProps.groupComponent ? {
          groupComponent,
          standalone: false
        } : {};
        var newProps = (0, import_defaults3.default)(standardProps, childProps, omit(this.props, ["children", "groupComponent"]));
        var child = children && /* @__PURE__ */ import_react47.default.cloneElement(children, newProps);
        return this.renderPortal(child);
      }
    }]);
    return VictoryPortal2;
  }(import_react47.default.Component);
  VictoryPortal.displayName = "VictoryPortal";
  VictoryPortal.role = "portal";
  VictoryPortal.propTypes = {
    children: import_prop_types40.default.node,
    groupComponent: import_prop_types40.default.element
  };
  VictoryPortal.defaultProps = {
    groupComponent: /* @__PURE__ */ import_react47.default.createElement("g", null)
  };
  VictoryPortal.contextType = PortalContext;

  // node_modules/victory-core/es/victory-primitives/rect.js
  var import_react48 = __toESM(require_react());
  var _excluded2 = ["desc"];
  function _extends3() {
    _extends3 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends3.apply(this, arguments);
  }
  function _objectWithoutProperties3(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose2(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _objectWithoutPropertiesLoose2(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  var Rect = function(props) {
    var desc = props.desc, rest = _objectWithoutProperties3(props, _excluded2);
    return desc ? (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react48.default.createElement("rect", _extends3({
        vectorEffect: "non-scaling-stroke"
      }, rest), /* @__PURE__ */ import_react48.default.createElement("desc", null, desc))
    ) : (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react48.default.createElement("rect", _extends3({
        vectorEffect: "non-scaling-stroke"
      }, rest))
    );
  };

  // node_modules/victory-core/es/victory-primitives/text.js
  var import_react49 = __toESM(require_react());
  var import_prop_types41 = __toESM(require_prop_types());
  var _excluded3 = ["children", "title", "desc"];
  function _objectWithoutProperties4(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose3(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _objectWithoutPropertiesLoose3(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  var Text2 = function(props) {
    var children = props.children, title = props.title, desc = props.desc, rest = _objectWithoutProperties4(props, _excluded3);
    return (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react49.default.createElement("text", rest, title && /* @__PURE__ */ import_react49.default.createElement("title", null, title), desc && /* @__PURE__ */ import_react49.default.createElement("desc", null, desc), children)
    );
  };
  Text2.propTypes = {
    children: import_prop_types41.default.node,
    desc: import_prop_types41.default.string,
    title: import_prop_types41.default.string
  };

  // node_modules/victory-core/es/victory-primitives/tspan.js
  var import_react50 = __toESM(require_react());
  var TSpan = function(props) {
    return (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react50.default.createElement("tspan", props)
    );
  };

  // node_modules/victory-core/es/victory-util/label-helpers.js
  var label_helpers_exports = {};
  __export(label_helpers_exports, {
    getDegrees: () => getDegrees,
    getPolarAngle: () => getPolarAngle,
    getPolarTextAnchor: () => getPolarTextAnchor,
    getPolarVerticalAnchor: () => getPolarVerticalAnchor,
    getProps: () => getProps,
    getText: () => getText
  });
  var import_defaults4 = __toESM(require_defaults());
  function getVerticalAnchor(props, datum) {
    datum = datum || {};
    var sign2 = datum._y >= 0 ? 1 : -1;
    var labelStyle = props.style && props.style.labels || {};
    if (datum.verticalAnchor || labelStyle.verticalAnchor) {
      return datum.verticalAnchor || labelStyle.verticalAnchor;
    } else if (!props.horizontal) {
      return sign2 >= 0 ? "end" : "start";
    }
    return "middle";
  }
  function getTextAnchor(props, datum) {
    datum = datum || {};
    var style = props.style, horizontal = props.horizontal;
    var sign2 = datum._y >= 0 ? 1 : -1;
    var labelStyle = style && style.labels || {};
    if (datum.verticalAnchor || labelStyle.verticalAnchor) {
      return datum.verticalAnchor || labelStyle.verticalAnchor;
    } else if (!horizontal) {
      return "middle";
    }
    return sign2 >= 0 ? "start" : "end";
  }
  function getAngle(props, datum) {
    datum = datum || {};
    var labelStyle = props.style && props.style.labels || {};
    return datum.angle === void 0 ? labelStyle.angle : datum.angle;
  }
  function getPadding2(props, datum) {
    datum = datum || {};
    var horizontal = props.horizontal, style = props.style;
    var labelStyle = style.labels || {};
    var defaultPadding = evaluateProp(labelStyle.padding, props) || 0;
    var sign2 = datum._y < 0 ? -1 : 1;
    return {
      x: horizontal ? sign2 * defaultPadding : 0,
      y: horizontal ? 0 : -1 * sign2 * defaultPadding
    };
  }
  function getOffset(props, datum) {
    if (props.polar) {
      return {};
    }
    var padding2 = getPadding2(props, datum);
    return {
      dx: padding2.x,
      dy: padding2.y
    };
  }
  function getPosition(props, datum) {
    var polar = props.polar;
    var _Helpers$scalePoint = scalePoint(props, datum), x2 = _Helpers$scalePoint.x, y2 = _Helpers$scalePoint.y;
    if (!polar) {
      return {
        x: x2,
        y: y2
      };
    }
    var polarPadding = getPolarPadding(props, datum);
    return {
      x: x2 + polarPadding.x,
      y: y2 + polarPadding.y
    };
  }
  function getPolarPadding(props, datum) {
    var style = props.style;
    var degrees = getDegrees(props, datum);
    var labelStyle = style.labels || {};
    var padding2 = evaluateProp(labelStyle.padding, props) || 0;
    var angle = degreesToRadians(degrees);
    return {
      x: padding2 * Math.cos(angle),
      y: -padding2 * Math.sin(angle)
    };
  }
  function getLabelPlacement(props) {
    var labelComponent = props.labelComponent, labelPlacement = props.labelPlacement, polar = props.polar;
    var defaultLabelPlacement = polar ? "perpendicular" : "vertical";
    return labelPlacement ? labelPlacement : labelComponent.props && labelComponent.props.labelPlacement || defaultLabelPlacement;
  }
  function getPolarOrientation(degrees) {
    if (degrees < 45 || degrees > 315) {
      return "right";
    } else if (degrees >= 45 && degrees <= 135) {
      return "top";
    } else if (degrees > 135 && degrees < 225) {
      return "left";
    }
    return "bottom";
  }
  function getText(props, datum, index) {
    datum = datum || {};
    if (datum.label !== void 0) {
      return datum.label;
    }
    return Array.isArray(props.labels) ? props.labels[index] : props.labels;
  }
  function getPolarTextAnchor(props, degrees) {
    var labelPlacement = getLabelPlacement(props);
    if (labelPlacement === "perpendicular" || labelPlacement === "vertical" && (degrees === 90 || degrees === 270)) {
      return "middle";
    }
    return degrees <= 90 || degrees > 270 ? "start" : "end";
  }
  function getPolarVerticalAnchor(props, degrees) {
    var labelPlacement = getLabelPlacement(props);
    var orientation = getPolarOrientation(degrees);
    if (labelPlacement === "parallel" || orientation === "left" || orientation === "right") {
      return "middle";
    }
    return orientation === "top" ? "end" : "start";
  }
  function getPolarAngle(props, baseAngle) {
    var labelPlacement = props.labelPlacement, datum = props.datum;
    if (!labelPlacement || labelPlacement === "vertical") {
      return 0;
    }
    var degrees = baseAngle !== void 0 ? baseAngle % 360 : getDegrees(props, datum);
    var sign2 = degrees > 90 && degrees < 180 || degrees > 270 ? 1 : -1;
    var angle = 0;
    if (degrees === 0 || degrees === 180) {
      angle = 90;
    } else if (degrees > 0 && degrees < 180) {
      angle = 90 - degrees;
    } else if (degrees > 180 && degrees < 360) {
      angle = 270 - degrees;
    }
    var labelRotation = labelPlacement === "perpendicular" ? 0 : 90;
    return angle + sign2 * labelRotation;
  }
  function getDegrees(props, datum) {
    var _Helpers$getPoint = getPoint(datum), x2 = _Helpers$getPoint.x;
    return radiansToDegrees(props.scale.x(x2)) % 360;
  }
  function getProps(props, index) {
    var scale2 = props.scale, data = props.data, style = props.style, horizontal = props.horizontal, polar = props.polar, width = props.width, height = props.height, theme = props.theme, labelComponent = props.labelComponent, disableInlineStyles = props.disableInlineStyles;
    var datum = data[index];
    var degrees = getDegrees(props, datum);
    var textAnchor = polar ? getPolarTextAnchor(props, degrees) : getTextAnchor(props, datum);
    var verticalAnchor = polar ? getPolarVerticalAnchor(props, degrees) : getVerticalAnchor(props, datum);
    var angle = getAngle(props, datum);
    var text = getText(props, datum, index);
    var labelPlacement = getLabelPlacement(props);
    var _getPosition = getPosition(props, datum), x2 = _getPosition.x, y2 = _getPosition.y;
    var _getOffset = getOffset(props, datum), dx = _getOffset.dx, dy = _getOffset.dy;
    var labelProps = {
      angle,
      data,
      datum,
      disableInlineStyles,
      horizontal,
      index,
      polar,
      scale: scale2,
      labelPlacement,
      text,
      textAnchor,
      verticalAnchor,
      x: x2,
      y: y2,
      dx,
      dy,
      width,
      height,
      style: style.labels
    };
    if (!isTooltip(labelComponent)) {
      return labelProps;
    }
    var tooltipTheme = theme && theme.tooltip || {};
    return (0, import_defaults4.default)({}, labelProps, omit(tooltipTheme, ["style"]));
  }

  // node_modules/victory-core/es/victory-util/style.js
  var style_exports = {};
  __export(style_exports, {
    getColorScale: () => getColorScale,
    toTransformString: () => toTransformString
  });
  var toTransformString = function(obj) {
    for (var _len = arguments.length, more = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      more[_key - 1] = arguments[_key];
    }
    if (more.length > 0) {
      return more.reduce(function(memo2, currentObj) {
        return [memo2, toTransformString(currentObj)].join(" ");
      }, toTransformString(obj)).trim();
    }
    if (obj === void 0 || obj === null || typeof obj === "string") {
      return obj;
    }
    var transforms = [];
    for (var key in obj) {
      if (obj.hasOwnProperty(key)) {
        var value = obj[key];
        transforms.push("".concat(key, "(").concat(value, ")"));
      }
    }
    return transforms.join(" ").trim();
  };
  function getColorScale(name2) {
    var scales = {
      grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
      qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
      heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
      warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
      cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
      red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
      blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
      green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
    };
    return name2 ? scales[name2] : scales.grayscale;
  }

  // node_modules/victory-core/es/victory-util/textsize.js
  var textsize_exports = {};
  __export(textsize_exports, {
    _approximateTextSizeInternal: () => _approximateTextSizeInternal,
    approximateTextSize: () => approximateTextSize,
    convertLengthToPixels: () => convertLengthToPixels
  });
  var import_memoize = __toESM(require_memoize());
  var import_defaults5 = __toESM(require_defaults());
  var import_assign3 = __toESM(require_assign());
  function _slicedToArray3(arr, i) {
    return _arrayWithHoles3(arr) || _iterableToArrayLimit3(arr, i) || _unsupportedIterableToArray5(arr, i) || _nonIterableRest3();
  }
  function _nonIterableRest3() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArrayLimit3(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null)
      return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i)
          break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null)
          _i["return"]();
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
  function _arrayWithHoles3(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _toConsumableArray5(arr) {
    return _arrayWithoutHoles4(arr) || _iterableToArray4(arr) || _unsupportedIterableToArray5(arr) || _nonIterableSpread4();
  }
  function _nonIterableSpread4() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray5(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray5(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray5(o, minLen);
  }
  function _iterableToArray4(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles4(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray5(arr);
  }
  function _arrayLikeToArray5(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  var fonts = {
    "American Typewriter": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0.4203125, 0.3296875, 0.6, 0.6375, 0.8015625, 0.8203125, 0.1875, 0.45625, 0.45625, 0.6375, 0.5, 0.2734375, 0.309375, 0.2734375, 0.4390625, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.2734375, 0.2734375, 0.5, 0.5, 0.5, 0.6, 0.6921875, 0.7640625, 0.6921875, 0.6375, 0.728125, 0.6734375, 0.6203125, 0.7109375, 0.784375, 0.3828125, 0.6421875, 0.7859375, 0.6375, 0.9484375, 0.7640625, 0.65625, 0.6375, 0.65625, 0.7296875, 0.6203125, 0.6375, 0.7109375, 0.740625, 0.940625, 0.784375, 0.7578125, 0.6203125, 0.4375, 0.5, 0.4375, 0.5, 0.5, 0.4921875, 0.5734375, 0.5890625, 0.5109375, 0.6, 0.528125, 0.43125, 0.5578125, 0.6375, 0.3109375, 0.40625, 0.6234375, 0.309375, 0.928125, 0.6375, 0.546875, 0.6, 0.58125, 0.4921875, 0.4921875, 0.4, 0.6203125, 0.625, 0.825, 0.6375, 0.640625, 0.528125, 0.5, 0.5, 0.5, 0.6671875],
      avg: 0.5793421052631578
    },
    Arial: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.278125, 0.278125, 0.35625, 0.55625, 0.55625, 0.890625, 0.6671875, 0.1921875, 0.334375, 0.334375, 0.390625, 0.584375, 0.278125, 0.334375, 0.278125, 0.278125, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.278125, 0.278125, 0.584375, 0.584375, 0.584375, 0.55625, 1.015625, 0.6703125, 0.6671875, 0.7234375, 0.7234375, 0.6671875, 0.6109375, 0.778125, 0.7234375, 0.278125, 0.5, 0.6671875, 0.55625, 0.834375, 0.7234375, 0.778125, 0.6671875, 0.778125, 0.7234375, 0.6671875, 0.6109375, 0.7234375, 0.6671875, 0.9453125, 0.6671875, 0.6671875, 0.6109375, 0.278125, 0.278125, 0.278125, 0.4703125, 0.584375, 0.334375, 0.55625, 0.55625, 0.5, 0.55625, 0.55625, 0.3125, 0.55625, 0.55625, 0.2234375, 0.2703125, 0.5, 0.2234375, 0.834375, 0.55625, 0.55625, 0.55625, 0.55625, 0.346875, 0.5, 0.278125, 0.55625, 0.5, 0.7234375, 0.5, 0.5, 0.5, 0.334375, 0.2609375, 0.334375, 0.584375],
      avg: 0.528733552631579
    },
    "Arial Black": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.33125, 0.334375, 0.5, 0.6609375, 0.6671875, 1, 0.890625, 0.278125, 0.390625, 0.390625, 0.55625, 0.6609375, 0.334375, 0.334375, 0.334375, 0.28125, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.334375, 0.334375, 0.6609375, 0.6609375, 0.6609375, 0.6109375, 0.7453125, 0.78125, 0.778125, 0.778125, 0.778125, 0.7234375, 0.6671875, 0.834375, 0.834375, 0.390625, 0.6671875, 0.834375, 0.6671875, 0.9453125, 0.834375, 0.834375, 0.7234375, 0.834375, 0.78125, 0.7234375, 0.7234375, 0.834375, 0.7796875, 1.003125, 0.78125, 0.78125, 0.7234375, 0.390625, 0.28125, 0.390625, 0.6609375, 0.5125, 0.334375, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.41875, 0.6671875, 0.6671875, 0.334375, 0.384375, 0.6671875, 0.334375, 1, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.4703125, 0.6109375, 0.4453125, 0.6671875, 0.6140625, 0.946875, 0.6671875, 0.615625, 0.55625, 0.390625, 0.278125, 0.390625, 0.6609375],
      avg: 0.6213157894736842
    },
    Baskerville: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0.25, 0.40625, 0.6671875, 0.490625, 0.875, 0.7015625, 0.178125, 0.2453125, 0.246875, 0.4171875, 0.6671875, 0.25, 0.3125, 0.25, 0.521875, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.25, 0.25, 0.6671875, 0.6671875, 0.6671875, 0.396875, 0.9171875, 0.684375, 0.615625, 0.71875, 0.7609375, 0.625, 0.553125, 0.771875, 0.803125, 0.3546875, 0.515625, 0.78125, 0.6046875, 0.928125, 0.75, 0.8234375, 0.5625, 0.96875, 0.7296875, 0.5421875, 0.6984375, 0.771875, 0.7296875, 0.9484375, 0.771875, 0.678125, 0.6359375, 0.3640625, 0.521875, 0.3640625, 0.46875, 0.5125, 0.334375, 0.46875, 0.521875, 0.428125, 0.521875, 0.4375, 0.3890625, 0.4765625, 0.53125, 0.25, 0.359375, 0.4640625, 0.240625, 0.803125, 0.53125, 0.5, 0.521875, 0.521875, 0.365625, 0.334375, 0.2921875, 0.521875, 0.4640625, 0.678125, 0.4796875, 0.465625, 0.428125, 0.4796875, 0.5109375, 0.4796875, 0.6671875],
      avg: 0.5323519736842108
    },
    Courier: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5984375, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6078125, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.61875, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.615625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6140625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625],
      avg: 0.6020559210526316
    },
    "Courier New": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5984375, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625],
      avg: 0.6015296052631579
    },
    cursive: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1921875, 0.24375, 0.40625, 0.5671875, 0.3984375, 0.721875, 0.909375, 0.2328125, 0.434375, 0.365625, 0.4734375, 0.5578125, 0.19375, 0.3484375, 0.19375, 0.7734375, 0.503125, 0.4171875, 0.5453125, 0.45, 0.6046875, 0.4703125, 0.5984375, 0.55625, 0.503125, 0.5546875, 0.20625, 0.2, 0.5625, 0.5546875, 0.546875, 0.403125, 0.70625, 0.734375, 0.7078125, 0.64375, 0.85, 0.753125, 0.75, 0.6484375, 1.0765625, 0.44375, 0.5359375, 0.8359375, 0.653125, 1.0109375, 1.1515625, 0.6796875, 0.6984375, 1.0625, 0.8234375, 0.5125, 0.9234375, 0.8546875, 0.70625, 0.9109375, 0.7421875, 0.715625, 0.6015625, 0.4640625, 0.3359375, 0.4109375, 0.5421875, 0.5421875, 0.4328125, 0.5125, 0.5, 0.3859375, 0.7375, 0.359375, 0.75625, 0.540625, 0.5328125, 0.3203125, 0.5296875, 0.5015625, 0.484375, 0.7890625, 0.5640625, 0.4203125, 0.703125, 0.471875, 0.4734375, 0.35, 0.4125, 0.5640625, 0.471875, 0.6484375, 0.5296875, 0.575, 0.4140625, 0.415625, 0.20625, 0.3796875, 0.5421875],
      avg: 0.5604440789473684
    },
    fantasy: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.215625, 0.2625, 0.3265625, 0.6109375, 0.534375, 0.7625, 0.7828125, 0.2, 0.4359375, 0.4359375, 0.3765625, 0.5109375, 0.2796875, 0.4609375, 0.2796875, 0.5296875, 0.6640625, 0.253125, 0.521875, 0.4765625, 0.6640625, 0.490625, 0.528125, 0.5546875, 0.496875, 0.5421875, 0.2796875, 0.2796875, 0.5625, 0.4609375, 0.5625, 0.4828125, 0.609375, 0.740625, 0.7234375, 0.740625, 0.8265625, 0.7234375, 0.6171875, 0.7359375, 0.765625, 0.240625, 0.5453125, 0.715625, 0.6078125, 0.8640625, 0.653125, 0.9125, 0.6484375, 0.946875, 0.6921875, 0.653125, 0.6953125, 0.8015625, 0.58125, 0.784375, 0.671875, 0.6265625, 0.690625, 0.4359375, 0.5296875, 0.4359375, 0.53125, 0.5, 0.2875, 0.5375, 0.603125, 0.4984375, 0.60625, 0.53125, 0.434375, 0.6421875, 0.56875, 0.209375, 0.4671875, 0.5484375, 0.2203125, 0.709375, 0.55, 0.5984375, 0.6140625, 0.5765625, 0.40625, 0.4734375, 0.3734375, 0.559375, 0.4421875, 0.6421875, 0.4890625, 0.578125, 0.4484375, 0.2546875, 0.2203125, 0.2546875, 0.55],
      avg: 0.536496710526316
    },
    Geneva: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3328125, 0.3046875, 0.5, 0.6671875, 0.6671875, 0.90625, 0.728125, 0.3046875, 0.446875, 0.446875, 0.5078125, 0.6671875, 0.3046875, 0.3796875, 0.3046875, 0.5390625, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.3046875, 0.3046875, 0.6671875, 0.6671875, 0.6671875, 0.56875, 0.871875, 0.728125, 0.6375, 0.6515625, 0.7015625, 0.5765625, 0.5546875, 0.675, 0.690625, 0.2421875, 0.4921875, 0.6640625, 0.584375, 0.7890625, 0.709375, 0.7359375, 0.584375, 0.78125, 0.60625, 0.60625, 0.640625, 0.6671875, 0.728125, 0.946875, 0.6109375, 0.6109375, 0.5765625, 0.446875, 0.5390625, 0.446875, 0.6671875, 0.6671875, 0.5921875, 0.5546875, 0.6109375, 0.546875, 0.603125, 0.5765625, 0.390625, 0.6109375, 0.584375, 0.2359375, 0.334375, 0.5390625, 0.2359375, 0.8953125, 0.584375, 0.60625, 0.603125, 0.603125, 0.3875, 0.509375, 0.44375, 0.584375, 0.565625, 0.78125, 0.53125, 0.571875, 0.5546875, 0.4515625, 0.246875, 0.4515625, 0.6671875],
      avg: 0.5762664473684211
    },
    Georgia: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2421875, 0.33125, 0.4125, 0.64375, 0.6109375, 0.81875, 0.7109375, 0.215625, 0.375, 0.375, 0.4734375, 0.64375, 0.2703125, 0.375, 0.2703125, 0.46875, 0.6140625, 0.4296875, 0.559375, 0.553125, 0.565625, 0.5296875, 0.5671875, 0.503125, 0.596875, 0.5671875, 0.3125, 0.3125, 0.64375, 0.64375, 0.64375, 0.4796875, 0.9296875, 0.715625, 0.6546875, 0.6421875, 0.75, 0.6546875, 0.6, 0.7265625, 0.815625, 0.390625, 0.51875, 0.7203125, 0.6046875, 0.928125, 0.7671875, 0.7453125, 0.6109375, 0.7453125, 0.7234375, 0.5625, 0.61875, 0.7578125, 0.70625, 0.99375, 0.7125, 0.6640625, 0.6015625, 0.375, 0.46875, 0.375, 0.64375, 0.65, 0.5, 0.5046875, 0.56875, 0.4546875, 0.575, 0.484375, 0.39375, 0.509375, 0.5828125, 0.29375, 0.3671875, 0.546875, 0.2875, 0.88125, 0.5921875, 0.5390625, 0.571875, 0.5640625, 0.4109375, 0.4328125, 0.3453125, 0.5765625, 0.5203125, 0.75625, 0.50625, 0.5171875, 0.4453125, 0.43125, 0.375, 0.43125, 0.64375],
      avg: 0.5551809210526316
    },
    "Gill Sans": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2765625, 0.271875, 0.3546875, 0.584375, 0.5421875, 0.6765625, 0.625, 0.1890625, 0.3234375, 0.3234375, 0.4171875, 0.584375, 0.2203125, 0.3234375, 0.2203125, 0.28125, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.2203125, 0.2296875, 0.584375, 0.584375, 0.584375, 0.334375, 1.0109375, 0.6671875, 0.5640625, 0.709375, 0.75, 0.5, 0.4703125, 0.740625, 0.7296875, 0.25, 0.3125, 0.65625, 0.490625, 0.78125, 0.78125, 0.8234375, 0.5109375, 0.8234375, 0.6046875, 0.459375, 0.6046875, 0.709375, 0.6046875, 1.0421875, 0.709375, 0.6046875, 0.646875, 0.334375, 0.28125, 0.334375, 0.4703125, 0.5828125, 0.334375, 0.428125, 0.5, 0.4390625, 0.5109375, 0.4796875, 0.296875, 0.428125, 0.5, 0.2203125, 0.2265625, 0.5, 0.2203125, 0.771875, 0.5, 0.553125, 0.5, 0.5, 0.3984375, 0.3859375, 0.334375, 0.5, 0.4390625, 0.7203125, 0.5, 0.4390625, 0.4171875, 0.334375, 0.2609375, 0.334375, 0.584375],
      avg: 0.4933717105263159
    },
    Helvetica: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625],
      avg: 0.5279276315789471
    },
    "Helvetica Neue": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.278125, 0.259375, 0.4265625, 0.55625, 0.55625, 1, 0.6453125, 0.278125, 0.2703125, 0.26875, 0.353125, 0.6, 0.278125, 0.3890625, 0.278125, 0.36875, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.278125, 0.278125, 0.6, 0.6, 0.6, 0.55625, 0.8, 0.6625, 0.6859375, 0.7234375, 0.7046875, 0.6125, 0.575, 0.759375, 0.7234375, 0.259375, 0.5203125, 0.6703125, 0.55625, 0.871875, 0.7234375, 0.7609375, 0.6484375, 0.7609375, 0.6859375, 0.6484375, 0.575, 0.7234375, 0.6140625, 0.9265625, 0.6125, 0.6484375, 0.6125, 0.259375, 0.36875, 0.259375, 0.6, 0.5, 0.25625, 0.5375, 0.59375, 0.5375, 0.59375, 0.5375, 0.2984375, 0.575, 0.55625, 0.2234375, 0.2375, 0.5203125, 0.2234375, 0.853125, 0.55625, 0.575, 0.59375, 0.59375, 0.334375, 0.5, 0.315625, 0.55625, 0.5, 0.759375, 0.51875, 0.5, 0.48125, 0.334375, 0.2234375, 0.334375, 0.6],
      avg: 0.5279440789473684
    },
    "Hoefler Text": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2359375, 0.2234375, 0.3921875, 0.7125, 0.49375, 0.8859375, 0.771875, 0.2125, 0.3078125, 0.309375, 0.375, 0.4234375, 0.234375, 0.3125, 0.234375, 0.3, 0.5828125, 0.365625, 0.434375, 0.3921875, 0.5234375, 0.3984375, 0.5125, 0.4328125, 0.46875, 0.5125, 0.234375, 0.234375, 0.515625, 0.4234375, 0.515625, 0.340625, 0.7609375, 0.7359375, 0.6359375, 0.721875, 0.8125, 0.6375, 0.5875, 0.8078125, 0.853125, 0.4296875, 0.503125, 0.78125, 0.609375, 0.9609375, 0.8515625, 0.8140625, 0.6125, 0.8140625, 0.71875, 0.49375, 0.7125, 0.76875, 0.771875, 1.125, 0.7765625, 0.7734375, 0.65625, 0.321875, 0.3078125, 0.321875, 0.3546875, 0.5, 0.3375, 0.446875, 0.5359375, 0.45, 0.5296875, 0.4546875, 0.425, 0.4921875, 0.54375, 0.2671875, 0.240625, 0.5390625, 0.25, 0.815625, 0.5375, 0.5234375, 0.5390625, 0.5421875, 0.365625, 0.36875, 0.35625, 0.5171875, 0.5015625, 0.75, 0.5, 0.509375, 0.44375, 0.2421875, 0.14375, 0.2421875, 0.35],
      avg: 0.5116447368421051
    },
    "Montserrat": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2625, 0.2609375, 0.3734375, 0.696875, 0.615625, 0.8296875, 0.6703125, 0.203125, 0.3296875, 0.3296875, 0.3875, 0.575, 0.2125, 0.3828125, 0.2125, 0.3953125, 0.6625, 0.3625, 0.56875, 0.5640625, 0.6625, 0.5671875, 0.609375, 0.5890625, 0.6390625, 0.609375, 0.2125, 0.2125, 0.575, 0.575, 0.575, 0.5671875, 1.034375, 0.7171875, 0.7546875, 0.7203125, 0.8265625, 0.6703125, 0.634375, 0.7734375, 0.8140625, 0.303125, 0.5078125, 0.7125, 0.5890625, 0.95625, 0.8140625, 0.8390625, 0.71875, 0.8390625, 0.7234375, 0.615625, 0.575, 0.7921875, 0.6984375, 1.1125, 0.65625, 0.6359375, 0.6515625, 0.31875, 0.396875, 0.31875, 0.5765625, 0.5, 0.6, 0.590625, 0.678125, 0.5640625, 0.678125, 0.6046875, 0.375, 0.6875, 0.678125, 0.2703125, 0.365625, 0.6015625, 0.2703125, 1.0625, 0.678125, 0.628125, 0.678125, 0.678125, 0.4015625, 0.4890625, 0.40625, 0.6734375, 0.5421875, 0.8796875, 0.534375, 0.5671875, 0.5125, 0.334375, 0.2953125, 0.334375, 0.575],
      avg: 0.571792763157895
    },
    monospace: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5984375, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6078125, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.61875, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.615625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6140625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625],
      avg: 0.6020559210526316
    },
    Overpass: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2296875, 0.2765625, 0.4203125, 0.68125, 0.584375, 0.8515625, 0.7015625, 0.2203125, 0.3453125, 0.3453125, 0.53125, 0.63125, 0.2234375, 0.3953125, 0.2234375, 0.509375, 0.65, 0.4046875, 0.6171875, 0.60625, 0.6484375, 0.60625, 0.6015625, 0.5375, 0.615625, 0.6015625, 0.2234375, 0.2234375, 0.63125, 0.63125, 0.63125, 0.5015625, 0.8203125, 0.696875, 0.6671875, 0.65, 0.6859375, 0.6015625, 0.559375, 0.690625, 0.7078125, 0.2953125, 0.565625, 0.678125, 0.58125, 0.8046875, 0.7109375, 0.740625, 0.6421875, 0.740625, 0.6765625, 0.6046875, 0.590625, 0.696875, 0.6640625, 0.853125, 0.65, 0.6671875, 0.6625, 0.3734375, 0.509375, 0.3734375, 0.63125, 0.5125, 0.4, 0.5328125, 0.5625, 0.51875, 0.5625, 0.546875, 0.3359375, 0.5625, 0.565625, 0.25625, 0.3203125, 0.55, 0.265625, 0.85, 0.565625, 0.5671875, 0.5625, 0.5625, 0.4046875, 0.4765625, 0.3796875, 0.565625, 0.521875, 0.7265625, 0.53125, 0.5390625, 0.5125, 0.3671875, 0.275, 0.3671875, 0.63125],
      avg: 0.5430756578947369
    },
    Palatino: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0.278125, 0.371875, 0.60625, 0.5, 0.840625, 0.778125, 0.209375, 0.334375, 0.334375, 0.390625, 0.60625, 0.2578125, 0.334375, 0.25, 0.60625, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.25, 0.25, 0.60625, 0.60625, 0.60625, 0.4453125, 0.7484375, 0.778125, 0.6109375, 0.709375, 0.775, 0.6109375, 0.55625, 0.7640625, 0.8328125, 0.3375, 0.346875, 0.7265625, 0.6109375, 0.946875, 0.83125, 0.7875, 0.6046875, 0.7875, 0.66875, 0.525, 0.6140625, 0.778125, 0.7234375, 1, 0.6671875, 0.6671875, 0.6671875, 0.334375, 0.60625, 0.334375, 0.60625, 0.5, 0.334375, 0.5, 0.565625, 0.4453125, 0.6109375, 0.4796875, 0.340625, 0.55625, 0.5828125, 0.2921875, 0.2671875, 0.5640625, 0.2921875, 0.8828125, 0.5828125, 0.546875, 0.6015625, 0.5609375, 0.3953125, 0.425, 0.3265625, 0.603125, 0.565625, 0.834375, 0.5171875, 0.55625, 0.5, 0.334375, 0.60625, 0.334375, 0.60625],
      avg: 0.5408552631578947
    },
    "RedHatText": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2328125, 0.2203125, 0.35625, 0.6890625, 0.55, 0.7390625, 0.6703125, 0.2140625, 0.4015625, 0.4015625, 0.4546875, 0.53125, 0.2203125, 0.45625, 0.2203125, 0.515625, 0.6609375, 0.3078125, 0.5484375, 0.5875, 0.61875, 0.5703125, 0.6203125, 0.559375, 0.6140625, 0.6203125, 0.2203125, 0.2234375, 0.465625, 0.534375, 0.465625, 0.5125, 0.7671875, 0.6609375, 0.6703125, 0.7265625, 0.728125, 0.6203125, 0.6109375, 0.8, 0.73125, 0.253125, 0.6, 0.6125, 0.6078125, 0.8625, 0.7390625, 0.8109375, 0.6546875, 0.809375, 0.6484375, 0.6234375, 0.6171875, 0.7125, 0.6609375, 0.8984375, 0.6546875, 0.646875, 0.60625, 0.3625, 0.5203125, 0.3625, 0.540625, 0.4609375, 0.5234375, 0.5265625, 0.584375, 0.509375, 0.5828125, 0.5578125, 0.3703125, 0.5828125, 0.553125, 0.2234375, 0.24375, 0.4890625, 0.2234375, 0.8453125, 0.553125, 0.58125, 0.584375, 0.5828125, 0.353125, 0.453125, 0.378125, 0.553125, 0.5015625, 0.6984375, 0.4875, 0.4984375, 0.459375, 0.3953125, 0.2921875, 0.3953125, 0.58125],
      avg: 0.5341940789473685
    },
    "sans-serif": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.278125, 0.278125, 0.35625, 0.55625, 0.55625, 0.890625, 0.6671875, 0.1921875, 0.334375, 0.334375, 0.390625, 0.584375, 0.278125, 0.334375, 0.278125, 0.303125, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.278125, 0.278125, 0.5859375, 0.584375, 0.5859375, 0.55625, 1.015625, 0.6671875, 0.6671875, 0.7234375, 0.7234375, 0.6671875, 0.6109375, 0.778125, 0.7234375, 0.278125, 0.5, 0.6671875, 0.55625, 0.834375, 0.7234375, 0.778125, 0.6671875, 0.778125, 0.7234375, 0.6671875, 0.6109375, 0.7234375, 0.6671875, 0.9453125, 0.6671875, 0.6671875, 0.6109375, 0.278125, 0.35625, 0.278125, 0.478125, 0.55625, 0.334375, 0.55625, 0.55625, 0.5, 0.55625, 0.55625, 0.278125, 0.55625, 0.55625, 0.2234375, 0.2421875, 0.5, 0.2234375, 0.834375, 0.55625, 0.55625, 0.55625, 0.55625, 0.334375, 0.5, 0.278125, 0.55625, 0.5, 0.7234375, 0.5, 0.5, 0.5, 0.35625, 0.2609375, 0.3546875, 0.590625],
      avg: 0.5293256578947368
    },
    Seravek: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.215625, 0.296875, 0.4171875, 0.6734375, 0.4953125, 0.9125, 0.740625, 0.2421875, 0.3375, 0.3375, 0.409375, 0.60625, 0.2609375, 0.35625, 0.25625, 0.41875, 0.5921875, 0.3515625, 0.475, 0.4875, 0.5375, 0.509375, 0.5484375, 0.4546875, 0.5421875, 0.5484375, 0.25625, 0.2546875, 0.5875, 0.6171875, 0.5875, 0.4578125, 0.8140625, 0.6765625, 0.5703125, 0.6109375, 0.684375, 0.5109375, 0.4953125, 0.678125, 0.6859375, 0.2625, 0.2625, 0.5859375, 0.4734375, 0.846875, 0.709375, 0.740625, 0.509375, 0.740625, 0.584375, 0.5015625, 0.528125, 0.675, 0.5953125, 0.9453125, 0.596875, 0.540625, 0.540625, 0.359375, 0.4203125, 0.359375, 0.5109375, 0.421875, 0.4046875, 0.5015625, 0.5421875, 0.446875, 0.5453125, 0.484375, 0.38125, 0.5140625, 0.5546875, 0.240625, 0.2640625, 0.490625, 0.2765625, 0.8625, 0.5546875, 0.546875, 0.5453125, 0.5453125, 0.3625, 0.41875, 0.3890625, 0.5453125, 0.4703125, 0.7546875, 0.4921875, 0.4609375, 0.453125, 0.4015625, 0.2640625, 0.4015625, 0.58125],
      avg: 0.5044078947368421
    },
    serif: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2484375, 0.334375, 0.409375, 0.5, 0.5, 0.834375, 0.778125, 0.18125, 0.334375, 0.334375, 0.5, 0.5640625, 0.25, 0.334375, 0.25, 0.278125, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.278125, 0.278125, 0.5640625, 0.5640625, 0.5640625, 0.4453125, 0.921875, 0.7234375, 0.6671875, 0.6671875, 0.7234375, 0.6109375, 0.55625, 0.7234375, 0.7234375, 0.334375, 0.390625, 0.7234375, 0.6109375, 0.890625, 0.7234375, 0.7234375, 0.55625, 0.7234375, 0.6671875, 0.55625, 0.6109375, 0.7234375, 0.7234375, 0.9453125, 0.7234375, 0.7234375, 0.6109375, 0.334375, 0.340625, 0.334375, 0.4703125, 0.5, 0.3453125, 0.4453125, 0.5, 0.4453125, 0.5, 0.4453125, 0.3828125, 0.5, 0.5, 0.278125, 0.3359375, 0.5, 0.278125, 0.778125, 0.5, 0.5, 0.5, 0.5, 0.3375, 0.390625, 0.2796875, 0.5, 0.5, 0.7234375, 0.5, 0.5, 0.4453125, 0.48125, 0.2015625, 0.48125, 0.5421875],
      avg: 0.5126315789473684
    },
    Tahoma: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3109375, 0.3328125, 0.4015625, 0.728125, 0.546875, 0.9765625, 0.70625, 0.2109375, 0.3828125, 0.3828125, 0.546875, 0.728125, 0.303125, 0.3640625, 0.303125, 0.3953125, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.3546875, 0.3546875, 0.728125, 0.728125, 0.728125, 0.475, 0.909375, 0.6109375, 0.590625, 0.6015625, 0.6796875, 0.5625, 0.521875, 0.66875, 0.6765625, 0.3734375, 0.4171875, 0.6046875, 0.4984375, 0.771875, 0.66875, 0.7078125, 0.5515625, 0.7078125, 0.6375, 0.5578125, 0.5875, 0.65625, 0.60625, 0.903125, 0.58125, 0.5890625, 0.559375, 0.3828125, 0.39375, 0.3828125, 0.728125, 0.5625, 0.546875, 0.525, 0.553125, 0.4625, 0.553125, 0.5265625, 0.3546875, 0.553125, 0.5578125, 0.2296875, 0.328125, 0.51875, 0.2296875, 0.840625, 0.5578125, 0.54375, 0.553125, 0.553125, 0.3609375, 0.446875, 0.3359375, 0.5578125, 0.4984375, 0.7421875, 0.4953125, 0.4984375, 0.4453125, 0.48125, 0.3828125, 0.48125, 0.728125],
      avg: 0.5384374999999998
    },
    "Times New Roman": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2484375, 0.334375, 0.409375, 0.5, 0.5, 0.834375, 0.778125, 0.18125, 0.334375, 0.334375, 0.5, 0.5640625, 0.25, 0.334375, 0.25, 0.28125, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.278125, 0.278125, 0.5640625, 0.5640625, 0.5640625, 0.4453125, 0.921875, 0.7234375, 0.6671875, 0.6671875, 0.7234375, 0.6109375, 0.55625, 0.7234375, 0.7234375, 0.334375, 0.390625, 0.73125, 0.6109375, 0.890625, 0.7375, 0.7234375, 0.55625, 0.7234375, 0.6765625, 0.55625, 0.6109375, 0.7234375, 0.7234375, 0.9453125, 0.7234375, 0.7234375, 0.6109375, 0.334375, 0.28125, 0.334375, 0.4703125, 0.51875, 0.334375, 0.4453125, 0.503125, 0.4453125, 0.503125, 0.4453125, 0.4359375, 0.5, 0.5, 0.278125, 0.35625, 0.50625, 0.278125, 0.778125, 0.5, 0.5, 0.5046875, 0.5, 0.340625, 0.390625, 0.2796875, 0.5, 0.5, 0.7234375, 0.5, 0.5, 0.4453125, 0.48125, 0.2015625, 0.48125, 0.5421875],
      avg: 0.5134375
    },
    "Trebuchet MS": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3015625, 0.3671875, 0.325, 0.53125, 0.525, 0.6015625, 0.70625, 0.1609375, 0.3671875, 0.3671875, 0.3671875, 0.525, 0.3671875, 0.3671875, 0.3671875, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.3671875, 0.3671875, 0.525, 0.525, 0.525, 0.3671875, 0.771875, 0.590625, 0.5671875, 0.5984375, 0.6140625, 0.5359375, 0.525, 0.6765625, 0.6546875, 0.2796875, 0.4765625, 0.5765625, 0.5078125, 0.7109375, 0.6390625, 0.675, 0.5578125, 0.7421875, 0.5828125, 0.48125, 0.58125, 0.6484375, 0.5875, 0.853125, 0.5578125, 0.5703125, 0.5515625, 0.3671875, 0.3578125, 0.3671875, 0.525, 0.53125, 0.525, 0.5265625, 0.5578125, 0.4953125, 0.5578125, 0.546875, 0.375, 0.503125, 0.546875, 0.2859375, 0.3671875, 0.5046875, 0.2953125, 0.83125, 0.546875, 0.5375, 0.5578125, 0.5578125, 0.3890625, 0.40625, 0.396875, 0.546875, 0.490625, 0.7453125, 0.5015625, 0.49375, 0.475, 0.3671875, 0.525, 0.3671875, 0.525],
      avg: 0.5085197368421052
    },
    Verdana: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.35, 0.39375, 0.459375, 0.81875, 0.6359375, 1.0765625, 0.759375, 0.26875, 0.4546875, 0.4546875, 0.6359375, 0.81875, 0.3640625, 0.4546875, 0.3640625, 0.4703125, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.4546875, 0.4546875, 0.81875, 0.81875, 0.81875, 0.546875, 1, 0.684375, 0.6859375, 0.6984375, 0.771875, 0.6328125, 0.575, 0.7765625, 0.7515625, 0.421875, 0.4546875, 0.69375, 0.5578125, 0.84375, 0.7484375, 0.7875, 0.603125, 0.7875, 0.7, 0.684375, 0.6171875, 0.7328125, 0.684375, 0.9890625, 0.6859375, 0.615625, 0.6859375, 0.4546875, 0.46875, 0.4546875, 0.81875, 0.6421875, 0.6359375, 0.6015625, 0.6234375, 0.521875, 0.6234375, 0.596875, 0.384375, 0.6234375, 0.6328125, 0.275, 0.3765625, 0.5921875, 0.275, 0.9734375, 0.6328125, 0.6078125, 0.6234375, 0.6234375, 0.43125, 0.521875, 0.3953125, 0.6328125, 0.5921875, 0.81875, 0.5921875, 0.5921875, 0.5265625, 0.6359375, 0.4546875, 0.6359375, 0.81875],
      avg: 0.6171875000000003
    }
  };
  var absoluteMeasurementUnitsToPixels = {
    mm: 3.8,
    sm: 38,
    pt: 1.33,
    pc: 16,
    in: 96,
    px: 1
  };
  var relativeMeasurementUnitsCoef = {
    em: 1,
    ex: 0.5
  };
  var coefficients = {
    heightOverlapCoef: 1.05,
    // Coefficient for height value to prevent overlap.
    lineCapitalCoef: 1.15
    // Coefficient for height value. Reserve space for capital chars.
  };
  var defaultStyle = {
    lineHeight: 1,
    letterSpacing: "0px",
    fontSize: 0,
    angle: 0,
    fontFamily: ""
  };
  var _degreeToRadian = function(angle) {
    return angle * Math.PI / 180;
  };
  var _getFontData = function(fontFamily) {
    var possibleFonts = fontFamily.split(",").map(function(f) {
      return f.replace(/'|"/g, "");
    });
    var fontMatch = possibleFonts.find(function(f) {
      return fonts[f];
    }) || "Helvetica";
    return fonts[fontMatch];
  };
  var _splitToLines = function(text) {
    return Array.isArray(text) ? text : text.toString().split(/\r\n|\r|\n/g);
  };
  var _getSizeWithRotate = function(axisSize, dependentSize, angle) {
    var angleInRadian = _degreeToRadian(angle);
    return Math.abs(Math.cos(angleInRadian) * axisSize) + Math.abs(Math.sin(angleInRadian) * dependentSize);
  };
  var convertLengthToPixels = function(length, fontSize3) {
    var _length$match;
    var attribute = (_length$match = length.match(/[a-zA-Z%]+/)) === null || _length$match === void 0 ? void 0 : _length$match[0];
    var value = Number(length.match(/[0-9.,]+/));
    var result;
    if (!attribute) {
      result = value || 0;
    } else if (absoluteMeasurementUnitsToPixels.hasOwnProperty(attribute)) {
      result = value * absoluteMeasurementUnitsToPixels[attribute];
    } else if (relativeMeasurementUnitsCoef.hasOwnProperty(attribute)) {
      result = (fontSize3 ? value * fontSize3 : value * defaultStyle.fontSize) * relativeMeasurementUnitsCoef[attribute];
    } else {
      result = value;
    }
    return result;
  };
  var _prepareParams = function(inputStyle, index) {
    var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
    var style = (0, import_defaults5.default)({}, lineStyle, defaultStyle);
    return (0, import_assign3.default)({}, style, {
      fontFamily: style.fontFamily,
      letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
      fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
    });
  };
  var _approximateTextWidthInternal = function(text, style) {
    if (text === void 0 || text === "" || text === null) {
      return 0;
    }
    var widths = _splitToLines(text).map(function(line, index) {
      var len = line.toString().length;
      var _prepareParams2 = _prepareParams(style, index), fontSize3 = _prepareParams2.fontSize, letterSpacing3 = _prepareParams2.letterSpacing, fontFamily = _prepareParams2.fontFamily;
      var fontData = _getFontData(fontFamily);
      var width = line.toString().split("").map(function(c2) {
        return c2.charCodeAt(0) < fontData.widths.length ? fontData.widths[c2.charCodeAt(0)] : fontData.avg;
      }).reduce(function(cur, acc) {
        return acc + cur;
      }, 0) * fontSize3;
      return width + letterSpacing3 * Math.max(len - 1, 0);
    });
    return Math.max.apply(Math, _toConsumableArray5(widths));
  };
  var _approximateTextHeightInternal = function(text, style) {
    if (text === void 0 || text === "" || text === null) {
      return 0;
    }
    return _splitToLines(text).reduce(function(total, line, index) {
      var lineStyle = _prepareParams(style, index);
      var containsCaps = line.toString().match(/[(A-Z)(0-9)]/);
      var height = containsCaps ? lineStyle.fontSize * coefficients.lineCapitalCoef : lineStyle.fontSize;
      return total + lineStyle.lineHeight * height;
    }, 0);
  };
  var _approximateDimensionsInternal = function(text, style) {
    var angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
    var height = _approximateTextHeightInternal(text, style);
    var width = _approximateTextWidthInternal(text, style);
    var widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
    var heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
    return {
      width: widthWithRotate,
      height: heightWithRotate * coefficients.heightOverlapCoef
    };
  };
  var _getMeasurementContainer = (0, import_memoize.default)(function() {
    var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
    element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
    var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
    element.appendChild(containerElement);
    element.style.position = "fixed";
    element.style.top = "-9999px";
    element.style.left = "-9999px";
    document.body.appendChild(element);
    return containerElement;
  });
  var styleToKeyComponent = function(style) {
    if (!style) {
      return "null";
    }
    return "".concat(style.angle, ":").concat(style.fontFamily, ":").concat(style.fontSize, ":").concat(style.letterSpacing, ":").concat(style.lineHeight);
  };
  var _measureDimensionsInternal = (0, import_memoize.default)(function(text, style) {
    var containerElement = _getMeasurementContainer();
    var lines = _splitToLines(text);
    var heightAcc = 0;
    for (var _ref2 of lines.entries()) {
      var _ref22 = _slicedToArray3(_ref2, 2);
      var i = _ref22[0];
      var line = _ref22[1];
      var textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
      var params = _prepareParams(style, i);
      textElement.style.fontFamily = params.fontFamily;
      textElement.style.transform = "rotate(".concat(params.angle, ")");
      textElement.style.fontSize = "".concat(params.fontSize, "px");
      textElement.style.lineHeight = params.lineHeight;
      textElement.style.fontFamily = params.fontFamily;
      textElement.style.letterSpacing = params.letterSpacing;
      textElement.textContent = line;
      textElement.setAttribute("x", "0");
      textElement.setAttribute("y", "".concat(heightAcc));
      heightAcc += params.lineHeight * params.fontSize;
      containerElement.appendChild(textElement);
    }
    var _containerElement$get = containerElement.getBoundingClientRect(), width = _containerElement$get.width, height = _containerElement$get.height;
    containerElement.innerHTML = "";
    return {
      width,
      height
    };
  }, function(text, style) {
    var totalText = Array.isArray(text) ? text.join() : text;
    var totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
    return "".concat(totalText, "::").concat(totalStyle);
  });
  var _approximateTextSizeInternal = {
    impl: function(text, style) {
      var __debugForceApproximate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
      var isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
      if (!isClient || __debugForceApproximate) {
        return _approximateDimensionsInternal(text, style);
      }
      return _measureDimensionsInternal(text, style);
    }
  };
  var approximateTextSize = function(text, style) {
    return _approximateTextSizeInternal.impl(text, style);
  };

  // node_modules/victory-core/es/victory-label/victory-label.js
  function ownKeys5(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread5(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys5(Object(source), true).forEach(function(key) {
        _defineProperty8(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys5(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty8(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toConsumableArray6(arr) {
    return _arrayWithoutHoles5(arr) || _iterableToArray5(arr) || _unsupportedIterableToArray6(arr) || _nonIterableSpread5();
  }
  function _nonIterableSpread5() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray6(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray6(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray6(o, minLen);
  }
  function _iterableToArray5(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles5(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray6(arr);
  }
  function _arrayLikeToArray6(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  var defaultStyles = {
    fill: "#252525",
    fontSize: 14,
    fontFamily: "'Gill Sans', 'Gill Sans MT', 'Ser\xADavek', 'Trebuchet MS', sans-serif",
    stroke: "transparent"
  };
  var getPosition2 = function(props, dimension) {
    if (!props.datum) {
      return 0;
    }
    var scaledPoint = scalePoint(props, props.datum);
    return scaledPoint[dimension];
  };
  var getFontSize = function(style) {
    var baseSize = style && style.fontSize;
    if (typeof baseSize === "number") {
      return baseSize;
    } else if (baseSize === void 0 || baseSize === null) {
      return defaultStyles.fontSize;
    } else if (typeof baseSize === "string") {
      var fontSize3 = Number(baseSize.replace("px", ""));
      if (!isNaN(fontSize3)) {
        return fontSize3;
      }
      warn("fontSize should be expressed as a number of pixels");
      return defaultStyles.fontSize;
    }
    return defaultStyles.fontSize;
  };
  var getSingleValue = function(prop) {
    var index = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
    return Array.isArray(prop) ? prop[index] || prop[0] : prop;
  };
  var shouldUseMultilineBackgrounds = function(props) {
    var backgroundStyle = props.backgroundStyle, backgroundPadding = props.backgroundPadding;
    return Array.isArray(backgroundStyle) && !(0, import_isEmpty.default)(backgroundStyle) || Array.isArray(backgroundPadding) && !(0, import_isEmpty.default)(backgroundPadding);
  };
  var getStyles2 = function(style, props) {
    if (props.disableInlineStyles) {
      var baseStyles2 = evaluateStyle(style, props);
      return {
        // Font size is necessary to calculate the y position of the label
        fontSize: getFontSize(baseStyles2)
      };
    }
    var getSingleStyle = function(s2) {
      s2 = s2 ? (0, import_defaults6.default)({}, s2, defaultStyles) : defaultStyles;
      var baseStyles3 = evaluateStyle(s2, props);
      return (0, import_assign4.default)({}, baseStyles3, {
        fontSize: getFontSize(baseStyles3)
      });
    };
    return Array.isArray(style) && !(0, import_isEmpty.default)(style) ? style.map(function(s2) {
      return getSingleStyle(s2);
    }) : getSingleStyle(style);
  };
  var getBackgroundStyles = function(style, props) {
    if (!style) {
      return void 0;
    }
    return Array.isArray(style) && !(0, import_isEmpty.default)(style) ? style.map(function(s2) {
      return evaluateStyle(s2, props);
    }) : evaluateStyle(style, props);
  };
  var getBackgroundPadding = function(props) {
    if (props.backgroundPadding && Array.isArray(props.backgroundPadding)) {
      return props.backgroundPadding.map(function(backgroundPadding) {
        var padding3 = evaluateProp(backgroundPadding, props);
        return getPadding({
          padding: padding3
        });
      });
    }
    var padding2 = evaluateProp(props.backgroundPadding, props);
    return getPadding({
      padding: padding2
    });
  };
  var getLineHeight = function(props) {
    var lineHeight = evaluateProp(props.lineHeight, props);
    if (Array.isArray(lineHeight)) {
      return (0, import_isEmpty.default)(lineHeight) ? [1] : lineHeight;
    }
    return lineHeight;
  };
  var getContent = function(text, props) {
    if (text === void 0 || text === null) {
      return void 0;
    }
    if (Array.isArray(text)) {
      return text.map(function(line) {
        return evaluateProp(line, props);
      });
    }
    var child = evaluateProp(text, props);
    if (child === void 0 || child === null) {
      return void 0;
    }
    return Array.isArray(child) ? child : "".concat(child).split("\n");
  };
  var getDy = function(props, verticalAnchor, lineHeight) {
    var dy = props.dy ? evaluateProp(props.dy, props) : 0;
    var length = props.inline ? 1 : props.text.length;
    var capHeight = evaluateProp(props.capHeight, props);
    var anchor = verticalAnchor ? evaluateProp(verticalAnchor, props) : "middle";
    var fontSizes = _toConsumableArray6(Array(length).keys()).map(function(i) {
      return getSingleValue(props.style, i).fontSize;
    });
    var lineHeights = _toConsumableArray6(Array(length).keys()).map(function(i) {
      return getSingleValue(lineHeight, i);
    });
    if (anchor === "start") {
      return dy + (capHeight / 2 + lineHeights[0] / 2) * fontSizes[0];
    } else if (props.inline) {
      return anchor === "end" ? dy + (capHeight / 2 - lineHeights[0] / 2) * fontSizes[0] : dy + capHeight / 2 * fontSizes[0];
    } else if (length === 1) {
      return anchor === "end" ? dy + (capHeight / 2 + (0.5 - length) * lineHeights[0]) * fontSizes[0] : dy + (capHeight / 2 + (0.5 - length / 2) * lineHeights[0]) * fontSizes[0];
    }
    var allHeights = _toConsumableArray6(Array(length).keys()).reduce(function(memo2, i) {
      return memo2 + (capHeight / 2 + (0.5 - length) * lineHeights[i]) * fontSizes[i] / length;
    }, 0);
    return anchor === "end" ? dy + allHeights : dy + allHeights / 2 + capHeight / 2 * lineHeights[length - 1] * fontSizes[length - 1];
  };
  var getTransform = function(props, x2, y2) {
    var polar = props.polar;
    var style = getSingleValue(props.style);
    var defaultAngle = polar ? getPolarAngle(props) : 0;
    var baseAngle = style.angle === void 0 ? evaluateProp(props.angle, props) : style.angle;
    var angle = baseAngle === void 0 ? defaultAngle : baseAngle;
    var transform2 = props.transform || style.transform;
    var transformPart = transform2 && evaluateProp(transform2, props);
    var rotatePart = angle && {
      rotate: [angle, x2, y2]
    };
    return transformPart || angle ? toTransformString(transformPart, rotatePart) : void 0;
  };
  var getXCoordinate = function(calculatedProps, labelSizeWidth) {
    var direction = calculatedProps.direction, textAnchor = calculatedProps.textAnchor, x2 = calculatedProps.x, dx = calculatedProps.dx;
    if (direction === "rtl") {
      return x2 - labelSizeWidth;
    }
    switch (textAnchor) {
      case "middle":
        return Math.round(x2 - labelSizeWidth / 2);
      case "end":
        return Math.round(x2 - labelSizeWidth);
      default:
        return x2 + (dx || 0);
    }
  };
  var getYCoordinate = function(calculatedProps, textHeight) {
    var verticalAnchor = calculatedProps.verticalAnchor, y2 = calculatedProps.y, _calculatedProps$orig = calculatedProps.originalDy, originalDy = _calculatedProps$orig === void 0 ? 0 : _calculatedProps$orig;
    var offset2 = y2 + originalDy;
    switch (verticalAnchor) {
      case "start":
        return Math.floor(offset2);
      case "end":
        return Math.ceil(offset2 - textHeight);
      default:
        return Math.floor(offset2 - textHeight / 2);
    }
  };
  var getFullBackground = function(calculatedProps, tspanValues) {
    var _calculatedProps$dx = calculatedProps.dx, dx = _calculatedProps$dx === void 0 ? 0 : _calculatedProps$dx, transform2 = calculatedProps.transform, backgroundComponent = calculatedProps.backgroundComponent, backgroundStyle = calculatedProps.backgroundStyle, inline = calculatedProps.inline, backgroundPadding = calculatedProps.backgroundPadding, capHeight = calculatedProps.capHeight;
    var textSizes = tspanValues.map(function(tspan) {
      return tspan.textSize;
    });
    var height = inline ? Math.max.apply(Math, _toConsumableArray6(textSizes.map(function(size) {
      return size.height;
    }))) : textSizes.reduce(function(memo2, size, i) {
      var capHeightAdjustment = i ? 0 : capHeight / 2;
      return memo2 + size.height * (tspanValues[i].lineHeight - capHeightAdjustment);
    }, 0);
    var width = inline ? textSizes.reduce(function(memo2, size, index) {
      var offset2 = index ? dx : 0;
      return memo2 + size.width + offset2;
    }, 0) : Math.max.apply(Math, _toConsumableArray6(textSizes.map(function(size) {
      return size.width;
    })));
    var xCoordinate = getXCoordinate(calculatedProps, width);
    var yCoordinate = getYCoordinate(calculatedProps, height);
    var backgroundProps = {
      key: "background",
      height: height + backgroundPadding.top + backgroundPadding.bottom,
      style: backgroundStyle,
      transform: transform2,
      width: width + backgroundPadding.left + backgroundPadding.right,
      x: inline ? xCoordinate - backgroundPadding.left : xCoordinate + dx - backgroundPadding.left,
      y: yCoordinate
    };
    return /* @__PURE__ */ import_react51.default.cloneElement(backgroundComponent, (0, import_defaults6.default)({}, backgroundComponent.props, backgroundProps));
  };
  var getInlineXOffset = function(calculatedProps, textElements, index) {
    var textAnchor = calculatedProps.textAnchor;
    var widths = textElements.map(function(t) {
      return t.widthWithPadding;
    });
    var totalWidth = widths.reduce(function(memo2, width) {
      return memo2 + width;
    }, 0);
    var centerOffset = -totalWidth / 2;
    switch (textAnchor) {
      case "start":
        return widths.reduce(function(memo2, width, i) {
          memo2 = i < index ? memo2 + width : memo2;
          return memo2;
        }, 0);
      case "end":
        return widths.reduce(function(memo2, width, i) {
          memo2 = i > index ? memo2 - width : memo2;
          return memo2;
        }, 0);
      default:
        return widths.reduce(function(memo2, width, i) {
          var offsetWidth = i < index ? width : 0;
          memo2 = i === index ? memo2 + width / 2 : memo2 + offsetWidth;
          return memo2;
        }, centerOffset);
    }
  };
  var getChildBackgrounds = function(calculatedProps, tspanValues) {
    var dy = calculatedProps.dy, dx = calculatedProps.dx, transform2 = calculatedProps.transform, backgroundStyle = calculatedProps.backgroundStyle, backgroundPadding = calculatedProps.backgroundPadding, backgroundComponent = calculatedProps.backgroundComponent, inline = calculatedProps.inline, y2 = calculatedProps.y;
    var textElements = tspanValues.map(function(current, i) {
      var previous = getSingleValue(tspanValues, i - 1);
      var labelSize = current.textSize;
      var totalLineHeight = current.fontSize * current.lineHeight;
      var textHeight = Math.ceil(totalLineHeight);
      var padding2 = getSingleValue(backgroundPadding, i);
      var prevPadding = getSingleValue(backgroundPadding, i - 1);
      var xOffset = inline ? dx || 0 : 0;
      var childDy = i && !inline ? previous.fontSize * previous.lineHeight + prevPadding.top + prevPadding.bottom : dy - totalLineHeight * 0.5 - (current.fontSize - current.capHeight);
      return {
        textHeight,
        labelSize,
        heightWithPadding: textHeight + padding2.top + padding2.bottom,
        widthWithPadding: labelSize.width + padding2.left + padding2.right + xOffset,
        y: y2,
        fontSize: current.fontSize,
        dy: childDy
      };
    });
    return textElements.map(function(textElement, i) {
      var xCoordinate = getXCoordinate(calculatedProps, textElement.labelSize.width);
      var yCoordinate = textElements.slice(0, i + 1).reduce(function(prev, curr) {
        return prev + curr.dy;
      }, y2);
      var padding2 = getSingleValue(backgroundPadding, i);
      var height = textElement.heightWithPadding;
      var xCoord = inline ? getInlineXOffset(calculatedProps, textElements, i) + xCoordinate - padding2.left : xCoordinate;
      var yCoord = inline ? getYCoordinate(calculatedProps, height) - padding2.top : yCoordinate;
      var backgroundProps = {
        key: "tspan-background-".concat(i),
        height,
        style: getSingleValue(backgroundStyle, i),
        width: textElement.widthWithPadding,
        transform: transform2,
        x: xCoord - padding2.left,
        y: yCoord
      };
      return /* @__PURE__ */ import_react51.default.cloneElement(backgroundComponent, (0, import_defaults6.default)({}, backgroundComponent.props, backgroundProps));
    });
  };
  var getBackgroundElement = function(calculatedProps, tspanValues) {
    return shouldUseMultilineBackgrounds(calculatedProps) ? getChildBackgrounds(calculatedProps, tspanValues) : getFullBackground(calculatedProps, tspanValues);
  };
  var calculateSpanDy = function(tspanValues, i, calculatedProps) {
    var current = getSingleValue(tspanValues, i);
    var previous = getSingleValue(tspanValues, i - 1);
    var previousHeight = previous.fontSize * previous.lineHeight;
    var currentHeight = current.fontSize * current.lineHeight;
    var previousCaps = previous.fontSize - previous.capHeight;
    var currentCaps = current.fontSize - current.capHeight;
    var textHeight = previousHeight - previous.fontSize / 2 + current.fontSize / 2 - previousHeight / 2 + currentHeight / 2 - currentCaps / 2 + previousCaps / 2;
    return shouldUseMultilineBackgrounds(calculatedProps) ? textHeight + current.backgroundPadding.top + previous.backgroundPadding.bottom : textHeight;
  };
  var getTSpanDy = function(tspanValues, calculatedProps, i) {
    var inline = calculatedProps.inline;
    var current = getSingleValue(tspanValues, i);
    if (i && !inline) {
      return calculateSpanDy(tspanValues, i, calculatedProps);
    } else if (inline) {
      return i === 0 ? current.backgroundPadding.top : void 0;
    }
    return current.backgroundPadding.top;
  };
  var evaluateProps = function(props) {
    var text = getContent(props.text, props);
    var style = getStyles2(props.style, (0, import_assign4.default)({}, props, {
      text
    }));
    var backgroundStyle = getBackgroundStyles(props.backgroundStyle, (0, import_assign4.default)({}, props, {
      text,
      style
    }));
    var backgroundPadding = getBackgroundPadding((0, import_assign4.default)({}, props, {
      text,
      style,
      backgroundStyle
    }));
    var id = evaluateProp(props.id, props);
    return (0, import_assign4.default)({}, props, {
      backgroundStyle,
      backgroundPadding,
      style,
      text,
      id
    });
  };
  var getCalculatedProps = function(props) {
    var ariaLabel = evaluateProp(props.ariaLabel, props);
    var style = getSingleValue(props.style);
    var lineHeight = getLineHeight(props);
    var direction = props.direction ? evaluateProp(props.direction, props) : "inherit";
    var textAnchor = props.textAnchor ? evaluateProp(props.textAnchor, props) : style.textAnchor || "start";
    var verticalAnchor = props.verticalAnchor ? evaluateProp(props.verticalAnchor, props) : style.verticalAnchor || "middle";
    var dx = props.dx ? evaluateProp(props.dx, props) : 0;
    var dy = getDy(props, verticalAnchor, lineHeight);
    var x2 = props.x !== void 0 ? props.x : getPosition2(props, "x");
    var y2 = props.y !== void 0 ? props.y : getPosition2(props, "y");
    var transform2 = getTransform(props, x2, y2);
    return (0, import_assign4.default)({}, props, {
      ariaLabel,
      lineHeight,
      direction,
      textAnchor,
      verticalAnchor,
      dx,
      dy,
      originalDy: props.dy,
      transform: transform2,
      x: x2,
      y: y2
    });
  };
  var renderLabel = function(calculatedProps, tspanValues) {
    var ariaLabel = calculatedProps.ariaLabel, inline = calculatedProps.inline, className = calculatedProps.className, title = calculatedProps.title, events = calculatedProps.events, direction = calculatedProps.direction, text = calculatedProps.text, textAnchor = calculatedProps.textAnchor, dx = calculatedProps.dx, dy = calculatedProps.dy, transform2 = calculatedProps.transform, x2 = calculatedProps.x, y2 = calculatedProps.y, desc = calculatedProps.desc, id = calculatedProps.id, tabIndex = calculatedProps.tabIndex, tspanComponent = calculatedProps.tspanComponent, textComponent = calculatedProps.textComponent;
    var userProps = getSafeUserProps(calculatedProps);
    var textProps = _objectSpread5(_objectSpread5({
      "aria-label": ariaLabel,
      key: "text"
    }, events), {}, {
      direction,
      dx,
      x: x2,
      y: y2 + dy,
      transform: transform2,
      className,
      title,
      desc: evaluateProp(desc, calculatedProps),
      tabIndex: evaluateProp(tabIndex, calculatedProps),
      id
    }, userProps);
    var tspans = text.map(function(line, i) {
      var currentStyle = tspanValues[i].style;
      var tspanProps = {
        key: "".concat(id, "-key-").concat(i),
        x: !inline ? x2 : void 0,
        dx: inline ? dx + tspanValues[i].backgroundPadding.left : dx,
        dy: getTSpanDy(tspanValues, calculatedProps, i),
        textAnchor: currentStyle.textAnchor || textAnchor,
        style: currentStyle,
        children: line
      };
      return /* @__PURE__ */ import_react51.default.cloneElement(tspanComponent, tspanProps);
    });
    return /* @__PURE__ */ import_react51.default.cloneElement(textComponent, textProps, tspans);
  };
  var VictoryLabel = function(props) {
    props = evaluateProps(props);
    if (props.text === null || props.text === void 0) {
      return null;
    }
    var calculatedProps = getCalculatedProps(props);
    var text = calculatedProps.text, style = calculatedProps.style, capHeight = calculatedProps.capHeight, backgroundPadding = calculatedProps.backgroundPadding, lineHeight = calculatedProps.lineHeight;
    var tspanValues = text.map(function(line, i) {
      var currentStyle = getSingleValue(style, i);
      var capHeightPx = convertLengthToPixels("".concat(capHeight, "em"), currentStyle.fontSize);
      var currentLineHeight = getSingleValue(lineHeight, i);
      return {
        style: currentStyle,
        fontSize: currentStyle.fontSize || defaultStyles.fontSize,
        capHeight: capHeightPx,
        text: line,
        // @ts-expect-error TODO: This looks like a bug:
        textSize: approximateTextSize(line, currentStyle),
        lineHeight: currentLineHeight,
        backgroundPadding: getSingleValue(backgroundPadding, i)
      };
    });
    var label = renderLabel(calculatedProps, tspanValues);
    if (props.backgroundStyle) {
      var backgroundElement = getBackgroundElement(calculatedProps, tspanValues);
      var children = [backgroundElement, label];
      var backgroundWithLabel = /* @__PURE__ */ import_react51.default.cloneElement(props.groupComponent, {}, children);
      return props.renderInPortal ? /* @__PURE__ */ import_react51.default.createElement(VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
    }
    return props.renderInPortal ? /* @__PURE__ */ import_react51.default.createElement(VictoryPortal, null, label) : label;
  };
  VictoryLabel.displayName = "VictoryLabel";
  VictoryLabel.role = "label";
  VictoryLabel.defaultStyles = defaultStyles;
  VictoryLabel.propTypes = {
    active: import_prop_types42.default.bool,
    angle: import_prop_types42.default.oneOfType([import_prop_types42.default.string, import_prop_types42.default.number, import_prop_types42.default.func]),
    ariaLabel: import_prop_types42.default.oneOfType([import_prop_types42.default.string, import_prop_types42.default.func]),
    backgroundComponent: import_prop_types42.default.element,
    backgroundPadding: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.object, import_prop_types42.default.array]),
    backgroundStyle: import_prop_types42.default.oneOfType([import_prop_types42.default.object, import_prop_types42.default.array]),
    capHeight: import_prop_types42.default.oneOfType([import_prop_types42.default.string, nonNegative, import_prop_types42.default.func]),
    className: import_prop_types42.default.string,
    data: import_prop_types42.default.array,
    datum: import_prop_types42.default.any,
    // @ts-expect-error "Function is not assignable to string"
    desc: import_prop_types42.default.oneOfType([import_prop_types42.default.string, import_prop_types42.default.func]),
    direction: import_prop_types42.default.oneOf(["rtl", "ltr", "inherit"]),
    dx: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.string, import_prop_types42.default.func]),
    dy: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.string, import_prop_types42.default.func]),
    events: import_prop_types42.default.object,
    groupComponent: import_prop_types42.default.element,
    id: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.string, import_prop_types42.default.func]),
    index: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.string]),
    inline: import_prop_types42.default.bool,
    labelPlacement: import_prop_types42.default.oneOf(["parallel", "perpendicular", "vertical"]),
    lineHeight: import_prop_types42.default.oneOfType([import_prop_types42.default.string, nonNegative, import_prop_types42.default.func, import_prop_types42.default.array]),
    origin: import_prop_types42.default.shape({
      x: nonNegative.isRequired,
      y: nonNegative.isRequired
    }),
    polar: import_prop_types42.default.bool,
    renderInPortal: import_prop_types42.default.bool,
    scale: import_prop_types42.default.shape({
      x: scale,
      y: scale
    }),
    style: import_prop_types42.default.oneOfType([import_prop_types42.default.object, import_prop_types42.default.array]),
    tabIndex: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.func]),
    text: import_prop_types42.default.oneOfType([import_prop_types42.default.string, import_prop_types42.default.number, import_prop_types42.default.func, import_prop_types42.default.array]),
    // @ts-expect-error Function is not assignable to string"
    textAnchor: import_prop_types42.default.oneOfType([import_prop_types42.default.oneOf(["start", "middle", "end", "inherit"]), import_prop_types42.default.func]),
    textComponent: import_prop_types42.default.element,
    title: import_prop_types42.default.string,
    transform: import_prop_types42.default.oneOfType([import_prop_types42.default.string, import_prop_types42.default.object, import_prop_types42.default.func]),
    tspanComponent: import_prop_types42.default.element,
    // @ts-expect-error Function is not assignable to string"
    verticalAnchor: import_prop_types42.default.oneOfType([import_prop_types42.default.oneOf(["start", "middle", "end"]), import_prop_types42.default.func]),
    // @ts-expect-error Number is not assignable to string
    x: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.string]),
    // @ts-expect-error Number is not assignable to string
    y: import_prop_types42.default.oneOfType([import_prop_types42.default.number, import_prop_types42.default.string])
  };
  VictoryLabel.defaultProps = {
    backgroundComponent: /* @__PURE__ */ import_react51.default.createElement(Rect, null),
    groupComponent: /* @__PURE__ */ import_react51.default.createElement("g", null),
    direction: "inherit",
    textComponent: /* @__PURE__ */ import_react51.default.createElement(Text2, null),
    tspanComponent: /* @__PURE__ */ import_react51.default.createElement(TSpan, null),
    capHeight: 0.71,
    // Magic number from d3.
    lineHeight: 1
  };

  // node_modules/victory-core/es/victory-transition/victory-transition.js
  var import_pick2 = __toESM(require_pick());
  var import_isFunction4 = __toESM(require_isFunction());
  var import_defaults8 = __toESM(require_defaults());
  var import_react53 = __toESM(require_react());
  var import_prop_types43 = __toESM(require_prop_types());

  // node_modules/victory-core/es/victory-util/transitions.js
  var import_keys3 = __toESM(require_keys());
  var import_identity3 = __toESM(require_identity());
  var import_defaults7 = __toESM(require_defaults());
  var import_assign5 = __toESM(require_assign());
  var import_react52 = __toESM(require_react());
  function getDatumKey(datum, idx) {
    return (datum.key || idx).toString();
  }
  function getKeyedData(data) {
    return data.reduce(function(keyedData, datum, idx) {
      var key = getDatumKey(datum, idx);
      keyedData[key] = datum;
      return keyedData;
    }, {});
  }
  function getKeyedDataDifference(a2, b) {
    var hasDifference = false;
    var difference = (0, import_keys3.default)(a2).reduce(function(_difference3, key) {
      if (!(key in b)) {
        hasDifference = true;
        _difference3[key] = true;
      }
      return _difference3;
    }, {});
    return hasDifference && difference;
  }
  function getNodeTransitions(oldData, nextData) {
    var oldDataKeyed = oldData && getKeyedData(oldData);
    var nextDataKeyed = nextData && getKeyedData(nextData);
    return {
      entering: oldDataKeyed && getKeyedDataDifference(nextDataKeyed, oldDataKeyed),
      exiting: nextDataKeyed && getKeyedDataDifference(oldDataKeyed, nextDataKeyed)
    };
  }
  function getChildData(child) {
    if (child.type && child.type.getData) {
      return child.type.getData(child.props);
    }
    return child.props && child.props.data || false;
  }
  function getInitialTransitionState(oldChildren, nextChildren) {
    var nodesWillExit = false;
    var nodesWillEnter = false;
    var getTransition = function(oldChild, newChild) {
      if (!newChild || oldChild.type !== newChild.type) {
        return {};
      }
      var _ref2 = getNodeTransitions(getChildData(oldChild), getChildData(newChild)) || {}, entering = _ref2.entering, exiting = _ref2.exiting;
      nodesWillExit = nodesWillExit || !!exiting;
      nodesWillEnter = nodesWillEnter || !!entering;
      return {
        entering: entering || false,
        exiting: exiting || false
      };
    };
    var getTransitionsFromChildren = function(old, next) {
      return old.map(function(child, idx) {
        if (child && child.props && child.props.children && next[idx]) {
          return getTransitionsFromChildren(import_react52.default.Children.toArray(old[idx].props.children), import_react52.default.Children.toArray(next[idx].props.children));
        }
        return getTransition(child, next[idx]);
      });
    };
    var childrenTransitions = getTransitionsFromChildren(import_react52.default.Children.toArray(oldChildren), import_react52.default.Children.toArray(nextChildren));
    return {
      nodesWillExit,
      nodesWillEnter,
      childrenTransitions,
      // TODO: This may need to be refactored for the following situation.
      //       The component receives new props, and the data provided
      //       is a perfect match for the previous data and domain except
      //       for new nodes. In this case, we wouldn't want a delay before
      //       the new nodes appear.
      nodesShouldEnter: false
    };
  }
  function getInitialChildProps(animate, data) {
    var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : import_identity3.default;
    return {
      data: data.map(function(datum, idx) {
        return (0, import_assign5.default)({}, datum, after(datum, idx, data));
      })
    };
  }
  function getChildBeforeLoad(animate, child, data, cb) {
    animate = (0, import_assign5.default)({}, animate, {
      onEnd: cb
    });
    if (animate && animate.onLoad && !animate.onLoad.duration) {
      return {
        animate,
        data
      };
    }
    var before = animate.onLoad && animate.onLoad.before ? animate.onLoad.before : import_identity3.default;
    data = data.map(function(datum, idx) {
      return (0, import_assign5.default)({}, datum, before(datum, idx, data));
    });
    return {
      animate,
      data,
      clipWidth: 0
    };
  }
  function getChildOnLoad(animate, data, cb) {
    animate = (0, import_assign5.default)({}, animate, {
      onEnd: cb
    });
    if (animate && animate.onLoad && !animate.onLoad.duration) {
      return {
        animate,
        data
      };
    }
    var after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : import_identity3.default;
    data = data.map(function(datum, idx) {
      return (0, import_assign5.default)({}, datum, after(datum, idx, data));
    });
    return {
      animate,
      data
    };
  }
  function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
    var onExit = animate && animate.onExit;
    animate = (0, import_assign5.default)({}, animate, onExit);
    if (exitingNodes) {
      animate.onEnd = cb;
      var before = animate.onExit && animate.onExit.before ? animate.onExit.before : import_identity3.default;
      data = data.map(function(datum, idx) {
        var key = (datum.key || idx).toString();
        return exitingNodes[key] ? (0, import_assign5.default)({}, datum, before(datum, idx, data)) : datum;
      });
    }
    return {
      animate,
      data
    };
  }
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
    if (enteringNodes) {
      animate = (0, import_assign5.default)({}, animate, {
        onEnd: cb
      });
      var before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : import_identity3.default;
      data = data.map(function(datum, idx) {
        var key = (datum.key || idx).toString();
        return enteringNodes[key] ? (0, import_assign5.default)({}, datum, before(datum, idx, data)) : datum;
      });
    }
    return {
      animate,
      data
    };
  }
  function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
    var onEnter = animate && animate.onEnter;
    animate = (0, import_assign5.default)({}, animate, onEnter);
    if (enteringNodes) {
      animate.onEnd = cb;
      var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : import_identity3.default;
      data = data.map(function(datum, idx) {
        var key = getDatumKey(datum, idx);
        return enteringNodes[key] ? (0, import_assign5.default)({}, datum, after(datum, idx, data)) : datum;
      });
    }
    return {
      animate,
      data
    };
  }
  function getTransitionPropsFactory(props, state, setState) {
    var nodesWillExit = state && state.nodesWillExit;
    var nodesWillEnter = state && state.nodesWillEnter;
    var nodesShouldEnter = state && state.nodesShouldEnter;
    var nodesShouldLoad = state && state.nodesShouldLoad;
    var nodesDoneLoad = state && state.nodesDoneLoad;
    var childrenTransitions = state && state.childrenTransitions || [];
    var transitionDurations = {
      enter: props.animate && props.animate.onEnter && props.animate.onEnter.duration,
      exit: props.animate && props.animate.onExit && props.animate.onExit.duration,
      load: props.animate && props.animate.onLoad && props.animate.onLoad.duration,
      move: props.animate && props.animate.duration
    };
    var onLoad = function(child, data, animate) {
      if (nodesShouldLoad) {
        return getChildOnLoad(animate, data, function() {
          setState({
            nodesShouldLoad: false,
            nodesDoneLoad: true
          });
        });
      }
      return getChildBeforeLoad(animate, child, data, function() {
        setState({
          nodesDoneLoad: true
        });
      });
    };
    var onExit = function(nodes, child, data, animate) {
      return getChildPropsOnExit(animate, child, data, nodes, function() {
        setState({
          nodesWillExit: false
        });
      });
    };
    var onEnter = function(nodes, child, data, animate) {
      if (nodesShouldEnter) {
        return getChildPropsOnEnter(animate, data, nodes, function() {
          setState({
            nodesWillEnter: false
          });
        });
      }
      return getChildPropsBeforeEnter(animate, child, data, nodes, function() {
        setState({
          nodesShouldEnter: true
        });
      });
    };
    var getChildTransitionDuration = function(child, type) {
      var animate = child.props.animate;
      if (!child.type) {
        return {};
      }
      var defaultTransitions = child.props && child.props.polar ? child.type.defaultPolarTransitions || child.type.defaultTransitions : child.type.defaultTransitions;
      if (defaultTransitions) {
        var animationDuration = animate[type] && animate[type].duration;
        return animationDuration !== void 0 ? animationDuration : defaultTransitions[type] && defaultTransitions[type].duration;
      }
      return {};
    };
    return function getTransitionProps(child, index) {
      var data = getChildData(child) || [];
      var animate = (0, import_defaults7.default)({}, props.animate, child.props.animate);
      var defaultTransitions = child.props.polar ? child.type.defaultPolarTransitions || child.type.defaultTransitions : child.type.defaultTransitions;
      animate.onExit = (0, import_defaults7.default)({}, animate.onExit, defaultTransitions && defaultTransitions.onExit);
      animate.onEnter = (0, import_defaults7.default)({}, animate.onEnter, defaultTransitions && defaultTransitions.onEnter);
      animate.onLoad = (0, import_defaults7.default)({}, animate.onLoad, defaultTransitions && defaultTransitions.onLoad);
      var childTransitions = childrenTransitions[index] || childrenTransitions[0];
      if (!nodesDoneLoad) {
        var load = transitionDurations.load !== void 0 ? transitionDurations.load : getChildTransitionDuration(child, "onLoad");
        var animation = {
          duration: load
        };
        return onLoad(child, data, (0, import_assign5.default)({}, animate, animation));
      } else if (nodesWillExit) {
        var exitingNodes = childTransitions && childTransitions.exiting;
        var exit = transitionDurations.exit !== void 0 ? transitionDurations.exit : getChildTransitionDuration(child, "onExit");
        var _animation = exitingNodes ? {
          duration: exit
        } : {
          delay: exit
        };
        return onExit(exitingNodes, child, data, (0, import_assign5.default)({}, animate, _animation));
      } else if (nodesWillEnter) {
        var enteringNodes = childTransitions && childTransitions.entering;
        var enter = transitionDurations.enter !== void 0 ? transitionDurations.enter : getChildTransitionDuration(child, "onEnter");
        var move = transitionDurations.move !== void 0 ? transitionDurations.move : child.props.animate && child.props.animate.duration;
        var _animation2 = {
          duration: nodesShouldEnter && enteringNodes ? enter : move
        };
        return onEnter(enteringNodes, child, data, (0, import_assign5.default)({}, animate, _animation2));
      } else if (!state && animate && animate.onExit) {
        return getInitialChildProps(animate, data);
      }
      return {
        animate,
        data
      };
    };
  }

  // node_modules/victory-core/es/victory-transition/victory-transition.js
  var import_react_fast_compare2 = __toESM(require_react_fast_compare());
  function _extends4() {
    _extends4 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends4.apply(this, arguments);
  }
  function _classCallCheck8(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties7(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass8(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties7(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties7(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits6(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf5(subClass, superClass);
  }
  function _setPrototypeOf5(o, p2) {
    _setPrototypeOf5 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf5(o, p2);
  }
  function _createSuper5(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct5();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf5(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf5(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn6(this, result);
    };
  }
  function _possibleConstructorReturn6(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized5(self2);
  }
  function _assertThisInitialized5(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct5() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf5(o) {
    _getPrototypeOf5 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf5(o);
  }
  var VictoryTransition = /* @__PURE__ */ function(_React$Component) {
    _inherits6(VictoryTransition2, _React$Component);
    var _super = _createSuper5(VictoryTransition2);
    function VictoryTransition2(props, context) {
      var _this;
      _classCallCheck8(this, VictoryTransition2);
      _this = _super.call(this, props, context);
      _this.continuous = void 0;
      _this.timer = void 0;
      _this.transitionProps = void 0;
      _this.state = {
        nodesShouldLoad: false,
        nodesDoneLoad: false
      };
      var child = _this.props.children;
      var polar = child.props.polar;
      _this.continuous = !polar && child.type && child.type.continuous === true;
      _this.timer = _this.context.transitionTimer;
      return _this;
    }
    _createClass8(VictoryTransition2, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        this.setState({
          nodesShouldLoad: true
        });
      }
    }, {
      key: "shouldComponentUpdate",
      value: function shouldComponentUpdate(nextProps) {
        var _this2 = this;
        if (!(0, import_react_fast_compare2.default)(this.props, nextProps)) {
          this.timer.bypassAnimation();
          this.setState(this.getTransitionState(this.props, nextProps), function() {
            return _this2.timer.resumeAnimation();
          });
        }
        return true;
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        this.timer.stop();
      }
    }, {
      key: "getTransitionState",
      value: function getTransitionState(props, nextProps) {
        var animate = props.animate;
        if (!animate) {
          return {};
        } else if (animate.parentState) {
          var state = animate.parentState;
          var oldProps = state.nodesWillExit ? props : null;
          return {
            oldProps,
            nextProps
          };
        }
        var oldChildren = import_react53.default.Children.toArray(props.children);
        var nextChildren = import_react53.default.Children.toArray(nextProps.children);
        var _Transitions$getIniti = getInitialTransitionState(oldChildren, nextChildren), nodesWillExit = _Transitions$getIniti.nodesWillExit, nodesWillEnter = _Transitions$getIniti.nodesWillEnter, childrenTransitions = _Transitions$getIniti.childrenTransitions, nodesShouldEnter = _Transitions$getIniti.nodesShouldEnter;
        return {
          nodesWillExit,
          nodesWillEnter,
          childrenTransitions,
          nodesShouldEnter,
          oldProps: nodesWillExit ? props : null,
          nextProps
        };
      }
    }, {
      key: "getDomainFromChildren",
      value: function getDomainFromChildren2(props, axis) {
        var getChildDomains = function(children) {
          return children.reduce(function(memo2, child2) {
            if (child2.type && (0, import_isFunction4.default)(child2.type.getDomain)) {
              var childDomain = child2.props && child2.type.getDomain(child2.props, axis);
              return childDomain ? memo2.concat(childDomain) : memo2;
            } else if (child2.props && child2.props.children) {
              return memo2.concat(getChildDomains(import_react53.default.Children.toArray(child2.props.children)));
            }
            return memo2;
          }, []);
        };
        var child = import_react53.default.Children.toArray(props.children)[0];
        var childProps = child.props || {};
        var domain2 = Array.isArray(childProps.domain) ? childProps.domain : childProps.domain && childProps.domain[axis];
        if (!childProps.children && domain2) {
          return domain2;
        }
        var childDomains = getChildDomains([child]);
        return childDomains.length === 0 ? [0, 1] : [getMinValue(childDomains), getMaxValue(childDomains)];
      }
    }, {
      key: "pickProps",
      value: function pickProps() {
        if (!this.state) {
          return this.props;
        }
        return this.state.nodesWillExit ? this.state.oldProps || this.props : this.props;
      }
    }, {
      key: "pickDomainProps",
      value: function pickDomainProps(props) {
        var _props$animate;
        var parentState = (_props$animate = props.animate) === null || _props$animate === void 0 ? void 0 : _props$animate.parentState;
        if (parentState && parentState.nodesWillExit) {
          return this.continuous || parentState.continuous ? parentState.nextProps || this.state.nextProps || props : props;
        }
        return this.continuous && this.state.nodesWillExit ? this.state.nextProps || props : props;
      }
    }, {
      key: "getClipWidth",
      value: function getClipWidth(props, child) {
        var getDefaultClipWidth = function() {
          var range2 = getRange(child.props, "x");
          return range2 ? Math.abs(range2[1] - range2[0]) : props.width;
        };
        var clipWidth = this.transitionProps ? this.transitionProps.clipWidth : void 0;
        return clipWidth !== void 0 ? clipWidth : getDefaultClipWidth();
      }
    }, {
      key: "render",
      value: function render() {
        var _this$props$animate, _this3 = this;
        var props = this.pickProps();
        var getTransitionProps = (_this$props$animate = this.props.animate) !== null && _this$props$animate !== void 0 && _this$props$animate.getTransitions ? this.props.animate.getTransitions : getTransitionPropsFactory(props, this.state, function(newState) {
          return _this3.setState(newState);
        });
        var child = import_react53.default.Children.toArray(props.children)[0];
        var transitionProps = getTransitionProps(child);
        this.transitionProps = transitionProps;
        var domain2 = {
          x: this.getDomainFromChildren(this.pickDomainProps(props), "x"),
          y: this.getDomainFromChildren(props, "y")
        };
        var clipWidth = this.getClipWidth(props, child);
        var combinedProps = (0, import_defaults8.default)({
          domain: domain2,
          clipWidth
        }, transitionProps, child.props);
        var animationWhitelist = props.animationWhitelist || [];
        var whitelist = animationWhitelist.concat(["clipWidth"]);
        var propsToAnimate = whitelist.length ? (0, import_pick2.default)(combinedProps, whitelist) : combinedProps;
        return /* @__PURE__ */ import_react53.default.createElement(VictoryAnimation, _extends4({}, combinedProps.animate, {
          data: propsToAnimate
        }), function(newProps) {
          if (child.props.groupComponent) {
            var groupComponent = _this3.continuous ? /* @__PURE__ */ import_react53.default.cloneElement(child.props.groupComponent, {
              clipWidth: newProps.clipWidth || 0
            }) : child.props.groupComponent;
            return /* @__PURE__ */ import_react53.default.cloneElement(child, (0, import_defaults8.default)({
              animate: null,
              animating: true,
              groupComponent
            }, newProps, combinedProps));
          }
          return /* @__PURE__ */ import_react53.default.cloneElement(child, (0, import_defaults8.default)({
            animate: null,
            animating: true
          }, newProps, combinedProps));
        });
      }
    }]);
    return VictoryTransition2;
  }(import_react53.default.Component);
  VictoryTransition.displayName = "VictoryTransition";
  VictoryTransition.propTypes = {
    animate: import_prop_types43.default.oneOfType([import_prop_types43.default.bool, import_prop_types43.default.object]),
    animationWhitelist: import_prop_types43.default.array,
    children: import_prop_types43.default.node
  };
  VictoryTransition.contextType = timer_context_default;

  // node_modules/victory-core/es/victory-clip-container/victory-clip-container.js
  var import_uniqueId2 = __toESM(require_uniqueId());
  var import_isObject2 = __toESM(require_isObject());
  var import_defaults9 = __toESM(require_defaults());
  var import_assign6 = __toESM(require_assign());
  var import_react56 = __toESM(require_react());
  var import_prop_types45 = __toESM(require_prop_types());

  // node_modules/victory-core/es/victory-primitives/clip-path.js
  var import_react54 = __toESM(require_react());
  var import_prop_types44 = __toESM(require_prop_types());
  var ClipPath = function(props) {
    return /* @__PURE__ */ import_react54.default.createElement(
      "defs",
      null,
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react54.default.createElement("clipPath", {
        id: props.clipId
      }, props.children)
    );
  };
  ClipPath.propTypes = {
    children: import_prop_types44.default.oneOfType([import_prop_types44.default.arrayOf(import_prop_types44.default.node), import_prop_types44.default.node]),
    clipId: import_prop_types44.default.oneOfType([import_prop_types44.default.number, import_prop_types44.default.string])
  };

  // node_modules/victory-core/es/victory-primitives/circle.js
  var import_react55 = __toESM(require_react());
  var _excluded4 = ["desc"];
  function _extends5() {
    _extends5 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends5.apply(this, arguments);
  }
  function _objectWithoutProperties5(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose4(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _objectWithoutPropertiesLoose4(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  var Circle = function(props) {
    var desc = props.desc, rest = _objectWithoutProperties5(props, _excluded4);
    return desc ? (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react55.default.createElement("circle", _extends5({
        vectorEffect: "non-scaling-stroke"
      }, rest), /* @__PURE__ */ import_react55.default.createElement("desc", null, desc))
    ) : (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react55.default.createElement("circle", _extends5({
        vectorEffect: "non-scaling-stroke"
      }, rest))
    );
  };

  // node_modules/victory-core/es/victory-clip-container/victory-clip-container.js
  function _toConsumableArray7(arr) {
    return _arrayWithoutHoles6(arr) || _iterableToArray6(arr) || _unsupportedIterableToArray7(arr) || _nonIterableSpread6();
  }
  function _nonIterableSpread6() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray7(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray7(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray7(o, minLen);
  }
  function _iterableToArray6(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles6(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray7(arr);
  }
  function _arrayLikeToArray7(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function ownKeys6(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread6(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys6(Object(source), true).forEach(function(key) {
        _defineProperty9(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys6(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty9(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _classCallCheck9(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties8(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass9(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties8(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties8(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits7(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf6(subClass, superClass);
  }
  function _setPrototypeOf6(o, p2) {
    _setPrototypeOf6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf6(o, p2);
  }
  function _createSuper6(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct6();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf6(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf6(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn7(this, result);
    };
  }
  function _possibleConstructorReturn7(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized6(self2);
  }
  function _assertThisInitialized6(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct6() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf6(o) {
    _getPrototypeOf6 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf6(o);
  }
  var VictoryClipContainer = /* @__PURE__ */ function(_React$Component) {
    _inherits7(VictoryClipContainer2, _React$Component);
    var _super = _createSuper6(VictoryClipContainer2);
    function VictoryClipContainer2(props) {
      var _this;
      _classCallCheck9(this, VictoryClipContainer2);
      _this = _super.call(this, props);
      _this.clipId = void 0;
      _this.clipId = !(0, import_isObject2.default)(props) || props.clipId === void 0 ? (0, import_uniqueId2.default)("victory-clip-") : props.clipId;
      return _this;
    }
    _createClass9(VictoryClipContainer2, [{
      key: "calculateAttributes",
      value: function calculateAttributes(props) {
        var polar = props.polar, origin = props.origin, _props$clipWidth = props.clipWidth, clipWidth = _props$clipWidth === void 0 ? 0 : _props$clipWidth, _props$clipHeight = props.clipHeight, clipHeight = _props$clipHeight === void 0 ? 0 : _props$clipHeight, _props$translateX = props.translateX, translateX = _props$translateX === void 0 ? 0 : _props$translateX, _props$translateY = props.translateY, translateY = _props$translateY === void 0 ? 0 : _props$translateY;
        var clipPadding = getPadding({
          padding: props.clipPadding
        });
        var radius = props.radius || getRadius(props);
        return {
          x: (polar ? origin.x : translateX) - clipPadding.left,
          y: (polar ? origin.y : translateY) - clipPadding.top,
          width: Math.max((polar ? radius : clipWidth) + clipPadding.left + clipPadding.right, 0),
          height: Math.max((polar ? radius : clipHeight) + clipPadding.top + clipPadding.bottom, 0)
        };
      }
    }, {
      key: "renderClippedGroup",
      value: function renderClippedGroup(props, clipId) {
        var userProps = getSafeUserProps(props);
        var style = props.style, events = props.events, transform2 = props.transform, children = props.children, className = props.className, groupComponent = props.groupComponent, tabIndex = props.tabIndex;
        var clipComponent = this.renderClipComponent(props, clipId);
        var groupProps = (0, import_assign6.default)({
          className,
          style,
          transform: transform2,
          key: "clipped-group-".concat(clipId),
          clipPath: "url(#".concat(clipId, ")")
        }, events);
        return /* @__PURE__ */ import_react56.default.cloneElement(groupComponent, _objectSpread6(_objectSpread6({}, groupProps), {}, {
          tabIndex
        }, userProps), [clipComponent].concat(_toConsumableArray7(import_react56.default.Children.toArray(children))));
      }
    }, {
      key: "renderGroup",
      value: function renderGroup(props) {
        var style = props.style, events = props.events, transform2 = props.transform, children = props.children, className = props.className, groupComponent = props.groupComponent, tabIndex = props.tabIndex;
        return /* @__PURE__ */ import_react56.default.cloneElement(groupComponent, (0, import_assign6.default)({
          className,
          style,
          transform: transform2,
          "aria-label": props["aria-label"],
          tabIndex
        }, events), children);
      }
    }, {
      key: "renderClipComponent",
      value: function renderClipComponent(props, clipId) {
        var polar = props.polar, origin = props.origin, _props$clipWidth2 = props.clipWidth, clipWidth = _props$clipWidth2 === void 0 ? 0 : _props$clipWidth2, _props$clipHeight2 = props.clipHeight, clipHeight = _props$clipHeight2 === void 0 ? 0 : _props$clipHeight2, _props$translateX2 = props.translateX, translateX = _props$translateX2 === void 0 ? 0 : _props$translateX2, _props$translateY2 = props.translateY, translateY = _props$translateY2 === void 0 ? 0 : _props$translateY2, circleComponent = props.circleComponent, rectComponent = props.rectComponent, clipPathComponent = props.clipPathComponent;
        var _Helpers$getPadding = getPadding({
          padding: props.clipPadding
        }), top2 = _Helpers$getPadding.top, bottom2 = _Helpers$getPadding.bottom, left2 = _Helpers$getPadding.left, right2 = _Helpers$getPadding.right;
        var child;
        if (polar) {
          var radius = props.radius || getRadius(props);
          var circleProps = {
            r: Math.max(radius + left2 + right2, radius + top2 + bottom2, 0),
            cx: origin.x - left2,
            cy: origin.y - top2
          };
          child = /* @__PURE__ */ import_react56.default.cloneElement(circleComponent, circleProps);
        } else {
          var rectProps = {
            x: translateX - left2,
            y: translateY - top2,
            width: Math.max(clipWidth + left2 + right2, 0),
            height: Math.max(clipHeight + top2 + bottom2, 0)
          };
          child = /* @__PURE__ */ import_react56.default.cloneElement(rectComponent, rectProps);
        }
        return /* @__PURE__ */ import_react56.default.cloneElement(clipPathComponent, (0, import_assign6.default)({
          key: "clip-path-".concat(clipId)
        }, props, {
          clipId
        }), child);
      }
    }, {
      key: "getClipValue",
      value: function getClipValue(props, axis) {
        var clipValues = {
          x: props.clipWidth,
          y: props.clipHeight
        };
        if (clipValues[axis] !== void 0) {
          return clipValues[axis];
        }
        var range2 = getRange(props, axis);
        return range2 ? Math.abs(range2[0] - range2[1]) || void 0 : void 0;
      }
    }, {
      key: "getTranslateValue",
      value: function getTranslateValue(props, axis) {
        var translateValues = {
          x: props.translateX,
          y: props.translateY
        };
        if (translateValues[axis] !== void 0) {
          return translateValues[axis];
        }
        var range2 = getRange(props, axis);
        return range2 ? Math.min.apply(Math, _toConsumableArray7(range2)) : void 0;
      }
    }, {
      key: "render",
      value: function render() {
        var clipHeight = this.getClipValue(this.props, "y");
        var clipWidth = this.getClipValue(this.props, "x");
        if (clipWidth === void 0 || clipHeight === void 0) {
          return this.renderGroup(this.props);
        }
        var translateX = this.getTranslateValue(this.props, "x");
        var translateY = this.getTranslateValue(this.props, "y");
        var clipProps = (0, import_defaults9.default)({}, this.props, {
          clipHeight,
          clipWidth,
          translateX,
          translateY
        });
        return this.renderClippedGroup(clipProps, this.clipId);
      }
    }]);
    return VictoryClipContainer2;
  }(import_react56.default.Component);
  VictoryClipContainer.displayName = "VictoryClipContainer";
  VictoryClipContainer.role = "container";
  VictoryClipContainer.propTypes = {
    "aria-label": import_prop_types45.default.string,
    children: import_prop_types45.default.oneOfType([import_prop_types45.default.arrayOf(import_prop_types45.default.node), import_prop_types45.default.node]),
    circleComponent: import_prop_types45.default.element,
    className: import_prop_types45.default.string,
    clipHeight: nonNegative,
    clipId: import_prop_types45.default.oneOfType([import_prop_types45.default.number, import_prop_types45.default.string]),
    clipPadding: import_prop_types45.default.shape({
      top: import_prop_types45.default.number,
      bottom: import_prop_types45.default.number,
      left: import_prop_types45.default.number,
      right: import_prop_types45.default.number
    }),
    clipPathComponent: import_prop_types45.default.element,
    clipWidth: nonNegative,
    events: import_prop_types45.default.object,
    groupComponent: import_prop_types45.default.element,
    origin: import_prop_types45.default.shape({
      x: nonNegative,
      y: nonNegative
    }),
    polar: import_prop_types45.default.bool,
    radius: nonNegative,
    style: import_prop_types45.default.object,
    tabIndex: import_prop_types45.default.number,
    transform: import_prop_types45.default.string,
    translateX: import_prop_types45.default.number,
    translateY: import_prop_types45.default.number
  };
  VictoryClipContainer.defaultProps = {
    circleComponent: /* @__PURE__ */ import_react56.default.createElement(Circle, null),
    rectComponent: /* @__PURE__ */ import_react56.default.createElement(Rect, null),
    clipPathComponent: /* @__PURE__ */ import_react56.default.createElement(ClipPath, null),
    groupComponent: /* @__PURE__ */ import_react56.default.createElement("g", null)
  };

  // node_modules/victory-core/es/victory-theme/grayscale.js
  var import_assign7 = __toESM(require_assign());
  var colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
  var charcoal = "#252525";
  var grey = "#969696";
  var sansSerif = "'Gill Sans', 'Seravek', 'Trebuchet MS', sans-serif";
  var letterSpacing = "normal";
  var fontSize = 14;
  var baseProps = {
    width: 450,
    height: 300,
    padding: 50,
    colorScale: colors
  };
  var baseLabelStyles = {
    fontFamily: sansSerif,
    fontSize,
    letterSpacing,
    padding: 10,
    fill: charcoal,
    stroke: "transparent"
  };
  var centeredLabelStyles = (0, import_assign7.default)({
    textAnchor: "middle"
  }, baseLabelStyles);
  var strokeLinecap = "round";
  var strokeLinejoin = "round";
  var grayscale = {
    area: (0, import_assign7.default)({
      style: {
        data: {
          fill: charcoal
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    axis: (0, import_assign7.default)({
      style: {
        axis: {
          fill: "transparent",
          stroke: charcoal,
          strokeWidth: 1,
          strokeLinecap,
          strokeLinejoin
        },
        axisLabel: (0, import_assign7.default)({}, centeredLabelStyles, {
          padding: 25
        }),
        grid: {
          fill: "none",
          stroke: "none",
          pointerEvents: "painted"
        },
        ticks: {
          fill: "transparent",
          size: 1,
          stroke: "transparent"
        },
        tickLabels: baseLabelStyles
      }
    }, baseProps),
    bar: (0, import_assign7.default)({
      style: {
        data: {
          fill: charcoal,
          padding: 8,
          strokeWidth: 0
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    boxplot: (0, import_assign7.default)({
      style: {
        max: {
          padding: 8,
          stroke: charcoal,
          strokeWidth: 1
        },
        maxLabels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 3
        }),
        median: {
          padding: 8,
          stroke: charcoal,
          strokeWidth: 1
        },
        medianLabels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 3
        }),
        min: {
          padding: 8,
          stroke: charcoal,
          strokeWidth: 1
        },
        minLabels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 3
        }),
        q1: {
          padding: 8,
          fill: grey
        },
        q1Labels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 3
        }),
        q3: {
          padding: 8,
          fill: grey
        },
        q3Labels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 3
        })
      },
      boxWidth: 20
    }, baseProps),
    candlestick: (0, import_assign7.default)({
      style: {
        data: {
          stroke: charcoal,
          strokeWidth: 1
        },
        labels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 5
        })
      },
      candleColors: {
        positive: "#ffffff",
        negative: charcoal
      }
    }, baseProps),
    chart: baseProps,
    errorbar: (0, import_assign7.default)({
      borderWidth: 8,
      style: {
        data: {
          fill: "transparent",
          stroke: charcoal,
          strokeWidth: 2
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    group: (0, import_assign7.default)({
      colorScale: colors
    }, baseProps),
    histogram: (0, import_assign7.default)({
      style: {
        data: {
          fill: grey,
          stroke: charcoal,
          strokeWidth: 2
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    legend: {
      colorScale: colors,
      gutter: 10,
      orientation: "vertical",
      titleOrientation: "top",
      style: {
        data: {
          type: "circle"
        },
        labels: baseLabelStyles,
        title: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 5
        })
      }
    },
    line: (0, import_assign7.default)({
      style: {
        data: {
          fill: "transparent",
          stroke: charcoal,
          strokeWidth: 2
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    pie: {
      style: {
        data: {
          padding: 10,
          stroke: "transparent",
          strokeWidth: 1
        },
        labels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 20
        })
      },
      colorScale: colors,
      width: 400,
      height: 400,
      padding: 50
    },
    scatter: (0, import_assign7.default)({
      style: {
        data: {
          fill: charcoal,
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    stack: (0, import_assign7.default)({
      colorScale: colors
    }, baseProps),
    tooltip: {
      style: (0, import_assign7.default)({}, baseLabelStyles, {
        padding: 0,
        pointerEvents: "none"
      }),
      flyoutStyle: {
        stroke: charcoal,
        strokeWidth: 1,
        fill: "#f0f0f0",
        pointerEvents: "none"
      },
      flyoutPadding: 5,
      cornerRadius: 5,
      pointerLength: 10
    },
    voronoi: (0, import_assign7.default)({
      style: {
        data: {
          fill: "transparent",
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: (0, import_assign7.default)({}, baseLabelStyles, {
          padding: 5,
          pointerEvents: "none"
        }),
        flyout: {
          stroke: charcoal,
          strokeWidth: 1,
          fill: "#f0f0f0",
          pointerEvents: "none"
        }
      }
    }, baseProps)
  };

  // node_modules/victory-core/es/victory-theme/material.js
  var import_assign8 = __toESM(require_assign());
  var yellow200 = "#FFF59D";
  var deepOrange600 = "#F4511E";
  var lime300 = "#DCE775";
  var lightGreen500 = "#8BC34A";
  var teal700 = "#00796B";
  var cyan900 = "#006064";
  var colors2 = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
  var blueGrey50 = "#ECEFF1";
  var blueGrey300 = "#90A4AE";
  var blueGrey700 = "#455A64";
  var grey900 = "#212121";
  var sansSerif2 = "'Helvetica Neue', 'Helvetica', sans-serif";
  var letterSpacing2 = "normal";
  var fontSize2 = 12;
  var padding = 8;
  var baseProps2 = {
    width: 350,
    height: 350,
    padding: 50
  };
  var baseLabelStyles2 = {
    fontFamily: sansSerif2,
    fontSize: fontSize2,
    letterSpacing: letterSpacing2,
    padding,
    fill: blueGrey700,
    stroke: "transparent",
    strokeWidth: 0
  };
  var centeredLabelStyles2 = (0, import_assign8.default)({
    textAnchor: "middle"
  }, baseLabelStyles2);
  var strokeDasharray = "10, 5";
  var strokeLinecap2 = "round";
  var strokeLinejoin2 = "round";
  var material = {
    area: (0, import_assign8.default)({
      style: {
        data: {
          fill: grey900
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    axis: (0, import_assign8.default)({
      style: {
        axis: {
          fill: "transparent",
          stroke: blueGrey300,
          strokeWidth: 2,
          strokeLinecap: strokeLinecap2,
          strokeLinejoin: strokeLinejoin2
        },
        axisLabel: (0, import_assign8.default)({}, centeredLabelStyles2, {
          padding,
          stroke: "transparent"
        }),
        grid: {
          fill: "none",
          stroke: blueGrey50,
          strokeDasharray,
          strokeLinecap: strokeLinecap2,
          strokeLinejoin: strokeLinejoin2,
          pointerEvents: "painted"
        },
        ticks: {
          fill: "transparent",
          size: 5,
          stroke: blueGrey300,
          strokeWidth: 1,
          strokeLinecap: strokeLinecap2,
          strokeLinejoin: strokeLinejoin2
        },
        tickLabels: (0, import_assign8.default)({}, baseLabelStyles2, {
          fill: blueGrey700
        })
      }
    }, baseProps2),
    polarDependentAxis: (0, import_assign8.default)({
      style: {
        ticks: {
          fill: "transparent",
          size: 1,
          stroke: "transparent"
        }
      }
    }),
    bar: (0, import_assign8.default)({
      style: {
        data: {
          fill: blueGrey700,
          padding,
          strokeWidth: 0
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    boxplot: (0, import_assign8.default)({
      style: {
        max: {
          padding,
          stroke: blueGrey700,
          strokeWidth: 1
        },
        maxLabels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 3
        }),
        median: {
          padding,
          stroke: blueGrey700,
          strokeWidth: 1
        },
        medianLabels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 3
        }),
        min: {
          padding,
          stroke: blueGrey700,
          strokeWidth: 1
        },
        minLabels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 3
        }),
        q1: {
          padding,
          fill: blueGrey700
        },
        q1Labels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 3
        }),
        q3: {
          padding,
          fill: blueGrey700
        },
        q3Labels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 3
        })
      },
      boxWidth: 20
    }, baseProps2),
    candlestick: (0, import_assign8.default)({
      style: {
        data: {
          stroke: blueGrey700
        },
        labels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 5
        })
      },
      candleColors: {
        positive: "#ffffff",
        negative: blueGrey700
      }
    }, baseProps2),
    chart: baseProps2,
    errorbar: (0, import_assign8.default)({
      borderWidth: 8,
      style: {
        data: {
          fill: "transparent",
          opacity: 1,
          stroke: blueGrey700,
          strokeWidth: 2
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    group: (0, import_assign8.default)({
      colorScale: colors2
    }, baseProps2),
    histogram: (0, import_assign8.default)({
      style: {
        data: {
          fill: blueGrey700,
          stroke: grey900,
          strokeWidth: 2
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    legend: {
      colorScale: colors2,
      gutter: 10,
      orientation: "vertical",
      titleOrientation: "top",
      style: {
        data: {
          type: "circle"
        },
        labels: baseLabelStyles2,
        title: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 5
        })
      }
    },
    line: (0, import_assign8.default)({
      style: {
        data: {
          fill: "transparent",
          opacity: 1,
          stroke: blueGrey700,
          strokeWidth: 2
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    pie: (0, import_assign8.default)({
      colorScale: colors2,
      style: {
        data: {
          padding,
          stroke: blueGrey50,
          strokeWidth: 1
        },
        labels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 20
        })
      }
    }, baseProps2),
    scatter: (0, import_assign8.default)({
      style: {
        data: {
          fill: blueGrey700,
          opacity: 1,
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    stack: (0, import_assign8.default)({
      colorScale: colors2
    }, baseProps2),
    tooltip: {
      style: (0, import_assign8.default)({}, baseLabelStyles2, {
        padding: 0,
        pointerEvents: "none"
      }),
      flyoutStyle: {
        stroke: grey900,
        strokeWidth: 1,
        fill: "#f0f0f0",
        pointerEvents: "none"
      },
      flyoutPadding: 5,
      cornerRadius: 5,
      pointerLength: 10
    },
    voronoi: (0, import_assign8.default)({
      style: {
        data: {
          fill: "transparent",
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: (0, import_assign8.default)({}, baseLabelStyles2, {
          padding: 5,
          pointerEvents: "none"
        }),
        flyout: {
          stroke: grey900,
          strokeWidth: 1,
          fill: "#f0f0f0",
          pointerEvents: "none"
        }
      }
    }, baseProps2)
  };

  // node_modules/victory-core/es/victory-theme/victory-theme.js
  var VictoryTheme = {
    grayscale,
    material
  };

  // node_modules/victory-core/es/victory-primitives/arc.js
  var import_assign9 = __toESM(require_assign());
  var import_react58 = __toESM(require_react());
  var import_prop_types47 = __toESM(require_prop_types());

  // node_modules/victory-core/es/victory-util/common-props.js
  var import_prop_types46 = __toESM(require_prop_types());
  var dataProps = {
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    categories: import_prop_types46.default.oneOfType([import_prop_types46.default.arrayOf(import_prop_types46.default.string), import_prop_types46.default.shape({
      x: import_prop_types46.default.arrayOf(import_prop_types46.default.string),
      y: import_prop_types46.default.arrayOf(import_prop_types46.default.string)
    })]),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    data: import_prop_types46.default.oneOfType([import_prop_types46.default.array, import_prop_types46.default.object]),
    dataComponent: import_prop_types46.default.element,
    disableInlineStyles: import_prop_types46.default.bool,
    labelComponent: import_prop_types46.default.element,
    labels: import_prop_types46.default.oneOfType([import_prop_types46.default.func, import_prop_types46.default.array]),
    samples: nonNegative,
    sortKey: import_prop_types46.default.oneOfType([import_prop_types46.default.func, allOfType([integer, nonNegative]), import_prop_types46.default.string, import_prop_types46.default.arrayOf(import_prop_types46.default.string.isRequired)]),
    sortOrder: import_prop_types46.default.oneOf(["ascending", "descending"]),
    style: import_prop_types46.default.shape({
      parent: import_prop_types46.default.object,
      data: import_prop_types46.default.object,
      labels: import_prop_types46.default.object
    }),
    x: import_prop_types46.default.oneOfType([import_prop_types46.default.func, allOfType([integer, nonNegative]), import_prop_types46.default.string, import_prop_types46.default.arrayOf(import_prop_types46.default.string.isRequired)]),
    y: import_prop_types46.default.oneOfType([import_prop_types46.default.func, allOfType([integer, nonNegative]), import_prop_types46.default.string, import_prop_types46.default.arrayOf(import_prop_types46.default.string.isRequired)]),
    y0: import_prop_types46.default.oneOfType([import_prop_types46.default.func, allOfType([integer, nonNegative]), import_prop_types46.default.string, import_prop_types46.default.arrayOf(import_prop_types46.default.string.isRequired)])
  };
  var baseProps3 = {
    animate: import_prop_types46.default.oneOfType([import_prop_types46.default.bool, import_prop_types46.default.object]),
    containerComponent: import_prop_types46.default.element,
    domain: import_prop_types46.default.oneOfType([domain, import_prop_types46.default.shape({
      x: domain,
      y: domain
    })]),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    maxDomain: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.instanceOf(Date), import_prop_types46.default.shape({
      x: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.instanceOf(Date)]),
      y: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.instanceOf(Date)])
    })]),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    minDomain: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.instanceOf(Date), import_prop_types46.default.shape({
      x: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.instanceOf(Date)]),
      y: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.instanceOf(Date)])
    })]),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    domainPadding: import_prop_types46.default.oneOfType([import_prop_types46.default.shape({
      x: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.arrayOf(import_prop_types46.default.number)]),
      y: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.arrayOf(import_prop_types46.default.number)])
    }), import_prop_types46.default.number, import_prop_types46.default.arrayOf(import_prop_types46.default.number)]),
    eventKey: import_prop_types46.default.oneOfType([import_prop_types46.default.func, allOfType([integer, nonNegative]), import_prop_types46.default.string]),
    events: import_prop_types46.default.arrayOf(import_prop_types46.default.shape({
      target: import_prop_types46.default.oneOf(["data", "labels", "parent"]),
      eventKey: import_prop_types46.default.oneOfType([import_prop_types46.default.array, allOfType([integer, nonNegative]), import_prop_types46.default.string]),
      eventHandlers: import_prop_types46.default.object
    })),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    externalEventMutations: import_prop_types46.default.arrayOf(import_prop_types46.default.shape({
      callback: import_prop_types46.default.func,
      childName: import_prop_types46.default.oneOfType([import_prop_types46.default.string, import_prop_types46.default.array]),
      eventKey: import_prop_types46.default.oneOfType([import_prop_types46.default.array, allOfType([integer, nonNegative]), import_prop_types46.default.string]),
      mutation: import_prop_types46.default.func,
      target: import_prop_types46.default.oneOfType([import_prop_types46.default.string, import_prop_types46.default.array])
    })),
    groupComponent: import_prop_types46.default.element,
    height: nonNegative,
    name: import_prop_types46.default.string,
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    origin: import_prop_types46.default.shape({
      x: import_prop_types46.default.number,
      y: import_prop_types46.default.number
    }),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    padding: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.shape({
      top: import_prop_types46.default.number,
      bottom: import_prop_types46.default.number,
      left: import_prop_types46.default.number,
      right: import_prop_types46.default.number
    })]),
    polar: import_prop_types46.default.bool,
    range: import_prop_types46.default.oneOfType([domain, import_prop_types46.default.shape({
      x: domain.isRequired,
      y: domain.isRequired
    })]),
    scale: import_prop_types46.default.oneOfType([scale, import_prop_types46.default.shape({
      x: scale.isRequired,
      y: scale.isRequired
    })]),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    sharedEvents: import_prop_types46.default.shape({
      events: import_prop_types46.default.array,
      getEventState: import_prop_types46.default.func
    }),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    singleQuadrantDomainPadding: import_prop_types46.default.oneOfType([import_prop_types46.default.bool, import_prop_types46.default.shape({
      x: import_prop_types46.default.oneOfType([import_prop_types46.default.bool]),
      y: import_prop_types46.default.oneOfType([import_prop_types46.default.bool])
    })]),
    standalone: import_prop_types46.default.bool,
    theme: import_prop_types46.default.object,
    width: nonNegative
  };
  var primitiveProps = {
    active: import_prop_types46.default.bool,
    ariaLabel: import_prop_types46.default.oneOfType([import_prop_types46.default.string, import_prop_types46.default.func]),
    className: import_prop_types46.default.string,
    clipPath: import_prop_types46.default.string,
    data: import_prop_types46.default.oneOfType([import_prop_types46.default.array, import_prop_types46.default.object]),
    desc: import_prop_types46.default.oneOfType([import_prop_types46.default.string, import_prop_types46.default.func]),
    disableInlineStyles: import_prop_types46.default.bool,
    events: import_prop_types46.default.object,
    id: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.string, import_prop_types46.default.func]),
    index: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.string]),
    // @ts-expect-error TODO: synchronize the type with this PropTypes
    origin: import_prop_types46.default.shape({
      x: import_prop_types46.default.number,
      y: import_prop_types46.default.number
    }),
    polar: import_prop_types46.default.bool,
    role: import_prop_types46.default.string,
    scale: import_prop_types46.default.oneOfType([scale, import_prop_types46.default.shape({
      x: scale,
      y: scale
    })]),
    shapeRendering: import_prop_types46.default.string,
    style: import_prop_types46.default.object,
    tabIndex: import_prop_types46.default.oneOfType([import_prop_types46.default.number, import_prop_types46.default.func]),
    transform: import_prop_types46.default.string
  };
  var CommonProps = {
    dataProps,
    baseProps: baseProps3,
    primitiveProps
  };

  // node_modules/victory-core/es/victory-primitives/path.js
  var import_react57 = __toESM(require_react());
  var _excluded5 = ["desc"];
  function _objectWithoutProperties6(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose5(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _objectWithoutPropertiesLoose5(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  var Path = function(props) {
    var desc = props.desc, rest = _objectWithoutProperties6(props, _excluded5);
    return desc ? (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react57.default.createElement("path", rest, /* @__PURE__ */ import_react57.default.createElement("desc", null, desc))
    ) : (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react57.default.createElement("path", rest)
    );
  };

  // node_modules/victory-core/es/victory-primitives/arc.js
  function ownKeys7(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread7(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys7(Object(source), true).forEach(function(key) {
        _defineProperty10(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys7(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty10(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var getArcPath = function(props) {
    var cx = props.cx, cy = props.cy, r = props.r, startAngle = props.startAngle, endAngle = props.endAngle, closedPath = props.closedPath;
    var halfAngle = Math.abs(endAngle - startAngle) / 2 + startAngle;
    var x1 = cx + r * Math.cos(degreesToRadians(startAngle));
    var y1 = cy - r * Math.sin(degreesToRadians(startAngle));
    var x2 = cx + r * Math.cos(degreesToRadians(halfAngle));
    var y2 = cy - r * Math.sin(degreesToRadians(halfAngle));
    var x3 = cx + r * Math.cos(degreesToRadians(endAngle));
    var y3 = cy - r * Math.sin(degreesToRadians(endAngle));
    var largerArcFlag1 = halfAngle - startAngle <= 180 ? 0 : 1;
    var largerArcFlag2 = endAngle - halfAngle <= 180 ? 0 : 1;
    var arcStart = closedPath ? " M ".concat(cx, ", ").concat(cy, " L ").concat(x1, ", ").concat(y1) : "M ".concat(x1, ", ").concat(y1);
    var arc1 = "A ".concat(r, ", ").concat(r, ", 0, ").concat(largerArcFlag1, ", 0, ").concat(x2, ", ").concat(y2);
    var arc2 = "A ".concat(r, ", ").concat(r, ", 0, ").concat(largerArcFlag2, ", 0, ").concat(x3, ", ").concat(y3);
    var arcEnd = closedPath ? "Z" : "";
    return "".concat(arcStart, " ").concat(arc1, " ").concat(arc2, " ").concat(arcEnd);
  };
  var evaluateProps2 = function(props) {
    var ariaLabel = evaluateProp(props.ariaLabel, props);
    var desc = evaluateProp(props.desc, props);
    var id = evaluateProp(props.id, props);
    var style = evaluateStyle((0, import_assign9.default)({
      stroke: "black",
      fill: "none"
    }, props.style), props);
    var tabIndex = evaluateProp(props.tabIndex, props);
    return (0, import_assign9.default)({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var Arc = function(props) {
    props = evaluateProps2(props);
    return /* @__PURE__ */ import_react58.default.cloneElement(props.pathComponent, _objectSpread7(_objectSpread7({}, props.events), {}, {
      "aria-label": props.ariaLabel,
      d: getArcPath(props),
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      className: props.className,
      role: props.role,
      shapeRendering: props.shapeRendering,
      transform: props.transform,
      clipPath: props.clipPath
    }));
  };
  Arc.propTypes = _objectSpread7(_objectSpread7({}, CommonProps.primitiveProps), {}, {
    closedPath: import_prop_types47.default.bool,
    cx: import_prop_types47.default.number,
    cy: import_prop_types47.default.number,
    datum: import_prop_types47.default.any,
    endAngle: import_prop_types47.default.number,
    pathComponent: import_prop_types47.default.element,
    r: import_prop_types47.default.number,
    startAngle: import_prop_types47.default.number
  });
  Arc.defaultProps = {
    pathComponent: /* @__PURE__ */ import_react58.default.createElement(Path, null),
    role: "presentation",
    shapeRendering: "auto"
  };

  // node_modules/victory-core/es/victory-primitives/background.js
  var import_assign10 = __toESM(require_assign());
  var import_react59 = __toESM(require_react());
  var import_prop_types48 = __toESM(require_prop_types());
  function ownKeys8(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread8(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys8(Object(source), true).forEach(function(key) {
        _defineProperty11(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys8(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty11(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var evaluateProps3 = function(props) {
    var id = evaluateProp(props.id, props);
    return (0, import_assign10.default)({}, props, {
      id
    });
  };
  var Background = function(props) {
    props = evaluateProps3(props);
    return props.polar ? /* @__PURE__ */ import_react59.default.cloneElement(props.circleComponent, _objectSpread8(_objectSpread8({}, props.events), {}, {
      style: props.style,
      role: props.role,
      shapeRendering: props.shapeRendering,
      cx: props.x,
      cy: props.y,
      r: props.height,
      className: props.className
    })) : /* @__PURE__ */ import_react59.default.cloneElement(props.rectComponent, _objectSpread8(_objectSpread8({}, props.events), {}, {
      style: props.style,
      role: props.role,
      shapeRendering: props.shapeRendering,
      x: props.x,
      y: props.y,
      rx: props.rx,
      ry: props.ry,
      width: props.width,
      height: props.height,
      className: props.className
    }));
  };
  Background.propTypes = _objectSpread8(_objectSpread8({}, CommonProps.primitiveProps), {}, {
    circleComponent: import_prop_types48.default.element,
    height: import_prop_types48.default.number,
    rectComponent: import_prop_types48.default.element,
    rx: import_prop_types48.default.number,
    ry: import_prop_types48.default.number,
    width: import_prop_types48.default.number,
    x: import_prop_types48.default.number,
    y: import_prop_types48.default.number
  });
  Background.defaultProps = {
    circleComponent: /* @__PURE__ */ import_react59.default.createElement(Circle, null),
    rectComponent: /* @__PURE__ */ import_react59.default.createElement(Rect, null),
    role: "presentation",
    shapeRendering: "auto"
  };

  // node_modules/victory-core/es/victory-primitives/border.js
  var import_assign11 = __toESM(require_assign());
  var import_react60 = __toESM(require_react());
  var import_prop_types49 = __toESM(require_prop_types());
  function ownKeys9(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread9(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys9(Object(source), true).forEach(function(key) {
        _defineProperty12(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys9(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty12(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var evaluateProps4 = function(props) {
    var ariaLabel = evaluateProp(props.ariaLabel, props);
    var desc = evaluateProp(props.desc, props);
    var id = evaluateProp(props.id, props);
    var style = evaluateStyle((0, import_assign11.default)({
      fill: "none"
    }, props.style), props);
    var tabIndex = evaluateProp(props.tabIndex, props);
    return (0, import_assign11.default)({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var Border = function(props) {
    props = evaluateProps4(props);
    return /* @__PURE__ */ import_react60.default.cloneElement(props.rectComponent, _objectSpread9(_objectSpread9({}, props.events), {}, {
      "aria-label": props.ariaLabel,
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      transform: props.transform,
      className: props.className,
      role: props.role,
      shapeRendering: props.shapeRendering,
      x: props.x,
      y: props.y,
      width: props.width,
      height: props.height,
      clipPath: props.clipPath
    }));
  };
  Border.propTypes = _objectSpread9(_objectSpread9({}, CommonProps.primitiveProps), {}, {
    height: import_prop_types49.default.number,
    rectComponent: import_prop_types49.default.element,
    width: import_prop_types49.default.number,
    x: import_prop_types49.default.number,
    y: import_prop_types49.default.number
  });
  Border.defaultProps = {
    rectComponent: /* @__PURE__ */ import_react60.default.createElement(Rect, null),
    role: "presentation",
    shapeRendering: "auto"
  };

  // node_modules/victory-core/es/victory-primitives/line.js
  var import_react61 = __toESM(require_react());
  var _excluded6 = ["desc"];
  function _extends6() {
    _extends6 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends6.apply(this, arguments);
  }
  function _objectWithoutProperties7(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose6(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _objectWithoutPropertiesLoose6(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  var Line = function(props) {
    var desc = props.desc, rest = _objectWithoutProperties7(props, _excluded6);
    return desc ? (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react61.default.createElement("line", _extends6({
        vectorEffect: "non-scaling-stroke"
      }, rest), /* @__PURE__ */ import_react61.default.createElement("desc", null, desc))
    ) : (
      // @ts-expect-error FIXME: "id cannot be a number"
      /* @__PURE__ */ import_react61.default.createElement("line", _extends6({
        vectorEffect: "non-scaling-stroke"
      }, rest))
    );
  };

  // node_modules/victory-core/es/victory-primitives/line-segment.js
  var import_assign12 = __toESM(require_assign());
  var import_react62 = __toESM(require_react());
  var import_prop_types50 = __toESM(require_prop_types());
  function ownKeys10(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread10(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys10(Object(source), true).forEach(function(key) {
        _defineProperty13(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys10(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty13(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var evaluateProps5 = function(props) {
    var ariaLabel = evaluateProp(props.ariaLabel, props);
    var desc = evaluateProp(props.desc, props);
    var id = evaluateProp(props.id, props);
    var style = evaluateStyle((0, import_assign12.default)({
      stroke: "black"
    }, props.style), props);
    var tabIndex = evaluateProp(props.tabIndex, props);
    return (0, import_assign12.default)({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var LineSegment = function(props) {
    props = evaluateProps5(props);
    return /* @__PURE__ */ import_react62.default.cloneElement(props.lineComponent, _objectSpread10(_objectSpread10({}, props.events), {}, {
      "aria-label": props.ariaLabel,
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      className: props.className,
      role: props.role,
      shapeRendering: props.shapeRendering,
      x1: props.x1,
      x2: props.x2,
      y1: props.y1,
      y2: props.y2,
      transform: props.transform,
      clipPath: props.clipPath
    }));
  };
  LineSegment.propTypes = _objectSpread10(_objectSpread10({}, CommonProps.primitiveProps), {}, {
    datum: import_prop_types50.default.any,
    lineComponent: import_prop_types50.default.element,
    x1: import_prop_types50.default.number,
    x2: import_prop_types50.default.number,
    y1: import_prop_types50.default.number,
    y2: import_prop_types50.default.number
  });
  LineSegment.defaultProps = {
    lineComponent: /* @__PURE__ */ import_react62.default.createElement(Line, null),
    role: "presentation",
    shapeRendering: "auto"
  };

  // node_modules/victory-core/es/victory-primitives/point.js
  var import_assign13 = __toESM(require_assign());
  var import_prop_types51 = __toESM(require_prop_types());
  var import_react63 = __toESM(require_react());

  // node_modules/victory-core/es/victory-util/point-path-helpers.js
  var point_path_helpers_exports = {};
  __export(point_path_helpers_exports, {
    circle: () => circle,
    cross: () => cross,
    diamond: () => diamond,
    minus: () => minus,
    plus: () => plus,
    square: () => square2,
    star: () => star,
    triangleDown: () => triangleDown,
    triangleUp: () => triangleUp
  });
  var import_range2 = __toESM(require_range());
  function circle(x2, y2, size) {
    return "M ".concat(x2, ", ").concat(y2, "\n      m ").concat(-size, ", 0\n      a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n      a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0");
  }
  function square2(x2, y2, size) {
    var baseSize = 0.87 * size;
    var x0 = x2 - baseSize;
    var y1 = y2 + baseSize;
    var distance = x2 + baseSize - x0;
    return "M ".concat(x0, ", ").concat(y1, "\n      h").concat(distance, "\n      v-").concat(distance, "\n      h-").concat(distance, "\n      z");
  }
  function diamond(x2, y2, size) {
    var baseSize = 0.87 * size;
    var length = Math.sqrt(2 * (baseSize * baseSize));
    return "M ".concat(x2, ", ").concat(y2 + length, "\n      l ").concat(length, ", -").concat(length, "\n      l -").concat(length, ", -").concat(length, "\n      l -").concat(length, ", ").concat(length, "\n      l ").concat(length, ", ").concat(length, "\n      z");
  }
  function triangleDown(x2, y2, size) {
    var height = size / 2 * Math.sqrt(3);
    var x0 = x2 - size;
    var x1 = x2 + size;
    var y0 = y2 - size;
    var y1 = y2 + height;
    return "M ".concat(x0, ", ").concat(y0, "\n      L ").concat(x1, ", ").concat(y0, "\n      L ").concat(x2, ", ").concat(y1, "\n      z");
  }
  function triangleUp(x2, y2, size) {
    var height = size / 2 * Math.sqrt(3);
    var x0 = x2 - size;
    var x1 = x2 + size;
    var y0 = y2 - height;
    var y1 = y2 + size;
    return "M ".concat(x0, ", ").concat(y1, "\n      L ").concat(x1, ", ").concat(y1, "\n      L ").concat(x2, ", ").concat(y0, "\n      z");
  }
  function plus(x2, y2, size) {
    var baseSize = 1.1 * size;
    var distance = baseSize / 1.5;
    return "\n      M ".concat(x2 - distance / 2, ", ").concat(y2 + baseSize, "\n      v-").concat(distance, "\n      h-").concat(distance, "\n      v-").concat(distance, "\n      h").concat(distance, "\n      v-").concat(distance, "\n      h").concat(distance, "\n      v").concat(distance, "\n      h").concat(distance, "\n      v").concat(distance, "\n      h-").concat(distance, "\n      v").concat(distance, "\n      z");
  }
  function cross(x2, y2, size) {
    var baseSize = 0.8 * size;
    var distance = baseSize / 1.5;
    return "\n      M ".concat(x2 - distance / 2, ", ").concat(y2 + baseSize + distance, "\n      v-").concat(distance * 2, "\n      h-").concat(distance, "\n      v-").concat(distance, "\n      h").concat(distance, "\n      v-").concat(distance, "\n      h").concat(distance, "\n      v").concat(distance, "\n      h").concat(distance, "\n      v").concat(distance, "\n      h-").concat(distance, "\n      v").concat(distance * 2, "\n      z");
  }
  function minus(x2, y2, size) {
    var baseSize = 1.1 * size;
    var lineHeight = baseSize - baseSize * 0.3;
    var x0 = x2 - baseSize;
    var y1 = y2 + lineHeight / 2;
    var distance = x2 + baseSize - x0;
    return "M ".concat(x0, ", ").concat(y1, "\n      h").concat(distance, "\n      v-").concat(lineHeight, "\n      h-").concat(distance, "\n      z");
  }
  function star(x2, y2, size) {
    var baseSize = 1.35 * size;
    var angle = Math.PI / 5;
    var starCoords = (0, import_range2.default)(10).map(function(index) {
      var length = index % 2 === 0 ? baseSize : baseSize / 2;
      return "".concat(length * Math.sin(angle * (index + 1)) + x2, ",\n        ").concat(length * Math.cos(angle * (index + 1)) + y2);
    });
    return "M ".concat(starCoords.join("L"), " z");
  }

  // node_modules/victory-core/es/victory-primitives/point.js
  function ownKeys11(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread11(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys11(Object(source), true).forEach(function(key) {
        _defineProperty14(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys11(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty14(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var getPath = function(props) {
    var x2 = props.x, y2 = props.y, size = props.size, symbol = props.symbol;
    if (props.getPath) {
      return props.getPath(x2, y2, size);
    }
    var pathFunctions = point_path_helpers_exports;
    var symbolFunction = typeof pathFunctions[symbol] === "function" ? pathFunctions[symbol] : pathFunctions.circle;
    return symbolFunction(x2, y2, size);
  };
  var evaluateProps6 = function(props) {
    var ariaLabel = evaluateProp(props.ariaLabel, props);
    var desc = evaluateProp(props.desc, props);
    var id = evaluateProp(props.id, props);
    var size = evaluateProp(props.size, props);
    var style = evaluateStyle(props.style, props);
    var symbol = evaluateProp(props.symbol, props);
    var tabIndex = evaluateProp(props.tabIndex, props);
    return (0, import_assign13.default)({}, props, {
      ariaLabel,
      desc,
      id,
      size,
      style,
      symbol,
      tabIndex
    });
  };
  var Point = function(props) {
    props = evaluateProps6(props);
    var userProps = getSafeUserProps(props);
    return /* @__PURE__ */ import_react63.default.cloneElement(props.pathComponent, _objectSpread11(_objectSpread11({}, props.events), {}, {
      "aria-label": props.ariaLabel,
      d: getPath(props),
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      role: props.role,
      shapeRendering: props.shapeRendering,
      className: props.className,
      transform: props.transform,
      clipPath: props.clipPath
    }, userProps));
  };
  Point.propTypes = _objectSpread11(_objectSpread11({}, CommonProps.primitiveProps), {}, {
    datum: import_prop_types51.default.object,
    getPath: import_prop_types51.default.func,
    pathComponent: import_prop_types51.default.element,
    size: import_prop_types51.default.oneOfType([import_prop_types51.default.number, import_prop_types51.default.func]),
    symbol: import_prop_types51.default.oneOfType([import_prop_types51.default.oneOf(["circle", "cross", "diamond", "plus", "minus", "square", "star", "triangleDown", "triangleUp"]), import_prop_types51.default.func]),
    x: import_prop_types51.default.number,
    y: import_prop_types51.default.number
  });
  Point.defaultProps = {
    pathComponent: /* @__PURE__ */ import_react63.default.createElement(Path, null),
    role: "presentation",
    shapeRendering: "auto"
  };

  // node_modules/victory-core/es/victory-util/add-events.js
  var import_without2 = __toESM(require_without());
  var import_pick3 = __toESM(require_pick());
  var import_keys5 = __toESM(require_keys());
  var import_isNil = __toESM(require_isNil());
  var import_isFunction6 = __toESM(require_isFunction());
  var import_isEmpty3 = __toESM(require_isEmpty());
  var import_difference = __toESM(require_difference());
  var import_defaults10 = __toESM(require_defaults());
  var import_assign15 = __toESM(require_assign());
  var import_react64 = __toESM(require_react());

  // node_modules/victory-core/es/victory-util/events.js
  var events_exports = {};
  __export(events_exports, {
    emulateReactEvent: () => emulateReactEvent,
    getComponentEvents: () => getComponentEvents,
    getEventState: () => getEventState,
    getEvents: () => getEvents,
    getExternalMutation: () => getExternalMutation,
    getExternalMutations: () => getExternalMutations,
    getExternalMutationsWithChildren: () => getExternalMutationsWithChildren,
    getGlobalEventNameFromKey: () => getGlobalEventNameFromKey,
    getGlobalEvents: () => getGlobalEvents,
    getPartialEvents: () => getPartialEvents,
    getScopedEvents: () => getScopedEvents,
    omitGlobalEvents: () => omitGlobalEvents
  });
  var import_keys4 = __toESM(require_keys());
  var import_includes2 = __toESM(require_includes());
  var import_uniq = __toESM(require_uniq());
  var import_omitBy = __toESM(require_omitBy());
  var import_pickBy = __toESM(require_pickBy());
  var import_without = __toESM(require_without());
  var import_isFunction5 = __toESM(require_isFunction());
  var import_isEmpty2 = __toESM(require_isEmpty());
  var import_assign14 = __toESM(require_assign());
  function _defineProperty15(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toConsumableArray8(arr) {
    return _arrayWithoutHoles7(arr) || _iterableToArray7(arr) || _unsupportedIterableToArray8(arr) || _nonIterableSpread7();
  }
  function _nonIterableSpread7() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray8(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray8(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray8(o, minLen);
  }
  function _iterableToArray7(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles7(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray8(arr);
  }
  function _arrayLikeToArray8(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  var GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
  function getEvents(props, target, eventKey, getScopedEvents2) {
    var _this = this;
    var getEventsByTarget = function(events) {
      var getSelectedEvents = function() {
        var targetEvents = events.reduce(function(memo2, event) {
          if (event.target !== void 0) {
            var matchesTarget = Array.isArray(event.target) ? (0, import_includes2.default)(event.target, target) : "".concat(event.target) === "".concat(target);
            return matchesTarget ? memo2.concat(event) : memo2;
          }
          return memo2.concat(event);
        }, []);
        if (eventKey !== void 0 && target !== "parent") {
          return targetEvents.filter(function(obj) {
            var targetKeys = obj.eventKey;
            var useKey = function(key) {
              return key ? "".concat(key) === "".concat(eventKey) : true;
            };
            return Array.isArray(targetKeys) ? targetKeys.some(function(k2) {
              return useKey(k2);
            }) : useKey(targetKeys);
          });
        }
        return targetEvents;
      };
      var selectedEvents = getSelectedEvents();
      return Array.isArray(selectedEvents) && selectedEvents.reduce(function(memo2, event) {
        return event ? (0, import_assign14.default)(memo2, event.eventHandlers) : memo2;
      }, {});
    };
    var getAllEvents2 = function() {
      if (Array.isArray(_this.componentEvents)) {
        var _this$componentEvents;
        return Array.isArray(props.events) ? (_this$componentEvents = _this.componentEvents).concat.apply(_this$componentEvents, _toConsumableArray8(props.events)) : _this.componentEvents;
      }
      return props.events;
    };
    var allEvents = getAllEvents2();
    var ownEvents = allEvents && (0, import_isFunction5.default)(getScopedEvents2) ? getScopedEvents2(getEventsByTarget(allEvents), target) : void 0;
    if (!props.sharedEvents) {
      return ownEvents;
    }
    var getSharedEvents = props.sharedEvents.getEvents;
    var sharedEvents = props.sharedEvents.events && getSharedEvents(getEventsByTarget(props.sharedEvents.events), target);
    return (0, import_assign14.default)({}, sharedEvents, ownEvents);
  }
  function getScopedEvents(events, namespace2, childType, baseProps4) {
    var _this2 = this;
    if ((0, import_isEmpty2.default)(events)) {
      return {};
    }
    baseProps4 = baseProps4 || this.baseProps;
    var getTargetProps = function(identifier, type) {
      var childName = identifier.childName, target = identifier.target, key = identifier.key;
      var baseType = type === "props" ? baseProps4 : _this2.state || {};
      var base = childName === void 0 || childName === null || !baseType[childName] ? baseType : baseType[childName];
      return key === "parent" ? base.parent : base[key] && base[key][target];
    };
    var parseEvent = function(eventReturn, eventKey) {
      var childNames = namespace2 === "parent" ? eventReturn.childName : eventReturn.childName || childType;
      var target = eventReturn.target || namespace2;
      var getKeys = function(childName) {
        if (target === "parent") {
          return "parent";
        }
        if (eventReturn.eventKey === "all") {
          return baseProps4[childName] ? (0, import_without.default)((0, import_keys4.default)(baseProps4[childName]), "parent") : (0, import_without.default)((0, import_keys4.default)(baseProps4), "parent");
        } else if (eventReturn.eventKey === void 0 && eventKey === "parent") {
          return baseProps4[childName] ? (0, import_keys4.default)(baseProps4[childName]) : (0, import_keys4.default)(baseProps4);
        }
        return eventReturn.eventKey !== void 0 ? eventReturn.eventKey : eventKey;
      };
      var getMutationObject = function(key, childName) {
        var baseState = _this2.state || {};
        if (!(0, import_isFunction5.default)(eventReturn.mutation)) {
          return baseState;
        }
        var mutationTargetProps = getTargetProps({
          childName,
          key,
          target
        }, "props");
        var mutationTargetState = getTargetProps({
          childName,
          key,
          target
        }, "state");
        var mutatedProps = eventReturn.mutation((0, import_assign14.default)({}, mutationTargetProps, mutationTargetState), baseProps4);
        var childState = baseState[childName] || {};
        var filterState = function(state) {
          if (state[key] && state[key][target]) {
            delete state[key][target];
          }
          if (state[key] && !(0, import_keys4.default)(state[key]).length) {
            delete state[key];
          }
          return state;
        };
        var extendState = function(state) {
          return target === "parent" ? (0, import_assign14.default)(state, _defineProperty15({}, key, (0, import_assign14.default)(state[key], mutatedProps))) : (0, import_assign14.default)(state, _defineProperty15({}, key, (0, import_assign14.default)(state[key], _defineProperty15({}, target, mutatedProps))));
        };
        var updateState = function(state) {
          return mutatedProps ? extendState(state) : filterState(state);
        };
        return childName !== void 0 && childName !== null ? (0, import_assign14.default)(baseState, _defineProperty15({}, childName, updateState(childState))) : updateState(baseState);
      };
      var getReturnByChild = function(childName) {
        var mutationKeys = getKeys(childName);
        return Array.isArray(mutationKeys) ? mutationKeys.reduce(function(memo2, key) {
          return (0, import_assign14.default)(memo2, getMutationObject(key, childName));
        }, {}) : getMutationObject(mutationKeys, childName);
      };
      var allChildNames = childNames === "all" ? (0, import_without.default)((0, import_keys4.default)(baseProps4), "parent") : childNames;
      return Array.isArray(allChildNames) ? allChildNames.reduce(function(memo2, childName) {
        return (0, import_assign14.default)(memo2, getReturnByChild(childName));
      }, {}) : getReturnByChild(allChildNames);
    };
    var parseEventReturn = function(eventReturn, eventKey) {
      return Array.isArray(eventReturn) ? eventReturn.reduce(function(memo2, props) {
        memo2 = (0, import_assign14.default)({}, memo2, parseEvent(props, eventKey));
        return memo2;
      }, {}) : parseEvent(eventReturn, eventKey);
    };
    var compileCallbacks = function(eventReturn) {
      var getCallback = function(obj) {
        return (0, import_isFunction5.default)(obj.callback) && obj.callback;
      };
      var callbacks = Array.isArray(eventReturn) ? eventReturn.map(function(evtObj) {
        return getCallback(evtObj);
      }) : [getCallback(eventReturn)];
      var callbackArray = callbacks.filter(function(callback) {
        return callback !== false;
      });
      return callbackArray.length ? function() {
        return callbackArray.forEach(function(callback) {
          return callback();
        });
      } : void 0;
    };
    var onEvent = function(evt, childProps, eventKey, eventName) {
      var eventReturn = events[eventName](evt, childProps, eventKey, _this2);
      if (!(0, import_isEmpty2.default)(eventReturn)) {
        var callbacks = compileCallbacks(eventReturn);
        _this2.setState(parseEventReturn(eventReturn, eventKey), callbacks);
      }
    };
    return (0, import_keys4.default)(events).reduce(function(memo2, event) {
      memo2[event] = onEvent;
      return memo2;
    }, {});
  }
  function getPartialEvents(events, eventKey, childProps) {
    if (!events)
      return {};
    return (0, import_keys4.default)(events).reduce(function(memo2, eventName) {
      var appliedEvent = function(evt) {
        return events[eventName](evt, childProps, eventKey, eventName);
      };
      memo2[eventName] = appliedEvent;
      return memo2;
    }, {});
  }
  function getEventState(eventKey, namespace2, childType) {
    var state = this.state || {};
    if (!childType) {
      return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace2] || state[eventKey] : state[eventKey] && state[eventKey][namespace2];
    }
    return state[childType] && state[childType][eventKey] && state[childType][eventKey][namespace2];
  }
  function getExternalMutationsWithChildren(mutations, baseProps4, baseState, childNames) {
    baseProps4 = baseProps4 || {};
    baseState = baseState || {};
    return childNames.reduce(function(memo2, childName) {
      var childState = baseState[childName];
      var mutation = getExternalMutations(mutations, baseProps4[childName], baseState[childName], childName);
      memo2[childName] = mutation ? mutation : childState;
      return (0, import_pickBy.default)(memo2, function(v) {
        return !(0, import_isEmpty2.default)(v);
      });
    }, {});
  }
  function getExternalMutations(mutations, baseProps4, baseState, childName) {
    baseProps4 = baseProps4 || {};
    baseState = baseState || {};
    var eventKeys = (0, import_keys4.default)(baseProps4);
    return eventKeys.reduce(function(memo2, eventKey) {
      var keyState = baseState[eventKey] || {};
      var keyProps = baseProps4[eventKey] || {};
      if (eventKey === "parent") {
        var identifier = {
          eventKey,
          target: "parent"
        };
        var mutation = getExternalMutation(mutations, keyProps, keyState, identifier);
        memo2[eventKey] = mutation !== void 0 ? (0, import_assign14.default)({}, keyState, mutation) : keyState;
      } else {
        var targets = (0, import_uniq.default)((0, import_keys4.default)(keyProps).concat((0, import_keys4.default)(keyState)));
        memo2[eventKey] = targets.reduce(function(m, target) {
          var identifier2 = {
            eventKey,
            target,
            childName
          };
          var mutation2 = getExternalMutation(mutations, keyProps[target], keyState[target], identifier2);
          m[target] = mutation2 !== void 0 ? (0, import_assign14.default)({}, keyState[target], mutation2) : keyState[target];
          return (0, import_pickBy.default)(m, function(v) {
            return !(0, import_isEmpty2.default)(v);
          });
        }, {});
      }
      return (0, import_pickBy.default)(memo2, function(v) {
        return !(0, import_isEmpty2.default)(v);
      });
    }, {});
  }
  function getExternalMutation(mutations, baseProps4, baseState, identifier) {
    var filterMutations = function(mutation, type) {
      if (typeof mutation[type] === "string") {
        return mutation[type] === "all" || mutation[type] === identifier[type];
      } else if (Array.isArray(mutation[type])) {
        var stringArray = mutation[type].map(function(m) {
          return "".concat(m);
        });
        return (0, import_includes2.default)(stringArray, identifier[type]);
      }
      return false;
    };
    mutations = Array.isArray(mutations) ? mutations : [mutations];
    var scopedMutations = mutations;
    if (identifier.childName) {
      scopedMutations = mutations.filter(function(m) {
        return filterMutations(m, "childName");
      });
    }
    var targetMutations = scopedMutations.filter(function(m) {
      return filterMutations(m, "target");
    });
    if ((0, import_isEmpty2.default)(targetMutations)) {
      return void 0;
    }
    var keyMutations = targetMutations.filter(function(m) {
      return filterMutations(m, "eventKey");
    });
    if ((0, import_isEmpty2.default)(keyMutations)) {
      return void 0;
    }
    return keyMutations.reduce(function(memo2, curr) {
      var mutationFunction = curr && (0, import_isFunction5.default)(curr.mutation) ? curr.mutation : function() {
        return void 0;
      };
      var currentMutation = mutationFunction((0, import_assign14.default)({}, baseProps4, baseState));
      return (0, import_assign14.default)({}, memo2, currentMutation);
    }, {});
  }
  function getComponentEvents(props, components) {
    var events = Array.isArray(components) && components.reduce(function(memo2, componentName) {
      var _memo;
      var component = props[componentName];
      var defaultEvents = component && component.type && component.type.defaultEvents;
      var componentEvents = (0, import_isFunction5.default)(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
      memo2 = Array.isArray(componentEvents) ? (_memo = memo2).concat.apply(_memo, _toConsumableArray8(componentEvents)) : memo2;
      return memo2;
    }, []);
    return events && events.length ? events : void 0;
  }
  function getGlobalEventNameFromKey(key) {
    var match = key.match(GLOBAL_EVENT_REGEX);
    return match && match[1] && match[1].toLowerCase();
  }
  var getGlobalEvents = function(events) {
    return (0, import_pickBy.default)(events, function(_, key) {
      return GLOBAL_EVENT_REGEX.test(key);
    });
  };
  var omitGlobalEvents = function(events) {
    return (0, import_omitBy.default)(events, function(_, key) {
      return GLOBAL_EVENT_REGEX.test(key);
    });
  };
  var emulateReactEvent = function(event) {
    return (0, import_assign14.default)(event, {
      nativeEvent: event
    });
  };

  // node_modules/victory-core/es/victory-util/add-events.js
  var import_react_fast_compare3 = __toESM(require_react_fast_compare());
  function _toConsumableArray9(arr) {
    return _arrayWithoutHoles8(arr) || _iterableToArray8(arr) || _unsupportedIterableToArray9(arr) || _nonIterableSpread8();
  }
  function _nonIterableSpread8() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray9(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray9(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray9(o, minLen);
  }
  function _iterableToArray8(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles8(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray9(arr);
  }
  function _arrayLikeToArray9(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _classCallCheck10(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties9(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass10(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties9(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties9(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits8(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf7(subClass, superClass);
  }
  function _setPrototypeOf7(o, p2) {
    _setPrototypeOf7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf7(o, p2);
  }
  function _createSuper7(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct7();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf7(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf7(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn8(this, result);
    };
  }
  function _possibleConstructorReturn8(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized7(self2);
  }
  function _assertThisInitialized7(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct7() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf7(o) {
    _getPrototypeOf7 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf7(o);
  }
  var datumHasXandY = function(datum) {
    return !(0, import_isNil.default)(datum._x) && !(0, import_isNil.default)(datum._y);
  };
  var defaultComponents = [{
    name: "parent",
    index: "parent"
  }, {
    name: "data"
  }, {
    name: "labels"
  }];
  function addEvents(WrappedComponent) {
    var options4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    var AddEventsMixin = /* @__PURE__ */ function(_WrappedComponent) {
      _inherits8(AddEventsMixin2, _WrappedComponent);
      var _super = _createSuper7(AddEventsMixin2);
      function AddEventsMixin2(props) {
        var _this;
        _classCallCheck10(this, AddEventsMixin2);
        _this = _super.call(this, props);
        _this.state = {};
        _this.getEventState = getEventState.bind(_assertThisInitialized7(_this));
        _this.getScopedEvents = getScopedEvents.bind(_assertThisInitialized7(_this));
        _this.getEvents = function(p2, target, eventKey) {
          return getEvents.call(_assertThisInitialized7(_this), p2, target, eventKey, _this.getScopedEvents);
        };
        _this.externalMutations = _this.getExternalMutations(_this.props);
        _this.calculatedState = _this.getStateChanges(_this.props);
        _this.globalEvents = {};
        _this.prevGlobalEventKeys = [];
        _this.boundGlobalEvents = {};
        _this.cacheValues(_this.getCalculatedValues(props));
        return _this;
      }
      _createClass10(AddEventsMixin2, [{
        key: "shouldComponentUpdate",
        value: function shouldComponentUpdate(nextProps) {
          var externalMutations = this.getExternalMutations(nextProps);
          var animating = this.props.animating || this.props.animate;
          var newMutation = !(0, import_react_fast_compare3.default)(externalMutations, this.externalMutations);
          if (animating || newMutation) {
            this.cacheValues(this.getCalculatedValues(nextProps));
            this.externalMutations = externalMutations;
            this.applyExternalMutations(nextProps, externalMutations);
            return true;
          }
          var calculatedState = this.getStateChanges(nextProps);
          if (!(0, import_react_fast_compare3.default)(this.calculatedState, calculatedState)) {
            this.cacheValues(this.getCalculatedValues(nextProps));
            return true;
          }
          if (!(0, import_react_fast_compare3.default)(this.props, nextProps)) {
            this.cacheValues(this.getCalculatedValues(nextProps));
            return true;
          }
          return false;
        }
      }, {
        key: "componentDidMount",
        value: function componentDidMount() {
          var _this2 = this;
          var globalEventKeys = (0, import_keys5.default)(this.globalEvents);
          globalEventKeys.forEach(function(key) {
            return _this2.addGlobalListener(key);
          });
          this.prevGlobalEventKeys = globalEventKeys;
        }
      }, {
        key: "componentDidUpdate",
        value: function componentDidUpdate(prevProps) {
          var _this3 = this;
          var calculatedState = this.getStateChanges(prevProps);
          this.calculatedState = calculatedState;
          var globalEventKeys = (0, import_keys5.default)(this.globalEvents);
          var removedGlobalEventKeys = (0, import_difference.default)(this.prevGlobalEventKeys, globalEventKeys);
          removedGlobalEventKeys.forEach(function(key) {
            return _this3.removeGlobalListener(key);
          });
          var addedGlobalEventKeys = (0, import_difference.default)(globalEventKeys, this.prevGlobalEventKeys);
          addedGlobalEventKeys.forEach(function(key) {
            return _this3.addGlobalListener(key);
          });
          this.prevGlobalEventKeys = globalEventKeys;
        }
      }, {
        key: "componentWillUnmount",
        value: function componentWillUnmount() {
          var _this4 = this;
          this.prevGlobalEventKeys.forEach(function(key) {
            return _this4.removeGlobalListener(key);
          });
        }
      }, {
        key: "addGlobalListener",
        value: function addGlobalListener(key) {
          var _this5 = this;
          var boundListener = function(event) {
            var listener3 = _this5.globalEvents[key];
            return listener3 && listener3(emulateReactEvent(event));
          };
          this.boundGlobalEvents[key] = boundListener;
          window.addEventListener(getGlobalEventNameFromKey(key), boundListener);
        }
      }, {
        key: "removeGlobalListener",
        value: function removeGlobalListener(key) {
          window.removeEventListener(getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
        }
        // compile all state changes from own and parent state. Order doesn't matter, as any state
        // state change should trigger a re-render
      }, {
        key: "getStateChanges",
        value: function getStateChanges(props) {
          var _this6 = this;
          if (!this.hasEvents) {
            return {};
          }
          var getState = function(key, type) {
            var result = (0, import_defaults10.default)({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
            return (0, import_isEmpty3.default)(result) ? void 0 : result;
          };
          var components = options4.components || defaultComponents;
          var stateChanges = components.map(function(component) {
            if (!props.standalone && component.name === "parent") {
              return void 0;
            }
            return component.index !== void 0 ? getState(component.index, component.name) : _this6.dataKeys.map(function(key) {
              return getState(key, component.name);
            }).filter(Boolean);
          }).filter(Boolean);
          return stateChanges;
        }
      }, {
        key: "applyExternalMutations",
        value: function applyExternalMutations(props, externalMutations) {
          if (!(0, import_isEmpty3.default)(externalMutations)) {
            var callbacks = props.externalEventMutations.reduce(function(memo2, mutation) {
              memo2 = (0, import_isFunction6.default)(mutation.callback) ? memo2.concat(mutation.callback) : memo2;
              return memo2;
            }, []);
            var compiledCallbacks = callbacks.length ? function() {
              callbacks.forEach(function(c2) {
                return c2();
              });
            } : void 0;
            this.setState(externalMutations, compiledCallbacks);
          }
        }
      }, {
        key: "getCalculatedValues",
        value: function getCalculatedValues5(props) {
          var sharedEvents = props.sharedEvents;
          var components = WrappedComponent.expectedComponents;
          var componentEvents = getComponentEvents(props, components);
          var getSharedEventState = sharedEvents && (0, import_isFunction6.default)(sharedEvents.getEventState) ? sharedEvents.getEventState : function() {
            return void 0;
          };
          var baseProps4 = this.getBaseProps(props, getSharedEventState);
          var dataKeys = (0, import_keys5.default)(baseProps4).filter(function(key) {
            return key !== "parent";
          });
          var hasEvents = props.events || props.sharedEvents || componentEvents;
          var events = this.getAllEvents(props);
          return {
            componentEvents,
            getSharedEventState,
            baseProps: baseProps4,
            dataKeys,
            hasEvents,
            events
          };
        }
      }, {
        key: "getExternalMutations",
        value: function getExternalMutations2(props) {
          var sharedEvents = props.sharedEvents, externalEventMutations = props.externalEventMutations;
          return (0, import_isEmpty3.default)(externalEventMutations) || sharedEvents ? void 0 : getExternalMutations(externalEventMutations, this.baseProps, this.state);
        }
      }, {
        key: "cacheValues",
        value: function cacheValues(obj) {
          var _this7 = this;
          (0, import_keys5.default)(obj).forEach(function(key) {
            _this7[key] = obj[key];
          });
        }
      }, {
        key: "getBaseProps",
        value: function getBaseProps5(props, getSharedEventState) {
          getSharedEventState = getSharedEventState || this.getSharedEventState.bind(this);
          var sharedParentState = getSharedEventState("parent", "parent");
          var parentState = this.getEventState("parent", "parent");
          var baseParentProps = (0, import_defaults10.default)({}, parentState, sharedParentState);
          var parentPropsList = baseParentProps.parentControlledProps;
          var parentProps = parentPropsList ? (0, import_pick3.default)(baseParentProps, parentPropsList) : {};
          var modifiedProps = (0, import_defaults10.default)({}, parentProps, props);
          return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
        }
      }, {
        key: "getAllEvents",
        value: function getAllEvents2(props) {
          if (Array.isArray(this.componentEvents)) {
            var _this$componentEvents;
            return Array.isArray(props.events) ? (_this$componentEvents = this.componentEvents).concat.apply(_this$componentEvents, _toConsumableArray9(props.events)) : this.componentEvents;
          }
          return props.events;
        }
      }, {
        key: "getComponentProps",
        value: function getComponentProps(component, type, index) {
          var name2 = this.props.name || WrappedComponent.role;
          var key = this.dataKeys && this.dataKeys[index] || index;
          var id = "".concat(name2, "-").concat(type, "-").concat(key);
          var baseProps4 = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
          if (!baseProps4 && !this.hasEvents) {
            return void 0;
          }
          if (this.hasEvents) {
            var baseEvents = this.getEvents(this.props, type, key);
            var componentProps = (0, import_defaults10.default)({
              index,
              key: id
            }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps4, {
              id
            });
            var events = (0, import_defaults10.default)({}, getPartialEvents(baseEvents, key, componentProps), componentProps.events);
            return (0, import_assign15.default)({}, componentProps, {
              events
            });
          }
          return (0, import_defaults10.default)({
            index,
            key: id
          }, component.props, baseProps4, {
            id
          });
        }
      }, {
        key: "renderContainer",
        value: function renderContainer(component, children) {
          var isContainer = component.type && component.type.role === "container";
          var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
          if (parentProps.events) {
            this.globalEvents = getGlobalEvents(parentProps.events);
            parentProps.events = omitGlobalEvents(parentProps.events);
          }
          return /* @__PURE__ */ import_react64.default.cloneElement(component, parentProps, children);
        }
      }, {
        key: "animateComponent",
        value: function animateComponent(props, defaultAnimationWhitelist) {
          var _props$animate;
          var animationWhitelist = typeof props.animate === "object" && ((_props$animate = props.animate) === null || _props$animate === void 0 ? void 0 : _props$animate.animationWhitelist) || defaultAnimationWhitelist;
          var Comp = this.constructor;
          return /* @__PURE__ */ import_react64.default.createElement(VictoryTransition, {
            animate: props.animate,
            animationWhitelist
          }, /* @__PURE__ */ import_react64.default.createElement(Comp, props));
        }
        // Used by `VictoryLine` and `VictoryArea`
      }, {
        key: "renderContinuousData",
        value: function renderContinuousData(props) {
          var _this8 = this;
          var dataComponent = props.dataComponent, labelComponent = props.labelComponent, groupComponent = props.groupComponent;
          var dataKeys = (0, import_without2.default)(this.dataKeys, "all");
          var labelComponents = dataKeys.reduce(function(memo2, key) {
            var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
            if (labelProps && labelProps.text !== void 0 && labelProps.text !== null) {
              memo2 = memo2.concat(/* @__PURE__ */ import_react64.default.cloneElement(labelComponent, labelProps));
            }
            return memo2;
          }, []);
          var dataProps2 = this.getComponentProps(dataComponent, "data", "all");
          var children = [/* @__PURE__ */ import_react64.default.cloneElement(dataComponent, dataProps2)].concat(_toConsumableArray9(labelComponents));
          return this.renderContainer(groupComponent, children);
        }
      }, {
        key: "renderData",
        value: function renderData(props) {
          var _this9 = this;
          var shouldRenderDatum = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : datumHasXandY;
          var dataComponent = props.dataComponent, labelComponent = props.labelComponent, groupComponent = props.groupComponent;
          var dataComponents = this.dataKeys.reduce(function(validDataComponents, _dataKey, index) {
            var dataProps2 = _this9.getComponentProps(dataComponent, "data", index);
            if (shouldRenderDatum(dataProps2.datum)) {
              validDataComponents.push(/* @__PURE__ */ import_react64.default.cloneElement(dataComponent, dataProps2));
            }
            return validDataComponents;
          }, []);
          var labelComponents = this.dataKeys.map(function(_dataKey, index) {
            var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
            if (labelProps.text !== void 0 && labelProps.text !== null) {
              return /* @__PURE__ */ import_react64.default.cloneElement(labelComponent, labelProps);
            }
            return void 0;
          }).filter(Boolean);
          var children = [].concat(_toConsumableArray9(dataComponents), _toConsumableArray9(labelComponents));
          return this.renderContainer(groupComponent, children);
        }
      }]);
      return AddEventsMixin2;
    }(WrappedComponent);
    return AddEventsMixin;
  }

  // node_modules/victory-core/es/victory-util/axis.js
  var axis_exports = {};
  __export(axis_exports, {
    findAxisComponents: () => findAxisComponents,
    getAxis: () => getAxis,
    getAxisComponent: () => getAxisComponent,
    getAxisComponentsWithParent: () => getAxisComponentsWithParent,
    getAxisValue: () => getAxisValue,
    getDomain: () => getDomain2,
    getOrigin: () => getOrigin,
    getOriginSign: () => getOriginSign,
    getTickFormat: () => getTickFormat,
    getTicks: () => getTicks,
    isVertical: () => isVertical,
    modifyProps: () => modifyProps2,
    stringTicks: () => stringTicks
  });
  var import_without3 = __toESM(require_without());
  var import_includes5 = __toESM(require_includes());
  var import_values = __toESM(require_values());
  var import_orderBy3 = __toESM(require_orderBy());
  var import_range4 = __toESM(require_range());
  var import_uniq3 = __toESM(require_uniq());
  var import_invert = __toESM(require_invert());
  var import_isObject3 = __toESM(require_isObject());
  var import_isFunction9 = __toESM(require_isFunction());
  var import_identity4 = __toESM(require_identity());
  var import_defaults11 = __toESM(require_defaults());
  var import_assign17 = __toESM(require_assign());
  var import_react67 = __toESM(require_react());

  // node_modules/victory-core/es/victory-util/domain.js
  var domain_exports = {};
  __export(domain_exports, {
    createDomainFunction: () => createDomainFunction,
    formatDomain: () => formatDomain,
    getDomain: () => getDomain,
    getDomainFromCategories: () => getDomainFromCategories,
    getDomainFromData: () => getDomainFromData,
    getDomainFromMinMax: () => getDomainFromMinMax,
    getDomainFromProps: () => getDomainFromProps,
    getDomainWithZero: () => getDomainWithZero,
    getMaxFromProps: () => getMaxFromProps,
    getMinFromProps: () => getMinFromProps,
    getSymmetricDomain: () => getSymmetricDomain,
    isDomainComponent: () => isDomainComponent
  });
  var import_isDate = __toESM(require_isDate());
  var import_includes4 = __toESM(require_includes());
  var import_isFunction8 = __toESM(require_isFunction());
  var import_sortedUniq = __toESM(require_sortedUniq());
  var import_isPlainObject4 = __toESM(require_isPlainObject());
  var import_flatten = __toESM(require_flatten());
  var import_react66 = __toESM(require_react());

  // node_modules/victory-core/es/victory-util/data.js
  var data_exports = {};
  __export(data_exports, {
    createStringMap: () => createStringMap,
    downsample: () => downsample,
    formatData: () => formatData,
    formatDataFromDomain: () => formatDataFromDomain,
    generateData: () => generateData,
    getCategories: () => getCategories,
    getData: () => getData,
    getStringsFromAxes: () => getStringsFromAxes,
    getStringsFromCategories: () => getStringsFromCategories,
    getStringsFromData: () => getStringsFromData,
    isDataComponent: () => isDataComponent
  });
  var import_omitBy2 = __toESM(require_omitBy());
  var import_isUndefined = __toESM(require_isUndefined());
  var import_includes3 = __toESM(require_includes());
  var import_isEqual3 = __toESM(require_isEqual());
  var import_isEmpty4 = __toESM(require_isEmpty());
  var import_orderBy2 = __toESM(require_orderBy());
  var import_property2 = __toESM(require_property());
  var import_isPlainObject3 = __toESM(require_isPlainObject());
  var import_isFunction7 = __toESM(require_isFunction());
  var import_last = __toESM(require_last());
  var import_range3 = __toESM(require_range());
  var import_uniq2 = __toESM(require_uniq());
  var import_assign16 = __toESM(require_assign());
  var import_react65 = __toESM(require_react());

  // node_modules/victory-core/es/victory-util/immutable.js
  var IMMUTABLE_ITERABLE = "@@__IMMUTABLE_ITERABLE__@@";
  var IMMUTABLE_RECORD = "@@__IMMUTABLE_RECORD__@@";
  var IMMUTABLE_LIST = "@@__IMMUTABLE_LIST__@@";
  function isIterable(x2) {
    return !!(x2 && x2[IMMUTABLE_ITERABLE]);
  }
  function isRecord(x2) {
    return !!(x2 && x2[IMMUTABLE_RECORD]);
  }
  function isImmutable(x2) {
    return isIterable(x2) || isRecord(x2);
  }
  function isList(x2) {
    return !!(x2 && x2[IMMUTABLE_LIST]);
  }
  function shallowToJS(x2, whitelist) {
    return isIterable(x2) ? x2.reduce(function(result, curr, key) {
      if (whitelist && whitelist[key]) {
        curr = shallowToJS(curr);
      }
      result[key] = curr;
      return result;
    }, isList(x2) ? [] : {}) : x2;
  }

  // node_modules/victory-core/es/victory-util/data.js
  function _toConsumableArray10(arr) {
    return _arrayWithoutHoles9(arr) || _iterableToArray9(arr) || _unsupportedIterableToArray10(arr) || _nonIterableSpread9();
  }
  function _nonIterableSpread9() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray10(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray10(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray10(o, minLen);
  }
  function _iterableToArray9(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles9(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray10(arr);
  }
  function _arrayLikeToArray10(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function parseDatum(datum) {
    var immutableDatumWhitelist = {
      errorX: true,
      errorY: true
    };
    return isImmutable(datum) ? shallowToJS(datum, immutableDatumWhitelist) : datum;
  }
  function getLength(data) {
    return isIterable(data) ? data.size : data.length;
  }
  function generateDataArray(props, axis) {
    var propsDomain = (0, import_isPlainObject3.default)(props.domain) ? props.domain[axis] : props.domain;
    var domain2 = propsDomain || getBaseScale(props, axis).domain();
    var samples = props.samples || 1;
    var domainMax = Math.max.apply(Math, _toConsumableArray10(domain2));
    var domainMin = Math.min.apply(Math, _toConsumableArray10(domain2));
    var step = (domainMax - domainMin) / samples;
    var values = (0, import_range3.default)(domainMin, domainMax, step);
    return (0, import_last.default)(values) === domainMax ? values : values.concat(domainMax);
  }
  function sortData(dataset, sortKey) {
    var sortOrder = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "ascending";
    if (!sortKey) {
      return dataset;
    }
    if (sortKey === "x" || sortKey === "y") {
      sortKey = "_".concat(sortKey);
    }
    var order2 = sortOrder === "ascending" ? "asc" : "desc";
    return (0, import_orderBy2.default)(dataset, sortKey, order2);
  }
  function cleanData(dataset, props) {
    var smallNumber = 1 / Number.MAX_SAFE_INTEGER;
    var scaleType = {
      x: getScaleType(props, "x"),
      y: getScaleType(props, "y")
    };
    if (scaleType.x !== "log" && scaleType.y !== "log") {
      return dataset;
    }
    var rules = function(datum, axis) {
      return scaleType[axis] === "log" ? datum["_".concat(axis)] !== 0 : true;
    };
    var sanitize = function(datum) {
      var _x = rules(datum, "x") ? datum._x : smallNumber;
      var _y = rules(datum, "y") ? datum._y : smallNumber;
      var _y0 = rules(datum, "y0") ? datum._y0 : smallNumber;
      return (0, import_assign16.default)({}, datum, {
        _x,
        _y,
        _y0
      });
    };
    return dataset.map(function(datum) {
      if (rules(datum, "x") && rules(datum, "y") && rules(datum, "y0")) {
        return datum;
      }
      return sanitize(datum);
    });
  }
  function getEventKey(key) {
    if ((0, import_isFunction7.default)(key)) {
      return key;
    } else if (key === null || key === void 0) {
      return function() {
        return void 0;
      };
    }
    return (0, import_property2.default)(key);
  }
  function addEventKeys(props, data) {
    var hasEventKeyAccessor = !!props.eventKey;
    var eventKeyAccessor = getEventKey(props.eventKey);
    return data.map(function(datum, index) {
      if (datum.eventKey !== void 0) {
        return datum;
      } else if (hasEventKeyAccessor) {
        var eventKey = eventKeyAccessor(datum, index);
        return eventKey !== void 0 ? (0, import_assign16.default)({
          eventKey
        }, datum) : datum;
      }
      return datum;
    });
  }
  function formatDataFromDomain(dataset, domain2, defaultBaseline) {
    var exists2 = function(val) {
      return val !== void 0;
    };
    var minDomainX = getMinValue(domain2.x);
    var maxDomainX = getMaxValue(domain2.x);
    var minDomainY = getMinValue(domain2.y);
    var maxDomainY = getMaxValue(domain2.y);
    var underMin = function(min3) {
      return function(val) {
        return exists2(val) && val < min3;
      };
    };
    var overMax = function(max3) {
      return function(val) {
        return exists2(val) && val > max3;
      };
    };
    var isUnderMinX = underMin(minDomainX);
    var isUnderMinY = underMin(minDomainY);
    var isOverMaxX = overMax(maxDomainX);
    var isOverMaxY = overMax(maxDomainY);
    return dataset.map(function(datum) {
      var _x = datum._x, _y = datum._y, _y0 = datum._y0, _y1 = datum._y1;
      if (isUnderMinX(_x) || isOverMaxX(_x))
        _x = null;
      var baseline = exists2(_y0) ? _y0 : defaultBaseline;
      var value = exists2(_y1) ? _y1 : _y;
      if (!exists2(value))
        return datum;
      if (!exists2(baseline) && (isUnderMinY(value) || isOverMaxY(value)))
        _y = null;
      if (isUnderMinY(baseline) && isUnderMinY(value) || isOverMaxY(baseline) && isOverMaxY(value))
        _y = _y0 = _y1 = null;
      if (isUnderMinY(baseline) && !isUnderMinY(value))
        _y0 = minDomainY;
      if (isOverMaxY(baseline) && !isOverMaxY(value))
        _y0 = maxDomainY;
      return (0, import_assign16.default)({}, datum, (0, import_omitBy2.default)({
        _x,
        _y,
        _y0,
        _y1
      }, import_isUndefined.default));
    });
  }
  function createStringMap(props, axis) {
    var stringsFromAxes = getStringsFromAxes(props, axis);
    var stringsFromCategories = getStringsFromCategories(props, axis);
    var stringsFromData = getStringsFromData(props, axis);
    var allStrings = (0, import_uniq2.default)([].concat(_toConsumableArray10(stringsFromAxes), _toConsumableArray10(stringsFromCategories), _toConsumableArray10(stringsFromData)));
    return allStrings.length === 0 ? null : allStrings.reduce(function(memo2, string, index) {
      memo2[string] = index + 1;
      return memo2;
    }, {});
  }
  function downsample(data, maxPoints) {
    var startingIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
    var dataLength = getLength(data);
    if (dataLength > maxPoints) {
      var k2 = Math.pow(2, Math.ceil(Math.log2(dataLength / maxPoints)));
      return data.filter(
        // ensure modulo is always calculated from same reference: i + startingIndex
        function(d, i) {
          return (i + startingIndex) % k2 === 0;
        }
      );
    }
    return data;
  }
  function formatData(dataset, props, expectedKeys) {
    var isArrayOrIterable = Array.isArray(dataset) || isIterable(dataset);
    if (!isArrayOrIterable || getLength(dataset) < 1) {
      return [];
    }
    var defaultKeys = ["x", "y", "y0"];
    expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
    var createAccessor2 = function(name2) {
      return createAccessor(props[name2] !== void 0 ? props[name2] : name2);
    };
    var accessor = expectedKeys.reduce(function(memo2, type) {
      memo2[type] = createAccessor2(type);
      return memo2;
    }, {});
    var preformattedData = (0, import_isEqual3.default)(expectedKeys, defaultKeys) && props.x === "_x" && props.y === "_y" && props.y0 === "_y0";
    var stringMap;
    if (preformattedData === false) {
      stringMap = {
        x: expectedKeys.indexOf("x") !== -1 ? createStringMap(props, "x") : void 0,
        y: expectedKeys.indexOf("y") !== -1 ? createStringMap(props, "y") : void 0,
        y0: expectedKeys.indexOf("y0") !== -1 ? createStringMap(props, "y") : void 0
      };
    }
    var data = preformattedData ? dataset : dataset.reduce(function(dataArr, datum, index) {
      datum = parseDatum(datum);
      var fallbackValues = {
        x: index,
        y: datum
      };
      var processedValues = expectedKeys.reduce(function(memo2, type) {
        var processedValue = accessor[type](datum);
        var value = processedValue !== void 0 ? processedValue : fallbackValues[type];
        if (value !== void 0) {
          if (typeof value === "string" && stringMap[type]) {
            memo2["".concat(type, "Name")] = value;
            memo2["_".concat(type)] = stringMap[type][value];
          } else {
            memo2["_".concat(type)] = value;
          }
        }
        return memo2;
      }, {});
      var formattedDatum = (0, import_assign16.default)({}, processedValues, datum);
      if (!(0, import_isEmpty4.default)(formattedDatum)) {
        dataArr.push(formattedDatum);
      }
      return dataArr;
    }, []);
    var sortedData = sortData(data, props.sortKey, props.sortOrder);
    var cleanedData = cleanData(sortedData, props);
    return addEventKeys(props, cleanedData);
  }
  function generateData(props) {
    var xValues = generateDataArray(props, "x");
    var yValues = generateDataArray(props, "y");
    var values = xValues.map(function(x2, i) {
      return {
        x: x2,
        y: yValues[i]
      };
    });
    return values;
  }
  function getCategories(props, axis) {
    return props.categories && !Array.isArray(props.categories) ? props.categories[axis] : props.categories;
  }
  function getData(props) {
    return props.data ? formatData(props.data, props) : formatData(generateData(props), props);
  }
  function getStringsFromAxes(props, axis) {
    var tickValues = props.tickValues, tickFormat2 = props.tickFormat;
    var tickValueArray;
    if (!tickValues || !Array.isArray(tickValues) && !tickValues[axis]) {
      tickValueArray = tickFormat2 && Array.isArray(tickFormat2) ? tickFormat2 : [];
    } else {
      tickValueArray = tickValues[axis] || tickValues;
    }
    return tickValueArray.filter(function(val) {
      return typeof val === "string";
    });
  }
  function getStringsFromCategories(props, axis) {
    if (!props.categories) {
      return [];
    }
    var categories = getCategories(props, axis);
    var categoryStrings = categories && categories.filter(function(val) {
      return typeof val === "string";
    });
    return categoryStrings ? removeUndefined(categoryStrings) : [];
  }
  function getStringsFromData(props, axis) {
    var isArrayOrIterable = Array.isArray(props.data) || isIterable(props.data);
    if (!isArrayOrIterable) {
      return [];
    }
    var key = props[axis] === void 0 ? axis : props[axis];
    var accessor = createAccessor(key);
    var data = props.data.reduce(function(memo2, d) {
      memo2.push(parseDatum(d));
      return memo2;
    }, []);
    var sortedData = sortData(data, props.sortKey, props.sortOrder);
    var dataStrings = sortedData.reduce(function(dataArr, datum) {
      datum = parseDatum(datum);
      dataArr.push(accessor(datum));
      return dataArr;
    }, []).filter(function(datum) {
      return typeof datum === "string";
    });
    return dataStrings.reduce(function(prev, curr) {
      if (curr !== void 0 && curr !== null && prev.indexOf(curr) === -1) {
        prev.push(curr);
      }
      return prev;
    }, []);
  }
  function isDataComponent(component) {
    var getRole = function(child) {
      return child && child.type ? child.type.role : "";
    };
    var role = getRole(component);
    if (role === "portal") {
      var children = import_react65.default.Children.toArray(component.props.children);
      role = children.length ? getRole(children[0]) : "";
    }
    var whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
    return (0, import_includes3.default)(whitelist, role);
  }

  // node_modules/victory-core/es/victory-util/domain.js
  function _toConsumableArray11(arr) {
    return _arrayWithoutHoles10(arr) || _iterableToArray10(arr) || _unsupportedIterableToArray11(arr) || _nonIterableSpread10();
  }
  function _nonIterableSpread10() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray11(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray11(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray11(o, minLen);
  }
  function _iterableToArray10(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles10(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray11(arr);
  }
  function _arrayLikeToArray11(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function cleanDomain(domain2, props, axis) {
    var scaleType = getScaleType(props, axis);
    if (scaleType !== "log") {
      return domain2;
    }
    var rules = function(dom) {
      var almostZero = dom[0] < 0 || dom[1] < 0 ? -1 / Number.MAX_SAFE_INTEGER : 1 / Number.MAX_SAFE_INTEGER;
      var domainOne = dom[0] === 0 ? almostZero : dom[0];
      var domainTwo = dom[1] === 0 ? almostZero : dom[1];
      return [domainOne, domainTwo];
    };
    return rules(domain2);
  }
  function getDomainPadding(props, axis) {
    var formatPadding = function(padding2) {
      return Array.isArray(padding2) ? {
        left: padding2[0],
        right: padding2[1]
      } : {
        left: padding2,
        right: padding2
      };
    };
    return (0, import_isPlainObject4.default)(props.domainPadding) ? formatPadding(props.domainPadding[axis]) : formatPadding(props.domainPadding);
  }
  function getFlatData(dataset, axis) {
    var axisKey = "_".concat(axis);
    return (0, import_flatten.default)(dataset).map(function(datum) {
      return datum[axisKey] && datum[axisKey][1] !== void 0 ? datum[axisKey][1] : datum[axisKey];
    });
  }
  function getExtremeFromData(dataset, axis) {
    var type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "min";
    var getExtreme = function(arr) {
      return type === "max" ? Math.max.apply(Math, _toConsumableArray11(arr)) : Math.min.apply(Math, _toConsumableArray11(arr));
    };
    var initialValue = type === "max" ? -Infinity : Infinity;
    var containsDate = false;
    var result = (0, import_flatten.default)(dataset).reduce(function(memo2, datum) {
      var current0 = datum["_".concat(axis, "0")] !== void 0 ? datum["_".concat(axis, "0")] : datum["_".concat(axis)];
      var current1 = datum["_".concat(axis, "1")] !== void 0 ? datum["_".concat(axis, "1")] : datum["_".concat(axis)];
      var current = getExtreme([current0, current1]);
      containsDate = containsDate || current0 instanceof Date || current1 instanceof Date;
      return getExtreme([memo2, current]);
    }, initialValue);
    return containsDate ? new Date(result) : result;
  }
  function padDomain(domain2, props, axis) {
    if (!props.domainPadding) {
      return domain2;
    }
    var minDomain = getMinFromProps(props, axis);
    var maxDomain = getMaxFromProps(props, axis);
    var padding2 = getDomainPadding(props, axis);
    if (!padding2.left && !padding2.right) {
      return domain2;
    }
    var min3 = getMinValue(domain2);
    var max3 = getMaxValue(domain2);
    var currentAxis = getCurrentAxis(axis, props.horizontal);
    var range2 = getRange(props, currentAxis);
    var rangeExtent = Math.abs(range2[0] - range2[1]);
    var paddedRangeExtent = Math.max(rangeExtent - padding2.left - padding2.right, 1);
    var paddedDomainExtent = Math.abs(max3.valueOf() - min3.valueOf()) / paddedRangeExtent * rangeExtent;
    var simplePadding = {
      left: paddedDomainExtent * padding2.left / rangeExtent,
      right: paddedDomainExtent * padding2.right / rangeExtent
    };
    var paddedDomain = {
      min: min3.valueOf() - simplePadding.left,
      max: max3.valueOf() + simplePadding.right
    };
    var singleQuadrantDomainPadding = (0, import_isPlainObject4.default)(props.singleQuadrantDomainPadding) ? props.singleQuadrantDomainPadding[axis] : props.singleQuadrantDomainPadding;
    var addsQuadrants = min3 >= 0 && paddedDomain.min <= 0 || max3 <= 0 && paddedDomain.max >= 0;
    var adjust = function(val, type) {
      var coerce2 = type === "min" && min3 >= 0 && val <= 0 || type === "max" && max3 <= 0 && val >= 0;
      return coerce2 ? 0 : val;
    };
    if (addsQuadrants && singleQuadrantDomainPadding !== false) {
      var initialPadding = {
        // @ts-expect-error `max/min` might be dates
        left: Math.abs(max3 - min3) * padding2.left / rangeExtent,
        // @ts-expect-error `max/min` might be dates
        right: Math.abs(max3 - min3) * padding2.right / rangeExtent
      };
      var adjustedDomain = {
        min: adjust(min3.valueOf() - initialPadding.left, "min"),
        max: adjust(max3.valueOf() + initialPadding.right, "max")
      };
      var finalPadding = {
        left: Math.abs(adjustedDomain.max - adjustedDomain.min) * padding2.left / rangeExtent,
        right: Math.abs(adjustedDomain.max - adjustedDomain.min) * padding2.right / rangeExtent
      };
      paddedDomain = {
        min: adjust(min3.valueOf() - finalPadding.left, "min"),
        max: adjust(max3.valueOf() + finalPadding.right, "max")
      };
    }
    var finalDomain = {
      min: minDomain !== void 0 ? minDomain : paddedDomain.min,
      max: maxDomain !== void 0 ? maxDomain : paddedDomain.max
    };
    return min3 instanceof Date || max3 instanceof Date ? getDomainFromMinMax(new Date(finalDomain.min), new Date(finalDomain.max)) : getDomainFromMinMax(finalDomain.min, finalDomain.max);
  }
  function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
    getDomainFromDataFunction = (0, import_isFunction8.default)(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
    formatDomainFunction = (0, import_isFunction8.default)(formatDomainFunction) ? formatDomainFunction : formatDomain;
    return function(props, axis) {
      var propsDomain = getDomainFromProps(props, axis);
      if (propsDomain) {
        return formatDomainFunction(propsDomain, props, axis);
      }
      var categories = getCategories(props, axis);
      var domain2 = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFunction(props, axis);
      return domain2 ? formatDomainFunction(domain2, props, axis) : void 0;
    };
  }
  function formatDomain(domain2, props, axis) {
    return cleanDomain(padDomain(domain2, props, axis), props, axis);
  }
  function getDomain(props, axis) {
    return createDomainFunction()(props, axis);
  }
  function getDomainFromCategories(props, axis, categories) {
    categories = categories || getCategories(props, axis);
    var polar = props.polar, _props$startAngle = props.startAngle, startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle, _props$endAngle = props.endAngle, endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
    if (!categories) {
      return void 0;
    }
    var minDomain = getMinFromProps(props, axis);
    var maxDomain = getMaxFromProps(props, axis);
    var stringArray = containsStrings(categories) ? getStringsFromCategories(props, axis) : [];
    var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function(memo2, string, index) {
      memo2[string] = index + 1;
      return memo2;
    }, {});
    var categoryValues = stringMap ? categories.map(function(value) {
      return stringMap[value];
    }) : categories;
    var min3 = minDomain !== void 0 ? minDomain : getMinValue(categoryValues);
    var max3 = maxDomain !== void 0 ? maxDomain : getMaxValue(categoryValues);
    var categoryDomain = getDomainFromMinMax(min3, max3);
    return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(categoryDomain, categoryValues) : categoryDomain;
  }
  function getDomainFromData(props, axis, dataset) {
    dataset = dataset || getData(props);
    var polar = props.polar, _props$startAngle2 = props.startAngle, startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2, _props$endAngle2 = props.endAngle, endAngle = _props$endAngle2 === void 0 ? 360 : _props$endAngle2;
    var minDomain = getMinFromProps(props, axis);
    var maxDomain = getMaxFromProps(props, axis);
    if (dataset.length < 1) {
      return minDomain !== void 0 && maxDomain !== void 0 ? getDomainFromMinMax(minDomain, maxDomain) : void 0;
    }
    var min3 = minDomain !== void 0 ? minDomain : getExtremeFromData(dataset, axis, "min");
    var max3 = maxDomain !== void 0 ? maxDomain : getExtremeFromData(dataset, axis, "max");
    var domain2 = getDomainFromMinMax(min3, max3);
    return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain2, getFlatData(dataset, axis)) : domain2;
  }
  function getDomainFromMinMax(min3, max3) {
    var getSinglePointDomain = function(val) {
      var verySmallNumber = (
        // eslint-disable-next-line no-magic-numbers
        val === 0 ? 2 * Math.pow(10, -10) : Math.pow(10, -10)
      );
      var verySmallDate = 1;
      var minVal = val instanceof Date ? new Date(Number(val) - verySmallDate) : Number(val) - verySmallNumber;
      var maxVal = val instanceof Date ? new Date(Number(val) + verySmallDate) : Number(val) + verySmallNumber;
      return val === 0 ? [0, maxVal] : [minVal, maxVal];
    };
    return Number(min3) === Number(max3) ? getSinglePointDomain(max3) : [min3, max3];
  }
  function getDomainFromProps(props, axis) {
    var minDomain = getMinFromProps(props, axis);
    var maxDomain = getMaxFromProps(props, axis);
    if ((0, import_isPlainObject4.default)(props.domain) && props.domain[axis]) {
      return props.domain[axis];
    } else if (Array.isArray(props.domain)) {
      return props.domain;
    } else if (minDomain !== void 0 && maxDomain !== void 0) {
      return getDomainFromMinMax(minDomain, maxDomain);
    }
    return void 0;
  }
  function getDomainWithZero(props, axis) {
    var propsDomain = getDomainFromProps(props, axis);
    if (propsDomain) {
      return propsDomain;
    }
    var dataset = getData(props);
    var y0Min = dataset.reduce(function(min3, datum) {
      return datum._y0 < min3 ? datum._y0 : min3;
    }, Infinity);
    var ensureZero = function(domain2) {
      if (axis === "x") {
        return domain2;
      }
      var defaultMin = y0Min !== Infinity ? y0Min : 0;
      var maxDomainProp = getMaxFromProps(props, axis);
      var minDomainProp = getMinFromProps(props, axis);
      var max3 = maxDomainProp !== void 0 ? maxDomainProp : getMaxValue(domain2, defaultMin);
      var min3 = minDomainProp !== void 0 ? minDomainProp : getMinValue(domain2, defaultMin);
      return getDomainFromMinMax(min3, max3);
    };
    var getDomainFunction = function() {
      return getDomainFromData(props, axis, dataset);
    };
    var formatDomainFunction = function(domain2) {
      return formatDomain(ensureZero(domain2), props, axis);
    };
    return createDomainFunction(getDomainFunction, formatDomainFunction)(props, axis);
  }
  function getMaxFromProps(props, axis) {
    if ((0, import_isPlainObject4.default)(props.maxDomain) && props.maxDomain[axis] !== void 0) {
      return props.maxDomain[axis];
    }
    return typeof props.maxDomain === "number" || (0, import_isDate.default)(props.maxDomain) ? props.maxDomain : void 0;
  }
  function getMinFromProps(props, axis) {
    if ((0, import_isPlainObject4.default)(props.minDomain) && props.minDomain[axis] !== void 0) {
      return props.minDomain[axis];
    }
    return typeof props.minDomain === "number" || (0, import_isDate.default)(props.minDomain) ? props.minDomain : void 0;
  }
  function getSymmetricDomain(domain2, values) {
    var processedData = (0, import_sortedUniq.default)(values.sort(function(a2, b) {
      return a2 - b;
    }));
    var step = processedData[1] - processedData[0];
    return [domain2[0], domain2[1] + step];
  }
  function isDomainComponent(component) {
    var getRole = function(child) {
      return child && child.type ? child.type.role : "";
    };
    var role = getRole(component);
    if (role === "portal") {
      var children = import_react66.default.Children.toArray(component.props.children);
      role = children.length ? getRole(children[0]) : "";
    }
    var whitelist = ["area", "axis", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
    return (0, import_includes4.default)(whitelist, role);
  }

  // node_modules/victory-core/es/victory-util/axis.js
  function _toConsumableArray12(arr) {
    return _arrayWithoutHoles11(arr) || _iterableToArray11(arr) || _unsupportedIterableToArray12(arr) || _nonIterableSpread11();
  }
  function _nonIterableSpread11() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray12(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray12(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray12(o, minLen);
  }
  function _iterableToArray11(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles11(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray12(arr);
  }
  function _arrayLikeToArray12(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function getAxis(props) {
    var dependentAxis = props.dependentAxis;
    return dependentAxis ? "y" : "x";
  }
  function findAxisComponents(childComponents, predicate) {
    predicate = predicate || import_identity4.default;
    var findAxes = function(children) {
      return children.reduce(function(memo2, child) {
        if (child.type && child.type.role === "axis" && predicate(child)) {
          return memo2.concat(child);
        } else if (child.props && child.props.children) {
          return memo2.concat(findAxes(import_react67.default.Children.toArray(child.props.children)));
        }
        return memo2;
      }, []);
    };
    return findAxes(childComponents);
  }
  function getAxisComponent(childComponents, axis) {
    var matchesAxis = function(component) {
      var type = component.type.getAxis(component.props);
      return type === axis;
    };
    return findAxisComponents(childComponents, matchesAxis)[0];
  }
  function getAxisComponentsWithParent(childComponents, type) {
    var matchesType = function(child) {
      return type === "dependent" ? child.props.dependentAxis : !child.props.dependentAxis;
    };
    var findComponents = function(children) {
      return children.reduce(function(memo2, child) {
        if (child.type && child.type.role === "axis" && matchesType(child)) {
          return memo2.concat(child);
        } else if (child.props && child.props.children) {
          var childAxis = findComponents(import_react67.default.Children.toArray(child.props.children));
          return childAxis.length > 0 ? memo2.concat(child) : memo2;
        }
        return memo2;
      }, []);
    };
    return findComponents(childComponents);
  }
  function getOrigin(domain2) {
    var getSingleOrigin = function(d) {
      var domainMin = Math.min.apply(Math, _toConsumableArray12(d));
      var domainMax = Math.max.apply(Math, _toConsumableArray12(d));
      return domainMax < 0 ? domainMax : Math.max(0, domainMin);
    };
    return {
      x: containsDates(domain2.x) ? new Date(Math.min.apply(Math, _toConsumableArray12(domain2.x))) : getSingleOrigin(domain2.x),
      y: containsDates(domain2.y) ? new Date(Math.min.apply(Math, _toConsumableArray12(domain2.y))) : getSingleOrigin(domain2.y)
    };
  }
  function getOriginSign(origin, domain2) {
    var getSign = function() {
      return origin <= 0 && Math.max.apply(Math, _toConsumableArray12(domain2)) <= 0 ? "negative" : "positive";
    };
    return containsDates(domain2) ? "positive" : getSign();
  }
  function isVertical(props) {
    var orientation = props.orientation || (props.dependentAxis ? "left" : "bottom");
    var vertical = {
      top: false,
      bottom: false,
      left: true,
      right: true
    };
    return vertical[orientation];
  }
  function stringTicks(props) {
    return props.tickValues !== void 0 && containsStrings(props.tickValues);
  }
  function getDefaultTickFormat(props) {
    var tickValues = props.tickValues;
    var axis = getAxis(props);
    var stringMap = props.stringMap && props.stringMap[axis];
    var fallbackFormat = tickValues && !containsDates(tickValues) ? function(x2) {
      return x2;
    } : void 0;
    if (!stringMap) {
      return stringTicks(props) ? function(x2, index) {
        return tickValues[index];
      } : fallbackFormat;
    }
    var invertedStringMap = stringMap && (0, import_invert.default)(stringMap);
    var tickValueArray = (0, import_orderBy3.default)((0, import_values.default)(stringMap), function(n) {
      return n;
    });
    var dataNames = tickValueArray.map(function(tick) {
      return invertedStringMap[tick];
    });
    var dataTicks = [""].concat(_toConsumableArray12(dataNames), [""]);
    return function(x2) {
      return dataTicks[x2];
    };
  }
  function getStringTicks(props) {
    var axis = getAxis(props);
    var stringMap = props.stringMap && props.stringMap[axis];
    var categories = Array.isArray(props.categories) ? props.categories : props.categories && props.categories[axis];
    var ticksFromCategories = categories && containsOnlyStrings(categories) ? categories.map(function(tick) {
      return stringMap[tick];
    }) : void 0;
    var ticksFromStringMap = stringMap && (0, import_values.default)(stringMap);
    return ticksFromCategories && ticksFromCategories.length !== 0 ? ticksFromCategories : ticksFromStringMap;
  }
  function getTickArray(props) {
    var tickValues = props.tickValues, tickFormat2 = props.tickFormat;
    var axis = getAxis(props);
    var stringMap = props.stringMap && props.stringMap[axis];
    var getTicksFromFormat = function() {
      if (!tickFormat2 || !Array.isArray(tickFormat2)) {
        return void 0;
      }
      return containsStrings(tickFormat2) ? tickFormat2.map(function(t, i) {
        return i;
      }) : tickFormat2;
    };
    var ticks2 = tickValues;
    if (stringMap) {
      ticks2 = getStringTicks(props);
    }
    if (tickValues && containsStrings(tickValues)) {
      ticks2 = stringMap ? tickValues.map(function(tick) {
        return stringMap[tick];
      }) : (0, import_range4.default)(1, tickValues.length + 1);
    }
    var tickArray = ticks2 ? (0, import_uniq3.default)(ticks2) : getTicksFromFormat();
    var buildTickArray = function(arr) {
      var newTickArray = [];
      var domain2 = props.domain && props.domain[axis] || props.domain;
      if (arr) {
        arr.forEach(function(t, index) {
          if (Array.isArray(domain2)) {
            if (t >= getMinValue(domain2) && t <= getMaxValue(domain2)) {
              newTickArray.push({
                value: t,
                index
              });
            }
          } else {
            newTickArray.push({
              value: t,
              index
            });
          }
        });
        return newTickArray;
      }
      return void 0;
    };
    return Array.isArray(tickArray) && tickArray.length ? buildTickArray(tickArray) : void 0;
  }
  function getTickFormat(props, scale2) {
    var tickFormat2 = props.tickFormat;
    var axis = getAxis(props);
    var stringMap = props.stringMap && props.stringMap[axis];
    if (!tickFormat2) {
      var defaultTickFormat = getDefaultTickFormat(props);
      var scaleTickFormat = scale2.tickFormat && (0, import_isFunction9.default)(scale2.tickFormat) ? scale2.tickFormat() : function(x2) {
        return x2;
      };
      return defaultTickFormat || scaleTickFormat;
    } else if (tickFormat2 && Array.isArray(tickFormat2)) {
      var tickArray = getTickArray(props);
      var tickArrayIndices = tickArray === null || tickArray === void 0 ? void 0 : tickArray.map(function(v) {
        return v.index;
      });
      var filteredTickFormat = tickFormat2.filter(function(t, index) {
        return tickArrayIndices === null || tickArrayIndices === void 0 ? void 0 : tickArrayIndices.includes(index);
      });
      return function(x2, index) {
        return filteredTickFormat[index];
      };
    } else if (tickFormat2 && (0, import_isFunction9.default)(tickFormat2)) {
      var applyStringTicks = function(tick, index, ticks2) {
        var invertedStringMap = (0, import_invert.default)(stringMap);
        var stringTickArray = ticks2.map(function(t) {
          return invertedStringMap[t];
        });
        return props.tickFormat(invertedStringMap[tick], index, stringTickArray);
      };
      return stringMap ? applyStringTicks : tickFormat2;
    }
    return function(x2) {
      return x2;
    };
  }
  function downsampleTicks(ticks2, tickCount) {
    if (!tickCount || !Array.isArray(ticks2) || ticks2.length <= tickCount) {
      return ticks2;
    }
    var k2 = Math.floor(ticks2.length / tickCount);
    return ticks2.filter(function(d, i) {
      return i % k2 === 0;
    });
  }
  function getTicks(props, scale2) {
    var filterZero = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
    var tickCount = props.tickCount;
    var tickArray = getTickArray(props);
    var tickValues = tickArray ? tickArray.map(function(v) {
      return v.value;
    }) : void 0;
    if (tickValues) {
      return downsampleTicks(tickValues, tickCount);
    } else if (scale2.ticks && (0, import_isFunction9.default)(scale2.ticks)) {
      var defaultTickCount = tickCount || 5;
      var scaleTicks = scale2.ticks(defaultTickCount);
      var scaledTickArray = Array.isArray(scaleTicks) && scaleTicks.length ? scaleTicks : scale2.domain();
      var ticks2 = downsampleTicks(scaledTickArray, tickCount);
      if (filterZero) {
        var filteredTicks = (0, import_includes5.default)(ticks2, 0) ? (0, import_without3.default)(ticks2, 0) : ticks2;
        return filteredTicks.length ? filteredTicks : ticks2;
      }
      return ticks2;
    }
    return scale2.domain();
  }
  function getDomainFromData2(props, axis) {
    var polar = props.polar, _props$startAngle = props.startAngle, startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle, _props$endAngle = props.endAngle, endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
    var tickArray = getTickArray(props);
    var tickValues = tickArray ? tickArray.map(function(v) {
      return v.value;
    }) : void 0;
    if (!Array.isArray(tickValues)) {
      return void 0;
    }
    var minDomain = getMinFromProps(props, axis);
    var maxDomain = getMaxFromProps(props, axis);
    var tickStrings = stringTicks(props);
    var ticks2 = tickValues.map(function(value) {
      return Number(value);
    });
    var defaultMin = tickStrings ? 1 : getMinValue(ticks2);
    var defaultMax = tickStrings ? tickValues.length : getMaxValue(ticks2);
    var min3 = minDomain !== void 0 ? minDomain : defaultMin;
    var max3 = maxDomain !== void 0 ? maxDomain : defaultMax;
    var initialDomain = getDomainFromMinMax(min3, max3);
    var domain2 = polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(initialDomain, ticks2) : initialDomain;
    if (isVertical(props) && !polar) {
      domain2.reverse();
    }
    return domain2;
  }
  function getDomain2(props, axis) {
    var inherentAxis = getAxis(props);
    if (axis && axis !== inherentAxis) {
      return void 0;
    }
    return createDomainFunction(getDomainFromData2)(props, inherentAxis);
  }
  function getAxisValue(props, axis) {
    if (!props.axisValue) {
      return void 0;
    }
    var scaleAxis = axis === "x" ? "y" : "x";
    var scale2 = (0, import_isObject3.default)(props.scale) && (0, import_isFunction9.default)(props.scale[scaleAxis]) ? props.scale[scaleAxis] : void 0;
    if (!scale2) {
      return void 0;
    }
    var stringMapAxis = axis === "x" ? "y" : "x";
    var stringMap = (0, import_isObject3.default)(props.stringMap) && props.stringMap[stringMapAxis];
    var axisValue = stringMap && typeof props.axisValue === "string" ? stringMap[props.axisValue] : props.axisValue;
    return scale2(axisValue);
  }
  function modifyProps2(props, fallbackProps10) {
    if (!(0, import_isObject3.default)(props.theme)) {
      return modifyProps(props, fallbackProps10, "axis");
    }
    var role = "axis";
    if (props.dependentAxis && props.theme.dependentAxis) {
      role = "dependentAxis";
    } else if (!props.dependentAxis && props.theme.independentAxis) {
      role = "independentAxis";
    }
    if (role === "axis") {
      return modifyProps(props, fallbackProps10, "axis");
    }
    var axisTheme = (0, import_defaults11.default)({}, props.theme[role], props.theme.axis);
    var theme = (0, import_assign17.default)({}, props.theme, {
      axis: axisTheme
    });
    return modifyProps((0, import_assign17.default)({}, props, {
      theme
    }), fallbackProps10, "axis");
  }

  // node_modules/victory-core/es/victory-util/default-transitions.js
  var default_transitions_exports = {};
  __export(default_transitions_exports, {
    continuousPolarTransitions: () => continuousPolarTransitions,
    continuousTransitions: () => continuousTransitions,
    discreteTransitions: () => discreteTransitions
  });
  function continuousTransitions() {
    return {
      onLoad: {
        duration: 2e3
      },
      onExit: {
        duration: 500
      },
      onEnter: {
        duration: 500
      }
    };
  }
  function continuousPolarTransitions() {
    return {
      onLoad: {
        duration: 2e3,
        before: function() {
          return {
            _y: 0,
            _y1: 0,
            _y0: 0
          };
        },
        after: function(datum) {
          return {
            _y: datum._y,
            _y1: datum._y1,
            _y0: datum._y0
          };
        }
      },
      onExit: {
        duration: 500,
        before: function(datum, index, data) {
          var adjacent = function(attr) {
            var adj = index === 0 ? data[index + 1] : data[index - 1];
            return adj[attr];
          };
          return {
            _x: adjacent("_x"),
            _y: adjacent("_y"),
            _y0: adjacent("_y0")
          };
        }
      },
      onEnter: {
        duration: 500,
        before: function(datum, index, data) {
          var adjacent = function(attr) {
            var adj = index === 0 ? data[index + 1] : data[index - 1];
            return adj[attr];
          };
          return {
            _x: adjacent("_x"),
            _y: adjacent("_y"),
            _y0: adjacent("_y0")
          };
        },
        after: function(datum) {
          return {
            _x: datum._x,
            _y: datum._y,
            _y1: datum._y1,
            _y0: datum._y0
          };
        }
      }
    };
  }
  function discreteTransitions() {
    return {
      onLoad: {
        duration: 2e3,
        before: function() {
          return {
            opacity: 0
          };
        },
        after: function(datum) {
          return datum;
        }
      },
      onExit: {
        duration: 600,
        before: function() {
          return {
            opacity: 0
          };
        }
      },
      onEnter: {
        duration: 600,
        before: function() {
          return {
            opacity: 0
          };
        },
        after: function(datum) {
          return datum;
        }
      }
    };
  }

  // node_modules/victory-core/es/victory-util/hooks/index.js
  var hooks_exports = {};
  __export(hooks_exports, {
    useAnimationState: () => useAnimationState,
    usePreviousProps: () => usePreviousProps
  });

  // node_modules/victory-core/es/victory-util/hooks/use-previous-props.js
  var import_react68 = __toESM(require_react());
  function usePreviousProps(props) {
    var ref = import_react68.default.useRef();
    import_react68.default.useEffect(function() {
      ref.current = props;
    });
    return ref.current;
  }

  // node_modules/victory-core/es/victory-util/hooks/use-animation-state.js
  var import_some = __toESM(require_some());
  var import_defaults12 = __toESM(require_defaults());
  var import_react69 = __toESM(require_react());
  function ownKeys12(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread12(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys12(Object(source), true).forEach(function(key) {
        _defineProperty16(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys12(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty16(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _slicedToArray4(arr, i) {
    return _arrayWithHoles4(arr) || _iterableToArrayLimit4(arr, i) || _unsupportedIterableToArray13(arr, i) || _nonIterableRest4();
  }
  function _nonIterableRest4() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray13(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray13(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray13(o, minLen);
  }
  function _arrayLikeToArray13(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _iterableToArrayLimit4(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null)
      return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i)
          break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null)
          _i["return"]();
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
  function _arrayWithHoles4(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  var INITIAL_STATE = {
    nodesShouldLoad: false,
    nodesDoneLoad: false,
    animating: true
  };
  var useAnimationState = function() {
    var initialState = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : INITIAL_STATE;
    var _React$useState = import_react69.default.useState(initialState), _React$useState2 = _slicedToArray4(_React$useState, 2), state = _React$useState2[0], _setState = _React$useState2[1];
    var setState = import_react69.default.useCallback(function(newState) {
      _setState(function(oldState) {
        return _objectSpread12(_objectSpread12({}, oldState), newState);
      });
    }, [_setState]);
    var getAnimationProps = import_react69.default.useCallback(function(props, child, index) {
      if (!(props !== null && props !== void 0 && props.animate)) {
        return child.props.animate;
      }
      var getFilteredState = function() {
        var childrenTransitions = state && state.childrenTransitions;
        childrenTransitions = isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions;
        return (0, import_defaults12.default)({
          childrenTransitions
        }, state);
      };
      var getTransitions = props.animate && props.animate.getTransitions;
      var filteredState = getFilteredState();
      var parentState = props.animate && props.animate.parentState || filteredState;
      if (!getTransitions) {
        var getTransitionProps = getTransitionPropsFactory(props, filteredState, function(newState) {
          return setState(newState);
        });
        getTransitions = function(childComponent) {
          return getTransitionProps(childComponent, index);
        };
      }
      return (0, import_defaults12.default)({
        getTransitions,
        parentState
      }, props.animate, child.props.animate);
    }, [state, setState]);
    var setAnimationState = import_react69.default.useCallback(function(props, nextProps) {
      if (!(props !== null && props !== void 0 && props.animate)) {
        return;
      }
      if (props.animate.parentState) {
        var nodesWillExit = props.animate.parentState.nodesWillExit;
        var oldProps = nodesWillExit ? props : null;
        var newState = (0, import_defaults12.default)({
          oldProps,
          nextProps
        }, props.animate.parentState);
        setState(newState);
      } else {
        var oldChildren = import_react69.default.Children.toArray(props.children);
        var nextChildren = import_react69.default.Children.toArray(nextProps.children);
        var isContinuous = function(child) {
          var check = function(c2) {
            return c2.type && c2.type.continuous;
          };
          return Array.isArray(child) ? (0, import_some.default)(child, check) : check(child);
        };
        var continuous2 = !props.polar && (0, import_some.default)(oldChildren, function(child) {
          return isContinuous(child) || child.props.children && isContinuous(child.props.children);
        });
        var _Transitions$getIniti = getInitialTransitionState(oldChildren, nextChildren), _nodesWillExit = _Transitions$getIniti.nodesWillExit, nodesWillEnter = _Transitions$getIniti.nodesWillEnter, childrenTransitions = _Transitions$getIniti.childrenTransitions, nodesShouldEnter = _Transitions$getIniti.nodesShouldEnter;
        setState({
          nodesWillExit: _nodesWillExit,
          nodesWillEnter,
          nodesShouldEnter,
          childrenTransitions: isArrayOfArrays(childrenTransitions) ? childrenTransitions[0] : childrenTransitions,
          oldProps: _nodesWillExit ? props : void 0,
          nextProps,
          continuous: continuous2
        });
      }
    }, [setState]);
    var getProps2 = import_react69.default.useCallback(function(initialProps) {
      return state && state.nodesWillExit ? state.oldProps || initialProps : initialProps;
    }, [state]);
    return {
      state,
      setState,
      getAnimationProps,
      setAnimationState,
      getProps: getProps2
    };
  };

  // node_modules/victory-core/es/victory-util/line-helpers.js
  var line_helpers_exports = {};
  __export(line_helpers_exports, {
    getInterpolationFunction: () => getInterpolationFunction,
    getLineFunction: () => getLineFunction
  });

  // node_modules/victory-vendor/es/d3-shape.js
  var d3_shape_exports = {};
  __export(d3_shape_exports, {
    arc: () => arc_default,
    area: () => area_default,
    areaRadial: () => areaRadial_default,
    curveBasis: () => basis_default2,
    curveBasisClosed: () => basisClosed_default2,
    curveBasisOpen: () => basisOpen_default,
    curveBumpX: () => bumpX,
    curveBumpY: () => bumpY,
    curveBundle: () => bundle_default,
    curveCardinal: () => cardinal_default,
    curveCardinalClosed: () => cardinalClosed_default,
    curveCardinalOpen: () => cardinalOpen_default,
    curveCatmullRom: () => catmullRom_default,
    curveCatmullRomClosed: () => catmullRomClosed_default,
    curveCatmullRomOpen: () => catmullRomOpen_default,
    curveLinear: () => linear_default,
    curveLinearClosed: () => linearClosed_default,
    curveMonotoneX: () => monotoneX,
    curveMonotoneY: () => monotoneY,
    curveNatural: () => natural_default,
    curveStep: () => step_default,
    curveStepAfter: () => stepAfter,
    curveStepBefore: () => stepBefore,
    line: () => line_default,
    lineRadial: () => lineRadial_default,
    link: () => link,
    linkHorizontal: () => linkHorizontal,
    linkRadial: () => linkRadial,
    linkVertical: () => linkVertical,
    pie: () => pie_default,
    pointRadial: () => pointRadial_default,
    radialArea: () => areaRadial_default,
    radialLine: () => lineRadial_default,
    stack: () => stack_default,
    stackOffsetDiverging: () => diverging_default,
    stackOffsetExpand: () => expand_default,
    stackOffsetNone: () => none_default,
    stackOffsetSilhouette: () => silhouette_default,
    stackOffsetWiggle: () => wiggle_default,
    stackOrderAppearance: () => appearance_default,
    stackOrderAscending: () => ascending_default,
    stackOrderDescending: () => descending_default2,
    stackOrderInsideOut: () => insideOut_default,
    stackOrderNone: () => none_default2,
    stackOrderReverse: () => reverse_default,
    symbol: () => Symbol2,
    symbolAsterisk: () => asterisk_default,
    symbolCircle: () => circle_default,
    symbolCross: () => cross_default,
    symbolDiamond: () => diamond_default,
    symbolDiamond2: () => diamond2_default,
    symbolPlus: () => plus_default,
    symbolSquare: () => square_default,
    symbolSquare2: () => square2_default,
    symbolStar: () => star_default,
    symbolTimes: () => times_default,
    symbolTriangle: () => triangle_default,
    symbolTriangle2: () => triangle2_default,
    symbolWye: () => wye_default,
    symbolX: () => times_default,
    symbols: () => symbolsFill,
    symbolsFill: () => symbolsFill,
    symbolsStroke: () => symbolsStroke
  });

  // node_modules/d3-shape/src/constant.js
  function constant_default2(x2) {
    return function constant() {
      return x2;
    };
  }

  // node_modules/d3-shape/src/math.js
  var abs = Math.abs;
  var atan2 = Math.atan2;
  var cos = Math.cos;
  var max2 = Math.max;
  var min2 = Math.min;
  var sin = Math.sin;
  var sqrt2 = Math.sqrt;
  var epsilon = 1e-12;
  var pi2 = Math.PI;
  var halfPi2 = pi2 / 2;
  var tau2 = 2 * pi2;
  function acos(x2) {
    return x2 > 1 ? 0 : x2 < -1 ? pi2 : Math.acos(x2);
  }
  function asin(x2) {
    return x2 >= 1 ? halfPi2 : x2 <= -1 ? -halfPi2 : Math.asin(x2);
  }

  // node_modules/d3-path/src/path.js
  var pi3 = Math.PI;
  var tau3 = 2 * pi3;
  var epsilon2 = 1e-6;
  var tauEpsilon = tau3 - epsilon2;
  function append(strings) {
    this._ += strings[0];
    for (let i = 1, n = strings.length; i < n; ++i) {
      this._ += arguments[i] + strings[i];
    }
  }
  function appendRound(digits) {
    let d = Math.floor(digits);
    if (!(d >= 0))
      throw new Error(`invalid digits: ${digits}`);
    if (d > 15)
      return append;
    const k2 = 10 ** d;
    return function(strings) {
      this._ += strings[0];
      for (let i = 1, n = strings.length; i < n; ++i) {
        this._ += Math.round(arguments[i] * k2) / k2 + strings[i];
      }
    };
  }
  var Path2 = class {
    constructor(digits) {
      this._x0 = this._y0 = // start of current subpath
      this._x1 = this._y1 = null;
      this._ = "";
      this._append = digits == null ? append : appendRound(digits);
    }
    moveTo(x2, y2) {
      this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`;
    }
    closePath() {
      if (this._x1 !== null) {
        this._x1 = this._x0, this._y1 = this._y0;
        this._append`Z`;
      }
    }
    lineTo(x2, y2) {
      this._append`L${this._x1 = +x2},${this._y1 = +y2}`;
    }
    quadraticCurveTo(x1, y1, x2, y2) {
      this._append`Q${+x1},${+y1},${this._x1 = +x2},${this._y1 = +y2}`;
    }
    bezierCurveTo(x1, y1, x2, y2, x3, y3) {
      this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`;
    }
    arcTo(x1, y1, x2, y2, r) {
      x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
      if (r < 0)
        throw new Error(`negative radius: ${r}`);
      let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
      if (this._x1 === null) {
        this._append`M${this._x1 = x1},${this._y1 = y1}`;
      } else if (!(l01_2 > epsilon2))
        ;
      else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon2) || !r) {
        this._append`L${this._x1 = x1},${this._y1 = y1}`;
      } else {
        let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi3 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
        if (Math.abs(t01 - 1) > epsilon2) {
          this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
        }
        this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
      }
    }
    arc(x2, y2, r, a0, a1, ccw) {
      x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw;
      if (r < 0)
        throw new Error(`negative radius: ${r}`);
      let dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
      if (this._x1 === null) {
        this._append`M${x0},${y0}`;
      } else if (Math.abs(this._x1 - x0) > epsilon2 || Math.abs(this._y1 - y0) > epsilon2) {
        this._append`L${x0},${y0}`;
      }
      if (!r)
        return;
      if (da < 0)
        da = da % tau3 + tau3;
      if (da > tauEpsilon) {
        this._append`A${r},${r},0,1,${cw},${x2 - dx},${y2 - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
      } else if (da > epsilon2) {
        this._append`A${r},${r},0,${+(da >= pi3)},${cw},${this._x1 = x2 + r * Math.cos(a1)},${this._y1 = y2 + r * Math.sin(a1)}`;
      }
    }
    rect(x2, y2, w2, h) {
      this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w2 = +w2}v${+h}h${-w2}Z`;
    }
    toString() {
      return this._;
    }
  };
  function path() {
    return new Path2();
  }
  path.prototype = Path2.prototype;

  // node_modules/d3-shape/src/path.js
  function withPath(shape) {
    let digits = 3;
    shape.digits = function(_) {
      if (!arguments.length)
        return digits;
      if (_ == null) {
        digits = null;
      } else {
        const d = Math.floor(_);
        if (!(d >= 0))
          throw new RangeError(`invalid digits: ${_}`);
        digits = d;
      }
      return shape;
    };
    return () => new Path2(digits);
  }

  // node_modules/d3-shape/src/arc.js
  function arcInnerRadius(d) {
    return d.innerRadius;
  }
  function arcOuterRadius(d) {
    return d.outerRadius;
  }
  function arcStartAngle(d) {
    return d.startAngle;
  }
  function arcEndAngle(d) {
    return d.endAngle;
  }
  function arcPadAngle(d) {
    return d && d.padAngle;
  }
  function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
    var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
    if (t * t < epsilon)
      return;
    t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
    return [x0 + t * x10, y0 + t * y10];
  }
  function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
    var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt2(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt2(max2(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
    if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1)
      cx0 = cx1, cy0 = cy1;
    return {
      cx: cx0,
      cy: cy0,
      x01: -ox,
      y01: -oy,
      x11: cx0 * (r1 / r - 1),
      y11: cy0 * (r1 / r - 1)
    };
  }
  function arc_default() {
    var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default2(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path2 = withPath(arc);
    function arc() {
      var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi2, a1 = endAngle.apply(this, arguments) - halfPi2, da = abs(a1 - a0), cw = a1 > a0;
      if (!context)
        context = buffer = path2();
      if (r1 < r0)
        r = r1, r1 = r0, r0 = r;
      if (!(r1 > epsilon))
        context.moveTo(0, 0);
      else if (da > tau2 - epsilon) {
        context.moveTo(r1 * cos(a0), r1 * sin(a0));
        context.arc(0, 0, r1, a0, a1, !cw);
        if (r0 > epsilon) {
          context.moveTo(r0 * cos(a1), r0 * sin(a1));
          context.arc(0, 0, r0, a1, a0, cw);
        }
      } else {
        var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt2(r0 * r0 + r1 * r1)), rc = min2(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t02, t12;
        if (rp > epsilon) {
          var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
          if ((da0 -= p0 * 2) > epsilon)
            p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
          else
            da0 = 0, a00 = a10 = (a0 + a1) / 2;
          if ((da1 -= p1 * 2) > epsilon)
            p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
          else
            da1 = 0, a01 = a11 = (a0 + a1) / 2;
        }
        var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
        if (rc > epsilon) {
          var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
          if (da < pi2) {
            if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
              var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt2(ax * ax + ay * ay) * sqrt2(bx * bx + by * by))) / 2), lc = sqrt2(oc[0] * oc[0] + oc[1] * oc[1]);
              rc0 = min2(rc, (r0 - lc) / (kc - 1));
              rc1 = min2(rc, (r1 - lc) / (kc + 1));
            } else {
              rc0 = rc1 = 0;
            }
          }
        }
        if (!(da1 > epsilon))
          context.moveTo(x01, y01);
        else if (rc1 > epsilon) {
          t02 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
          t12 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
          context.moveTo(t02.cx + t02.x01, t02.cy + t02.y01);
          if (rc1 < rc)
            context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw);
          else {
            context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw);
            context.arc(0, 0, r1, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), !cw);
            context.arc(t12.cx, t12.cy, rc1, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw);
          }
        } else
          context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
        if (!(r0 > epsilon) || !(da0 > epsilon))
          context.lineTo(x10, y10);
        else if (rc0 > epsilon) {
          t02 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
          t12 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
          context.lineTo(t02.cx + t02.x01, t02.cy + t02.y01);
          if (rc0 < rc)
            context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw);
          else {
            context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw);
            context.arc(0, 0, r0, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), cw);
            context.arc(t12.cx, t12.cy, rc0, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw);
          }
        } else
          context.arc(0, 0, r0, a10, a00, cw);
      }
      context.closePath();
      if (buffer)
        return context = null, buffer + "" || null;
    }
    arc.centroid = function() {
      var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi2 / 2;
      return [cos(a2) * r, sin(a2) * r];
    };
    arc.innerRadius = function(_) {
      return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant_default2(+_), arc) : innerRadius;
    };
    arc.outerRadius = function(_) {
      return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant_default2(+_), arc) : outerRadius;
    };
    arc.cornerRadius = function(_) {
      return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant_default2(+_), arc) : cornerRadius;
    };
    arc.padRadius = function(_) {
      return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant_default2(+_), arc) : padRadius;
    };
    arc.startAngle = function(_) {
      return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default2(+_), arc) : startAngle;
    };
    arc.endAngle = function(_) {
      return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default2(+_), arc) : endAngle;
    };
    arc.padAngle = function(_) {
      return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default2(+_), arc) : padAngle;
    };
    arc.context = function(_) {
      return arguments.length ? (context = _ == null ? null : _, arc) : context;
    };
    return arc;
  }

  // node_modules/d3-shape/src/array.js
  var slice = Array.prototype.slice;
  function array_default(x2) {
    return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2);
  }

  // node_modules/d3-shape/src/curve/linear.js
  function Linear(context) {
    this._context = context;
  }
  Linear.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 1)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
        default:
          this._context.lineTo(x2, y2);
          break;
      }
    }
  };
  function linear_default(context) {
    return new Linear(context);
  }

  // node_modules/d3-shape/src/point.js
  function x(p2) {
    return p2[0];
  }
  function y(p2) {
    return p2[1];
  }

  // node_modules/d3-shape/src/line.js
  function line_default(x2, y2) {
    var defined3 = constant_default2(true), context = null, curve = linear_default, output = null, path2 = withPath(line);
    x2 = typeof x2 === "function" ? x2 : x2 === void 0 ? x : constant_default2(x2);
    y2 = typeof y2 === "function" ? y2 : y2 === void 0 ? y : constant_default2(y2);
    function line(data) {
      var i, n = (data = array_default(data)).length, d, defined0 = false, buffer;
      if (context == null)
        output = curve(buffer = path2());
      for (i = 0; i <= n; ++i) {
        if (!(i < n && defined3(d = data[i], i, data)) === defined0) {
          if (defined0 = !defined0)
            output.lineStart();
          else
            output.lineEnd();
        }
        if (defined0)
          output.point(+x2(d, i, data), +y2(d, i, data));
      }
      if (buffer)
        return output = null, buffer + "" || null;
    }
    line.x = function(_) {
      return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default2(+_), line) : x2;
    };
    line.y = function(_) {
      return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default2(+_), line) : y2;
    };
    line.defined = function(_) {
      return arguments.length ? (defined3 = typeof _ === "function" ? _ : constant_default2(!!_), line) : defined3;
    };
    line.curve = function(_) {
      return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
    };
    line.context = function(_) {
      return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
    };
    return line;
  }

  // node_modules/d3-shape/src/area.js
  function area_default(x0, y0, y1) {
    var x1 = null, defined3 = constant_default2(true), context = null, curve = linear_default, output = null, path2 = withPath(area);
    x0 = typeof x0 === "function" ? x0 : x0 === void 0 ? x : constant_default2(+x0);
    y0 = typeof y0 === "function" ? y0 : y0 === void 0 ? constant_default2(0) : constant_default2(+y0);
    y1 = typeof y1 === "function" ? y1 : y1 === void 0 ? y : constant_default2(+y1);
    function area(data) {
      var i, j, k2, n = (data = array_default(data)).length, d, defined0 = false, buffer, x0z = new Array(n), y0z = new Array(n);
      if (context == null)
        output = curve(buffer = path2());
      for (i = 0; i <= n; ++i) {
        if (!(i < n && defined3(d = data[i], i, data)) === defined0) {
          if (defined0 = !defined0) {
            j = i;
            output.areaStart();
            output.lineStart();
          } else {
            output.lineEnd();
            output.lineStart();
            for (k2 = i - 1; k2 >= j; --k2) {
              output.point(x0z[k2], y0z[k2]);
            }
            output.lineEnd();
            output.areaEnd();
          }
        }
        if (defined0) {
          x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);
          output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);
        }
      }
      if (buffer)
        return output = null, buffer + "" || null;
    }
    function arealine() {
      return line_default().defined(defined3).curve(curve).context(context);
    }
    area.x = function(_) {
      return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default2(+_), x1 = null, area) : x0;
    };
    area.x0 = function(_) {
      return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default2(+_), area) : x0;
    };
    area.x1 = function(_) {
      return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant_default2(+_), area) : x1;
    };
    area.y = function(_) {
      return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default2(+_), y1 = null, area) : y0;
    };
    area.y0 = function(_) {
      return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default2(+_), area) : y0;
    };
    area.y1 = function(_) {
      return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant_default2(+_), area) : y1;
    };
    area.lineX0 = area.lineY0 = function() {
      return arealine().x(x0).y(y0);
    };
    area.lineY1 = function() {
      return arealine().x(x0).y(y1);
    };
    area.lineX1 = function() {
      return arealine().x(x1).y(y0);
    };
    area.defined = function(_) {
      return arguments.length ? (defined3 = typeof _ === "function" ? _ : constant_default2(!!_), area) : defined3;
    };
    area.curve = function(_) {
      return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
    };
    area.context = function(_) {
      return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
    };
    return area;
  }

  // node_modules/d3-shape/src/descending.js
  function descending_default(a2, b) {
    return b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN;
  }

  // node_modules/d3-shape/src/identity.js
  function identity_default2(d) {
    return d;
  }

  // node_modules/d3-shape/src/pie.js
  function pie_default() {
    var value = identity_default2, sortValues = descending_default, sort = null, startAngle = constant_default2(0), endAngle = constant_default2(tau2), padAngle = constant_default2(0);
    function pie(data) {
      var i, n = (data = array_default(data)).length, j, k2, sum2 = 0, index = new Array(n), arcs = new Array(n), a0 = +startAngle.apply(this, arguments), da = Math.min(tau2, Math.max(-tau2, endAngle.apply(this, arguments) - a0)), a1, p2 = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), pa = p2 * (da < 0 ? -1 : 1), v;
      for (i = 0; i < n; ++i) {
        if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
          sum2 += v;
        }
      }
      if (sortValues != null)
        index.sort(function(i2, j2) {
          return sortValues(arcs[i2], arcs[j2]);
        });
      else if (sort != null)
        index.sort(function(i2, j2) {
          return sort(data[i2], data[j2]);
        });
      for (i = 0, k2 = sum2 ? (da - n * pa) / sum2 : 0; i < n; ++i, a0 = a1) {
        j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k2 : 0) + pa, arcs[j] = {
          data: data[j],
          index: i,
          value: v,
          startAngle: a0,
          endAngle: a1,
          padAngle: p2
        };
      }
      return arcs;
    }
    pie.value = function(_) {
      return arguments.length ? (value = typeof _ === "function" ? _ : constant_default2(+_), pie) : value;
    };
    pie.sortValues = function(_) {
      return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
    };
    pie.sort = function(_) {
      return arguments.length ? (sort = _, sortValues = null, pie) : sort;
    };
    pie.startAngle = function(_) {
      return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default2(+_), pie) : startAngle;
    };
    pie.endAngle = function(_) {
      return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default2(+_), pie) : endAngle;
    };
    pie.padAngle = function(_) {
      return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default2(+_), pie) : padAngle;
    };
    return pie;
  }

  // node_modules/d3-shape/src/curve/radial.js
  var curveRadialLinear = curveRadial(linear_default);
  function Radial(curve) {
    this._curve = curve;
  }
  Radial.prototype = {
    areaStart: function() {
      this._curve.areaStart();
    },
    areaEnd: function() {
      this._curve.areaEnd();
    },
    lineStart: function() {
      this._curve.lineStart();
    },
    lineEnd: function() {
      this._curve.lineEnd();
    },
    point: function(a2, r) {
      this._curve.point(r * Math.sin(a2), r * -Math.cos(a2));
    }
  };
  function curveRadial(curve) {
    function radial2(context) {
      return new Radial(curve(context));
    }
    radial2._curve = curve;
    return radial2;
  }

  // node_modules/d3-shape/src/lineRadial.js
  function lineRadial(l) {
    var c2 = l.curve;
    l.angle = l.x, delete l.x;
    l.radius = l.y, delete l.y;
    l.curve = function(_) {
      return arguments.length ? c2(curveRadial(_)) : c2()._curve;
    };
    return l;
  }
  function lineRadial_default() {
    return lineRadial(line_default().curve(curveRadialLinear));
  }

  // node_modules/d3-shape/src/areaRadial.js
  function areaRadial_default() {
    var a2 = area_default().curve(curveRadialLinear), c2 = a2.curve, x0 = a2.lineX0, x1 = a2.lineX1, y0 = a2.lineY0, y1 = a2.lineY1;
    a2.angle = a2.x, delete a2.x;
    a2.startAngle = a2.x0, delete a2.x0;
    a2.endAngle = a2.x1, delete a2.x1;
    a2.radius = a2.y, delete a2.y;
    a2.innerRadius = a2.y0, delete a2.y0;
    a2.outerRadius = a2.y1, delete a2.y1;
    a2.lineStartAngle = function() {
      return lineRadial(x0());
    }, delete a2.lineX0;
    a2.lineEndAngle = function() {
      return lineRadial(x1());
    }, delete a2.lineX1;
    a2.lineInnerRadius = function() {
      return lineRadial(y0());
    }, delete a2.lineY0;
    a2.lineOuterRadius = function() {
      return lineRadial(y1());
    }, delete a2.lineY1;
    a2.curve = function(_) {
      return arguments.length ? c2(curveRadial(_)) : c2()._curve;
    };
    return a2;
  }

  // node_modules/d3-shape/src/pointRadial.js
  function pointRadial_default(x2, y2) {
    return [(y2 = +y2) * Math.cos(x2 -= Math.PI / 2), y2 * Math.sin(x2)];
  }

  // node_modules/d3-shape/src/curve/bump.js
  var Bump = class {
    constructor(context, x2) {
      this._context = context;
      this._x = x2;
    }
    areaStart() {
      this._line = 0;
    }
    areaEnd() {
      this._line = NaN;
    }
    lineStart() {
      this._point = 0;
    }
    lineEnd() {
      if (this._line || this._line !== 0 && this._point === 1)
        this._context.closePath();
      this._line = 1 - this._line;
    }
    point(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0: {
          this._point = 1;
          if (this._line)
            this._context.lineTo(x2, y2);
          else
            this._context.moveTo(x2, y2);
          break;
        }
        case 1:
          this._point = 2;
        default: {
          if (this._x)
            this._context.bezierCurveTo(this._x0 = (this._x0 + x2) / 2, this._y0, this._x0, y2, x2, y2);
          else
            this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y2) / 2, x2, this._y0, x2, y2);
          break;
        }
      }
      this._x0 = x2, this._y0 = y2;
    }
  };
  var BumpRadial = class {
    constructor(context) {
      this._context = context;
    }
    lineStart() {
      this._point = 0;
    }
    lineEnd() {
    }
    point(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point === 0) {
        this._point = 1;
      } else {
        const p0 = pointRadial_default(this._x0, this._y0);
        const p1 = pointRadial_default(this._x0, this._y0 = (this._y0 + y2) / 2);
        const p2 = pointRadial_default(x2, this._y0);
        const p3 = pointRadial_default(x2, y2);
        this._context.moveTo(...p0);
        this._context.bezierCurveTo(...p1, ...p2, ...p3);
      }
      this._x0 = x2, this._y0 = y2;
    }
  };
  function bumpX(context) {
    return new Bump(context, true);
  }
  function bumpY(context) {
    return new Bump(context, false);
  }
  function bumpRadial(context) {
    return new BumpRadial(context);
  }

  // node_modules/d3-shape/src/link.js
  function linkSource(d) {
    return d.source;
  }
  function linkTarget(d) {
    return d.target;
  }
  function link(curve) {
    let source = linkSource, target = linkTarget, x2 = x, y2 = y, context = null, output = null, path2 = withPath(link2);
    function link2() {
      let buffer;
      const argv = slice.call(arguments);
      const s2 = source.apply(this, argv);
      const t = target.apply(this, argv);
      if (context == null)
        output = curve(buffer = path2());
      output.lineStart();
      argv[0] = s2, output.point(+x2.apply(this, argv), +y2.apply(this, argv));
      argv[0] = t, output.point(+x2.apply(this, argv), +y2.apply(this, argv));
      output.lineEnd();
      if (buffer)
        return output = null, buffer + "" || null;
    }
    link2.source = function(_) {
      return arguments.length ? (source = _, link2) : source;
    };
    link2.target = function(_) {
      return arguments.length ? (target = _, link2) : target;
    };
    link2.x = function(_) {
      return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default2(+_), link2) : x2;
    };
    link2.y = function(_) {
      return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default2(+_), link2) : y2;
    };
    link2.context = function(_) {
      return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link2) : context;
    };
    return link2;
  }
  function linkHorizontal() {
    return link(bumpX);
  }
  function linkVertical() {
    return link(bumpY);
  }
  function linkRadial() {
    const l = link(bumpRadial);
    l.angle = l.x, delete l.x;
    l.radius = l.y, delete l.y;
    return l;
  }

  // node_modules/d3-shape/src/symbol/asterisk.js
  var sqrt3 = sqrt2(3);
  var asterisk_default = {
    draw(context, size) {
      const r = sqrt2(size + min2(size / 28, 0.75)) * 0.59436;
      const t = r / 2;
      const u = t * sqrt3;
      context.moveTo(0, r);
      context.lineTo(0, -r);
      context.moveTo(-u, -t);
      context.lineTo(u, t);
      context.moveTo(-u, t);
      context.lineTo(u, -t);
    }
  };

  // node_modules/d3-shape/src/symbol/circle.js
  var circle_default = {
    draw(context, size) {
      const r = sqrt2(size / pi2);
      context.moveTo(r, 0);
      context.arc(0, 0, r, 0, tau2);
    }
  };

  // node_modules/d3-shape/src/symbol/cross.js
  var cross_default = {
    draw(context, size) {
      const r = sqrt2(size / 5) / 2;
      context.moveTo(-3 * r, -r);
      context.lineTo(-r, -r);
      context.lineTo(-r, -3 * r);
      context.lineTo(r, -3 * r);
      context.lineTo(r, -r);
      context.lineTo(3 * r, -r);
      context.lineTo(3 * r, r);
      context.lineTo(r, r);
      context.lineTo(r, 3 * r);
      context.lineTo(-r, 3 * r);
      context.lineTo(-r, r);
      context.lineTo(-3 * r, r);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/diamond.js
  var tan30 = sqrt2(1 / 3);
  var tan30_2 = tan30 * 2;
  var diamond_default = {
    draw(context, size) {
      const y2 = sqrt2(size / tan30_2);
      const x2 = y2 * tan30;
      context.moveTo(0, -y2);
      context.lineTo(x2, 0);
      context.lineTo(0, y2);
      context.lineTo(-x2, 0);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/diamond2.js
  var diamond2_default = {
    draw(context, size) {
      const r = sqrt2(size) * 0.62625;
      context.moveTo(0, -r);
      context.lineTo(r, 0);
      context.lineTo(0, r);
      context.lineTo(-r, 0);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/plus.js
  var plus_default = {
    draw(context, size) {
      const r = sqrt2(size - min2(size / 7, 2)) * 0.87559;
      context.moveTo(-r, 0);
      context.lineTo(r, 0);
      context.moveTo(0, r);
      context.lineTo(0, -r);
    }
  };

  // node_modules/d3-shape/src/symbol/square.js
  var square_default = {
    draw(context, size) {
      const w2 = sqrt2(size);
      const x2 = -w2 / 2;
      context.rect(x2, x2, w2, w2);
    }
  };

  // node_modules/d3-shape/src/symbol/square2.js
  var square2_default = {
    draw(context, size) {
      const r = sqrt2(size) * 0.4431;
      context.moveTo(r, r);
      context.lineTo(r, -r);
      context.lineTo(-r, -r);
      context.lineTo(-r, r);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/star.js
  var ka = 0.8908130915292852;
  var kr = sin(pi2 / 10) / sin(7 * pi2 / 10);
  var kx = sin(tau2 / 10) * kr;
  var ky = -cos(tau2 / 10) * kr;
  var star_default = {
    draw(context, size) {
      const r = sqrt2(size * ka);
      const x2 = kx * r;
      const y2 = ky * r;
      context.moveTo(0, -r);
      context.lineTo(x2, y2);
      for (let i = 1; i < 5; ++i) {
        const a2 = tau2 * i / 5;
        const c2 = cos(a2);
        const s2 = sin(a2);
        context.lineTo(s2 * r, -c2 * r);
        context.lineTo(c2 * x2 - s2 * y2, s2 * x2 + c2 * y2);
      }
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/triangle.js
  var sqrt32 = sqrt2(3);
  var triangle_default = {
    draw(context, size) {
      const y2 = -sqrt2(size / (sqrt32 * 3));
      context.moveTo(0, y2 * 2);
      context.lineTo(-sqrt32 * y2, -y2);
      context.lineTo(sqrt32 * y2, -y2);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/triangle2.js
  var sqrt33 = sqrt2(3);
  var triangle2_default = {
    draw(context, size) {
      const s2 = sqrt2(size) * 0.6824;
      const t = s2 / 2;
      const u = s2 * sqrt33 / 2;
      context.moveTo(0, -s2);
      context.lineTo(u, t);
      context.lineTo(-u, t);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/wye.js
  var c = -0.5;
  var s = sqrt2(3) / 2;
  var k = 1 / sqrt2(12);
  var a = (k / 2 + 1) * 3;
  var wye_default = {
    draw(context, size) {
      const r = sqrt2(size / a);
      const x0 = r / 2, y0 = r * k;
      const x1 = x0, y1 = r * k + r;
      const x2 = -x1, y2 = y1;
      context.moveTo(x0, y0);
      context.lineTo(x1, y1);
      context.lineTo(x2, y2);
      context.lineTo(c * x0 - s * y0, s * x0 + c * y0);
      context.lineTo(c * x1 - s * y1, s * x1 + c * y1);
      context.lineTo(c * x2 - s * y2, s * x2 + c * y2);
      context.lineTo(c * x0 + s * y0, c * y0 - s * x0);
      context.lineTo(c * x1 + s * y1, c * y1 - s * x1);
      context.lineTo(c * x2 + s * y2, c * y2 - s * x2);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/times.js
  var times_default = {
    draw(context, size) {
      const r = sqrt2(size - min2(size / 6, 1.7)) * 0.6189;
      context.moveTo(-r, -r);
      context.lineTo(r, r);
      context.moveTo(-r, r);
      context.lineTo(r, -r);
    }
  };

  // node_modules/d3-shape/src/symbol.js
  var symbolsFill = [
    circle_default,
    cross_default,
    diamond_default,
    square_default,
    star_default,
    triangle_default,
    wye_default
  ];
  var symbolsStroke = [
    circle_default,
    plus_default,
    times_default,
    triangle2_default,
    asterisk_default,
    square2_default,
    diamond2_default
  ];
  function Symbol2(type, size) {
    let context = null, path2 = withPath(symbol);
    type = typeof type === "function" ? type : constant_default2(type || circle_default);
    size = typeof size === "function" ? size : constant_default2(size === void 0 ? 64 : +size);
    function symbol() {
      let buffer;
      if (!context)
        context = buffer = path2();
      type.apply(this, arguments).draw(context, +size.apply(this, arguments));
      if (buffer)
        return context = null, buffer + "" || null;
    }
    symbol.type = function(_) {
      return arguments.length ? (type = typeof _ === "function" ? _ : constant_default2(_), symbol) : type;
    };
    symbol.size = function(_) {
      return arguments.length ? (size = typeof _ === "function" ? _ : constant_default2(+_), symbol) : size;
    };
    symbol.context = function(_) {
      return arguments.length ? (context = _ == null ? null : _, symbol) : context;
    };
    return symbol;
  }

  // node_modules/d3-shape/src/noop.js
  function noop_default() {
  }

  // node_modules/d3-shape/src/curve/basis.js
  function point2(that, x2, y2) {
    that._context.bezierCurveTo(
      (2 * that._x0 + that._x1) / 3,
      (2 * that._y0 + that._y1) / 3,
      (that._x0 + 2 * that._x1) / 3,
      (that._y0 + 2 * that._y1) / 3,
      (that._x0 + 4 * that._x1 + x2) / 6,
      (that._y0 + 4 * that._y1 + y2) / 6
    );
  }
  function Basis(context) {
    this._context = context;
  }
  Basis.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._y0 = this._y1 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 3:
          point2(this, this._x1, this._y1);
        case 2:
          this._context.lineTo(this._x1, this._y1);
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
        default:
          point2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }
  };
  function basis_default2(context) {
    return new Basis(context);
  }

  // node_modules/d3-shape/src/curve/basisClosed.js
  function BasisClosed(context) {
    this._context = context;
  }
  BasisClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 1: {
          this._context.moveTo(this._x2, this._y2);
          this._context.closePath();
          break;
        }
        case 2: {
          this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
          this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
          this._context.closePath();
          break;
        }
        case 3: {
          this.point(this._x2, this._y2);
          this.point(this._x3, this._y3);
          this.point(this._x4, this._y4);
          break;
        }
      }
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._x2 = x2, this._y2 = y2;
          break;
        case 1:
          this._point = 2;
          this._x3 = x2, this._y3 = y2;
          break;
        case 2:
          this._point = 3;
          this._x4 = x2, this._y4 = y2;
          this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6);
          break;
        default:
          point2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }
  };
  function basisClosed_default2(context) {
    return new BasisClosed(context);
  }

  // node_modules/d3-shape/src/curve/basisOpen.js
  function BasisOpen(context) {
    this._context = context;
  }
  BasisOpen.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._y0 = this._y1 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 3)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6;
          this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
          break;
        case 3:
          this._point = 4;
        default:
          point2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }
  };
  function basisOpen_default(context) {
    return new BasisOpen(context);
  }

  // node_modules/d3-shape/src/curve/bundle.js
  function Bundle(context, beta) {
    this._basis = new Basis(context);
    this._beta = beta;
  }
  Bundle.prototype = {
    lineStart: function() {
      this._x = [];
      this._y = [];
      this._basis.lineStart();
    },
    lineEnd: function() {
      var x2 = this._x, y2 = this._y, j = x2.length - 1;
      if (j > 0) {
        var x0 = x2[0], y0 = y2[0], dx = x2[j] - x0, dy = y2[j] - y0, i = -1, t;
        while (++i <= j) {
          t = i / j;
          this._basis.point(
            this._beta * x2[i] + (1 - this._beta) * (x0 + t * dx),
            this._beta * y2[i] + (1 - this._beta) * (y0 + t * dy)
          );
        }
      }
      this._x = this._y = null;
      this._basis.lineEnd();
    },
    point: function(x2, y2) {
      this._x.push(+x2);
      this._y.push(+y2);
    }
  };
  var bundle_default = function custom10(beta) {
    function bundle(context) {
      return beta === 1 ? new Basis(context) : new Bundle(context, beta);
    }
    bundle.beta = function(beta2) {
      return custom10(+beta2);
    };
    return bundle;
  }(0.85);

  // node_modules/d3-shape/src/curve/cardinal.js
  function point3(that, x2, y2) {
    that._context.bezierCurveTo(
      that._x1 + that._k * (that._x2 - that._x0),
      that._y1 + that._k * (that._y2 - that._y0),
      that._x2 + that._k * (that._x1 - x2),
      that._y2 + that._k * (that._y1 - y2),
      that._x2,
      that._y2
    );
  }
  function Cardinal(context, tension) {
    this._context = context;
    this._k = (1 - tension) / 6;
  }
  Cardinal.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x2, this._y2);
          break;
        case 3:
          point3(this, this._x1, this._y1);
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          this._x1 = x2, this._y1 = y2;
          break;
        case 2:
          this._point = 3;
        default:
          point3(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var cardinal_default = function custom11(tension) {
    function cardinal(context) {
      return new Cardinal(context, tension);
    }
    cardinal.tension = function(tension2) {
      return custom11(+tension2);
    };
    return cardinal;
  }(0);

  // node_modules/d3-shape/src/curve/cardinalClosed.js
  function CardinalClosed(context, tension) {
    this._context = context;
    this._k = (1 - tension) / 6;
  }
  CardinalClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 1: {
          this._context.moveTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 2: {
          this._context.lineTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 3: {
          this.point(this._x3, this._y3);
          this.point(this._x4, this._y4);
          this.point(this._x5, this._y5);
          break;
        }
      }
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._x3 = x2, this._y3 = y2;
          break;
        case 1:
          this._point = 2;
          this._context.moveTo(this._x4 = x2, this._y4 = y2);
          break;
        case 2:
          this._point = 3;
          this._x5 = x2, this._y5 = y2;
          break;
        default:
          point3(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var cardinalClosed_default = function custom12(tension) {
    function cardinal(context) {
      return new CardinalClosed(context, tension);
    }
    cardinal.tension = function(tension2) {
      return custom12(+tension2);
    };
    return cardinal;
  }(0);

  // node_modules/d3-shape/src/curve/cardinalOpen.js
  function CardinalOpen(context, tension) {
    this._context = context;
    this._k = (1 - tension) / 6;
  }
  CardinalOpen.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 3)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
          break;
        case 3:
          this._point = 4;
        default:
          point3(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var cardinalOpen_default = function custom13(tension) {
    function cardinal(context) {
      return new CardinalOpen(context, tension);
    }
    cardinal.tension = function(tension2) {
      return custom13(+tension2);
    };
    return cardinal;
  }(0);

  // node_modules/d3-shape/src/curve/catmullRom.js
  function point4(that, x2, y2) {
    var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2;
    if (that._l01_a > epsilon) {
      var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a);
      x1 = (x1 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
      y1 = (y1 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
    }
    if (that._l23_a > epsilon) {
      var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a);
      x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m;
      y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m;
    }
    that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2);
  }
  function CatmullRom(context, alpha) {
    this._context = context;
    this._alpha = alpha;
  }
  CatmullRom.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x2, this._y2);
          break;
        case 3:
          this.point(this._x2, this._y2);
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) {
        var x23 = this._x2 - x2, y23 = this._y2 - y2;
        this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
      }
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
        default:
          point4(this, x2, y2);
          break;
      }
      this._l01_a = this._l12_a, this._l12_a = this._l23_a;
      this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var catmullRom_default = function custom14(alpha) {
    function catmullRom(context) {
      return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
    }
    catmullRom.alpha = function(alpha2) {
      return custom14(+alpha2);
    };
    return catmullRom;
  }(0.5);

  // node_modules/d3-shape/src/curve/catmullRomClosed.js
  function CatmullRomClosed(context, alpha) {
    this._context = context;
    this._alpha = alpha;
  }
  CatmullRomClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
      this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 1: {
          this._context.moveTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 2: {
          this._context.lineTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 3: {
          this.point(this._x3, this._y3);
          this.point(this._x4, this._y4);
          this.point(this._x5, this._y5);
          break;
        }
      }
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) {
        var x23 = this._x2 - x2, y23 = this._y2 - y2;
        this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
      }
      switch (this._point) {
        case 0:
          this._point = 1;
          this._x3 = x2, this._y3 = y2;
          break;
        case 1:
          this._point = 2;
          this._context.moveTo(this._x4 = x2, this._y4 = y2);
          break;
        case 2:
          this._point = 3;
          this._x5 = x2, this._y5 = y2;
          break;
        default:
          point4(this, x2, y2);
          break;
      }
      this._l01_a = this._l12_a, this._l12_a = this._l23_a;
      this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var catmullRomClosed_default = function custom15(alpha) {
    function catmullRom(context) {
      return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
    }
    catmullRom.alpha = function(alpha2) {
      return custom15(+alpha2);
    };
    return catmullRom;
  }(0.5);

  // node_modules/d3-shape/src/curve/catmullRomOpen.js
  function CatmullRomOpen(context, alpha) {
    this._context = context;
    this._alpha = alpha;
  }
  CatmullRomOpen.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 3)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) {
        var x23 = this._x2 - x2, y23 = this._y2 - y2;
        this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
      }
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
          break;
        case 3:
          this._point = 4;
        default:
          point4(this, x2, y2);
          break;
      }
      this._l01_a = this._l12_a, this._l12_a = this._l23_a;
      this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var catmullRomOpen_default = function custom16(alpha) {
    function catmullRom(context) {
      return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
    }
    catmullRom.alpha = function(alpha2) {
      return custom16(+alpha2);
    };
    return catmullRom;
  }(0.5);

  // node_modules/d3-shape/src/curve/linearClosed.js
  function LinearClosed(context) {
    this._context = context;
  }
  LinearClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      if (this._point)
        this._context.closePath();
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point)
        this._context.lineTo(x2, y2);
      else
        this._point = 1, this._context.moveTo(x2, y2);
    }
  };
  function linearClosed_default(context) {
    return new LinearClosed(context);
  }

  // node_modules/d3-shape/src/curve/monotone.js
  function sign(x2) {
    return x2 < 0 ? -1 : 1;
  }
  function slope3(that, x2, y2) {
    var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p2 = (s0 * h1 + s1 * h0) / (h0 + h1);
    return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p2)) || 0;
  }
  function slope2(that, t) {
    var h = that._x1 - that._x0;
    return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
  }
  function point5(that, t02, t12) {
    var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3;
    that._context.bezierCurveTo(x0 + dx, y0 + dx * t02, x1 - dx, y1 - dx * t12, x1, y1);
  }
  function MonotoneX(context) {
    this._context = context;
  }
  MonotoneX.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x1, this._y1);
          break;
        case 3:
          point5(this, this._t0, slope2(this, this._t0));
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1)
        this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      var t12 = NaN;
      x2 = +x2, y2 = +y2;
      if (x2 === this._x1 && y2 === this._y1)
        return;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          point5(this, slope2(this, t12 = slope3(this, x2, y2)), t12);
          break;
        default:
          point5(this, this._t0, t12 = slope3(this, x2, y2));
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
      this._t0 = t12;
    }
  };
  function MonotoneY(context) {
    this._context = new ReflectContext(context);
  }
  (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) {
    MonotoneX.prototype.point.call(this, y2, x2);
  };
  function ReflectContext(context) {
    this._context = context;
  }
  ReflectContext.prototype = {
    moveTo: function(x2, y2) {
      this._context.moveTo(y2, x2);
    },
    closePath: function() {
      this._context.closePath();
    },
    lineTo: function(x2, y2) {
      this._context.lineTo(y2, x2);
    },
    bezierCurveTo: function(x1, y1, x2, y2, x3, y3) {
      this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3);
    }
  };
  function monotoneX(context) {
    return new MonotoneX(context);
  }
  function monotoneY(context) {
    return new MonotoneY(context);
  }

  // node_modules/d3-shape/src/curve/natural.js
  function Natural(context) {
    this._context = context;
  }
  Natural.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x = [];
      this._y = [];
    },
    lineEnd: function() {
      var x2 = this._x, y2 = this._y, n = x2.length;
      if (n) {
        this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]);
        if (n === 2) {
          this._context.lineTo(x2[1], y2[1]);
        } else {
          var px = controlPoints(x2), py = controlPoints(y2);
          for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
            this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]);
          }
        }
      }
      if (this._line || this._line !== 0 && n === 1)
        this._context.closePath();
      this._line = 1 - this._line;
      this._x = this._y = null;
    },
    point: function(x2, y2) {
      this._x.push(+x2);
      this._y.push(+y2);
    }
  };
  function controlPoints(x2) {
    var i, n = x2.length - 1, m, a2 = new Array(n), b = new Array(n), r = new Array(n);
    a2[0] = 0, b[0] = 2, r[0] = x2[0] + 2 * x2[1];
    for (i = 1; i < n - 1; ++i)
      a2[i] = 1, b[i] = 4, r[i] = 4 * x2[i] + 2 * x2[i + 1];
    a2[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x2[n - 1] + x2[n];
    for (i = 1; i < n; ++i)
      m = a2[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
    a2[n - 1] = r[n - 1] / b[n - 1];
    for (i = n - 2; i >= 0; --i)
      a2[i] = (r[i] - a2[i + 1]) / b[i];
    b[n - 1] = (x2[n] + a2[n - 1]) / 2;
    for (i = 0; i < n - 1; ++i)
      b[i] = 2 * x2[i + 1] - a2[i + 1];
    return [a2, b];
  }
  function natural_default(context) {
    return new Natural(context);
  }

  // node_modules/d3-shape/src/curve/step.js
  function Step(context, t) {
    this._context = context;
    this._t = t;
  }
  Step.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x = this._y = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      if (0 < this._t && this._t < 1 && this._point === 2)
        this._context.lineTo(this._x, this._y);
      if (this._line || this._line !== 0 && this._point === 1)
        this._context.closePath();
      if (this._line >= 0)
        this._t = 1 - this._t, this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
        default: {
          if (this._t <= 0) {
            this._context.lineTo(this._x, y2);
            this._context.lineTo(x2, y2);
          } else {
            var x1 = this._x * (1 - this._t) + x2 * this._t;
            this._context.lineTo(x1, this._y);
            this._context.lineTo(x1, y2);
          }
          break;
        }
      }
      this._x = x2, this._y = y2;
    }
  };
  function step_default(context) {
    return new Step(context, 0.5);
  }
  function stepBefore(context) {
    return new Step(context, 0);
  }
  function stepAfter(context) {
    return new Step(context, 1);
  }

  // node_modules/d3-shape/src/offset/none.js
  function none_default(series, order2) {
    if (!((n = series.length) > 1))
      return;
    for (var i = 1, j, s0, s1 = series[order2[0]], n, m = s1.length; i < n; ++i) {
      s0 = s1, s1 = series[order2[i]];
      for (j = 0; j < m; ++j) {
        s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
      }
    }
  }

  // node_modules/d3-shape/src/order/none.js
  function none_default2(series) {
    var n = series.length, o = new Array(n);
    while (--n >= 0)
      o[n] = n;
    return o;
  }

  // node_modules/d3-shape/src/stack.js
  function stackValue(d, key) {
    return d[key];
  }
  function stackSeries(key) {
    const series = [];
    series.key = key;
    return series;
  }
  function stack_default() {
    var keys = constant_default2([]), order2 = none_default2, offset2 = none_default, value = stackValue;
    function stack(data) {
      var sz = Array.from(keys.apply(this, arguments), stackSeries), i, n = sz.length, j = -1, oz;
      for (const d of data) {
        for (i = 0, ++j; i < n; ++i) {
          (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;
        }
      }
      for (i = 0, oz = array_default(order2(sz)); i < n; ++i) {
        sz[oz[i]].index = i;
      }
      offset2(sz, oz);
      return sz;
    }
    stack.keys = function(_) {
      return arguments.length ? (keys = typeof _ === "function" ? _ : constant_default2(Array.from(_)), stack) : keys;
    };
    stack.value = function(_) {
      return arguments.length ? (value = typeof _ === "function" ? _ : constant_default2(+_), stack) : value;
    };
    stack.order = function(_) {
      return arguments.length ? (order2 = _ == null ? none_default2 : typeof _ === "function" ? _ : constant_default2(Array.from(_)), stack) : order2;
    };
    stack.offset = function(_) {
      return arguments.length ? (offset2 = _ == null ? none_default : _, stack) : offset2;
    };
    return stack;
  }

  // node_modules/d3-shape/src/offset/expand.js
  function expand_default(series, order2) {
    if (!((n = series.length) > 0))
      return;
    for (var i, n, j = 0, m = series[0].length, y2; j < m; ++j) {
      for (y2 = i = 0; i < n; ++i)
        y2 += series[i][j][1] || 0;
      if (y2)
        for (i = 0; i < n; ++i)
          series[i][j][1] /= y2;
    }
    none_default(series, order2);
  }

  // node_modules/d3-shape/src/offset/diverging.js
  function diverging_default(series, order2) {
    if (!((n = series.length) > 0))
      return;
    for (var i, j = 0, d, dy, yp, yn, n, m = series[order2[0]].length; j < m; ++j) {
      for (yp = yn = 0, i = 0; i < n; ++i) {
        if ((dy = (d = series[order2[i]][j])[1] - d[0]) > 0) {
          d[0] = yp, d[1] = yp += dy;
        } else if (dy < 0) {
          d[1] = yn, d[0] = yn += dy;
        } else {
          d[0] = 0, d[1] = dy;
        }
      }
    }
  }

  // node_modules/d3-shape/src/offset/silhouette.js
  function silhouette_default(series, order2) {
    if (!((n = series.length) > 0))
      return;
    for (var j = 0, s0 = series[order2[0]], n, m = s0.length; j < m; ++j) {
      for (var i = 0, y2 = 0; i < n; ++i)
        y2 += series[i][j][1] || 0;
      s0[j][1] += s0[j][0] = -y2 / 2;
    }
    none_default(series, order2);
  }

  // node_modules/d3-shape/src/offset/wiggle.js
  function wiggle_default(series, order2) {
    if (!((n = series.length) > 0) || !((m = (s0 = series[order2[0]]).length) > 0))
      return;
    for (var y2 = 0, j = 1, s0, m, n; j < m; ++j) {
      for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {
        var si = series[order2[i]], sij0 = si[j][1] || 0, sij1 = si[j - 1][1] || 0, s3 = (sij0 - sij1) / 2;
        for (var k2 = 0; k2 < i; ++k2) {
          var sk = series[order2[k2]], skj0 = sk[j][1] || 0, skj1 = sk[j - 1][1] || 0;
          s3 += skj0 - skj1;
        }
        s1 += sij0, s2 += s3 * sij0;
      }
      s0[j - 1][1] += s0[j - 1][0] = y2;
      if (s1)
        y2 -= s2 / s1;
    }
    s0[j - 1][1] += s0[j - 1][0] = y2;
    none_default(series, order2);
  }

  // node_modules/d3-shape/src/order/appearance.js
  function appearance_default(series) {
    var peaks = series.map(peak);
    return none_default2(series).sort(function(a2, b) {
      return peaks[a2] - peaks[b];
    });
  }
  function peak(series) {
    var i = -1, j = 0, n = series.length, vi, vj = -Infinity;
    while (++i < n)
      if ((vi = +series[i][1]) > vj)
        vj = vi, j = i;
    return j;
  }

  // node_modules/d3-shape/src/order/ascending.js
  function ascending_default(series) {
    var sums = series.map(sum);
    return none_default2(series).sort(function(a2, b) {
      return sums[a2] - sums[b];
    });
  }
  function sum(series) {
    var s2 = 0, i = -1, n = series.length, v;
    while (++i < n)
      if (v = +series[i][1])
        s2 += v;
    return s2;
  }

  // node_modules/d3-shape/src/order/descending.js
  function descending_default2(series) {
    return ascending_default(series).reverse();
  }

  // node_modules/d3-shape/src/order/insideOut.js
  function insideOut_default(series) {
    var n = series.length, i, j, sums = series.map(sum), order2 = appearance_default(series), top2 = 0, bottom2 = 0, tops = [], bottoms = [];
    for (i = 0; i < n; ++i) {
      j = order2[i];
      if (top2 < bottom2) {
        top2 += sums[j];
        tops.push(j);
      } else {
        bottom2 += sums[j];
        bottoms.push(j);
      }
    }
    return bottoms.reverse().concat(tops);
  }

  // node_modules/d3-shape/src/order/reverse.js
  function reverse_default(series) {
    return none_default2(series).reverse();
  }

  // node_modules/victory-core/es/victory-util/line-helpers.js
  var defined = function(d) {
    var y2 = d._y1 !== void 0 ? d._y1 : d._y;
    return y2 !== null && y2 !== void 0 && d._y0 !== null;
  };
  var getXAccessor = function(scale2) {
    return function(d) {
      return scale2.x(d._x1 !== void 0 ? d._x1 : d._x);
    };
  };
  var getYAccessor = function(scale2) {
    return function(d) {
      return scale2.y(d._y1 !== void 0 ? d._y1 : d._y);
    };
  };
  var getAngleAccessor = function(scale2) {
    return function(d) {
      var x2 = scale2.x(d._x1 !== void 0 ? d._x1 : d._x);
      return -1 * x2 + Math.PI / 2;
    };
  };
  var toNewName2 = function(interpolation) {
    var capitalize4 = function(s2) {
      return s2 && s2[0].toUpperCase() + s2.slice(1);
    };
    return "curve".concat(capitalize4(interpolation));
  };
  var toNewNameClosed = function(interpolation) {
    return "".concat(toNewName2(interpolation), "Closed");
  };
  var getInterpolationFunction = function(props) {
    var interpolation = props.interpolation;
    if (typeof interpolation === "function") {
      return interpolation;
    }
    if (typeof interpolation === "string") {
      var polar = props.polar, _props$openCurve = props.openCurve, openCurve = _props$openCurve === void 0 ? !polar : _props$openCurve;
      var interpolationName = !openCurve ? toNewNameClosed(interpolation) : toNewName2(interpolation);
      return d3_shape_exports[interpolationName];
    }
    return linear_default;
  };
  var getLineFunction = function(props) {
    var polar = props.polar, scale2 = props.scale, horizontal = props.horizontal;
    return polar ? lineRadial_default().defined(defined).curve(getInterpolationFunction(props)).angle(getAngleAccessor(scale2)).radius(getYAccessor(scale2)) : line_default().defined(defined).curve(getInterpolationFunction(props)).x(horizontal ? getYAccessor(scale2) : getXAccessor(scale2)).y(horizontal ? getXAccessor(scale2) : getYAccessor(scale2));
  };

  // node_modules/victory-core/es/victory-util/selection.js
  var selection_exports = {};
  __export(selection_exports, {
    getBounds: () => getBounds,
    getDataCoordinates: () => getDataCoordinates,
    getDomainCoordinates: () => getDomainCoordinates,
    getParentSVG: () => getParentSVG,
    getSVGEventCoordinates: () => getSVGEventCoordinates
  });
  function transformTarget(target, matrix, dimension) {
    var a2 = matrix.a, d = matrix.d, e = matrix.e, f = matrix.f;
    return dimension === "y" ? d * target + f : a2 * target + e;
  }
  function getTransformationMatrix(svg) {
    return svg.getScreenCTM().inverse();
  }
  function isNativeTouchEvent(nativeEvent) {
    return !!(nativeEvent && nativeEvent.identifier !== void 0);
  }
  function isReactTouchEvent(evt) {
    return evt.changedTouches && evt.changedTouches.length > 0;
  }
  function getParentSVG(evt) {
    if (isNativeTouchEvent(evt.nativeEvent)) {
      return void 0;
    }
    var getParent = function(target) {
      if (target.nodeName === "svg") {
        return target;
      }
      return target.parentNode ? getParent(target.parentNode) : target;
    };
    return getParent(evt.target);
  }
  function getSVGEventCoordinates(evt, svg) {
    if (isNativeTouchEvent(evt.nativeEvent)) {
      return {
        x: evt.nativeEvent.locationX,
        y: evt.nativeEvent.locationY
      };
    }
    var location = isReactTouchEvent(evt) ? evt.changedTouches[0] : evt;
    svg = svg || getParentSVG(location);
    var matrix = getTransformationMatrix(svg);
    return {
      x: transformTarget(location.clientX, matrix, "x"),
      y: transformTarget(location.clientY, matrix, "y")
    };
  }
  function getDomainCoordinates(props, domain2) {
    var horizontal = props.horizontal;
    var scale2 = props.scale;
    var domainObj = domain2 || {
      x: scale2.x.domain(),
      y: scale2.y.domain()
    };
    return {
      x: horizontal ? [scale2.y(domainObj.y[0]), scale2.y(domainObj.y[1])] : [scale2.x(domainObj.x[0]), scale2.x(domainObj.x[1])],
      y: horizontal ? [scale2.x(domainObj.x[0]), scale2.x(domainObj.x[1])] : [scale2.y(domainObj.y[0]), scale2.y(domainObj.y[1])]
    };
  }
  function getDataCoordinates(props, scale2, x2, y2) {
    var polar = props.polar, horizontal = props.horizontal;
    if (!polar) {
      return {
        x: horizontal ? scale2.x.invert(y2) : scale2.x.invert(x2),
        y: horizontal ? scale2.y.invert(x2) : scale2.y.invert(y2)
      };
    }
    var origin = props.origin || {
      x: 0,
      y: 0
    };
    var baseX = x2 - origin.x;
    var baseY = y2 - origin.y;
    var radius = Math.abs(baseX * Math.sqrt(1 + Math.pow(-baseY / baseX, 2)));
    var angle = (-Math.atan2(baseY, baseX) + Math.PI * 2) % (Math.PI * 2);
    return {
      x: scale2.x.invert(angle),
      y: scale2.y.invert(radius)
    };
  }
  function getBounds(props) {
    var x1 = props.x1, x2 = props.x2, y1 = props.y1, y2 = props.y2, scale2 = props.scale;
    var point1 = getDataCoordinates(props, scale2, x1, y1);
    var point22 = getDataCoordinates(props, scale2, x2, y2);
    var makeBound = function(a2, b) {
      return [getMinValue([a2, b]), getMaxValue([a2, b])];
    };
    return {
      x: makeBound(point1.x, point22.x),
      y: makeBound(point1.y, point22.y)
    };
  }

  // node_modules/victory-core/es/victory-util/wrapper.js
  var wrapper_exports = {};
  __export(wrapper_exports, {
    addBinsToParentPropsIfHistogram: () => addBinsToParentPropsIfHistogram,
    getAllEvents: () => getAllEvents,
    getCategories: () => getCategories2,
    getCategoryAndAxisStringsFromChildren: () => getCategoryAndAxisStringsFromChildren,
    getChildStyle: () => getChildStyle,
    getColor: () => getColor,
    getData: () => getData2,
    getDataFromChildren: () => getDataFromChildren,
    getDefaultDomainPadding: () => getDefaultDomainPadding,
    getDomain: () => getDomain3,
    getDomainFromChildren: () => getDomainFromChildren,
    getScale: () => getScale,
    getStringsFromCategories: () => getStringsFromCategories2,
    getStringsFromChildren: () => getStringsFromChildren,
    getStringsFromData: () => getStringsFromData2,
    getStyle: () => getStyle,
    getWidth: () => getWidth
  });
  var import_isPlainObject5 = __toESM(require_isPlainObject());
  var import_values2 = __toESM(require_values());
  var import_uniqBy = __toESM(require_uniqBy());
  var import_groupBy = __toESM(require_groupBy());
  var import_uniq4 = __toESM(require_uniq());
  var import_isFunction10 = __toESM(require_isFunction());
  var import_flatten2 = __toESM(require_flatten());
  var import_defaults13 = __toESM(require_defaults());
  var import_assign18 = __toESM(require_assign());
  var import_react70 = __toESM(require_react());
  function _toConsumableArray13(arr) {
    return _arrayWithoutHoles12(arr) || _iterableToArray12(arr) || _unsupportedIterableToArray14(arr) || _nonIterableSpread12();
  }
  function _nonIterableSpread12() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray14(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray14(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray14(o, minLen);
  }
  function _iterableToArray12(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles12(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray14(arr);
  }
  function _arrayLikeToArray14(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function ownKeys13(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread13(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys13(Object(source), true).forEach(function(key) {
        _defineProperty17(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys13(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty17(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function addBinsToParentPropsIfHistogram(_ref2) {
    var children = _ref2.children, props = _ref2.props, childComponents = _ref2.childComponents, parentProps = _ref2.parentProps;
    var someChildrenAreHistograms = children.some(function(child) {
      return child.type && child.type.role === "histogram";
    });
    var allChildrenAreHistograms = someChildrenAreHistograms && children.length && children.every(function(child) {
      return child.type && child.type.role === "histogram";
    });
    if (someChildrenAreHistograms && !allChildrenAreHistograms) {
      warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
    }
    if (!allChildrenAreHistograms) {
      return parentProps;
    }
    var childBins = props.bins || childComponents[0].props.bins;
    if (!Array.isArray(childBins)) {
      var combinedData = children.reduce(function(memo2, child) {
        var xAccessor = createAccessor(child.props.x || "x");
        return memo2.concat(child.props.data.map(function(datum) {
          return {
            x: xAccessor(datum)
          };
        }));
      }, []);
      var getFormattedHistogramData = children[0].type.getFormattedData;
      childBins = getFormattedHistogramData({
        data: combinedData,
        bins: childBins
      }).reduce(function(memo2, _ref22, index) {
        var x0 = _ref22.x0, x1 = _ref22.x1;
        return index === 0 ? memo2.concat([x0, x1]) : memo2.concat(x1);
      }, []);
    }
    return _objectSpread13(_objectSpread13({}, parentProps), {}, {
      bins: childBins
    });
  }
  function getDataFromChildren(props, childComponents) {
    var polar = props.polar, startAngle = props.startAngle, endAngle = props.endAngle, categories = props.categories, minDomain = props.minDomain, maxDomain = props.maxDomain;
    var parentProps = {
      polar,
      startAngle,
      endAngle,
      categories,
      minDomain,
      maxDomain
    };
    var stack = 0;
    var children = childComponents ? childComponents.slice(0) : import_react70.default.Children.toArray(props.children);
    parentProps = addBinsToParentPropsIfHistogram({
      children,
      props,
      childComponents,
      parentProps
    });
    var iteratee = function(child, childName, parent) {
      var childProps = (0, import_assign18.default)({}, child.props, parentProps);
      var childData;
      if (!isDataComponent(child)) {
        return null;
      } else if (child.type && (0, import_isFunction10.default)(child.type.getData)) {
        child = parent ? /* @__PURE__ */ import_react70.default.cloneElement(child, parent.props) : child;
        childData = child.type.getData(childProps);
      } else {
        childData = getData(childProps);
      }
      stack += 1;
      return childData.map(function(datum, index) {
        return (0, import_assign18.default)({
          _stack: stack,
          _group: index
        }, datum);
      });
    };
    var stacked = children.filter(function(c2) {
      return c2.type && c2.type.role === "stack";
    }).length;
    var combine = function(memo2, val) {
      return memo2.concat((0, import_uniqBy.default)(val, "_group"));
    };
    var datasets = reduceChildren(children, iteratee, props, [], combine);
    var group = stacked ? "_group" : "_stack";
    return (0, import_values2.default)((0, import_groupBy.default)(datasets, group));
  }
  function getData2(props, childComponents) {
    if (props.data) {
      return getData(props);
    }
    childComponents = childComponents || import_react70.default.Children.toArray(props.children);
    return getDataFromChildren(props, childComponents);
  }
  function getWidth(props, groupLength, seriesLength) {
    var datasets = props.datasets, horizontal = props.horizontal;
    var range2 = horizontal ? getRange(props, "y") : getRange(props, "x");
    var extent = Math.abs(range2[1] - range2[0]);
    seriesLength = seriesLength !== void 0 ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
    groupLength = groupLength || datasets.length;
    var bars = groupLength * seriesLength;
    var barRatio = 0.5;
    return Math.round(barRatio * extent / bars);
  }
  function getDefaultDomainPadding(props, axis, childComponents) {
    if (props.polar || axis !== "x") {
      return void 0;
    }
    var groupComponent = childComponents.filter(function(child) {
      return child.type && child.type.role && child.type.role === "group";
    });
    if (groupComponent.length < 1) {
      return void 0;
    }
    var _groupComponent$0$pro = groupComponent[0].props, offset2 = _groupComponent$0$pro.offset, children = _groupComponent$0$pro.children;
    if (!offset2) {
      return void 0;
    }
    var firstChild = Array.isArray(children) && children[0];
    if (!firstChild) {
      return void 0;
    }
    var barWidth = firstChild.props.barWidth;
    var dataLength = firstChild.props.data && firstChild.props.data.length || 1;
    if (firstChild && firstChild.type.role === "stack") {
      var nestedChild = firstChild.props.children && firstChild.props.children[0];
      if (!nestedChild) {
        return void 0;
      }
      barWidth = nestedChild.props.barWidth;
      dataLength = firstChild.props.children.length;
    }
    var width = barWidth || getWidth(props, children.length, dataLength);
    return {
      x: width * children.length / 2 + (offset2 - width * ((children.length - 1) / 2))
    };
  }
  function getDomainFromChildren(props, axis, childComponents) {
    var children = childComponents ? childComponents.slice(0) : import_react70.default.Children.toArray(props.children);
    var parentData = props.data ? getData(props) : void 0;
    var polar = props.polar, startAngle = props.startAngle, endAngle = props.endAngle, categories = props.categories, minDomain = props.minDomain, maxDomain = props.maxDomain, horizontal = props.horizontal;
    var baseParentProps = {
      horizontal,
      polar,
      startAngle,
      endAngle,
      minDomain,
      maxDomain,
      categories
    };
    var parentProps = parentData ? (0, import_assign18.default)(baseParentProps, {
      data: parentData
    }) : baseParentProps;
    var iteratee = function(child) {
      var sharedProps = (0, import_assign18.default)({}, child.props, parentProps);
      if (!isDomainComponent(child)) {
        return null;
      } else if (child.type && (0, import_isFunction10.default)(child.type.getDomain)) {
        return child.props && child.type.getDomain(sharedProps, axis);
      }
      return getDomain(sharedProps, axis);
    };
    var childDomains = reduceChildren(children, iteratee, props);
    var min3 = childDomains.length === 0 ? 0 : getMinValue(childDomains);
    var max3 = childDomains.length === 0 ? 1 : getMaxValue(childDomains);
    return [min3, max3];
  }
  function getDomain3(props, axis, childComponents) {
    childComponents = childComponents || import_react70.default.Children.toArray(props.children);
    var propsDomain = getDomainFromProps(props, axis);
    var domainPadding = getDefaultDomainPadding(props, axis, childComponents);
    var domain2;
    if (propsDomain) {
      domain2 = propsDomain;
    } else {
      var minDomain = getMinFromProps(props, axis);
      var maxDomain = getMaxFromProps(props, axis);
      var dataset = (props.data || props.y) && getData(props);
      var dataDomain = dataset ? getDomainFromData(props, axis, dataset) : [];
      var childDomain = getDomainFromChildren(props, axis, childComponents);
      var min3 = minDomain || getMinValue([].concat(_toConsumableArray13(dataDomain), _toConsumableArray13(childDomain)));
      var max3 = maxDomain || getMaxValue([].concat(_toConsumableArray13(dataDomain), _toConsumableArray13(childDomain)));
      domain2 = getDomainFromMinMax(min3, max3);
    }
    return formatDomain(domain2, (0, import_assign18.default)({
      domainPadding
    }, props), axis);
  }
  function getScale(props, axis, childComponents) {
    if (props.data) {
      return getBaseScale(props, axis);
    }
    var children = childComponents ? childComponents.slice(0) : import_react70.default.Children.toArray(props.children);
    var iteratee = function(child) {
      var sharedProps = (0, import_assign18.default)({}, child.props, {
        horizontal: props.horizontal
      });
      return getScaleType(sharedProps, axis);
    };
    var childScale = (0, import_uniq4.default)(reduceChildren(children, iteratee, props));
    return childScale.length > 1 ? getScaleFromName("linear") : getScaleFromName(childScale[0]);
  }
  function getAllEvents(props) {
    var components = ["groupComponent", "containerComponent", "labelComponent"];
    var componentEvents = getComponentEvents(props, components);
    var events = props.events;
    if (Array.isArray(componentEvents)) {
      events = Array.isArray(props.events) ? componentEvents.concat.apply(componentEvents, _toConsumableArray13(props.events)) : componentEvents;
    }
    return events || [];
  }
  function getColor(calculatedProps, child, index) {
    var style = calculatedProps.style;
    var colorScale = calculatedProps.colorScale, color2 = calculatedProps.color;
    if (style && style.data && style.data.fill) {
      return style.data.fill;
    }
    colorScale = child.props && child.props.colorScale ? child.props.colorScale : colorScale;
    color2 = child.props && child.props.color ? child.props.color : color2;
    if (!colorScale && !color2) {
      return void 0;
    }
    var colors3 = Array.isArray(colorScale) ? colorScale : getColorScale(colorScale);
    return color2 || colors3[index % colors3.length];
  }
  function getStyle(theme, style, role) {
    var defaultStyle2 = theme && theme[role] && theme[role].style ? theme[role].style : {};
    return getStyles(style, defaultStyle2);
  }
  function getChildStyle(child, index, calculatedProps) {
    var style = calculatedProps.style, role = calculatedProps.role;
    var childStyle = child.props.style || {};
    if (Array.isArray(childStyle)) {
      return childStyle;
    }
    var childRole = child.type && child.type.role;
    var defaultFill = childRole === "stack" ? void 0 : getColor(calculatedProps, child, index);
    var defaultColor = childRole === "line" ? {
      fill: "none",
      stroke: defaultFill
    } : {
      fill: defaultFill
    };
    var dataWidth = role === "stack" ? {} : {
      width: getWidth(calculatedProps)
    };
    var dataStyle = (0, import_defaults13.default)({}, childStyle.data, (0, import_assign18.default)({}, dataWidth, style.data, defaultColor));
    var labelsStyle = (0, import_defaults13.default)({}, childStyle.labels, style.labels);
    return {
      parent: style.parent,
      data: dataStyle,
      labels: labelsStyle
    };
  }
  function getStringsFromCategories2(childComponents, axis) {
    var iteratee = function(child) {
      var childProps = child.props || {};
      if (!isDomainComponent(child) || !childProps.categories) {
        return null;
      }
      var categories = childProps.categories && !Array.isArray(childProps.categories) ? childProps.categories[axis] : childProps.props.categories;
      var categoryStrings = categories && categories.filter(function(val) {
        return typeof val === "string";
      });
      return categoryStrings ? removeUndefined(categoryStrings) : [];
    };
    return reduceChildren(childComponents.slice(0), iteratee);
  }
  function getStringsFromData2(childComponents) {
    var iteratee = function(child) {
      var childProps = child.props || {};
      var data;
      if (!isDataComponent(child)) {
        return null;
      } else if (child.type && (0, import_isFunction10.default)(child.type.getData)) {
        data = child.type.getData(childProps);
      } else {
        data = getData(childProps);
      }
      return data.map(function(d) {
        return {
          x: d.xName,
          y: d.yName
        };
      });
    };
    var initialMemo = {
      x: [],
      y: []
    };
    var combine = function(memo2, datum) {
      var x2 = Array.isArray(datum) ? datum.map(function(d) {
        return d.x;
      }).filter(Boolean) : datum.x;
      var y2 = Array.isArray(datum) ? datum.map(function(d) {
        return d.y;
      }).filter(Boolean) : datum.y;
      return {
        x: x2 !== void 0 ? memo2.x.concat(x2) : memo2.x,
        y: y2 !== void 0 ? memo2.y.concat(y2) : memo2.y
      };
    };
    return reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
  }
  function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
    var categories = (0, import_isPlainObject5.default)(props.categories) ? props.categories[axis] : props.categories;
    var axisComponent = getAxisComponent(childComponents, axis);
    var axisStrings = axisComponent ? getStringsFromAxes(axisComponent.props, axis) : [];
    var categoryStrings = categories || getStringsFromCategories2(childComponents, axis);
    return (0, import_uniq4.default)((0, import_flatten2.default)([].concat(_toConsumableArray13(categoryStrings), _toConsumableArray13(axisStrings))));
  }
  function getStringsFromChildren(props, childComponents) {
    childComponents = childComponents || import_react70.default.Children.toArray(props.children);
    var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", childComponents);
    var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", childComponents);
    var dataStrings = getStringsFromData2(childComponents);
    return {
      x: (0, import_uniq4.default)((0, import_flatten2.default)([].concat(_toConsumableArray13(xStrings), _toConsumableArray13(dataStrings.x)))),
      y: (0, import_uniq4.default)((0, import_flatten2.default)([].concat(_toConsumableArray13(yStrings), _toConsumableArray13(dataStrings.y))))
    };
  }
  function getCategories2(props, childComponents, allStrings) {
    var xPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.x : props.categories;
    var yPropCategories = props.categories && !Array.isArray(props.categories) ? props.categories.y : props.categories;
    var fallbackRequired = !xPropCategories || !yPropCategories;
    var fallbackProps10 = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
    var xCategories = xPropCategories || fallbackProps10.x;
    var yCategories = yPropCategories || fallbackProps10.y;
    return {
      x: xCategories.length > 0 ? xCategories : void 0,
      y: yCategories.length > 0 ? yCategories : void 0
    };
  }

  // node_modules/victory-shared-events/es/victory-shared-events.js
  var import_difference2 = __toESM(require_difference());
  var import_keys6 = __toESM(require_keys());
  var import_fromPairs = __toESM(require_fromPairs());
  var import_isEmpty5 = __toESM(require_isEmpty());
  var import_defaults14 = __toESM(require_defaults());
  var import_isFunction11 = __toESM(require_isFunction());
  var import_assign19 = __toESM(require_assign());
  var import_react71 = __toESM(require_react());
  var import_prop_types52 = __toESM(require_prop_types());
  var import_react_fast_compare4 = __toESM(require_react_fast_compare());
  var import_json_stringify_safe = __toESM(require_stringify());
  function _slicedToArray5(arr, i) {
    return _arrayWithHoles5(arr) || _iterableToArrayLimit5(arr, i) || _unsupportedIterableToArray15(arr, i) || _nonIterableRest5();
  }
  function _nonIterableRest5() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArrayLimit5(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null)
      return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i)
          break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null)
          _i["return"]();
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
  function _arrayWithHoles5(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function _toConsumableArray14(arr) {
    return _arrayWithoutHoles13(arr) || _iterableToArray13(arr) || _unsupportedIterableToArray15(arr) || _nonIterableSpread13();
  }
  function _nonIterableSpread13() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray15(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray15(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray15(o, minLen);
  }
  function _iterableToArray13(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles13(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray15(arr);
  }
  function _arrayLikeToArray15(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _classCallCheck11(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties10(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass11(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties10(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties10(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits9(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf8(subClass, superClass);
  }
  function _setPrototypeOf8(o, p2) {
    _setPrototypeOf8 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf8(o, p2);
  }
  function _createSuper8(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct8();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf8(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf8(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn9(this, result);
    };
  }
  function _possibleConstructorReturn9(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized8(self2);
  }
  function _assertThisInitialized8(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct8() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf8(o) {
    _getPrototypeOf8 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf8(o);
  }
  var VictorySharedEvents = /* @__PURE__ */ function(_React$Component) {
    _inherits9(VictorySharedEvents2, _React$Component);
    var _super = _createSuper8(VictorySharedEvents2);
    function VictorySharedEvents2(props) {
      var _this;
      _classCallCheck11(this, VictorySharedEvents2);
      _this = _super.call(this, props);
      _this.state = _this.state || {};
      _this.getScopedEvents = events_exports.getScopedEvents.bind(_assertThisInitialized8(_this));
      _this.getEventState = events_exports.getEventState.bind(_assertThisInitialized8(_this));
      _this.baseProps = _this.getBaseProps(props);
      _this.sharedEventsCache = {};
      _this.globalEvents = {};
      _this.prevGlobalEventKeys = [];
      _this.boundGlobalEvents = {};
      return _this;
    }
    _createClass11(VictorySharedEvents2, [{
      key: "shouldComponentUpdate",
      value: function shouldComponentUpdate(nextProps) {
        if (!(0, import_react_fast_compare4.default)(this.props, nextProps)) {
          this.baseProps = this.getBaseProps(nextProps);
          var externalMutations = this.getExternalMutations(nextProps, this.baseProps);
          this.applyExternalMutations(nextProps, externalMutations);
        }
        return true;
      }
    }, {
      key: "componentDidMount",
      value: function componentDidMount() {
        var _this2 = this;
        var globalEventKeys = (0, import_keys6.default)(this.globalEvents);
        globalEventKeys.forEach(function(key) {
          return _this2.addGlobalListener(key);
        });
        this.prevGlobalEventKeys = globalEventKeys;
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate() {
        var _this3 = this;
        var globalEventKeys = (0, import_keys6.default)(this.globalEvents);
        var removedGlobalEventKeys = (0, import_difference2.default)(this.prevGlobalEventKeys, globalEventKeys);
        removedGlobalEventKeys.forEach(function(key) {
          return _this3.removeGlobalListener(key);
        });
        var addedGlobalEventKeys = (0, import_difference2.default)(globalEventKeys, this.prevGlobalEventKeys);
        addedGlobalEventKeys.forEach(function(key) {
          return _this3.addGlobalListener(key);
        });
        this.prevGlobalEventKeys = globalEventKeys;
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        var _this4 = this;
        this.prevGlobalEventKeys.forEach(function(key) {
          return _this4.removeGlobalListener(key);
        });
      }
    }, {
      key: "addGlobalListener",
      value: function addGlobalListener(key) {
        var _this5 = this;
        var boundListener = function(event) {
          var listener3 = _this5.globalEvents[key];
          return listener3 && listener3(events_exports.emulateReactEvent(event));
        };
        this.boundGlobalEvents[key] = boundListener;
        window.addEventListener(events_exports.getGlobalEventNameFromKey(key), boundListener);
      }
    }, {
      key: "removeGlobalListener",
      value: function removeGlobalListener(key) {
        window.removeEventListener(events_exports.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
      }
    }, {
      key: "getAllEvents",
      value: function getAllEvents2(props) {
        var components = ["container", "groupComponent"];
        var componentEvents = events_exports.getComponentEvents(props, components);
        if (Array.isArray(componentEvents)) {
          return Array.isArray(props.events) ? componentEvents.concat.apply(componentEvents, _toConsumableArray14(props.events)) : componentEvents;
        }
        return props.events;
      }
    }, {
      key: "applyExternalMutations",
      value: function applyExternalMutations(props, externalMutations) {
        if (!(0, import_isEmpty5.default)(externalMutations)) {
          var callbacks = props.externalEventMutations.reduce(function(memo2, mutation) {
            memo2 = (0, import_isFunction11.default)(mutation.callback) ? memo2.concat(mutation.callback) : memo2;
            return memo2;
          }, []);
          var compiledCallbacks = callbacks.length ? function() {
            callbacks.forEach(function(c2) {
              return c2();
            });
          } : void 0;
          this.setState(externalMutations, compiledCallbacks);
        }
      }
    }, {
      key: "getExternalMutations",
      value: function getExternalMutations2(props, baseProps4) {
        return !(0, import_isEmpty5.default)(props.externalEventMutations) ? events_exports.getExternalMutationsWithChildren(props.externalEventMutations, baseProps4, this.state, (0, import_keys6.default)(baseProps4)) : void 0;
      }
    }, {
      key: "cacheSharedEvents",
      value: function cacheSharedEvents(name2, sharedEvents, cacheValues) {
        this.sharedEventsCache[name2] = [sharedEvents, cacheValues];
      }
    }, {
      key: "getCachedSharedEvents",
      value: function getCachedSharedEvents(name2, cacheValues) {
        var _ref2 = this.sharedEventsCache[name2] || [], _ref22 = _slicedToArray5(_ref2, 2), sharedEvents = _ref22[0], prevCacheValues = _ref22[1];
        if (sharedEvents && (0, import_react_fast_compare4.default)(cacheValues, prevCacheValues)) {
          return sharedEvents;
        }
        return void 0;
      }
    }, {
      key: "getBaseProps",
      value: function getBaseProps5(props) {
        var container = props.container;
        var children = import_react71.default.Children.toArray(this.props.children);
        var childBaseProps = this.getBasePropsFromChildren(children);
        var parentBaseProps = container ? container.props : {};
        return (0, import_assign19.default)({}, childBaseProps, {
          parent: parentBaseProps
        });
      }
    }, {
      key: "getBasePropsFromChildren",
      value: function getBasePropsFromChildren(childComponents) {
        var iteratee = function(child, childName) {
          if (child.type && (0, import_isFunction11.default)(child.type.getBaseProps)) {
            var _baseProps = child.props && child.type.getBaseProps(child.props);
            return _baseProps ? [[childName, _baseProps]] : null;
          }
          return null;
        };
        var baseProps4 = helpers_exports.reduceChildren(childComponents, iteratee);
        return (0, import_fromPairs.default)(baseProps4);
      }
    }, {
      key: "getNewChildren",
      value: function getNewChildren(props, baseProps4) {
        var _this6 = this;
        var events = props.events, eventKey = props.eventKey;
        var alterChildren = function(children, childNames2) {
          return children.reduce(function(memo2, child, index) {
            if (child.props.children) {
              var newChildren = import_react71.default.Children.toArray(child.props.children);
              var names = childNames2.slice(index, index + newChildren.length);
              var results = /* @__PURE__ */ import_react71.default.cloneElement(child, child.props, alterChildren(newChildren, names));
              return memo2.concat(results);
            } else if (childNames2[index] !== "parent" && child.type && (0, import_isFunction11.default)(child.type.getBaseProps)) {
              var name2 = child.props.name || childNames2[index];
              var childEvents = Array.isArray(events) && events.filter(function(event) {
                if (event.target === "parent") {
                  return false;
                }
                return Array.isArray(event.childName) ? event.childName.indexOf(name2) > -1 : event.childName === name2 || event.childName === "all";
              });
              var sharedEventsCacheValues = [name2, baseProps4, childEvents, (0, import_json_stringify_safe.default)(_this6.state[name2])];
              var sharedEvents = _this6.getCachedSharedEvents(name2, sharedEventsCacheValues) || {
                events: childEvents,
                // partially apply child name and baseProps,
                getEvents: function(evts, target) {
                  return _this6.getScopedEvents(evts, target, name2, baseProps4);
                },
                // partially apply child name
                getEventState: function(key, target) {
                  return _this6.getEventState(key, target, name2);
                }
              };
              _this6.cacheSharedEvents(name2, sharedEvents, sharedEventsCacheValues);
              return memo2.concat(/* @__PURE__ */ import_react71.default.cloneElement(child, (0, import_assign19.default)({
                key: "events-".concat(name2),
                sharedEvents,
                eventKey,
                name: name2
              }, child.props)));
            }
            return memo2.concat(child);
          }, []);
        };
        var childNames = (0, import_keys6.default)(baseProps4);
        var childComponents = import_react71.default.Children.toArray(props.children);
        return alterChildren(childComponents, childNames);
      }
    }, {
      key: "getContainer",
      value: function getContainer(props, baseProps4, events) {
        var _this7 = this;
        var children = this.getNewChildren(props, baseProps4);
        var parents = Array.isArray(events) && events.filter(function(event) {
          return event.target === "parent";
        });
        var sharedEvents = parents.length > 0 ? {
          events: parents,
          // partially apply childName (null) and baseProps,
          getEvents: function(evts, target) {
            return _this7.getScopedEvents(evts, target, null, baseProps4);
          },
          getEventState: this.getEventState
        } : null;
        var container = props.container || props.groupComponent;
        var role = container.type && container.type.role;
        var containerProps = container.props || {};
        var boundGetEvents = events_exports.getEvents.bind(this);
        var parentEvents = sharedEvents && boundGetEvents({
          sharedEvents
        }, "parent");
        var parentProps = (0, import_defaults14.default)({}, this.getEventState("parent", "parent"), containerProps, baseProps4.parent, {
          children
        });
        var containerEvents = (0, import_defaults14.default)({}, events_exports.getPartialEvents(parentEvents, "parent", parentProps), containerProps.events);
        this.globalEvents = events_exports.getGlobalEvents(containerEvents);
        var localEvents = events_exports.omitGlobalEvents(containerEvents);
        return role === "container" ? /* @__PURE__ */ import_react71.default.cloneElement(container, (0, import_assign19.default)({}, parentProps, {
          events: localEvents
        })) : /* @__PURE__ */ import_react71.default.cloneElement(container, localEvents, children);
      }
    }, {
      key: "render",
      value: function render() {
        var events = this.getAllEvents(this.props);
        if (events) {
          return this.getContainer(this.props, this.baseProps, events);
        }
        return /* @__PURE__ */ import_react71.default.cloneElement(this.props.container, {
          children: this.props.children
        });
      }
    }]);
    return VictorySharedEvents2;
  }(import_react71.default.Component);
  VictorySharedEvents.displayName = "VictorySharedEvents";
  VictorySharedEvents.role = "shared-event-wrapper";
  VictorySharedEvents.propTypes = {
    children: import_prop_types52.default.oneOfType([import_prop_types52.default.arrayOf(import_prop_types52.default.node), import_prop_types52.default.node]),
    container: import_prop_types52.default.node,
    eventKey: import_prop_types52.default.oneOfType([import_prop_types52.default.array, import_prop_types52.default.func, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types52.default.string]),
    events: import_prop_types52.default.arrayOf(import_prop_types52.default.shape({
      childName: import_prop_types52.default.oneOfType([import_prop_types52.default.string, import_prop_types52.default.array]),
      eventHandlers: import_prop_types52.default.object,
      eventKey: import_prop_types52.default.oneOfType([import_prop_types52.default.array, import_prop_types52.default.func, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types52.default.string]),
      target: import_prop_types52.default.string
    })),
    externalEventMutations: import_prop_types52.default.arrayOf(import_prop_types52.default.shape({
      callback: import_prop_types52.default.func,
      childName: import_prop_types52.default.oneOfType([import_prop_types52.default.string, import_prop_types52.default.array]),
      eventKey: import_prop_types52.default.oneOfType([import_prop_types52.default.array, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types52.default.string]),
      mutation: import_prop_types52.default.func,
      target: import_prop_types52.default.oneOfType([import_prop_types52.default.string, import_prop_types52.default.array])
    })),
    groupComponent: import_prop_types52.default.node
  };
  VictorySharedEvents.defaultProps = {
    groupComponent: /* @__PURE__ */ import_react71.default.createElement("g", null)
  };
  VictorySharedEvents.contextType = timer_context_default;

  // node_modules/victory-axis/es/victory-axis.js
  var import_isEmpty6 = __toESM(require_isEmpty());
  var import_assign21 = __toESM(require_assign());
  var import_prop_types53 = __toESM(require_prop_types());
  var import_react72 = __toESM(require_react());

  // node_modules/victory-axis/es/helper-methods.js
  var import_defaults15 = __toESM(require_defaults());
  var import_assign20 = __toESM(require_assign());
  function _toConsumableArray15(arr) {
    return _arrayWithoutHoles14(arr) || _iterableToArray14(arr) || _unsupportedIterableToArray16(arr) || _nonIterableSpread14();
  }
  function _nonIterableSpread14() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray16(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray16(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray16(o, minLen);
  }
  function _iterableToArray14(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles14(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray16(arr);
  }
  function _arrayLikeToArray16(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _defineProperty18(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var orientationSign = {
    top: -1,
    left: -1,
    right: 1,
    bottom: 1
  };
  var exists = function(val) {
    return val !== null && val !== void 0;
  };
  var getCurrentAxis2 = function(props, axis) {
    var orientation = props.orientation, horizontal = props.horizontal;
    if (orientation) {
      var dimensions = {
        top: "x",
        bottom: "x",
        left: "y",
        right: "y"
      };
      return dimensions[orientation];
    }
    var otherAxis = axis === "x" ? "y" : "x";
    return horizontal ? otherAxis : axis;
  };
  var getScale2 = function(props) {
    var axis = axis_exports.getAxis(props);
    var currentAxis = getCurrentAxis2(props, axis);
    var scale2 = scale_exports.getBaseScale(props, axis);
    var propsDomain = props.domain && props.domain[axis];
    var domain2 = propsDomain || axis_exports.getDomain(props) || scale2.domain();
    scale2.range(helpers_exports.getRange(props, currentAxis));
    scale2.domain(domain2);
    return scale2;
  };
  var getStyleObject = function(props) {
    var theme = props.theme, dependentAxis = props.dependentAxis;
    var generalAxisStyle = theme && theme.axis && theme.axis.style;
    var axisType = dependentAxis ? "dependentAxis" : "independentAxis";
    var specificAxisStyle = theme && theme[axisType] && theme[axisType].style;
    var mergeStyles = function() {
      var styleNamespaces = ["axis", "axisLabel", "grid", "parent", "tickLabels", "ticks"];
      return styleNamespaces.reduce(function(memo2, curr) {
        memo2[curr] = (0, import_defaults15.default)({}, specificAxisStyle[curr], generalAxisStyle[curr]);
        return memo2;
      }, {});
    };
    return generalAxisStyle && specificAxisStyle ? mergeStyles() : specificAxisStyle || generalAxisStyle;
  };
  var getStyles3 = function(props, styleObject) {
    var style = props.style || {};
    styleObject = styleObject || {};
    var parentStyleProps = {
      height: "100%",
      width: "100%"
    };
    return {
      parent: (0, import_defaults15.default)(style.parent, styleObject.parent, parentStyleProps),
      axis: (0, import_defaults15.default)({}, style.axis, styleObject.axis),
      axisLabel: (0, import_defaults15.default)({}, style.axisLabel, styleObject.axisLabel),
      grid: (0, import_defaults15.default)({}, style.grid, styleObject.grid),
      ticks: (0, import_defaults15.default)({}, style.ticks, styleObject.ticks),
      tickLabels: (0, import_defaults15.default)({}, style.tickLabels, styleObject.tickLabels)
    };
  };
  var getTickProps = function(layout, style, datum) {
    var position = layout.position, transform2 = layout.transform;
    return {
      x1: transform2.x,
      y1: transform2.y,
      x2: transform2.x + position.x2,
      y2: transform2.y + position.y2,
      style,
      datum
    };
  };
  var getTickLabelProps = function(layout, style, anchors, datum, text) {
    var position = layout.position, transform2 = layout.transform;
    return {
      style,
      x: transform2.x + position.x,
      y: transform2.y + position.y,
      verticalAnchor: anchors.verticalAnchor,
      textAnchor: anchors.textAnchor,
      angle: style.angle,
      text,
      datum
    };
  };
  var getGridProps = function(layout, style, datum) {
    var edge = layout.edge, transform2 = layout.transform;
    return {
      x1: transform2.x,
      y1: transform2.y,
      x2: edge.x + transform2.x,
      y2: edge.y + transform2.y,
      style,
      datum
    };
  };
  var getAxisProps = function(modifiedProps, calculatedValues, globalTransform) {
    var style = calculatedValues.style, padding2 = calculatedValues.padding, isVertical2 = calculatedValues.isVertical;
    var width = modifiedProps.width, height = modifiedProps.height;
    return {
      style: style.axis,
      x1: isVertical2 ? globalTransform.x : padding2.left + globalTransform.x,
      x2: isVertical2 ? globalTransform.x : width - padding2.right + globalTransform.x,
      y1: isVertical2 ? padding2.top + globalTransform.y : globalTransform.y,
      y2: isVertical2 ? height - padding2.bottom + globalTransform.y : globalTransform.y
    };
  };
  var getEvaluatedStyles = function(style, props) {
    return {
      tickStyle: helpers_exports.evaluateStyle(style.ticks, props),
      labelStyle: helpers_exports.evaluateStyle(style.tickLabels, props),
      gridStyle: helpers_exports.evaluateStyle(style.grid, props)
    };
  };
  var getAxisLabelProps = function(props, calculatedValues, globalTransform) {
    var style = calculatedValues.style, orientation = calculatedValues.orientation, padding2 = calculatedValues.padding, labelPadding = calculatedValues.labelPadding, isVertical2 = calculatedValues.isVertical;
    var sign2 = orientationSign[orientation];
    var hPadding = padding2.left + padding2.right;
    var vPadding = padding2.top + padding2.bottom;
    var verticalAnchor = sign2 < 0 ? "end" : "start";
    var labelStyle = style.axisLabel;
    var angle = isVertical2 ? -90 : 0;
    var x2 = isVertical2 ? globalTransform.x + sign2 * labelPadding : (props.width - hPadding) / 2 + padding2.left + globalTransform.x;
    var y2 = isVertical2 ? (props.height - vPadding) / 2 + padding2.top + globalTransform.y : sign2 * labelPadding + globalTransform.y;
    return {
      x: x2,
      y: y2,
      verticalAnchor: labelStyle.verticalAnchor || verticalAnchor,
      textAnchor: labelStyle.textAnchor || "middle",
      angle: labelStyle.angle === void 0 ? angle : labelStyle.angle,
      style: labelStyle,
      text: props.label
    };
  };
  var getAnchors = function(orientation, isVertical2) {
    var anchorOrientation = {
      top: "end",
      left: "end",
      right: "start",
      bottom: "start"
    };
    var anchor = anchorOrientation[orientation];
    return {
      textAnchor: isVertical2 ? anchor : "middle",
      verticalAnchor: isVertical2 ? "middle" : anchor
    };
  };
  var getLabelPadding = function(props, style) {
    var labelStyle = style.axisLabel || {};
    if (labelStyle.padding !== void 0 && labelStyle.padding !== null) {
      return labelStyle.padding;
    }
    var isVertical2 = axis_exports.isVertical(props);
    var fontSize3 = labelStyle.fontSize || 14;
    return props.label ? fontSize3 * (isVertical2 ? 2.3 : 1.6) : 0;
  };
  var getDefaultOrientations = function(axis, originSign, horizontal) {
    var sign2 = originSign || "positive";
    var orientations = {
      positive: {
        x: "bottom",
        y: "left"
      },
      negative: {
        x: "top",
        y: "right"
      }
    };
    var horizontalOrientations = {
      positive: {
        x: "left",
        y: "bottom"
      },
      negative: {
        x: "right",
        y: "top"
      }
    };
    return horizontal ? horizontalOrientations[sign2][axis] : orientations[sign2][axis];
  };
  var getStandaloneOffset = function(props, calculatedValues) {
    var style = calculatedValues.style, scale2 = calculatedValues.scale, orientation = calculatedValues.orientation, padding2 = calculatedValues.padding, axis = calculatedValues.axis, ticks2 = calculatedValues.ticks, stringTicks2 = calculatedValues.stringTicks, isVertical2 = calculatedValues.isVertical, labelPadding = calculatedValues.labelPadding;
    var polar = props.polar, horizontal = props.horizontal;
    var sharedProps = {
      scale: _defineProperty18({}, axis, scale2),
      polar,
      horizontal,
      ticks: ticks2,
      stringTicks: stringTicks2
    };
    var xPadding = orientation === "right" ? padding2.right : padding2.left;
    var yPadding = orientation === "top" ? padding2.top : padding2.bottom;
    var offsetX = props.offsetX !== null && props.offsetX !== void 0 ? props.offsetX : xPadding;
    var offsetY = props.offsetY !== null && props.offsetY !== void 0 ? props.offsetY : yPadding;
    var fontSize3 = style.axisLabel.fontSize || 14;
    var tickSizes = ticks2.map(function(data, index) {
      var tick = stringTicks2 ? props.tickValues[data - 1] : data;
      var tickStyle = helpers_exports.evaluateStyle(style.ticks, (0, import_assign20.default)({}, sharedProps, {
        tick,
        index
      }));
      return tickStyle.size || 0;
    });
    var totalPadding = fontSize3 + 2 * Math.max.apply(Math, _toConsumableArray15(tickSizes)) + labelPadding;
    var minimumPadding = 1.2 * fontSize3;
    var x2 = isVertical2 ? totalPadding : minimumPadding;
    var y2 = isVertical2 ? minimumPadding : totalPadding;
    return {
      x: offsetX !== null && offsetX !== void 0 ? offsetX : x2,
      y: offsetY !== null && offsetY !== void 0 ? offsetY : y2
    };
  };
  var getOffset2 = function(props, calculatedValues) {
    var scale2 = calculatedValues.scale, origin = calculatedValues.origin, orientation = calculatedValues.orientation, orientations = calculatedValues.orientations, domain2 = calculatedValues.domain, padding2 = calculatedValues.padding;
    var top2 = padding2.top, bottom2 = padding2.bottom, left2 = padding2.left, right2 = padding2.right;
    var calculatedOrientation = {
      x: orientation === "bottom" || orientation === "top" ? orientation : orientations.x,
      y: orientation === "left" || orientation === "right" ? orientation : orientations.y
    };
    var orientationOffset = {
      x: calculatedOrientation.y === "left" ? left2 : right2,
      y: calculatedOrientation.x === "bottom" ? bottom2 : top2
    };
    var originOffset = {
      x: calculatedOrientation.y === "left" ? 0 : props.width,
      y: calculatedOrientation.x === "bottom" ? props.height : 0
    };
    var originPosition = {
      x: origin.x === domain2.x[0] || origin.x === domain2.x[1] ? 0 : scale2.x(origin.x),
      y: origin.y === domain2.y[0] || origin.y === domain2.y[1] ? 0 : scale2.y(origin.y)
    };
    var x2 = originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x;
    var y2 = originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y;
    var offsetX = exists(props.offsetX) ? props.offsetX : x2;
    var offsetY = exists(props.offsetY) ? props.offsetY : y2;
    return {
      x: offsetX,
      y: offsetY
    };
  };
  var getHorizontalOffset = function(props, calculatedValues) {
    var scale2 = calculatedValues.scale, origin = calculatedValues.origin, orientation = calculatedValues.orientation, orientations = calculatedValues.orientations, domain2 = calculatedValues.domain, padding2 = calculatedValues.padding;
    var top2 = padding2.top, bottom2 = padding2.bottom, left2 = padding2.left, right2 = padding2.right;
    var calculatedOrientation = {
      y: orientation === "bottom" || orientation === "top" ? orientation : orientations.x,
      x: orientation === "left" || orientation === "right" ? orientation : orientations.y
    };
    var orientationOffset = {
      x: calculatedOrientation.y === "bottom" ? bottom2 : top2,
      y: calculatedOrientation.x === "left" ? left2 : right2
    };
    var originOffset = {
      y: calculatedOrientation.x === "left" ? 0 : props.width,
      x: calculatedOrientation.y === "bottom" ? props.height : 0
    };
    var originPosition = {
      x: origin.x === domain2.x[0] || origin.x === domain2.x[1] ? 0 : scale2.x(origin.x),
      y: origin.y === domain2.y[0] || origin.y === domain2.y[1] ? 0 : scale2.y(origin.y)
    };
    var y2 = originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x;
    var x2 = originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y;
    var offsetX = exists(props.offsetX) ? props.offsetX : x2;
    var offsetY = exists(props.offsetY) ? props.offsetY : y2;
    return {
      x: offsetX,
      y: offsetY
    };
  };
  var getTransform2 = function(props, calculatedValues, offset2) {
    var orientation = calculatedValues.orientation, axis = calculatedValues.axis;
    var axisValue = axis_exports.getAxisValue(props, axis);
    return {
      top: {
        x: 0,
        y: axisValue !== void 0 ? axisValue : offset2.y
      },
      bottom: {
        x: 0,
        y: axisValue !== void 0 ? axisValue : props.height - offset2.y
      },
      left: {
        x: axisValue !== void 0 ? axisValue : offset2.x,
        y: 0
      },
      right: {
        x: axisValue !== void 0 ? axisValue : props.width - offset2.x,
        y: 0
      }
    }[orientation];
  };
  var getTickPosition = function(style, orientation, isVertical2) {
    var tickStyle = style.tickStyle, labelStyle = style.labelStyle;
    var size = tickStyle.size || 0;
    var tickPadding = tickStyle.padding || 0;
    var labelPadding = labelStyle.padding || 0;
    var tickSpacing = size + tickPadding + labelPadding;
    var sign2 = orientationSign[orientation];
    return {
      x: isVertical2 ? sign2 * tickSpacing : 0,
      x2: isVertical2 ? sign2 * size : 0,
      y: isVertical2 ? 0 : sign2 * tickSpacing,
      y2: isVertical2 ? 0 : sign2 * size
    };
  };
  var getTickTransform = function(tick, globalTransform, isVertical2) {
    return {
      x: isVertical2 ? globalTransform.x : tick + globalTransform.x,
      y: isVertical2 ? tick + globalTransform.y : globalTransform.y
    };
  };
  var getGridEdge = function(props, calculatedValues) {
    var orientation = calculatedValues.orientation, padding2 = calculatedValues.padding, isVertical2 = calculatedValues.isVertical;
    var sign2 = -orientationSign[orientation];
    var x2 = isVertical2 ? sign2 * (props.width - (padding2.left + padding2.right)) : 0;
    var y2 = isVertical2 ? 0 : sign2 * (props.height - (padding2.top + padding2.bottom));
    return {
      x: x2,
      y: y2
    };
  };
  var getGridOffset = function(calculatedValues, offset2) {
    var padding2 = calculatedValues.padding, orientation = calculatedValues.orientation, crossAxis = calculatedValues.crossAxis;
    var xPadding = orientation === "right" ? padding2.right : padding2.left;
    var yPadding = orientation === "top" ? padding2.top : padding2.bottom;
    return {
      x: crossAxis ? offset2.x - xPadding : 0,
      y: crossAxis ? offset2.y - yPadding : 0
    };
  };
  var getLayoutProps = function(modifiedProps, calculatedValues) {
    var offset2;
    if (calculatedValues.domain.x && calculatedValues.domain.y) {
      offset2 = modifiedProps.horizontal ? getHorizontalOffset(modifiedProps, calculatedValues) : getOffset2(modifiedProps, calculatedValues);
    } else {
      offset2 = getStandaloneOffset(modifiedProps, calculatedValues);
    }
    return {
      globalTransform: getTransform2(modifiedProps, calculatedValues, offset2),
      gridOffset: getGridOffset(calculatedValues, offset2),
      gridEdge: getGridEdge(modifiedProps, calculatedValues)
    };
  };
  var getOrientation = function(props) {
    if (props.orientation) {
      return props.orientation;
    }
    var defaultOrientations = {
      dependent: props.horizontal ? "bottom" : "left",
      independent: props.horizontal ? "left" : "bottom"
    };
    return props.dependentAxis ? defaultOrientations.dependent : defaultOrientations.independent;
  };
  var getCalculatedValues = function(props) {
    var defaultStyles2 = getStyleObject(props);
    var style = getStyles3(props, defaultStyles2);
    var padding2 = helpers_exports.getPadding(props);
    var labelPadding = getLabelPadding(props, style);
    var stringTicks2 = axis_exports.stringTicks(props) ? props.tickValues : void 0;
    var axis = axis_exports.getAxis(props);
    var axisDomain = axis_exports.getDomain(props);
    var axisScale = getScale2(props);
    var xAxisDomain = axis === "x" ? axisDomain : void 0;
    var yAxisDomain = axis === "y" ? axisDomain : void 0;
    var xAxisScale = axis === "x" ? axisScale : void 0;
    var yAxisScale = axis === "y" ? axisScale : void 0;
    var crossAxis = !(props.crossAxis === false || props.standalone === true);
    var ticks2 = axis_exports.getTicks(props, axisScale, crossAxis);
    var tickFormat2 = axis_exports.getTickFormat(props, axisScale);
    var range2 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    var domain2 = {
      x: props.domain && props.domain.x ? props.domain.x : xAxisDomain,
      y: props.domain && props.domain.y ? props.domain.y : yAxisDomain
    };
    var scale2 = {
      x: props.domain && props.domain.x ? scale_exports.getBaseScale(props, "x").domain(props.domain.x).range(props.horizontal ? range2.y : range2.x) : xAxisScale,
      y: props.domain && props.domain.y ? scale_exports.getBaseScale(props, "y").domain(props.domain.y).range(props.horizontal ? range2.x : range2.y) : yAxisScale
    };
    var origin = domain2.x && domain2.y ? axis_exports.getOrigin(domain2) : void 0;
    var originSign = origin ? {
      x: axis_exports.getOriginSign(origin.x, domain2.x),
      y: axis_exports.getOriginSign(origin.y, domain2.y)
    } : void 0;
    var orientations = originSign ? {
      x: getDefaultOrientations("x", originSign.y, props.horizontal),
      y: getDefaultOrientations("y", originSign.x, props.horizontal)
    } : void 0;
    var orientation = orientations ? props.orientation || orientations[axis] : getOrientation(props);
    var isVertical2 = axis_exports.isVertical(Object.assign({}, props, {
      orientation
    }));
    var anchors = getAnchors(orientation, isVertical2);
    return {
      anchors,
      axis,
      crossAxis,
      domain: domain2,
      isVertical: isVertical2,
      labelPadding,
      orientation,
      orientations,
      origin,
      padding: padding2,
      scale: scale2,
      stringTicks: stringTicks2,
      style,
      tickFormat: tickFormat2,
      ticks: ticks2
    };
  };
  var getBaseProps = function(props, fallbackProps10) {
    props = axis_exports.modifyProps(props, fallbackProps10);
    var calculatedValues = getCalculatedValues(props);
    var axis = calculatedValues.axis, style = calculatedValues.style, orientation = calculatedValues.orientation, isVertical2 = calculatedValues.isVertical, scale2 = calculatedValues.scale, ticks2 = calculatedValues.ticks, tickFormat2 = calculatedValues.tickFormat, anchors = calculatedValues.anchors, domain2 = calculatedValues.domain, stringTicks2 = calculatedValues.stringTicks;
    var otherAxis = axis === "x" ? "y" : "x";
    var _props = props, width = _props.width, height = _props.height, standalone = _props.standalone, theme = _props.theme, polar = _props.polar, padding2 = _props.padding, horizontal = _props.horizontal;
    var _getLayoutProps = getLayoutProps(props, calculatedValues), globalTransform = _getLayoutProps.globalTransform, gridOffset = _getLayoutProps.gridOffset, gridEdge = _getLayoutProps.gridEdge;
    var sharedProps = {
      scale: _defineProperty18({}, axis, scale2[axis]),
      polar,
      horizontal,
      ticks: ticks2,
      stringTicks: stringTicks2
    };
    var axisProps = getAxisProps(props, calculatedValues, globalTransform);
    var axisLabelProps = getAxisLabelProps(props, calculatedValues, globalTransform);
    var initialChildProps = {
      parent: (0, import_assign20.default)({
        style: style.parent,
        ticks: ticks2,
        standalone,
        theme,
        width,
        height,
        padding: padding2,
        domain: domain2
      }, sharedProps)
    };
    var gridProps = {
      dimension: otherAxis,
      range: _defineProperty18({}, otherAxis, helpers_exports.getRange(props, otherAxis)),
      scale: props.scale && props.scale[otherAxis] ? _defineProperty18({}, otherAxis, props.scale[otherAxis]) : void 0
    };
    return ticks2.reduce(function(childProps, tickValue, index) {
      var _scale$axis, _scale$axis2, _scale$axis3;
      var tick = stringTicks2 ? stringTicks2[index] : tickValue;
      var text = tickFormat2(tickValue, index, ticks2);
      var styles164 = getEvaluatedStyles(style, (0, import_assign20.default)({}, sharedProps, {
        tick,
        tickValue,
        index,
        text
      }));
      var tickLayout = {
        position: getTickPosition(styles164, orientation, isVertical2),
        transform: getTickTransform((_scale$axis = scale2[axis]) === null || _scale$axis === void 0 ? void 0 : _scale$axis.call(scale2, tickValue), globalTransform, isVertical2)
      };
      var gridLayout = {
        edge: gridEdge,
        transform: {
          x: isVertical2 ? -gridOffset.x + globalTransform.x : ((_scale$axis2 = scale2[axis]) === null || _scale$axis2 === void 0 ? void 0 : _scale$axis2.call(scale2, tickValue)) + globalTransform.x,
          y: isVertical2 ? ((_scale$axis3 = scale2[axis]) === null || _scale$axis3 === void 0 ? void 0 : _scale$axis3.call(scale2, tickValue)) + globalTransform.y : gridOffset.y + globalTransform.y
        }
      };
      childProps[index] = {
        axis: (0, import_assign20.default)({
          dimension: axis
        }, sharedProps, axisProps),
        axisLabel: (0, import_assign20.default)({}, sharedProps, axisLabelProps),
        ticks: (0, import_assign20.default)({}, sharedProps, getTickProps(tickLayout, styles164.tickStyle, tickValue)),
        tickLabels: (0, import_assign20.default)({}, sharedProps, getTickLabelProps(tickLayout, styles164.labelStyle, anchors, tickValue, text)),
        grid: (0, import_assign20.default)({}, sharedProps, gridProps, getGridProps(gridLayout, styles164.gridStyle, tickValue))
      };
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-axis/es/victory-axis.js
  function ownKeys14(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread14(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys14(Object(source), true).forEach(function(key) {
        _defineProperty19(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys14(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty19(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toConsumableArray16(arr) {
    return _arrayWithoutHoles15(arr) || _iterableToArray15(arr) || _unsupportedIterableToArray17(arr) || _nonIterableSpread15();
  }
  function _nonIterableSpread15() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray17(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray17(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray17(o, minLen);
  }
  function _iterableToArray15(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles15(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray17(arr);
  }
  function _arrayLikeToArray17(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _classCallCheck12(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties11(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass12(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties11(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties11(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits10(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf9(subClass, superClass);
  }
  function _setPrototypeOf9(o, p2) {
    _setPrototypeOf9 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf9(o, p2);
  }
  function _createSuper9(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct9();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf9(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf9(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn10(this, result);
    };
  }
  function _possibleConstructorReturn10(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized9(self2);
  }
  function _assertThisInitialized9(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct9() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf9(o) {
    _getPrototypeOf9 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf9(o);
  }
  var fallbackProps = {
    width: 450,
    height: 300,
    padding: 50
  };
  var options = {
    components: [{
      name: "axis",
      index: 0
    }, {
      name: "axisLabel",
      index: 0
    }, {
      name: "grid"
    }, {
      name: "parent",
      index: "parent"
    }, {
      name: "ticks"
    }, {
      name: "tickLabels"
    }]
  };
  var VictoryAxisBase = /* @__PURE__ */ function(_React$Component) {
    _inherits10(VictoryAxisBase2, _React$Component);
    var _super = _createSuper9(VictoryAxisBase2);
    function VictoryAxisBase2() {
      _classCallCheck12(this, VictoryAxisBase2);
      return _super.apply(this, arguments);
    }
    _createClass12(VictoryAxisBase2, [{
      key: "renderLine",
      value: function renderLine(props) {
        var axisComponent = props.axisComponent;
        var axisProps = this.getComponentProps(axisComponent, "axis", 0);
        return /* @__PURE__ */ import_react72.default.cloneElement(axisComponent, axisProps);
      }
    }, {
      key: "renderLabel",
      value: function renderLabel2(props) {
        var axisLabelComponent = props.axisLabelComponent, label = props.label;
        if (!label) {
          return null;
        }
        var axisLabelProps = this.getComponentProps(axisLabelComponent, "axisLabel", 0);
        return /* @__PURE__ */ import_react72.default.cloneElement(axisLabelComponent, axisLabelProps);
      }
    }, {
      key: "renderGridAndTicks",
      value: function renderGridAndTicks(props) {
        var _this = this;
        var tickComponent = props.tickComponent, tickLabelComponent = props.tickLabelComponent, gridComponent = props.gridComponent, name2 = props.name;
        var shouldRender = function(componentProps) {
          var _componentProps$style = componentProps.style, style = _componentProps$style === void 0 ? {} : _componentProps$style, _componentProps$event = componentProps.events, events = _componentProps$event === void 0 ? {} : _componentProps$event;
          var visible = style.stroke !== "transparent" && style.stroke !== "none" && style.strokeWidth !== 0;
          return visible || !(0, import_isEmpty6.default)(events);
        };
        return this.dataKeys.map(function(key, index) {
          var tickProps = _this.getComponentProps(tickComponent, "ticks", index);
          var BaseTickComponent = /* @__PURE__ */ import_react72.default.cloneElement(tickComponent, tickProps);
          var TickComponent = shouldRender(BaseTickComponent.props) ? BaseTickComponent : void 0;
          var gridProps = _this.getComponentProps(gridComponent, "grid", index);
          var BaseGridComponent = /* @__PURE__ */ import_react72.default.cloneElement(gridComponent, gridProps);
          var GridComponent = shouldRender(BaseGridComponent.props) ? BaseGridComponent : void 0;
          var tickLabelProps = _this.getComponentProps(tickLabelComponent, "tickLabels", index);
          var TickLabel = /* @__PURE__ */ import_react72.default.cloneElement(tickLabelComponent, tickLabelProps);
          var children = [GridComponent, TickComponent, TickLabel].filter(Boolean);
          return /* @__PURE__ */ import_react72.default.cloneElement(props.groupComponent, {
            key: "".concat(name2, "-tick-group-").concat(key)
          }, children);
        });
      }
    }, {
      key: "fixLabelOverlap",
      value: function fixLabelOverlap(gridAndTicks, props) {
        var isVertical2 = axis_exports.isVertical(props);
        var size = isVertical2 ? props.height : props.width;
        var isVictoryLabel = function(child) {
          return child.type && child.type.role === "label";
        };
        var labels = gridAndTicks.map(function(gridAndTick) {
          return gridAndTick.props.children;
        }).reduce(function(accumulator, childArr) {
          return accumulator.concat(childArr);
        }, []).filter(isVictoryLabel).map(function(child) {
          return child.props;
        });
        var paddingToObject = function(padding2) {
          return typeof padding2 === "object" ? (0, import_assign21.default)({}, {
            top: 0,
            right: 0,
            bottom: 0,
            left: 0
          }, padding2) : {
            top: padding2,
            right: padding2,
            bottom: padding2,
            left: padding2
          };
        };
        var labelsSumSize = labels.reduce(function(sum2, label) {
          var padding2 = paddingToObject(label.style.padding);
          var labelSize = textsize_exports.approximateTextSize(label.text, {
            angle: label.angle,
            fontSize: label.style.fontSize,
            letterSpacing: label.style.letterSpacing,
            fontFamily: label.style.fontFamily
          });
          return sum2 + (isVertical2 ? labelSize.height + padding2.top + padding2.bottom : labelSize.width + padding2.right + padding2.left);
        }, 0);
        var availiableLabelCount = Math.floor(size * gridAndTicks.length / labelsSumSize);
        var divider = Math.ceil(gridAndTicks.length / availiableLabelCount) || 1;
        var getLabelCoord = function(gridAndTick) {
          return gridAndTick.props.children.filter(isVictoryLabel).reduce(function(prev, child) {
            return (isVertical2 ? child.props.y : child.props.x) || 0;
          }, 0);
        };
        var sorted = gridAndTicks.sort(
          function(a2, b) {
            return isVertical2 ? getLabelCoord(b) - getLabelCoord(a2) : getLabelCoord(a2) - getLabelCoord(b);
          }
          // ordinary axis has left-right orientation
        );
        return sorted.filter(function(gridAndTick, index) {
          return index % divider === 0;
        });
      }
      // Overridden in native versions
    }, {
      key: "shouldAnimate",
      value: function shouldAnimate() {
        return !!this.props.animate;
      }
    }, {
      key: "render",
      value: function render() {
        var animationWhitelist = VictoryAxis.animationWhitelist;
        var props = axis_exports.modifyProps(this.props, fallbackProps);
        var userProps = user_props_exports.getSafeUserProps(this.props);
        if (this.shouldAnimate()) {
          return this.animateComponent(props, animationWhitelist);
        }
        var gridAndTicks = this.renderGridAndTicks(props);
        var modifiedGridAndTicks = props.fixLabelOverlap ? this.fixLabelOverlap(gridAndTicks, props) : gridAndTicks;
        var children = [this.renderLine(props), this.renderLabel(props)].concat(_toConsumableArray16(modifiedGridAndTicks));
        var container = /* @__PURE__ */ import_react72.default.cloneElement(props.containerComponent, userProps);
        return props.standalone ? this.renderContainer(container, children) : /* @__PURE__ */ import_react72.default.cloneElement(props.groupComponent, userProps, children);
      }
    }]);
    return VictoryAxisBase2;
  }(import_react72.default.Component);
  VictoryAxisBase.animationWhitelist = ["style", "domain", "range", "tickCount", "tickValues", "offsetX", "offsetY", "padding", "width", "height"];
  VictoryAxisBase.displayName = "VictoryAxis";
  VictoryAxisBase.role = "axis";
  VictoryAxisBase.defaultTransitions = {
    onExit: {
      duration: 500
    },
    onEnter: {
      duration: 500
    }
  };
  VictoryAxisBase.propTypes = _objectSpread14(_objectSpread14({}, CommonProps.baseProps), {}, {
    axisComponent: import_prop_types53.default.element,
    axisLabelComponent: import_prop_types53.default.element,
    axisValue: import_prop_types53.default.oneOfType([import_prop_types53.default.number, import_prop_types53.default.string, import_prop_types53.default.object]),
    categories: import_prop_types53.default.oneOfType([import_prop_types53.default.arrayOf(import_prop_types53.default.string), import_prop_types53.default.shape({
      x: import_prop_types53.default.arrayOf(import_prop_types53.default.string),
      y: import_prop_types53.default.arrayOf(import_prop_types53.default.string)
    })]),
    crossAxis: import_prop_types53.default.bool,
    dependentAxis: import_prop_types53.default.bool,
    events: import_prop_types53.default.arrayOf(import_prop_types53.default.shape({
      target: import_prop_types53.default.oneOf(["axis", "axisLabel", "grid", "ticks", "tickLabels"]),
      eventKey: import_prop_types53.default.oneOfType([import_prop_types53.default.array, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types53.default.string]),
      eventHandlers: import_prop_types53.default.object
    })),
    fixLabelOverlap: import_prop_types53.default.bool,
    gridComponent: import_prop_types53.default.element,
    groupComponent: import_prop_types53.default.element,
    invertAxis: import_prop_types53.default.bool,
    label: import_prop_types53.default.any,
    offsetX: import_prop_types53.default.number,
    offsetY: import_prop_types53.default.number,
    orientation: import_prop_types53.default.oneOf(["top", "bottom", "left", "right"]),
    origin: import_prop_types53.default.shape({
      x: import_prop_types53.default.number,
      y: import_prop_types53.default.number
    }),
    stringMap: import_prop_types53.default.object,
    style: import_prop_types53.default.shape({
      parent: import_prop_types53.default.object,
      axis: import_prop_types53.default.object,
      axisLabel: import_prop_types53.default.object,
      grid: import_prop_types53.default.object,
      ticks: import_prop_types53.default.object,
      tickLabels: import_prop_types53.default.object
    }),
    tickComponent: import_prop_types53.default.element,
    tickCount: prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.greaterThanZero]),
    tickFormat: import_prop_types53.default.oneOfType([import_prop_types53.default.func, prop_types_exports.homogeneousArray]),
    tickLabelComponent: import_prop_types53.default.element,
    tickValues: prop_types_exports.homogeneousArray
  });
  VictoryAxisBase.defaultProps = {
    axisComponent: /* @__PURE__ */ import_react72.default.createElement(LineSegment, null),
    axisLabelComponent: /* @__PURE__ */ import_react72.default.createElement(VictoryLabel, null),
    tickLabelComponent: /* @__PURE__ */ import_react72.default.createElement(VictoryLabel, null),
    tickComponent: /* @__PURE__ */ import_react72.default.createElement(LineSegment, null),
    gridComponent: /* @__PURE__ */ import_react72.default.createElement(LineSegment, null),
    standalone: true,
    theme: VictoryTheme.grayscale,
    containerComponent: /* @__PURE__ */ import_react72.default.createElement(VictoryContainer, null),
    groupComponent: /* @__PURE__ */ import_react72.default.createElement("g", {
      role: "presentation"
    }),
    fixLabelOverlap: false
  };
  VictoryAxisBase.getDomain = axis_exports.getDomain;
  VictoryAxisBase.getAxis = axis_exports.getAxis;
  VictoryAxisBase.getStyles = function(props) {
    return getStyles3(props);
  };
  VictoryAxisBase.getBaseProps = function(props) {
    return getBaseProps(props, fallbackProps);
  };
  VictoryAxisBase.expectedComponents = ["axisComponent", "axisLabelComponent", "groupComponent", "containerComponent", "tickComponent", "tickLabelComponent", "gridComponent"];
  var VictoryAxis = addEvents(VictoryAxisBase, options);

  // node_modules/victory-polar-axis/es/victory-polar-axis.js
  var import_isEmpty7 = __toESM(require_isEmpty());
  var import_assign23 = __toESM(require_assign());
  var import_react73 = __toESM(require_react());
  var import_prop_types54 = __toESM(require_prop_types());

  // node_modules/victory-polar-axis/es/helper-methods.js
  var import_defaults16 = __toESM(require_defaults());
  var import_uniqBy2 = __toESM(require_uniqBy());
  var import_assign22 = __toESM(require_assign());
  var getPosition3 = function(r, angle, axis) {
    return axis === "x" ? r * Math.cos(angle) : -r * Math.sin(angle);
  };
  var getAxisType = function(props) {
    var typicalType = props.dependentAxis ? "radial" : "angular";
    var invertedType = typicalType === "angular" ? "radial" : "angular";
    return props.horizontal ? invertedType : typicalType;
  };
  var filterTicks = function(ticks2, scale2) {
    var compareTicks = function(t) {
      return scale2(t) % (2 * Math.PI);
    };
    return (0, import_uniqBy2.default)(ticks2, compareTicks);
  };
  var getEvaluatedStyles2 = function(style, props) {
    return {
      tickStyle: helpers_exports.evaluateStyle(style.ticks, props),
      labelStyle: helpers_exports.evaluateStyle(style.tickLabels, props),
      gridStyle: helpers_exports.evaluateStyle(style.grid, props)
    };
  };
  var getStyleObject2 = function(props) {
    var _props$theme = props.theme, theme = _props$theme === void 0 ? {} : _props$theme, dependentAxis = props.dependentAxis;
    var generalAxisStyle = theme.polarAxis && theme.polarAxis.style || theme.axis && theme.axis.style;
    var polarAxisType = dependentAxis ? "polarDependentAxis" : "polarIndependentAxis";
    var standardAxisType = dependentAxis ? "dependentAxis" : "independentAxis";
    var specificAxisStyle = theme[polarAxisType] && theme[polarAxisType].style || theme[standardAxisType] && theme[standardAxisType].style;
    var mergeStyles = function() {
      var styleNamespaces = ["axis", "axisLabel", "grid", "parent", "tickLabels", "ticks"];
      return styleNamespaces.reduce(function(memo2, curr) {
        memo2[curr] = (0, import_defaults16.default)({}, specificAxisStyle[curr], generalAxisStyle[curr]);
        return memo2;
      }, {});
    };
    return generalAxisStyle && specificAxisStyle ? mergeStyles() : specificAxisStyle || generalAxisStyle;
  };
  var getRadius2 = function(props) {
    var _Helpers$getPadding = helpers_exports.getPadding(props), left2 = _Helpers$getPadding.left, right2 = _Helpers$getPadding.right, top2 = _Helpers$getPadding.top, bottom2 = _Helpers$getPadding.bottom;
    var width = props.width, height = props.height;
    return Math.min(width - left2 - right2, height - top2 - bottom2) / 2;
  };
  var getRange2 = function(props, axis) {
    if (props.range && props.range[axis]) {
      return props.range[axis];
    } else if (props.range && Array.isArray(props.range)) {
      return props.range;
    }
    var axisType = getAxisType(props);
    if (axisType === "angular") {
      var startAngle = helpers_exports.degreesToRadians(props.startAngle);
      var endAngle = helpers_exports.degreesToRadians(props.endAngle);
      return [startAngle, endAngle];
    }
    var radius = getRadius2(props);
    return [props.innerRadius || 0, radius];
  };
  var getScale3 = function(props) {
    var axis = axis_exports.getAxis(props);
    var scale2 = scale_exports.getBaseScale(props, axis);
    var domain2 = axis_exports.getDomain(props, axis) || scale2.domain();
    var range2 = getRange2(props, axis);
    scale2.range(range2);
    scale2.domain(domain2);
    return scale2;
  };
  var getStyles4 = function(props, styleObject) {
    if (props.disableInlineStyles) {
      return {};
    }
    var style = props.style || {};
    styleObject = styleObject || {};
    var parentStyleProps = {
      height: "auto",
      width: "100%"
    };
    return {
      parent: (0, import_defaults16.default)(parentStyleProps, style.parent, styleObject.parent),
      axis: (0, import_defaults16.default)({}, style.axis, styleObject.axis),
      axisLabel: (0, import_defaults16.default)({}, style.axisLabel, styleObject.axisLabel),
      grid: (0, import_defaults16.default)({}, style.grid, styleObject.grid),
      ticks: (0, import_defaults16.default)({}, style.ticks, styleObject.ticks),
      tickLabels: (0, import_defaults16.default)({}, style.tickLabels, styleObject.tickLabels)
    };
  };
  var getAxisAngle = function(props) {
    var axisAngle = props.axisAngle, startAngle = props.startAngle, dependentAxis = props.dependentAxis;
    var axis = axis_exports.getAxis(props);
    var axisValue = axis_exports.getAxisValue(props, axis);
    if (axisValue === void 0 || !dependentAxis) {
      return axisAngle === void 0 ? startAngle : axisAngle;
    }
    return helpers_exports.radiansToDegrees(axisValue);
  };
  var getTickProps2 = function(props, calculatedValues, tickValue, index) {
    var axisType = calculatedValues.axisType, radius = calculatedValues.radius, scale2 = calculatedValues.scale, style = calculatedValues.style, stringTicks2 = calculatedValues.stringTicks, ticks2 = calculatedValues.ticks, tickFormat2 = calculatedValues.tickFormat, origin = calculatedValues.origin;
    var text = tickFormat2(tickValue, index, ticks2);
    var tick = stringTicks2 ? stringTicks2[index] : tickValue;
    var _getEvaluatedStyles = getEvaluatedStyles2(style, {
      tick,
      tickValue,
      index,
      ticks: ticks2,
      stringTicks: stringTicks2,
      radius,
      scale: scale2,
      axisType,
      text
    }), tickStyle = _getEvaluatedStyles.tickStyle;
    var axisAngle = axisType === "radial" ? getAxisAngle(props, scale2) : void 0;
    var tickPadding = tickStyle.padding || tickStyle.size || 0;
    var padAngle = helpers_exports.degreesToRadians(90 - axisAngle);
    var tickAngle = axisType === "angular" ? scale2(tickValue) : helpers_exports.degreesToRadians(-1 * axisAngle);
    var tickRadius = axisType === "angular" ? radius : scale2(tickValue);
    return axisType === "angular" ? {
      index,
      datum: tick,
      style: tickStyle,
      x1: getPosition3(tickRadius, tickAngle, "x") + origin.x,
      y1: getPosition3(tickRadius, tickAngle, "y") + origin.y,
      x2: getPosition3(tickRadius + tickPadding, tickAngle, "x") + origin.x,
      y2: getPosition3(tickRadius + tickPadding, tickAngle, "y") + origin.y
    } : {
      index,
      datum: tick,
      style: tickStyle,
      x1: tickRadius * Math.cos(tickAngle) + Math.cos(padAngle) * tickPadding + origin.x,
      x2: tickRadius * Math.cos(tickAngle) - Math.cos(padAngle) * tickPadding + origin.x,
      y1: tickRadius * Math.sin(tickAngle) + Math.sin(padAngle) * tickPadding + origin.y,
      y2: tickRadius * Math.sin(tickAngle) - Math.sin(padAngle) * tickPadding + origin.y
    };
  };
  var getTickLabelProps2 = function(props, calculatedValues, tickValue, index) {
    var axisType = calculatedValues.axisType, radius = calculatedValues.radius, tickFormat2 = calculatedValues.tickFormat, style = calculatedValues.style, scale2 = calculatedValues.scale, ticks2 = calculatedValues.ticks, stringTicks2 = calculatedValues.stringTicks, origin = calculatedValues.origin;
    var text = tickFormat2(tickValue, index, ticks2);
    var tick = stringTicks2 ? stringTicks2[index] : tickValue;
    var _getEvaluatedStyles2 = getEvaluatedStyles2(style, {
      text,
      tick,
      tickValue,
      index,
      ticks: ticks2,
      stringTicks: stringTicks2,
      radius,
      scale: scale2,
      axisType
    }), labelStyle = _getEvaluatedStyles2.labelStyle;
    var tickLabelComponent = props.tickLabelComponent;
    var labelPlacement = tickLabelComponent.props && tickLabelComponent.props.labelPlacement ? tickLabelComponent.props.labelPlacement : props.labelPlacement;
    var tickPadding = labelStyle.padding || 0;
    var angularPadding = 0;
    var axisAngle = axisType === "radial" ? getAxisAngle(props, scale2) : void 0;
    var labelAngle = axisType === "angular" ? helpers_exports.radiansToDegrees(scale2(tickValue)) : axisAngle + angularPadding;
    var textAngle = labelStyle.angle === void 0 ? label_helpers_exports.getPolarAngle((0, import_assign22.default)({}, props, {
      labelPlacement
    }), labelAngle) : labelStyle.angle;
    var labelRadius = axisType === "angular" ? radius + tickPadding : scale2(tickValue);
    var textAnchor = labelStyle.textAnchor || label_helpers_exports.getPolarTextAnchor((0, import_assign22.default)({}, props, {
      labelPlacement
    }), labelAngle);
    return {
      index,
      datum: tick,
      style: labelStyle,
      angle: textAngle,
      textAnchor,
      text,
      x: labelRadius * Math.cos(helpers_exports.degreesToRadians(labelAngle)) + origin.x,
      y: -labelRadius * Math.sin(helpers_exports.degreesToRadians(labelAngle)) + origin.y
    };
  };
  var getGridProps2 = function(props, calculatedValues, tickValue, index) {
    var axisType = calculatedValues.axisType, radius = calculatedValues.radius, style = calculatedValues.style, scale2 = calculatedValues.scale, stringTicks2 = calculatedValues.stringTicks, ticks2 = calculatedValues.ticks, tickFormat2 = calculatedValues.tickFormat, origin = calculatedValues.origin;
    var text = tickFormat2(tickValue, index, ticks2);
    var startAngle = props.startAngle, endAngle = props.endAngle, _props$innerRadius = props.innerRadius, innerRadius = _props$innerRadius === void 0 ? 0 : _props$innerRadius;
    var tick = stringTicks2 ? stringTicks2[index] : tickValue;
    var _getEvaluatedStyles3 = getEvaluatedStyles2(style, {
      tick,
      tickValue,
      index,
      ticks: ticks2,
      stringTicks: stringTicks2,
      radius,
      scale: scale2,
      axisType,
      text
    }), gridStyle = _getEvaluatedStyles3.gridStyle;
    var angle = scale2(tickValue);
    return axisType === "angular" ? {
      index,
      datum: tick,
      style: gridStyle,
      x1: getPosition3(radius, angle, "x") + origin.x,
      y1: getPosition3(radius, angle, "y") + origin.y,
      x2: getPosition3(innerRadius, angle, "x") + origin.x,
      y2: getPosition3(innerRadius, angle, "y") + origin.y
    } : {
      style: gridStyle,
      index,
      datum: tick,
      cx: origin.x,
      cy: origin.y,
      r: scale2(tickValue),
      startAngle,
      endAngle
    };
  };
  var getAxisLabelProps2 = function(props, calculatedValues) {
    var axisType = calculatedValues.axisType, radius = calculatedValues.radius, style = calculatedValues.style, scale2 = calculatedValues.scale, origin = calculatedValues.origin;
    var axisLabelComponent = props.axisLabelComponent;
    if (axisType !== "radial") {
      return {};
    }
    var labelPlacement = axisLabelComponent.props && axisLabelComponent.props.labelPlacement ? axisLabelComponent.props.labelPlacement : props.labelPlacement;
    var labelStyle = style && style.axisLabel || {};
    var axisAngle = axisType === "radial" ? getAxisAngle(props, scale2) : void 0;
    var textAngle = labelStyle.angle === void 0 ? label_helpers_exports.getPolarAngle((0, import_assign22.default)({}, props, {
      labelPlacement
    }), axisAngle) : labelStyle.angle;
    var labelRadius = radius + (labelStyle.padding || 0);
    var textAnchor = labelStyle.textAnchor || label_helpers_exports.getPolarTextAnchor((0, import_assign22.default)({}, props, {
      labelPlacement
    }), axisAngle);
    var verticalAnchor = labelStyle.verticalAnchor || label_helpers_exports.getPolarVerticalAnchor((0, import_assign22.default)({}, props, {
      labelPlacement
    }), axisAngle);
    return {
      style: labelStyle,
      angle: textAngle,
      textAnchor,
      verticalAnchor,
      text: props.label,
      x: getPosition3(labelRadius, helpers_exports.degreesToRadians(axisAngle), "x") + origin.x,
      y: getPosition3(labelRadius, helpers_exports.degreesToRadians(axisAngle), "y") + origin.y
    };
  };
  var getAxisProps2 = function(modifiedProps, calculatedValues) {
    var style = calculatedValues.style, axisType = calculatedValues.axisType, radius = calculatedValues.radius, scale2 = calculatedValues.scale, origin = calculatedValues.origin;
    var startAngle = modifiedProps.startAngle, endAngle = modifiedProps.endAngle, _modifiedProps$innerR = modifiedProps.innerRadius, innerRadius = _modifiedProps$innerR === void 0 ? 0 : _modifiedProps$innerR;
    var axisAngle = axisType === "radial" ? helpers_exports.degreesToRadians(getAxisAngle(modifiedProps, scale2)) : void 0;
    return axisType === "radial" ? {
      style: style.axis,
      x1: getPosition3(innerRadius, axisAngle, "x") + origin.x,
      x2: getPosition3(radius, axisAngle, "x") + origin.x,
      y1: getPosition3(innerRadius, axisAngle, "y") + origin.y,
      y2: getPosition3(radius, axisAngle, "y") + origin.y
    } : {
      style: style.axis,
      cx: origin.x,
      cy: origin.y,
      r: radius,
      startAngle,
      endAngle
    };
  };
  var getCalculatedValues2 = function(props) {
    props = (0, import_assign22.default)({
      polar: true
    }, props);
    var defaultStyles2 = getStyleObject2(props);
    var style = getStyles4(props, defaultStyles2);
    var padding2 = helpers_exports.getPadding(props);
    var axis = axis_exports.getAxis(props);
    var axisType = getAxisType(props);
    var stringTicks2 = axis_exports.stringTicks(props) ? props.tickValues : void 0;
    var domain2 = axis_exports.getDomain(props, axis);
    var range2 = getRange2(props, axis);
    var scale2 = getScale3(props);
    var initialTicks = axis_exports.getTicks(props, scale2);
    var ticks2 = axisType === "angular" ? filterTicks(initialTicks, scale2) : initialTicks;
    var tickFormat2 = axis_exports.getTickFormat(props, scale2);
    var radius = getRadius2(props);
    var origin = helpers_exports.getPolarOrigin(props);
    return {
      axis,
      style,
      padding: padding2,
      stringTicks: stringTicks2,
      axisType,
      scale: scale2,
      ticks: ticks2,
      tickFormat: tickFormat2,
      domain: domain2,
      range: range2,
      radius,
      origin
    };
  };
  var getBaseProps2 = function(props, fallbackProps10) {
    props = axis_exports.modifyProps(props, fallbackProps10);
    var calculatedValues = getCalculatedValues2(props);
    var style = calculatedValues.style, scale2 = calculatedValues.scale, ticks2 = calculatedValues.ticks, domain2 = calculatedValues.domain;
    var _props = props, width = _props.width, height = _props.height, standalone = _props.standalone, theme = _props.theme, name2 = _props.name;
    var axisProps = getAxisProps2(props, calculatedValues);
    var axisLabelProps = getAxisLabelProps2(props, calculatedValues);
    var initialChildProps = {
      parent: {
        style: style.parent,
        ticks: ticks2,
        scale: scale2,
        width,
        height,
        domain: domain2,
        standalone,
        theme,
        name: name2
      }
    };
    return ticks2.reduce(function(childProps, tick, index) {
      childProps[index] = {
        axis: axisProps,
        axisLabel: axisLabelProps,
        ticks: getTickProps2(props, calculatedValues, tick, index),
        tickLabels: getTickLabelProps2(props, calculatedValues, tick, index),
        grid: getGridProps2(props, calculatedValues, tick, index)
      };
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-polar-axis/es/victory-polar-axis.js
  function ownKeys15(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread15(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys15(Object(source), true).forEach(function(key) {
        _defineProperty20(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys15(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty20(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toConsumableArray17(arr) {
    return _arrayWithoutHoles16(arr) || _iterableToArray16(arr) || _unsupportedIterableToArray18(arr) || _nonIterableSpread16();
  }
  function _nonIterableSpread16() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray18(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray18(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray18(o, minLen);
  }
  function _iterableToArray16(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles16(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray18(arr);
  }
  function _arrayLikeToArray18(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _classCallCheck13(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties12(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass13(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties12(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties12(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits11(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf10(subClass, superClass);
  }
  function _setPrototypeOf10(o, p2) {
    _setPrototypeOf10 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf10(o, p2);
  }
  function _createSuper10(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct10();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf10(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf10(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn11(this, result);
    };
  }
  function _possibleConstructorReturn11(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized10(self2);
  }
  function _assertThisInitialized10(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct10() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf10(o) {
    _getPrototypeOf10 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf10(o);
  }
  var fallbackProps2 = {
    width: 450,
    height: 300,
    padding: 50
  };
  var options2 = {
    components: [{
      name: "axis",
      index: 0
    }, {
      name: "axisLabel",
      index: 0
    }, {
      name: "grid"
    }, {
      name: "parent",
      index: "parent"
    }, {
      name: "ticks"
    }, {
      name: "tickLabels"
    }]
  };
  var VictoryPolarAxis = /* @__PURE__ */ function(_React$Component) {
    _inherits11(VictoryPolarAxis2, _React$Component);
    var _super = _createSuper10(VictoryPolarAxis2);
    function VictoryPolarAxis2() {
      _classCallCheck13(this, VictoryPolarAxis2);
      return _super.apply(this, arguments);
    }
    _createClass13(VictoryPolarAxis2, [{
      key: "renderAxisLine",
      value: function renderAxisLine(props) {
        var dependentAxis = props.dependentAxis;
        var axisComponent = dependentAxis ? props.axisComponent : props.circularAxisComponent;
        var axisProps = this.getComponentProps(axisComponent, "axis", 0);
        return /* @__PURE__ */ import_react73.default.cloneElement(axisComponent, axisProps);
      }
    }, {
      key: "renderLabel",
      value: function renderLabel2(props) {
        var axisLabelComponent = props.axisLabelComponent, dependentAxis = props.dependentAxis, label = props.label;
        if (!label || !dependentAxis) {
          return null;
        }
        var axisLabelProps = this.getComponentProps(axisLabelComponent, "axisLabel", 0);
        return /* @__PURE__ */ import_react73.default.cloneElement(axisLabelComponent, axisLabelProps);
      }
    }, {
      key: "renderAxis",
      value: function renderAxis(props) {
        var _this = this;
        var tickComponent = props.tickComponent, tickLabelComponent = props.tickLabelComponent, name2 = props.name;
        var shouldRender = function(componentProps) {
          var _componentProps$style = componentProps.style, style = _componentProps$style === void 0 ? {} : _componentProps$style, _componentProps$event = componentProps.events, events = _componentProps$event === void 0 ? {} : _componentProps$event;
          var visible = style.stroke !== "transparent" && style.stroke !== "none" && style.strokeWidth !== 0;
          return visible || !(0, import_isEmpty7.default)(events);
        };
        var axisType = props.dependentAxis ? "radial" : "angular";
        var gridComponent = axisType === "radial" ? props.circularGridComponent : props.gridComponent;
        var tickComponents = this.dataKeys.map(function(key, index) {
          var tickProps = (0, import_assign23.default)({
            key: "".concat(name2, "-tick-").concat(key)
          }, _this.getComponentProps(tickComponent, "ticks", index));
          var TickComponent = /* @__PURE__ */ import_react73.default.cloneElement(tickComponent, tickProps);
          return shouldRender(TickComponent.props) ? TickComponent : void 0;
        }).filter(Boolean);
        var gridComponents = this.dataKeys.map(function(key, index) {
          var gridProps = (0, import_assign23.default)({
            key: "".concat(name2, "-grid-").concat(key)
          }, _this.getComponentProps(gridComponent, "grid", index));
          var GridComponent = /* @__PURE__ */ import_react73.default.cloneElement(gridComponent, gridProps);
          return shouldRender(GridComponent.props) ? GridComponent : void 0;
        }).filter(Boolean);
        var tickLabelComponents = this.dataKeys.map(function(key, index) {
          var tickLabelProps = (0, import_assign23.default)({
            key: "".concat(name2, "-tick-").concat(key)
          }, _this.getComponentProps(tickLabelComponent, "tickLabels", index));
          return /* @__PURE__ */ import_react73.default.cloneElement(tickLabelComponent, tickLabelProps);
        });
        var axis = this.renderAxisLine(props);
        var axisLabel = this.renderLabel(props);
        var children = [axis, axisLabel].concat(_toConsumableArray17(tickComponents), _toConsumableArray17(gridComponents), _toConsumableArray17(tickLabelComponents));
        return this.renderGroup(props, children);
      }
      // Overridden in victory-native
    }, {
      key: "renderGroup",
      value: function renderGroup(props, children) {
        var groupComponent = props.groupComponent;
        return /* @__PURE__ */ import_react73.default.cloneElement(groupComponent, {}, children);
      }
    }, {
      key: "shouldAnimate",
      value: function shouldAnimate() {
        return !!this.props.animate;
      }
    }, {
      key: "render",
      value: function render() {
        var animationWhitelist = VictoryPolarAxis2.animationWhitelist;
        var props = axis_exports.modifyProps(this.props, fallbackProps2);
        if (this.shouldAnimate()) {
          return this.animateComponent(props, animationWhitelist);
        }
        var children = this.renderAxis(props);
        return props.standalone ? this.renderContainer(props.containerComponent, children) : children;
      }
    }]);
    return VictoryPolarAxis2;
  }(import_react73.default.Component);
  VictoryPolarAxis.animationWhitelist = ["style", "domain", "range", "tickCount", "tickValues", "padding", "width", "height"];
  VictoryPolarAxis.displayName = "VictoryAxis";
  VictoryPolarAxis.role = "axis";
  VictoryPolarAxis.defaultTransitions = {
    onExit: {
      duration: 500
    },
    onEnter: {
      duration: 500
    }
  };
  VictoryPolarAxis.propTypes = _objectSpread15(_objectSpread15({}, CommonProps.baseProps), {}, {
    axisAngle: import_prop_types54.default.number,
    axisComponent: import_prop_types54.default.element,
    axisLabelComponent: import_prop_types54.default.element,
    axisValue: import_prop_types54.default.oneOfType([import_prop_types54.default.number, import_prop_types54.default.string, import_prop_types54.default.object]),
    categories: import_prop_types54.default.oneOfType([import_prop_types54.default.arrayOf(import_prop_types54.default.string), import_prop_types54.default.shape({
      x: import_prop_types54.default.arrayOf(import_prop_types54.default.string),
      y: import_prop_types54.default.arrayOf(import_prop_types54.default.string)
    })]),
    circularAxisComponent: import_prop_types54.default.element,
    circularGridComponent: import_prop_types54.default.element,
    containerComponent: import_prop_types54.default.element,
    dependentAxis: import_prop_types54.default.bool,
    disableInlineStyles: import_prop_types54.default.bool,
    endAngle: import_prop_types54.default.number,
    events: import_prop_types54.default.arrayOf(import_prop_types54.default.shape({
      target: import_prop_types54.default.oneOf(["axis", "axisLabel", "grid", "ticks", "tickLabels"]),
      eventKey: import_prop_types54.default.oneOfType([import_prop_types54.default.array, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types54.default.string]),
      eventHandlers: import_prop_types54.default.object
    })),
    gridComponent: import_prop_types54.default.element,
    innerRadius: prop_types_exports.nonNegative,
    labelPlacement: import_prop_types54.default.oneOf(["parallel", "perpendicular", "vertical"]),
    startAngle: import_prop_types54.default.number,
    stringMap: import_prop_types54.default.object,
    style: import_prop_types54.default.shape({
      parent: import_prop_types54.default.object,
      axis: import_prop_types54.default.object,
      axisLabel: import_prop_types54.default.object,
      grid: import_prop_types54.default.object,
      ticks: import_prop_types54.default.object,
      tickLabels: import_prop_types54.default.object
    }),
    tickComponent: import_prop_types54.default.element,
    tickCount: prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.greaterThanZero]),
    tickFormat: import_prop_types54.default.oneOfType([import_prop_types54.default.func, prop_types_exports.homogeneousArray]),
    tickLabelComponent: import_prop_types54.default.element,
    tickValues: prop_types_exports.homogeneousArray
  });
  VictoryPolarAxis.defaultProps = {
    axisComponent: /* @__PURE__ */ import_react73.default.createElement(LineSegment, null),
    axisLabelComponent: /* @__PURE__ */ import_react73.default.createElement(VictoryLabel, null),
    circularAxisComponent: /* @__PURE__ */ import_react73.default.createElement(Arc, null),
    circularGridComponent: /* @__PURE__ */ import_react73.default.createElement(Arc, null),
    containerComponent: /* @__PURE__ */ import_react73.default.createElement(VictoryContainer, null),
    endAngle: 360,
    gridComponent: /* @__PURE__ */ import_react73.default.createElement(LineSegment, null),
    groupComponent: /* @__PURE__ */ import_react73.default.createElement("g", {
      role: "presentation"
    }),
    labelPlacement: "parallel",
    startAngle: 0,
    standalone: true,
    theme: VictoryTheme.grayscale,
    tickComponent: /* @__PURE__ */ import_react73.default.createElement(LineSegment, null),
    tickLabelComponent: /* @__PURE__ */ import_react73.default.createElement(VictoryLabel, null)
  };
  VictoryPolarAxis.getDomain = axis_exports.getDomain;
  VictoryPolarAxis.getAxis = axis_exports.getAxis;
  VictoryPolarAxis.getScale = getScale3;
  VictoryPolarAxis.getStyles = function(props) {
    return getStyles4(props, fallbackProps2.style);
  };
  VictoryPolarAxis.getBaseProps = function(props) {
    return getBaseProps2(props, fallbackProps2);
  };
  VictoryPolarAxis.expectedComponents = ["axisComponent", "circularAxisComponent", "groupComponent", "containerComponent", "tickComponent", "tickLabelComponent", "gridComponent", "circularGridComponent"];
  var victory_polar_axis_default = addEvents(VictoryPolarAxis, options2);

  // node_modules/victory-chart/es/helper-methods.js
  var import_assign24 = __toESM(require_assign());
  var import_defaults17 = __toESM(require_defaults());
  var import_react74 = __toESM(require_react());
  function _toConsumableArray18(arr) {
    return _arrayWithoutHoles17(arr) || _iterableToArray17(arr) || _unsupportedIterableToArray19(arr) || _nonIterableSpread17();
  }
  function _nonIterableSpread17() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray19(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray19(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray19(o, minLen);
  }
  function _iterableToArray17(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles17(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray19(arr);
  }
  function _arrayLikeToArray19(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  var fallbackProps3 = {
    width: 450,
    height: 300,
    padding: 50
  };
  function getAxisProps3(child, props, calculatedProps) {
    var domain2 = calculatedProps.domain, scale2 = calculatedProps.scale, stringMap = calculatedProps.stringMap, categories = calculatedProps.categories, horizontal = calculatedProps.horizontal;
    return {
      stringMap,
      horizontal,
      categories,
      startAngle: props.startAngle,
      endAngle: props.endAngle,
      innerRadius: props.innerRadius,
      domain: domain2,
      scale: scale2
    };
  }
  function getBackgroundWithProps(props, calculatedProps) {
    var backgroundElement = props.backgroundComponent;
    var height = props.polar ? calculatedProps.range.y[1] : calculatedProps.range.y[0] - calculatedProps.range.y[1];
    var width = calculatedProps.range.x[1] - calculatedProps.range.x[0];
    var xScale = props.horizontal ? calculatedProps.scale.y.range()[0] : calculatedProps.scale.x.range()[0];
    var yScale = props.horizontal ? calculatedProps.scale.x.range()[1] : calculatedProps.scale.y.range()[1];
    var xCoordinate = props.polar ? calculatedProps.origin.x : xScale;
    var yCoordinate = props.polar ? calculatedProps.origin.y : yScale;
    var parentName = props.name || "chart";
    var backgroundProps = {
      height,
      polar: props.polar,
      scale: calculatedProps.scale,
      style: props.style.background,
      x: xCoordinate,
      y: yCoordinate,
      key: "".concat(parentName, "-background"),
      width
    };
    return /* @__PURE__ */ import_react74.default.cloneElement(backgroundElement, (0, import_defaults17.default)({}, backgroundElement.props, backgroundProps));
  }
  function getChildProps(child, props, calculatedProps) {
    var axisChild = axis_exports.findAxisComponents([child]);
    if (axisChild.length > 0) {
      return getAxisProps3(axisChild[0], props, calculatedProps);
    }
    var categories = calculatedProps.categories, domain2 = calculatedProps.domain, range2 = calculatedProps.range, scale2 = calculatedProps.scale, stringMap = calculatedProps.stringMap, horizontal = calculatedProps.horizontal;
    return {
      categories,
      domain: domain2,
      range: range2,
      scale: scale2,
      stringMap,
      horizontal
    };
  }
  function getStyles5(props) {
    var styleProps = props.style && props.style.parent;
    return {
      parent: (0, import_defaults17.default)({}, styleProps, {
        height: "100%",
        width: "100%",
        userSelect: "none"
      })
    };
  }
  function getCalculatedProps2(props, childComponents) {
    var style = getStyles5(props);
    props = helpers_exports.modifyProps(props, fallbackProps3, "chart");
    var _props = props, horizontal = _props.horizontal, polar = _props.polar;
    var allStrings = wrapper_exports.getStringsFromChildren(props, childComponents);
    var categories = wrapper_exports.getCategories(props, childComponents, allStrings);
    var stringMap = createStringMap2(props, childComponents, allStrings);
    var domain2 = {
      x: getDomain4((0, import_assign24.default)({}, props, {
        categories
      }), "x", childComponents),
      y: getDomain4((0, import_assign24.default)({}, props, {
        categories
      }), "y", childComponents)
    };
    var range2 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    var baseScale = {
      x: scale_exports.getScaleFromProps(props, "x") || wrapper_exports.getScale(props, "x"),
      y: scale_exports.getScaleFromProps(props, "y") || wrapper_exports.getScale(props, "y")
    };
    var scale2 = {
      x: baseScale.x.domain(domain2.x).range(horizontal ? range2.y : range2.x),
      y: baseScale.y.domain(domain2.y).range(horizontal ? range2.x : range2.y)
    };
    var origin = polar ? helpers_exports.getPolarOrigin(props) : axis_exports.getOrigin(domain2);
    var padding2 = helpers_exports.getPadding(props);
    return {
      categories,
      domain: domain2,
      range: range2,
      horizontal,
      scale: scale2,
      stringMap,
      style,
      origin,
      padding: padding2
    };
  }
  function getChildren(props, childComponents, calculatedProps) {
    childComponents = childComponents || getChildComponents(props);
    calculatedProps = calculatedProps || getCalculatedProps2(props, childComponents);
    var baseStyle = calculatedProps.style.parent;
    var height = props.height, polar = props.polar, theme = props.theme, width = props.width;
    var _calculatedProps = calculatedProps, origin = _calculatedProps.origin, horizontal = _calculatedProps.horizontal;
    var parentName = props.name || "chart";
    return childComponents.map(function(child, index) {
      var role = child.type && child.type.role;
      var style = Array.isArray(child.props.style) ? child.props.style : (0, import_defaults17.default)({}, child.props.style, {
        parent: baseStyle
      });
      var childProps = getChildProps(child, props, calculatedProps);
      var name2 = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
      var newProps = (0, import_defaults17.default)({
        horizontal,
        height,
        polar,
        theme,
        width,
        style,
        name: name2,
        origin: polar ? origin : void 0,
        padding: calculatedProps.padding,
        key: "".concat(name2, "-key-").concat(index),
        standalone: false
      }, childProps);
      return /* @__PURE__ */ import_react74.default.cloneElement(child, newProps);
    });
  }
  var getChildComponents = function(props, defaultAxes) {
    var childComponents = import_react74.default.Children.toArray(props.children);
    var newChildComponents = _toConsumableArray18(childComponents);
    if (childComponents.length === 0) {
      newChildComponents.push(defaultAxes.independent, defaultAxes.dependent);
    } else {
      var axisComponents = {
        dependent: axis_exports.getAxisComponentsWithParent(childComponents, "dependent"),
        independent: axis_exports.getAxisComponentsWithParent(childComponents, "independent")
      };
      if (axisComponents.dependent.length === 0 && axisComponents.independent.length === 0) {
        newChildComponents = props.prependDefaultAxes ? [defaultAxes.independent, defaultAxes.dependent].concat(newChildComponents) : newChildComponents.concat([defaultAxes.independent, defaultAxes.dependent]);
      }
    }
    return newChildComponents;
  };
  var getDomain4 = function(props, axis, childComponents) {
    childComponents = childComponents || import_react74.default.Children.toArray(props.children);
    var domain2 = wrapper_exports.getDomain(props, axis, childComponents);
    var axisComponent = axis_exports.getAxisComponent(childComponents, axis);
    var invertDomain = axisComponent && axisComponent.props && axisComponent.props.invertAxis;
    return invertDomain ? domain2.concat().reverse() : domain2;
  };
  var createStringMap2 = function(props, childComponents, allStrings) {
    var x2 = !allStrings.x || allStrings.x.length === 0 ? null : allStrings.x.reduce(function(memo2, string, index) {
      memo2[string] = index + 1;
      return memo2;
    }, {});
    var y2 = !allStrings.y || allStrings.y.length === 0 ? null : allStrings.y.reduce(function(memo2, string, index) {
      memo2[string] = index + 1;
      return memo2;
    }, {});
    return {
      x: x2,
      y: y2
    };
  };

  // node_modules/victory-chart/es/victory-chart.js
  var import_react_fast_compare5 = __toESM(require_react_fast_compare());
  function ownKeys16(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread16(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys16(Object(source), true).forEach(function(key) {
        _defineProperty21(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys16(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty21(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var fallbackProps4 = {
    width: 450,
    height: 300,
    padding: 50
  };
  var VictoryChartImpl = function(initialProps) {
    var role = "chart";
    var _Hooks$useAnimationSt = hooks_exports.useAnimationState(), getAnimationProps = _Hooks$useAnimationSt.getAnimationProps, setAnimationState = _Hooks$useAnimationSt.setAnimationState, getProps2 = _Hooks$useAnimationSt.getProps;
    var props = getProps2(initialProps);
    var modifiedProps = helpers_exports.modifyProps(props, fallbackProps4, role);
    var desc = modifiedProps.desc, eventKey = modifiedProps.eventKey, containerComponent = modifiedProps.containerComponent, standalone = modifiedProps.standalone, groupComponent = modifiedProps.groupComponent, externalEventMutations = modifiedProps.externalEventMutations, width = modifiedProps.width, height = modifiedProps.height, theme = modifiedProps.theme, polar = modifiedProps.polar, name2 = modifiedProps.name, title = modifiedProps.title;
    var axes = props.polar ? modifiedProps.defaultPolarAxes : modifiedProps.defaultAxes;
    var childComponents = import_react75.default.useMemo(function() {
      return getChildComponents(modifiedProps, axes);
    }, [modifiedProps, axes]);
    var calculatedProps = import_react75.default.useMemo(function() {
      return getCalculatedProps2(modifiedProps, childComponents);
    }, [modifiedProps, childComponents]);
    var domain2 = calculatedProps.domain, scale2 = calculatedProps.scale, style = calculatedProps.style, origin = calculatedProps.origin, horizontal = calculatedProps.horizontal;
    var newChildren = import_react75.default.useMemo(function() {
      var children = getChildren(props, childComponents, calculatedProps);
      var mappedChildren = children.map(function(child, index) {
        var childProps = (0, import_assign25.default)({
          animate: getAnimationProps(props, child, index)
        }, child.props);
        return /* @__PURE__ */ import_react75.default.cloneElement(child, childProps);
      });
      if (props.style && props.style.background) {
        var backgroundComponent = getBackgroundWithProps(props, calculatedProps);
        mappedChildren.unshift(backgroundComponent);
      }
      return mappedChildren;
    }, [getAnimationProps, childComponents, props, calculatedProps]);
    var containerProps = import_react75.default.useMemo(function() {
      if (standalone) {
        return {
          desc,
          domain: domain2,
          width,
          height,
          horizontal,
          name: name2,
          origin: polar ? origin : void 0,
          polar,
          theme,
          title,
          scale: scale2,
          standalone,
          style: style.parent
        };
      }
      return {};
    }, [desc, domain2, height, horizontal, name2, origin, polar, scale2, standalone, style, title, theme, width]);
    var container = import_react75.default.useMemo(function() {
      if (standalone) {
        var defaultContainerProps = (0, import_defaults18.default)({}, containerComponent.props, containerProps, user_props_exports.getSafeUserProps(initialProps));
        return /* @__PURE__ */ import_react75.default.cloneElement(containerComponent, defaultContainerProps);
      }
      return groupComponent;
    }, [groupComponent, standalone, containerComponent, containerProps, initialProps]);
    var events = import_react75.default.useMemo(function() {
      return wrapper_exports.getAllEvents(props);
    }, [props]);
    var previousProps = hooks_exports.usePreviousProps(initialProps);
    import_react75.default.useEffect(function() {
      return function() {
        if (initialProps.animate) {
          setAnimationState(previousProps, initialProps);
        }
      };
    }, [setAnimationState, previousProps, initialProps]);
    if (!(0, import_isEmpty8.default)(events)) {
      return /* @__PURE__ */ import_react75.default.createElement(VictorySharedEvents, {
        container,
        eventKey,
        events,
        externalEventMutations
      }, newChildren);
    }
    return /* @__PURE__ */ import_react75.default.cloneElement(container, container.props, newChildren);
  };
  VictoryChartImpl.propTypes = _objectSpread16(_objectSpread16({}, CommonProps.baseProps), {}, {
    backgroundComponent: import_prop_types55.default.element,
    children: import_prop_types55.default.oneOfType([import_prop_types55.default.arrayOf(import_prop_types55.default.node), import_prop_types55.default.node]),
    defaultAxes: import_prop_types55.default.shape({
      independent: import_prop_types55.default.element,
      dependent: import_prop_types55.default.element
    }),
    defaultPolarAxes: import_prop_types55.default.shape({
      independent: import_prop_types55.default.element,
      dependent: import_prop_types55.default.element
    }),
    endAngle: import_prop_types55.default.number,
    innerRadius: prop_types_exports.nonNegative,
    prependDefaultAxes: import_prop_types55.default.bool,
    startAngle: import_prop_types55.default.number
  });
  VictoryChartImpl.defaultProps = {
    backgroundComponent: /* @__PURE__ */ import_react75.default.createElement(Background, null),
    containerComponent: /* @__PURE__ */ import_react75.default.createElement(VictoryContainer, null),
    defaultAxes: {
      independent: /* @__PURE__ */ import_react75.default.createElement(VictoryAxis, null),
      dependent: /* @__PURE__ */ import_react75.default.createElement(VictoryAxis, {
        dependentAxis: true
      })
    },
    defaultPolarAxes: {
      independent: /* @__PURE__ */ import_react75.default.createElement(victory_polar_axis_default, null),
      dependent: /* @__PURE__ */ import_react75.default.createElement(victory_polar_axis_default, {
        dependentAxis: true
      })
    },
    groupComponent: /* @__PURE__ */ import_react75.default.createElement("g", null),
    standalone: true,
    theme: VictoryTheme.grayscale
  };
  var VictoryChart = /* @__PURE__ */ import_react75.default.memo(VictoryChartImpl, import_react_fast_compare5.default);
  VictoryChart.displayName = "VictoryChart";
  VictoryChart.expectedComponents = ["groupComponent", "containerComponent"];

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartContainer/ChartContainer.js
  init_tslib_es6();
  var React308 = __toESM(require_react());
  var import_hoist_non_react_statics3 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-voronoi-container/es/victory-voronoi-container.js
  var import_pick4 = __toESM(require_pick());
  var import_isFunction13 = __toESM(require_isFunction());
  var import_defaults20 = __toESM(require_defaults());
  var import_prop_types58 = __toESM(require_prop_types());
  var import_react79 = __toESM(require_react());

  // node_modules/victory-tooltip/es/victory-tooltip.js
  var import_orderBy4 = __toESM(require_orderBy());
  var import_isPlainObject7 = __toESM(require_isPlainObject());
  var import_uniqueId3 = __toESM(require_uniqueId());
  var import_defaults19 = __toESM(require_defaults());
  var import_assign27 = __toESM(require_assign());
  var import_react77 = __toESM(require_react());
  var import_prop_types57 = __toESM(require_prop_types());

  // node_modules/victory-tooltip/es/flyout.js
  var import_assign26 = __toESM(require_assign());
  var import_isPlainObject6 = __toESM(require_isPlainObject());
  var import_react76 = __toESM(require_react());
  var import_prop_types56 = __toESM(require_prop_types());
  function ownKeys17(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread17(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys17(Object(source), true).forEach(function(key) {
        _defineProperty22(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys17(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty22(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var getVerticalPath = function(props) {
    var pointerWidth = props.pointerWidth, cornerRadius = props.cornerRadius, orientation = props.orientation, width = props.width, height = props.height, center = props.center;
    var sign2 = orientation === "bottom" ? 1 : -1;
    var x2 = props.x + (props.dx || 0);
    var y2 = props.y + (props.dy || 0);
    var centerX = (0, import_isPlainObject6.default)(center) && center.x;
    var centerY = (0, import_isPlainObject6.default)(center) && center.y;
    var pointerEdge = centerY + sign2 * (height / 2);
    var oppositeEdge = centerY - sign2 * (height / 2);
    var rightEdge = centerX + width / 2;
    var leftEdge = centerX - width / 2;
    var pointerLength = sign2 * (y2 - pointerEdge) < 0 ? 0 : props.pointerLength;
    var direction = orientation === "bottom" ? "0 0 0" : "0 0 1";
    var arc = "".concat(cornerRadius, " ").concat(cornerRadius, " ").concat(direction);
    return "M ".concat(centerX - pointerWidth / 2, ", ").concat(pointerEdge, "\n    L ").concat(pointerLength ? x2 : centerX + pointerWidth / 2, ", ").concat(pointerLength ? y2 : pointerEdge, "\n    L ").concat(centerX + pointerWidth / 2, ", ").concat(pointerEdge, "\n    L ").concat(rightEdge - cornerRadius, ", ").concat(pointerEdge, "\n    A ").concat(arc, " ").concat(rightEdge, ", ").concat(pointerEdge - sign2 * cornerRadius, "\n    L ").concat(rightEdge, ", ").concat(oppositeEdge + sign2 * cornerRadius, "\n    A ").concat(arc, " ").concat(rightEdge - cornerRadius, ", ").concat(oppositeEdge, "\n    L ").concat(leftEdge + cornerRadius, ", ").concat(oppositeEdge, "\n    A ").concat(arc, " ").concat(leftEdge, ", ").concat(oppositeEdge + sign2 * cornerRadius, "\n    L ").concat(leftEdge, ", ").concat(pointerEdge - sign2 * cornerRadius, "\n    A ").concat(arc, " ").concat(leftEdge + cornerRadius, ", ").concat(pointerEdge, "\n    z");
  };
  var getHorizontalPath = function(props) {
    var pointerWidth = props.pointerWidth, cornerRadius = props.cornerRadius, orientation = props.orientation, width = props.width, height = props.height, center = props.center;
    var sign2 = orientation === "left" ? 1 : -1;
    var x2 = props.x + (props.dx || 0);
    var y2 = props.y + (props.dy || 0);
    var centerX = (0, import_isPlainObject6.default)(center) && center.x;
    var centerY = (0, import_isPlainObject6.default)(center) && center.y;
    var pointerEdge = centerX - sign2 * (width / 2);
    var oppositeEdge = centerX + sign2 * (width / 2);
    var bottomEdge = centerY + height / 2;
    var topEdge = centerY - height / 2;
    var pointerLength = sign2 * (x2 - pointerEdge) > 0 ? 0 : props.pointerLength;
    var direction = orientation === "left" ? "0 0 0" : "0 0 1";
    var arc = "".concat(cornerRadius, " ").concat(cornerRadius, " ").concat(direction);
    return "M ".concat(pointerEdge, ", ").concat(centerY - pointerWidth / 2, "\n    L ").concat(pointerLength ? x2 : pointerEdge, ", ").concat(pointerLength ? y2 : centerY + pointerWidth / 2, "\n    L ").concat(pointerEdge, ", ").concat(centerY + pointerWidth / 2, "\n    L ").concat(pointerEdge, ", ").concat(bottomEdge - cornerRadius, "\n    A ").concat(arc, " ").concat(pointerEdge + sign2 * cornerRadius, ", ").concat(bottomEdge, "\n    L ").concat(oppositeEdge - sign2 * cornerRadius, ", ").concat(bottomEdge, "\n    A ").concat(arc, " ").concat(oppositeEdge, ", ").concat(bottomEdge - cornerRadius, "\n    L ").concat(oppositeEdge, ", ").concat(topEdge + cornerRadius, "\n    A ").concat(arc, " ").concat(oppositeEdge - sign2 * cornerRadius, ", ").concat(topEdge, "\n    L ").concat(pointerEdge + sign2 * cornerRadius, ", ").concat(topEdge, "\n    A ").concat(arc, " ").concat(pointerEdge, ", ").concat(topEdge + cornerRadius, "\n    z");
  };
  var getFlyoutPath = function(props) {
    var orientation = props.orientation || "top";
    return orientation === "left" || orientation === "right" ? getHorizontalPath(props) : getVerticalPath(props);
  };
  var evaluateProps7 = function(props) {
    var id = helpers_exports.evaluateProp(props.id, props);
    var style = helpers_exports.evaluateStyle(props.style, props);
    return (0, import_assign26.default)({}, props, {
      id,
      style
    });
  };
  var Flyout = function(props) {
    props = evaluateProps7(props);
    var userProps = user_props_exports.getSafeUserProps(props);
    return /* @__PURE__ */ import_react76.default.cloneElement(props.pathComponent, _objectSpread17(_objectSpread17(_objectSpread17({}, props.events), userProps), {}, {
      style: props.style,
      d: getFlyoutPath(props),
      className: props.className,
      shapeRendering: props.shapeRendering,
      role: props.role,
      transform: props.transform,
      clipPath: props.clipPath
    }));
  };
  Flyout.propTypes = _objectSpread17(_objectSpread17({}, CommonProps.primitiveProps), {}, {
    center: import_prop_types56.default.shape({
      x: import_prop_types56.default.number,
      y: import_prop_types56.default.number
    }),
    cornerRadius: import_prop_types56.default.number,
    datum: import_prop_types56.default.object,
    dx: import_prop_types56.default.number,
    dy: import_prop_types56.default.number,
    height: import_prop_types56.default.number,
    orientation: import_prop_types56.default.oneOf(["top", "bottom", "left", "right"]),
    pathComponent: import_prop_types56.default.element,
    pointerLength: import_prop_types56.default.number,
    pointerWidth: import_prop_types56.default.number,
    width: import_prop_types56.default.number,
    x: import_prop_types56.default.number,
    y: import_prop_types56.default.number
  });
  Flyout.defaultProps = {
    pathComponent: /* @__PURE__ */ import_react76.default.createElement(Path, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var flyout_default = Flyout;

  // node_modules/victory-tooltip/es/victory-tooltip.js
  function _toConsumableArray19(arr) {
    return _arrayWithoutHoles18(arr) || _iterableToArray18(arr) || _unsupportedIterableToArray20(arr) || _nonIterableSpread18();
  }
  function _nonIterableSpread18() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray20(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray20(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray20(o, minLen);
  }
  function _iterableToArray18(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles18(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray20(arr);
  }
  function _arrayLikeToArray20(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _classCallCheck14(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties13(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass14(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties13(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties13(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits12(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf11(subClass, superClass);
  }
  function _setPrototypeOf11(o, p2) {
    _setPrototypeOf11 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf11(o, p2);
  }
  function _createSuper11(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct11();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf11(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf11(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn12(this, result);
    };
  }
  function _possibleConstructorReturn12(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized11(self2);
  }
  function _assertThisInitialized11(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct11() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf11(o) {
    _getPrototypeOf11 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf11(o);
  }
  var fallbackProps5 = {
    cornerRadius: 5,
    pointerLength: 10,
    pointerWidth: 10
  };
  var VictoryTooltip = /* @__PURE__ */ function(_React$Component) {
    _inherits12(VictoryTooltip2, _React$Component);
    var _super = _createSuper11(VictoryTooltip2);
    function VictoryTooltip2(props) {
      var _this;
      _classCallCheck14(this, VictoryTooltip2);
      _this = _super.call(this, props);
      _this.id = props.id === void 0 ? (0, import_uniqueId3.default)("tooltip-") : props.id;
      return _this;
    }
    _createClass14(VictoryTooltip2, [{
      key: "getDefaultOrientation",
      value: function getDefaultOrientation(props) {
        var datum = props.datum, horizontal = props.horizontal, polar = props.polar;
        if (!polar) {
          var positive = horizontal ? "right" : "top";
          var negative = horizontal ? "left" : "bottom";
          return datum && datum.y < 0 ? negative : positive;
        }
        return this.getPolarOrientation(props, datum);
      }
    }, {
      key: "getPolarOrientation",
      value: function getPolarOrientation2(props, datum) {
        var degrees = label_helpers_exports.getDegrees(props, datum);
        var placement = props.labelPlacement || "vertical";
        if (placement === " vertical") {
          return this.getVerticalOrientations(degrees);
        } else if (placement === "parallel") {
          return degrees < 90 || degrees > 270 ? "right" : "left";
        }
        return degrees > 180 ? "bottom" : "top";
      }
    }, {
      key: "getVerticalOrientations",
      value: function getVerticalOrientations(degrees) {
        if (degrees < 45 || degrees > 315) {
          return "right";
        } else if (degrees >= 45 && degrees <= 135) {
          return "top";
        } else if (degrees > 135 && degrees < 225) {
          return "left";
        }
        return "bottom";
      }
    }, {
      key: "getStyles",
      value: function getStyles7(props) {
        var theme = props.theme || VictoryTheme.grayscale;
        var defaultLabelStyles = theme && theme.tooltip && theme.tooltip.style ? theme.tooltip.style : {};
        var baseLabelStyle = Array.isArray(props.style) ? props.style.map(function(s2) {
          return (0, import_defaults19.default)({}, s2, defaultLabelStyles);
        }) : (0, import_defaults19.default)({}, props.style, defaultLabelStyles);
        var defaultFlyoutStyles = theme && theme.tooltip && theme.tooltip.flyoutStyle ? theme.tooltip.flyoutStyle : {};
        var baseFlyoutStyle = props.flyoutStyle ? (0, import_defaults19.default)({}, props.flyoutStyle, defaultFlyoutStyles) : defaultFlyoutStyles;
        var style = Array.isArray(baseLabelStyle) ? baseLabelStyle.map(function(s2) {
          return helpers_exports.evaluateStyle(s2, props);
        }) : helpers_exports.evaluateStyle(baseLabelStyle, props);
        var flyoutStyle = helpers_exports.evaluateStyle(baseFlyoutStyle, (0, import_assign27.default)({}, props, {
          style
        }));
        return {
          style,
          flyoutStyle
        };
      }
    }, {
      key: "getEvaluatedProps",
      value: function getEvaluatedProps(props) {
        var cornerRadius = props.cornerRadius, centerOffset = props.centerOffset, dx = props.dx, dy = props.dy;
        var active = helpers_exports.evaluateProp(props.active, props);
        var text = helpers_exports.evaluateProp(props.text, (0, import_assign27.default)({}, props, {
          active
        }));
        var _this$getStyles = this.getStyles((0, import_assign27.default)({}, props, {
          active,
          text
        })), style = _this$getStyles.style, flyoutStyle = _this$getStyles.flyoutStyle;
        var orientation = helpers_exports.evaluateProp(props.orientation, (0, import_assign27.default)({}, props, {
          active,
          text,
          style,
          flyoutStyle
        })) || this.getDefaultOrientation(props);
        var padding2 = helpers_exports.evaluateProp(props.flyoutPadding, (0, import_assign27.default)({}, props, {
          active,
          text,
          style,
          flyoutStyle,
          orientation
        })) || this.getLabelPadding(style);
        var flyoutPadding = helpers_exports.getPadding({
          padding: padding2
        });
        var pointerWidth = helpers_exports.evaluateProp(props.pointerWidth, (0, import_assign27.default)({}, props, {
          active,
          text,
          style,
          flyoutStyle,
          orientation
        }));
        var pointerLength = helpers_exports.evaluateProp(props.pointerLength, (0, import_assign27.default)({}, props, {
          active,
          text,
          style,
          flyoutStyle,
          orientation
        }));
        var labelSize = textsize_exports.approximateTextSize(text, style);
        var _this$getDimensions = this.getDimensions((0, import_assign27.default)({}, props, {
          style,
          flyoutStyle,
          active,
          text,
          orientation,
          flyoutPadding,
          pointerWidth,
          pointerLength
        }), labelSize), flyoutHeight = _this$getDimensions.flyoutHeight, flyoutWidth = _this$getDimensions.flyoutWidth;
        var evaluatedProps = (0, import_assign27.default)({}, props, {
          active,
          text,
          style,
          flyoutStyle,
          orientation,
          flyoutHeight,
          flyoutWidth,
          flyoutPadding,
          pointerWidth,
          pointerLength
        });
        var offsetX = (0, import_isPlainObject7.default)(centerOffset) && centerOffset.x !== void 0 ? helpers_exports.evaluateProp(centerOffset.x, evaluatedProps) : 0;
        var offsetY = (0, import_isPlainObject7.default)(centerOffset) && centerOffset.y !== void 0 ? helpers_exports.evaluateProp(centerOffset.y, evaluatedProps) : 0;
        return (0, import_assign27.default)({}, evaluatedProps, {
          centerOffset: {
            x: offsetX,
            y: offsetY
          },
          dx: dx !== void 0 ? helpers_exports.evaluateProp(dx, evaluatedProps) : 0,
          dy: dy !== void 0 ? helpers_exports.evaluateProp(dy, evaluatedProps) : 0,
          cornerRadius: helpers_exports.evaluateProp(cornerRadius, evaluatedProps)
        });
      }
    }, {
      key: "getCalculatedValues",
      value: function getCalculatedValues5(props) {
        var style = props.style, text = props.text, flyoutStyle = props.flyoutStyle, flyoutHeight = props.flyoutHeight, flyoutWidth = props.flyoutWidth;
        var labelSize = textsize_exports.approximateTextSize(text, style);
        var flyoutDimensions = {
          height: flyoutHeight,
          width: flyoutWidth
        };
        var flyoutCenter = this.getFlyoutCenter(props, flyoutDimensions);
        var transform2 = this.getTransform(props);
        return {
          style,
          flyoutStyle,
          labelSize,
          flyoutDimensions,
          flyoutCenter,
          transform: transform2
        };
      }
    }, {
      key: "getTransform",
      value: function getTransform3(props) {
        var x2 = props.x, y2 = props.y, style = props.style;
        var labelStyle = style || {};
        var angle = labelStyle.angle || props.angle || this.getDefaultAngle(props);
        return angle ? "rotate(".concat(angle, " ").concat(x2, " ").concat(y2, ")") : void 0;
      }
      // eslint-disable-next-line complexity
    }, {
      key: "getDefaultAngle",
      value: function getDefaultAngle(props) {
        var polar = props.polar, labelPlacement = props.labelPlacement, orientation = props.orientation, datum = props.datum;
        if (!polar || !labelPlacement || labelPlacement === "vertical") {
          return 0;
        }
        var degrees = label_helpers_exports.getDegrees(props, datum);
        var sign2 = degrees > 90 && degrees < 180 || degrees > 270 ? 1 : -1;
        var labelRotation = labelPlacement === "perpendicular" ? 0 : 90;
        var angle;
        if (degrees === 0 || degrees === 180) {
          angle = orientation === "top" && degrees === 180 ? 270 : 90;
        } else if (degrees > 0 && degrees < 180) {
          angle = 90 - degrees;
        } else if (degrees > 180 && degrees < 360) {
          angle = 270 - degrees;
        }
        return angle + sign2 * labelRotation;
      }
    }, {
      key: "constrainTooltip",
      value: function constrainTooltip(center, props, dimensions) {
        var x2 = center.x, y2 = center.y;
        var width = dimensions.width, height = dimensions.height;
        var extent = {
          x: [0, props.width],
          y: [0, props.height]
        };
        var flyoutExtent = {
          x: [x2 - width / 2, x2 + width / 2],
          y: [y2 - height / 2, y2 + height / 2]
        };
        var adjustments = {
          x: [flyoutExtent.x[0] < extent.x[0] ? extent.x[0] - flyoutExtent.x[0] : 0, flyoutExtent.x[1] > extent.x[1] ? flyoutExtent.x[1] - extent.x[1] : 0],
          y: [flyoutExtent.y[0] < extent.y[0] ? extent.y[0] - flyoutExtent.y[0] : 0, flyoutExtent.y[1] > extent.y[1] ? flyoutExtent.y[1] - extent.y[1] : 0]
        };
        return {
          x: Math.round(x2 + adjustments.x[0] - adjustments.x[1]),
          y: Math.round(y2 + adjustments.y[0] - adjustments.y[1])
        };
      }
      // eslint-disable-next-line complexity
    }, {
      key: "getFlyoutCenter",
      value: function getFlyoutCenter(props, dimensions) {
        var x2 = props.x, y2 = props.y, dx = props.dx, dy = props.dy, pointerLength = props.pointerLength, orientation = props.orientation, constrainToVisibleArea = props.constrainToVisibleArea, centerOffset = props.centerOffset;
        var height = dimensions.height, width = dimensions.width;
        var xSign = orientation === "left" ? -1 : 1;
        var ySign = orientation === "bottom" ? -1 : 1;
        var flyoutCenter = {
          x: orientation === "left" || orientation === "right" ? x2 + xSign * (pointerLength + width / 2 + xSign * dx) : x2 + dx,
          y: orientation === "top" || orientation === "bottom" ? y2 - ySign * (pointerLength + height / 2 - ySign * dy) : y2 + dy
        };
        var center = {
          x: (0, import_isPlainObject7.default)(props.center) && props.center.x !== void 0 ? props.center.x : flyoutCenter.x,
          y: (0, import_isPlainObject7.default)(props.center) && props.center.y !== void 0 ? props.center.y : flyoutCenter.y
        };
        var centerWithOffset = {
          x: center.x + centerOffset.x,
          y: center.y + centerOffset.y
        };
        return constrainToVisibleArea ? this.constrainTooltip(centerWithOffset, props, dimensions) : centerWithOffset;
      }
    }, {
      key: "getLabelPadding",
      value: function getLabelPadding2(style) {
        if (!style) {
          return 0;
        }
        var paddings = Array.isArray(style) ? style.map(function(s2) {
          return s2.padding;
        }) : [style.padding];
        return Math.max.apply(Math, _toConsumableArray19(paddings).concat([0]));
      }
    }, {
      key: "getDimensions",
      value: function getDimensions2(props, labelSize) {
        var orientation = props.orientation, pointerLength = props.pointerLength, pointerWidth = props.pointerWidth, flyoutHeight = props.flyoutHeight, flyoutWidth = props.flyoutWidth, flyoutPadding = props.flyoutPadding;
        var cornerRadius = helpers_exports.evaluateProp(props.cornerRadius, props);
        var getHeight = function() {
          var calculatedHeight = labelSize.height + flyoutPadding.top + flyoutPadding.bottom;
          var minHeight = orientation === "top" || orientation === "bottom" ? 2 * cornerRadius : 2 * cornerRadius + pointerWidth;
          return Math.max(minHeight, calculatedHeight);
        };
        var getWidth2 = function() {
          var calculatedWidth = labelSize.width + flyoutPadding.left + flyoutPadding.right;
          var minWidth = orientation === "left" || orientation === "right" ? 2 * cornerRadius + pointerLength : 2 * cornerRadius;
          return Math.max(minWidth, calculatedWidth);
        };
        return {
          flyoutHeight: flyoutHeight ? helpers_exports.evaluateProp(flyoutHeight, props) : getHeight(props, labelSize, orientation),
          flyoutWidth: flyoutWidth ? helpers_exports.evaluateProp(flyoutWidth, props) : getWidth2(props, labelSize, orientation)
        };
      }
    }, {
      key: "getLabelProps",
      value: function getLabelProps(props, calculatedValues) {
        var flyoutCenter = calculatedValues.flyoutCenter, style = calculatedValues.style, labelSize = calculatedValues.labelSize, _calculatedValues$dy = calculatedValues.dy, dy = _calculatedValues$dy === void 0 ? 0 : _calculatedValues$dy, _calculatedValues$dx = calculatedValues.dx, dx = _calculatedValues$dx === void 0 ? 0 : _calculatedValues$dx;
        var text = props.text, datum = props.datum, activePoints = props.activePoints, labelComponent = props.labelComponent, index = props.index, flyoutPadding = props.flyoutPadding;
        var textAnchor = (Array.isArray(style) && style.length ? style[0].textAnchor : style.textAnchor) || "middle";
        var getLabelX = function() {
          if (!textAnchor || textAnchor === "middle") {
            return flyoutCenter.x;
          }
          var sign2 = textAnchor === "end" ? -1 : 1;
          return flyoutCenter.x - sign2 * (labelSize.width / 2);
        };
        return (0, import_defaults19.default)({}, labelComponent.props, {
          key: "".concat(this.id, "-label-").concat(index),
          text,
          datum,
          activePoints,
          textAnchor,
          dy,
          dx,
          style,
          x: getLabelX() + (flyoutPadding.left - flyoutPadding.right) / 2,
          y: flyoutCenter.y + (flyoutPadding.top - flyoutPadding.bottom) / 2,
          verticalAnchor: "middle",
          angle: style.angle
        });
      }
    }, {
      key: "getPointerOrientation",
      value: function getPointerOrientation(point6, center, flyoutDimensions) {
        var edges = {
          bottom: center.y + flyoutDimensions.height / 2,
          top: center.y - flyoutDimensions.height / 2,
          left: center.x - flyoutDimensions.width / 2,
          right: center.x + flyoutDimensions.width / 2
        };
        var gaps = [{
          side: "top",
          val: edges.top > point6.y ? edges.top - point6.y : -1
        }, {
          side: "bottom",
          val: edges.bottom < point6.y ? point6.y - edges.bottom : -1
        }, {
          side: "right",
          val: edges.right < point6.x ? point6.x - edges.right : -1
        }, {
          side: "left",
          val: edges.left > point6.x ? edges.left - point6.x : -1
        }];
        return (0, import_orderBy4.default)(gaps, "val", "desc")[0].side;
      }
    }, {
      key: "getFlyoutProps",
      value: function getFlyoutProps(props, calculatedValues) {
        var flyoutDimensions = calculatedValues.flyoutDimensions, flyoutStyle = calculatedValues.flyoutStyle, flyoutCenter = calculatedValues.flyoutCenter;
        var x2 = props.x, y2 = props.y, dx = props.dx, dy = props.dy, datum = props.datum, activePoints = props.activePoints, index = props.index, pointerLength = props.pointerLength, pointerWidth = props.pointerWidth, cornerRadius = props.cornerRadius, events = props.events, flyoutComponent = props.flyoutComponent;
        var pointerOrientation = helpers_exports.evaluateProp(props.pointerOrientation, props);
        return (0, import_defaults19.default)({}, flyoutComponent.props, {
          x: x2,
          y: y2,
          dx,
          dy,
          datum,
          activePoints,
          index,
          pointerLength,
          pointerWidth,
          cornerRadius,
          events,
          orientation: pointerOrientation || this.getPointerOrientation({
            x: x2,
            y: y2
          }, flyoutCenter, flyoutDimensions),
          key: "".concat(this.id, "-tooltip-").concat(index),
          width: flyoutDimensions.width,
          height: flyoutDimensions.height,
          style: flyoutStyle,
          center: flyoutCenter
        });
      }
      // Overridden in victory-core-native
    }, {
      key: "renderTooltip",
      value: function renderTooltip(props) {
        var active = helpers_exports.evaluateProp(props.active, props);
        var renderInPortal = props.renderInPortal;
        if (!active) {
          return renderInPortal ? /* @__PURE__ */ import_react77.default.createElement(VictoryPortal, null, null) : null;
        }
        var evaluatedProps = this.getEvaluatedProps(props);
        var flyoutComponent = evaluatedProps.flyoutComponent, labelComponent = evaluatedProps.labelComponent, groupComponent = evaluatedProps.groupComponent;
        var calculatedValues = this.getCalculatedValues(evaluatedProps);
        var children = [/* @__PURE__ */ import_react77.default.cloneElement(flyoutComponent, this.getFlyoutProps(evaluatedProps, calculatedValues)), /* @__PURE__ */ import_react77.default.cloneElement(labelComponent, this.getLabelProps(evaluatedProps, calculatedValues))];
        var tooltip = /* @__PURE__ */ import_react77.default.cloneElement(groupComponent, {
          role: "presentation",
          transform: calculatedValues.transform
        }, children);
        return renderInPortal ? /* @__PURE__ */ import_react77.default.createElement(VictoryPortal, null, tooltip) : tooltip;
      }
    }, {
      key: "render",
      value: function render() {
        var props = helpers_exports.modifyProps(this.props, fallbackProps5, "tooltip");
        return this.renderTooltip(props);
      }
    }]);
    return VictoryTooltip2;
  }(import_react77.default.Component);
  VictoryTooltip.displayName = "VictoryTooltip";
  VictoryTooltip.role = "tooltip";
  VictoryTooltip.propTypes = {
    activateData: import_prop_types57.default.bool,
    active: import_prop_types57.default.oneOfType([import_prop_types57.default.bool, import_prop_types57.default.func]),
    activePoints: import_prop_types57.default.array,
    angle: import_prop_types57.default.number,
    center: import_prop_types57.default.shape({
      x: prop_types_exports.nonNegative,
      y: prop_types_exports.nonNegative
    }),
    centerOffset: import_prop_types57.default.shape({
      x: import_prop_types57.default.oneOfType([import_prop_types57.default.number, import_prop_types57.default.func]),
      y: import_prop_types57.default.oneOfType([import_prop_types57.default.number, import_prop_types57.default.func])
    }),
    constrainToVisibleArea: import_prop_types57.default.bool,
    cornerRadius: import_prop_types57.default.oneOfType([prop_types_exports.nonNegative, import_prop_types57.default.func]),
    data: import_prop_types57.default.array,
    datum: import_prop_types57.default.object,
    dx: import_prop_types57.default.oneOfType([import_prop_types57.default.number, import_prop_types57.default.func]),
    dy: import_prop_types57.default.oneOfType([import_prop_types57.default.number, import_prop_types57.default.func]),
    events: import_prop_types57.default.object,
    flyoutComponent: import_prop_types57.default.element,
    flyoutHeight: import_prop_types57.default.oneOfType([prop_types_exports.nonNegative, import_prop_types57.default.func]),
    flyoutPadding: import_prop_types57.default.oneOfType([import_prop_types57.default.func, import_prop_types57.default.number, import_prop_types57.default.shape({
      top: import_prop_types57.default.number,
      bottom: import_prop_types57.default.number,
      left: import_prop_types57.default.number,
      right: import_prop_types57.default.number
    })]),
    flyoutStyle: import_prop_types57.default.object,
    flyoutWidth: import_prop_types57.default.oneOfType([prop_types_exports.nonNegative, import_prop_types57.default.func]),
    groupComponent: import_prop_types57.default.element,
    height: import_prop_types57.default.number,
    horizontal: import_prop_types57.default.bool,
    id: import_prop_types57.default.oneOfType([import_prop_types57.default.number, import_prop_types57.default.string]),
    index: import_prop_types57.default.oneOfType([import_prop_types57.default.number, import_prop_types57.default.string]),
    labelComponent: import_prop_types57.default.element,
    orientation: import_prop_types57.default.oneOfType([import_prop_types57.default.oneOf(["top", "bottom", "left", "right"]), import_prop_types57.default.func]),
    pointerLength: import_prop_types57.default.oneOfType([prop_types_exports.nonNegative, import_prop_types57.default.func]),
    pointerOrientation: import_prop_types57.default.oneOfType([import_prop_types57.default.oneOf(["top", "bottom", "left", "right"]), import_prop_types57.default.func]),
    pointerWidth: import_prop_types57.default.oneOfType([prop_types_exports.nonNegative, import_prop_types57.default.func]),
    polar: import_prop_types57.default.bool,
    renderInPortal: import_prop_types57.default.bool,
    scale: import_prop_types57.default.shape({
      x: prop_types_exports.scale,
      y: prop_types_exports.scale
    }),
    style: import_prop_types57.default.oneOfType([import_prop_types57.default.object, import_prop_types57.default.array]),
    text: import_prop_types57.default.oneOfType([import_prop_types57.default.string, import_prop_types57.default.number, import_prop_types57.default.func, import_prop_types57.default.array]),
    theme: import_prop_types57.default.object,
    width: import_prop_types57.default.number,
    x: import_prop_types57.default.number,
    y: import_prop_types57.default.number
  };
  VictoryTooltip.defaultProps = {
    active: false,
    renderInPortal: true,
    labelComponent: /* @__PURE__ */ import_react77.default.createElement(VictoryLabel, null),
    flyoutComponent: /* @__PURE__ */ import_react77.default.createElement(flyout_default, null),
    groupComponent: /* @__PURE__ */ import_react77.default.createElement("g", null)
  };
  VictoryTooltip.defaultEvents = function(props) {
    var activate = props.activateData ? [{
      target: "labels",
      mutation: function() {
        return {
          active: true
        };
      }
    }, {
      target: "data",
      mutation: function() {
        return {
          active: true
        };
      }
    }] : [{
      target: "labels",
      mutation: function() {
        return {
          active: true
        };
      }
    }];
    var deactivate = props.activateData ? [{
      target: "labels",
      mutation: function() {
        return {
          active: void 0
        };
      }
    }, {
      target: "data",
      mutation: function() {
        return {
          active: void 0
        };
      }
    }] : [{
      target: "labels",
      mutation: function() {
        return {
          active: void 0
        };
      }
    }];
    return [{
      target: "data",
      eventHandlers: {
        onMouseOver: function() {
          return activate;
        },
        onFocus: function() {
          return activate;
        },
        onTouchStart: function() {
          return activate;
        },
        onMouseOut: function() {
          return deactivate;
        },
        onBlur: function() {
          return deactivate;
        },
        onTouchEnd: function() {
          return deactivate;
        }
      }
    }];
  };

  // node_modules/victory-voronoi-container/es/voronoi-helpers.js
  var import_isRegExp2 = __toESM(require_isRegExp());
  var import_isString = __toESM(require_isString());
  var import_includes6 = __toESM(require_includes());
  var import_isEmpty9 = __toESM(require_isEmpty());
  var import_isFunction12 = __toESM(require_isFunction());
  var import_throttle = __toESM(require_throttle());
  var import_assign28 = __toESM(require_assign());
  var import_react_fast_compare6 = __toESM(require_react_fast_compare());
  var import_lib = __toESM(require_lib());
  var import_react78 = __toESM(require_react());
  function _toConsumableArray20(arr) {
    return _arrayWithoutHoles19(arr) || _iterableToArray19(arr) || _unsupportedIterableToArray21(arr) || _nonIterableSpread19();
  }
  function _nonIterableSpread19() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray21(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray21(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray21(o, minLen);
  }
  function _iterableToArray19(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles19(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray21(arr);
  }
  function _arrayLikeToArray21(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  var VoronoiHelpers = {
    withinBounds: function(props, point6) {
      var width = props.width, height = props.height, polar = props.polar, origin = props.origin, scale2 = props.scale;
      var padding2 = helpers_exports.getPadding(props, "voronoiPadding");
      var x2 = point6.x, y2 = point6.y;
      if (polar) {
        var distanceSquared = Math.pow(x2 - origin.x, 2) + Math.pow(y2 - origin.y, 2);
        var radius = Math.max.apply(Math, _toConsumableArray20(scale2.y.range()));
        return distanceSquared < Math.pow(radius, 2);
      }
      return x2 >= padding2.left && x2 <= width - padding2.right && y2 >= padding2.top && y2 <= height - padding2.bottom;
    },
    getDatasets: function(props) {
      var minDomain = {
        x: collection_exports.getMinValue(props.domain.x),
        y: collection_exports.getMinValue(props.domain.y)
      };
      var children = import_react78.default.Children.toArray(props.children);
      var addMeta = function(data, name2, child) {
        var continuous2 = child && child.type && child.type.continuous;
        var style = child ? child.props && child.props.style : props.style;
        return data.map(function(datum, index) {
          var _Helpers$getPoint = helpers_exports.getPoint(datum), x2 = _Helpers$getPoint.x, y2 = _Helpers$getPoint.y, y0 = _Helpers$getPoint.y0, x0 = _Helpers$getPoint.x0;
          var voronoiX = (Number(x2) + Number(x0)) / 2;
          var voronoiY = (Number(y2) + Number(y0)) / 2;
          return (0, import_assign28.default)({
            _voronoiX: props.voronoiDimension === "y" ? minDomain.x : voronoiX,
            _voronoiY: props.voronoiDimension === "x" ? minDomain.y : voronoiY,
            eventKey: index,
            childName: name2,
            continuous: continuous2,
            style
          }, datum);
        });
      };
      if (props.data) {
        return addMeta(props.data);
      }
      var getData3 = function(childProps) {
        var data = data_exports.getData(childProps);
        return Array.isArray(data) && data.length > 0 ? data : void 0;
      };
      var iteratee = function(child, childName) {
        var childProps = child.props || {};
        var name2 = childProps.name || childName;
        var blacklist = props.voronoiBlacklist || [];
        var blacklistStr = blacklist.filter(import_isString.default);
        var blacklistRegExp = blacklist.filter(import_isRegExp2.default);
        var isRegExpMatch = blacklistRegExp.some(function(regExp2) {
          return regExp2.test(name2);
        });
        if (!data_exports.isDataComponent(child) || (0, import_includes6.default)(blacklistStr, name2) || isRegExpMatch) {
          return null;
        }
        var getChildData2 = child.type && (0, import_isFunction12.default)(child.type.getData) ? child.type.getData : getData3;
        var childData = getChildData2(child.props);
        return childData ? addMeta(childData, name2, child) : null;
      };
      return helpers_exports.reduceChildren(children, iteratee, props);
    },
    findPoints: function(datasets, point6) {
      return datasets.filter(function(d) {
        return point6._voronoiX === d._voronoiX && point6._voronoiY === d._voronoiY;
      });
    },
    withinRadius: function(point6, mousePosition, radius) {
      if (!point6) {
        return false;
      }
      if (!radius) {
        return true;
      }
      var x2 = mousePosition.x, y2 = mousePosition.y;
      var distanceSquared = Math.pow(x2 - point6[0], 2) + Math.pow(y2 - point6[1], 2);
      return distanceSquared < Math.pow(radius, 2);
    },
    getVoronoiPoints: function(props, mousePosition) {
      var datasets = this.getDatasets(props);
      var scaledData = datasets.map(function(d) {
        var _Helpers$scalePoint = helpers_exports.scalePoint(props, d), x2 = _Helpers$scalePoint.x, y2 = _Helpers$scalePoint.y;
        return [x2, y2];
      });
      var delaunay = import_lib.default.from(scaledData);
      var index = delaunay.find(mousePosition.x, mousePosition.y);
      var withinRadius = this.withinRadius(scaledData[index], mousePosition, props.radius);
      var points = withinRadius ? this.findPoints(datasets, datasets[index]) : [];
      return {
        points,
        index
      };
    },
    getActiveMutations: function(props, point6) {
      var childName = point6.childName, continuous2 = point6.continuous;
      var activateData = props.activateData, activateLabels = props.activateLabels, labels = props.labels;
      if (!activateData && !activateLabels) {
        return [];
      }
      var defaultTarget = activateData ? ["data"] : [];
      var targets = labels && !activateLabels ? defaultTarget : defaultTarget.concat("labels");
      if ((0, import_isEmpty9.default)(targets)) {
        return [];
      }
      return targets.map(function(target) {
        var eventKey = continuous2 === true && target === "data" ? "all" : point6.eventKey;
        return {
          childName,
          eventKey,
          target,
          mutation: function() {
            return {
              active: true
            };
          }
        };
      });
    },
    getInactiveMutations: function(props, point6) {
      var childName = point6.childName, continuous2 = point6.continuous;
      var activateData = props.activateData, activateLabels = props.activateLabels, labels = props.labels;
      if (!activateData && !activateLabels) {
        return [];
      }
      var defaultTarget = activateData ? ["data"] : [];
      var targets = labels && !activateLabels ? defaultTarget : defaultTarget.concat("labels");
      if ((0, import_isEmpty9.default)(targets)) {
        return [];
      }
      return targets.map(function(target) {
        var eventKey = continuous2 && target === "data" ? "all" : point6.eventKey;
        return {
          childName,
          eventKey,
          target,
          mutation: function() {
            return null;
          }
        };
      });
    },
    // eslint-disable-next-line max-params
    getParentMutation: function(activePoints, mousePosition, parentSVG, vIndex) {
      return [{
        target: "parent",
        eventKey: "parent",
        mutation: function() {
          return {
            activePoints,
            mousePosition,
            parentSVG,
            vIndex
          };
        }
      }];
    },
    onActivated: function(props, points) {
      if ((0, import_isFunction12.default)(props.onActivated)) {
        props.onActivated(points, props);
      }
    },
    onDeactivated: function(props, points) {
      if ((0, import_isFunction12.default)(props.onDeactivated)) {
        props.onDeactivated(points, props);
      }
    },
    onMouseLeave: function(evt, targetProps) {
      var _this = this, _this$getParentMutati;
      var activePoints = targetProps.activePoints || [];
      this.onDeactivated(targetProps, activePoints);
      var inactiveMutations = activePoints.length ? activePoints.map(function(point6) {
        return _this.getInactiveMutations(targetProps, point6);
      }) : [];
      return (_this$getParentMutati = this.getParentMutation([])).concat.apply(_this$getParentMutati, _toConsumableArray20(inactiveMutations));
    },
    onMouseMove: function(evt, targetProps) {
      var _this2 = this;
      var activePoints = targetProps.activePoints || [];
      var parentSVG = targetProps.parentSVG || selection_exports.getParentSVG(evt);
      var mousePosition = selection_exports.getSVGEventCoordinates(evt, parentSVG);
      if (!this.withinBounds(targetProps, mousePosition)) {
        var _this$getParentMutati2;
        this.onDeactivated(targetProps, activePoints);
        var _inactiveMutations = activePoints.length ? activePoints.map(function(point6) {
          return _this2.getInactiveMutations(targetProps, point6);
        }) : [];
        return (_this$getParentMutati2 = this.getParentMutation([], mousePosition, parentSVG)).concat.apply(_this$getParentMutati2, _toConsumableArray20(_inactiveMutations));
      }
      var _this$getVoronoiPoint = this.getVoronoiPoints(targetProps, mousePosition), _this$getVoronoiPoint2 = _this$getVoronoiPoint.points, points = _this$getVoronoiPoint2 === void 0 ? [] : _this$getVoronoiPoint2, index = _this$getVoronoiPoint.index;
      var parentMutations = this.getParentMutation(points, mousePosition, parentSVG, index);
      if (activePoints.length && (0, import_react_fast_compare6.default)(points, activePoints)) {
        return parentMutations;
      }
      this.onActivated(targetProps, points);
      this.onDeactivated(targetProps, activePoints);
      var activeMutations = points.length ? points.map(function(point6) {
        return _this2.getActiveMutations(targetProps, point6);
      }) : [];
      var inactiveMutations = activePoints.length ? activePoints.map(function(point6) {
        return _this2.getInactiveMutations(targetProps, point6);
      }) : [];
      return parentMutations.concat.apply(parentMutations, _toConsumableArray20(inactiveMutations).concat(_toConsumableArray20(activeMutations)));
    }
  };
  var voronoi_helpers_default = {
    onMouseLeave: VoronoiHelpers.onMouseLeave.bind(VoronoiHelpers),
    onMouseMove: (0, import_throttle.default)(
      VoronoiHelpers.onMouseMove.bind(VoronoiHelpers),
      32,
      // eslint-disable-line no-magic-numbers
      {
        leading: true,
        trailing: false
      }
    )
  };

  // node_modules/victory-voronoi-container/es/victory-voronoi-container.js
  var _excluded7 = ["childName", "eventKey", "style", "continuous"];
  function _toConsumableArray21(arr) {
    return _arrayWithoutHoles20(arr) || _iterableToArray20(arr) || _unsupportedIterableToArray22(arr) || _nonIterableSpread20();
  }
  function _nonIterableSpread20() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray22(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray22(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray22(o, minLen);
  }
  function _iterableToArray20(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles20(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray22(arr);
  }
  function _arrayLikeToArray22(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _objectWithoutProperties8(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose7(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _objectWithoutPropertiesLoose7(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  function ownKeys18(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread18(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys18(Object(source), true).forEach(function(key) {
        _defineProperty23(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys18(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty23(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _classCallCheck15(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties14(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass15(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties14(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties14(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits13(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf12(subClass, superClass);
  }
  function _setPrototypeOf12(o, p2) {
    _setPrototypeOf12 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf12(o, p2);
  }
  function _createSuper12(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct12();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf12(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf12(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn13(this, result);
    };
  }
  function _possibleConstructorReturn13(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized12(self2);
  }
  function _assertThisInitialized12(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct12() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf12(o) {
    _getPrototypeOf12 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf12(o);
  }
  var voronoiContainerMixin = function(base) {
    var _class;
    return _class = /* @__PURE__ */ function(_base) {
      _inherits13(VictoryVoronoiContainer, _base);
      var _super = _createSuper12(VictoryVoronoiContainer);
      function VictoryVoronoiContainer() {
        _classCallCheck15(this, VictoryVoronoiContainer);
        return _super.apply(this, arguments);
      }
      _createClass15(VictoryVoronoiContainer, [{
        key: "getDimension",
        value: function getDimension(props) {
          var horizontal = props.horizontal, voronoiDimension = props.voronoiDimension;
          if (!horizontal || !voronoiDimension) {
            return voronoiDimension;
          }
          return voronoiDimension === "x" ? "y" : "x";
        }
      }, {
        key: "getPoint",
        value: function getPoint2(point6) {
          var whitelist = ["_x", "_x1", "_x0", "_y", "_y1", "_y0"];
          return (0, import_pick4.default)(point6, whitelist);
        }
      }, {
        key: "getLabelPosition",
        value: function getLabelPosition(props, labelProps, points) {
          var mousePosition = props.mousePosition, mouseFollowTooltips = props.mouseFollowTooltips;
          var voronoiDimension = this.getDimension(props);
          var point6 = this.getPoint(points[0]);
          var basePosition = helpers_exports.scalePoint(props, point6);
          var center = mouseFollowTooltips ? mousePosition : void 0;
          if (!voronoiDimension || points.length < 2) {
            return _objectSpread18(_objectSpread18({}, basePosition), {}, {
              center: (0, import_defaults20.default)({}, labelProps.center, center)
            });
          }
          var x2 = voronoiDimension === "y" ? mousePosition.x : basePosition.x;
          var y2 = voronoiDimension === "x" ? mousePosition.y : basePosition.y;
          center = mouseFollowTooltips ? mousePosition : {
            x: x2,
            y: y2
          };
          return {
            x: x2,
            y: y2,
            center: (0, import_defaults20.default)({}, labelProps.center, center)
          };
        }
      }, {
        key: "getStyle",
        value: function getStyle2(props, points, type) {
          var labels = props.labels, labelComponent = props.labelComponent, theme = props.theme;
          var componentProps = labelComponent.props || {};
          var themeStyles = theme && theme.voronoi && theme.voronoi.style ? theme.voronoi.style : {};
          var componentStyleArray = type === "flyout" ? componentProps.flyoutStyle : componentProps.style;
          return points.reduce(function(memo2, datum, index) {
            var labelProps = (0, import_defaults20.default)({}, componentProps, {
              datum,
              active: true
            });
            var text = (0, import_isFunction13.default)(labels) ? labels(labelProps) : void 0;
            var textArray = text !== void 0 ? "".concat(text).split("\n") : [];
            var baseStyle = datum.style && datum.style[type] || {};
            var componentStyle = Array.isArray(componentStyleArray) ? componentStyleArray[index] : componentStyleArray;
            var style = helpers_exports.evaluateStyle((0, import_defaults20.default)({}, componentStyle, baseStyle, themeStyles[type]), labelProps);
            var styleArray = textArray.length ? textArray.map(function() {
              return style;
            }) : [style];
            memo2 = memo2.concat(styleArray);
            return memo2;
          }, []);
        }
      }, {
        key: "getDefaultLabelProps",
        value: function getDefaultLabelProps(props, points) {
          var voronoiDimension = props.voronoiDimension, horizontal = props.horizontal, mouseFollowTooltips = props.mouseFollowTooltips;
          var point6 = this.getPoint(points[0]);
          var multiPoint = voronoiDimension && points.length > 1;
          var y2 = point6._y1 !== void 0 ? point6._y1 : point6._y;
          var defaultHorizontalOrientation = y2 < 0 ? "left" : "right";
          var defaultOrientation = y2 < 0 ? "bottom" : "top";
          var labelOrientation = horizontal ? defaultHorizontalOrientation : defaultOrientation;
          var orientation = mouseFollowTooltips ? void 0 : labelOrientation;
          return {
            orientation,
            pointerLength: multiPoint ? 0 : void 0,
            constrainToVisibleArea: multiPoint || mouseFollowTooltips ? true : void 0
          };
        }
      }, {
        key: "getLabelProps",
        value: function getLabelProps(props, points) {
          var labels = props.labels, scale2 = props.scale, labelComponent = props.labelComponent, theme = props.theme, width = props.width, height = props.height;
          var componentProps = labelComponent.props || {};
          var text = points.reduce(function(memo2, datum2) {
            var labelProps2 = (0, import_defaults20.default)({}, componentProps, {
              datum: datum2,
              active: true
            });
            var t = (0, import_isFunction13.default)(labels) ? labels(labelProps2) : null;
            if (t === null || t === void 0) {
              return memo2;
            }
            memo2 = memo2.concat("".concat(t).split("\n"));
            return memo2;
          }, []);
          var _points$ = points[0], childName = _points$.childName, eventKey = _points$.eventKey, style = _points$.style, continuous2 = _points$.continuous, datum = _objectWithoutProperties8(_points$, _excluded7);
          var name2 = props.name === childName ? childName : "".concat(props.name, "-").concat(childName);
          var labelProps = (0, import_defaults20.default)({
            key: "".concat(name2, "-").concat(eventKey, "-voronoi-tooltip"),
            id: "".concat(name2, "-").concat(eventKey, "-voronoi-tooltip"),
            active: true,
            renderInPortal: false,
            activePoints: points,
            datum,
            scale: scale2,
            theme
          }, componentProps, {
            text,
            width,
            height,
            style: this.getStyle(props, points, "labels"),
            flyoutStyle: this.getStyle(props, points, "flyout")[0]
          }, this.getDefaultLabelProps(props, points));
          var labelPosition = this.getLabelPosition(props, labelProps, points);
          return (0, import_defaults20.default)({}, labelPosition, labelProps);
        }
      }, {
        key: "getTooltip",
        value: function getTooltip(props) {
          var labels = props.labels, activePoints = props.activePoints, labelComponent = props.labelComponent;
          if (!labels) {
            return null;
          }
          if (Array.isArray(activePoints) && activePoints.length) {
            var labelProps = this.getLabelProps(props, activePoints);
            var text = labelProps.text;
            var showLabel = Array.isArray(text) ? text.filter(Boolean).length : text;
            return showLabel ? /* @__PURE__ */ import_react79.default.cloneElement(labelComponent, labelProps) : null;
          }
          return null;
        }
        // Overrides method in VictoryContainer
      }, {
        key: "getChildren",
        value: function getChildren3(props) {
          return [].concat(_toConsumableArray21(import_react79.default.Children.toArray(props.children)), [this.getTooltip(props)]);
        }
      }]);
      return VictoryVoronoiContainer;
    }(base), _class.displayName = "VictoryVoronoiContainer", _class.propTypes = _objectSpread18(_objectSpread18({}, VictoryContainer.propTypes), {}, {
      activateData: import_prop_types58.default.bool,
      activateLabels: import_prop_types58.default.bool,
      disable: import_prop_types58.default.bool,
      labelComponent: import_prop_types58.default.element,
      labels: import_prop_types58.default.func,
      mouseFollowTooltips: import_prop_types58.default.bool,
      onActivated: import_prop_types58.default.func,
      onDeactivated: import_prop_types58.default.func,
      radius: import_prop_types58.default.number,
      voronoiBlacklist: import_prop_types58.default.arrayOf(import_prop_types58.default.oneOfType([import_prop_types58.default.string, prop_types_exports.regExp])),
      voronoiDimension: import_prop_types58.default.oneOf(["x", "y"]),
      voronoiPadding: import_prop_types58.default.oneOfType([import_prop_types58.default.number, import_prop_types58.default.shape({
        top: import_prop_types58.default.number,
        bottom: import_prop_types58.default.number,
        left: import_prop_types58.default.number,
        right: import_prop_types58.default.number
      })])
    }), _class.defaultProps = _objectSpread18(_objectSpread18({}, VictoryContainer.defaultProps), {}, {
      activateData: true,
      activateLabels: true,
      labelComponent: /* @__PURE__ */ import_react79.default.createElement(VictoryTooltip, null),
      voronoiPadding: 5
    }), _class.defaultEvents = function(props) {
      return [{
        target: "parent",
        eventHandlers: {
          onMouseLeave: function(evt, targetProps) {
            return props.disable ? {} : voronoi_helpers_default.onMouseLeave(evt, targetProps);
          },
          onTouchCancel: function(evt, targetProps) {
            return props.disable ? {} : voronoi_helpers_default.onMouseLeave(evt, targetProps);
          },
          onMouseMove: function(evt, targetProps) {
            return props.disable ? {} : voronoi_helpers_default.onMouseMove(evt, targetProps);
          },
          onTouchMove: function(evt, targetProps) {
            return props.disable ? {} : voronoi_helpers_default.onMouseMove(evt, targetProps);
          }
        }
      }, {
        target: "data",
        eventHandlers: props.disable ? {} : {
          onMouseOver: function() {
            return null;
          },
          onMouseOut: function() {
            return null;
          },
          onMouseMove: function() {
            return null;
          }
        }
      }];
    }, _class;
  };
  var victory_voronoi_container_default = voronoiContainerMixin(VictoryContainer);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTooltip/ChartTooltip.js
  init_tslib_es6();
  var React304 = __toESM(require_react());
  var import_hoist_non_react_statics2 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLabel/ChartLabel.js
  init_tslib_es6();
  var React303 = __toESM(require_react());
  var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
  var import_defaults21 = __toESM(require_defaults());

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_grid_stroke_Color.js
  var chart_axis_grid_stroke_Color = {
    "name": "--pf-chart-axis--grid--stroke--Color",
    "value": "#d2d2d2",
    "var": "var(--pf-chart-axis--grid--stroke--Color, #d2d2d2)"
  };
  var chart_axis_grid_stroke_Color_default = chart_axis_grid_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_stroke_Color.js
  var chart_axis_tick_stroke_Color = {
    "name": "--pf-chart-axis--tick--stroke--Color",
    "value": "#d2d2d2",
    "var": "var(--pf-chart-axis--tick--stroke--Color, #d2d2d2)"
  };
  var chart_axis_tick_stroke_Color_default = chart_axis_tick_stroke_Color;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/axis-theme.js
  var AxisTheme = {
    axis: {
      style: {
        grid: {
          stroke: chart_axis_grid_stroke_Color_default.var
        },
        ticks: {
          stroke: chart_axis_tick_stroke_Color_default.var
        }
      }
    }
  };

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_FontFamily.js
  var chart_global_FontFamily = {
    "name": "--pf-chart-global--FontFamily",
    "value": '"RedHatText", "Overpass", overpass, helvetica, arial, sans-serif',
    "var": 'var(--pf-chart-global--FontFamily, "RedHatText", "Overpass", overpass, helvetica, arial, sans-serif)'
  };
  var chart_global_FontFamily_default = chart_global_FontFamily;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_letter_spacing.js
  var chart_global_letter_spacing = {
    "name": "--pf-chart-global--letter-spacing",
    "value": "normal",
    "var": "var(--pf-chart-global--letter-spacing, normal)"
  };
  var chart_global_letter_spacing_default = chart_global_letter_spacing;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_FontSize_sm.js
  var chart_global_FontSize_sm = {
    "name": "--pf-chart-global--FontSize--sm",
    "value": 14,
    "var": "var(--pf-chart-global--FontSize--sm, 14)"
  };
  var chart_global_FontSize_sm_default = chart_global_FontSize_sm;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_Padding.js
  var chart_global_label_Padding = {
    "name": "--pf-chart-global--label--Padding",
    "value": 10,
    "var": "var(--pf-chart-global--label--Padding, 10)"
  };
  var chart_global_label_Padding_default = chart_global_label_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_stroke.js
  var chart_global_label_stroke = {
    "name": "--pf-chart-global--label--stroke",
    "value": "transparent",
    "var": "var(--pf-chart-global--label--stroke, transparent)"
  };
  var chart_global_label_stroke_default = chart_global_label_stroke;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_text_anchor.js
  var chart_global_label_text_anchor = {
    "name": "--pf-chart-global--label--text-anchor",
    "value": "middle",
    "var": "var(--pf-chart-global--label--text-anchor, middle)"
  };
  var chart_global_label_text_anchor_default = chart_global_label_text_anchor;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_Fill.js
  var chart_global_label_Fill = {
    "name": "--pf-chart-global--label--Fill",
    "value": "#151515",
    "var": "var(--pf-chart-global--label--Fill, #151515)"
  };
  var chart_global_label_Fill_default = chart_global_label_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_layout_Padding.js
  var chart_global_layout_Padding = {
    "name": "--pf-chart-global--layout--Padding",
    "value": 50,
    "var": "var(--pf-chart-global--layout--Padding, 50)"
  };
  var chart_global_layout_Padding_default = chart_global_layout_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_layout_Height.js
  var chart_global_layout_Height = {
    "name": "--pf-chart-global--layout--Height",
    "value": 300,
    "var": "var(--pf-chart-global--layout--Height, 300)"
  };
  var chart_global_layout_Height_default = chart_global_layout_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_layout_Width.js
  var chart_global_layout_Width = {
    "name": "--pf-chart-global--layout--Width",
    "value": 450,
    "var": "var(--pf-chart-global--layout--Width, 450)"
  };
  var chart_global_layout_Width_default = chart_global_layout_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_stroke_line_cap.js
  var chart_global_stroke_line_cap = {
    "name": "--pf-chart-global--stroke-line-cap",
    "value": "round",
    "var": "var(--pf-chart-global--stroke-line-cap, round)"
  };
  var chart_global_stroke_line_cap_default = chart_global_stroke_line_cap;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_stroke_line_join.js
  var chart_global_stroke_line_join = {
    "name": "--pf-chart-global--stroke-line-join",
    "value": "round",
    "var": "var(--pf-chart-global--stroke-line-join, round)"
  };
  var chart_global_stroke_line_join_default = chart_global_stroke_line_join;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_area_data_Fill.js
  var chart_area_data_Fill = {
    "name": "--pf-chart-area--data--Fill",
    "value": "#151515",
    "var": "var(--pf-chart-area--data--Fill, #151515)"
  };
  var chart_area_data_Fill_default = chart_area_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_area_Opacity.js
  var chart_area_Opacity = {
    "name": "--pf-chart-area--Opacity",
    "value": 0.3,
    "var": "var(--pf-chart-area--Opacity, 0.3)"
  };
  var chart_area_Opacity_default = chart_area_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_area_stroke_Width.js
  var chart_area_stroke_Width = {
    "name": "--pf-chart-area--stroke--Width",
    "value": 2,
    "var": "var(--pf-chart-area--stroke--Width, 2)"
  };
  var chart_area_stroke_Width_default = chart_area_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_stroke_Width.js
  var chart_axis_axis_stroke_Width = {
    "name": "--pf-chart-axis--axis--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-axis--axis--stroke--Width, 1)"
  };
  var chart_axis_axis_stroke_Width_default = chart_axis_axis_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_stroke_Color.js
  var chart_axis_axis_stroke_Color = {
    "name": "--pf-chart-axis--axis--stroke--Color",
    "value": "#d2d2d2",
    "var": "var(--pf-chart-axis--axis--stroke--Color, #d2d2d2)"
  };
  var chart_axis_axis_stroke_Color_default = chart_axis_axis_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_Fill.js
  var chart_axis_axis_Fill = {
    "name": "--pf-chart-axis--axis--Fill",
    "value": "transparent",
    "var": "var(--pf-chart-axis--axis--Fill, transparent)"
  };
  var chart_axis_axis_Fill_default = chart_axis_axis_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_label_Padding.js
  var chart_axis_axis_label_Padding = {
    "name": "--pf-chart-axis--axis-label--Padding",
    "value": 40,
    "var": "var(--pf-chart-axis--axis-label--Padding, 40)"
  };
  var chart_axis_axis_label_Padding_default = chart_axis_axis_label_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_label_stroke_Color.js
  var chart_axis_axis_label_stroke_Color = {
    "name": "--pf-chart-axis--axis-label--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-chart-axis--axis-label--stroke--Color, transparent)"
  };
  var chart_axis_axis_label_stroke_Color_default = chart_axis_axis_label_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_grid_Fill.js
  var chart_axis_grid_Fill = {
    "name": "--pf-chart-axis--grid--Fill",
    "value": "none",
    "var": "var(--pf-chart-axis--grid--Fill, none)"
  };
  var chart_axis_grid_Fill_default = chart_axis_grid_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_grid_PointerEvents.js
  var chart_axis_grid_PointerEvents = {
    "name": "--pf-chart-axis--grid--PointerEvents",
    "value": "painted",
    "var": "var(--pf-chart-axis--grid--PointerEvents, painted)"
  };
  var chart_axis_grid_PointerEvents_default = chart_axis_grid_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_Fill.js
  var chart_axis_tick_Fill = {
    "name": "--pf-chart-axis--tick--Fill",
    "value": "transparent",
    "var": "var(--pf-chart-axis--tick--Fill, transparent)"
  };
  var chart_axis_tick_Fill_default = chart_axis_tick_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_Size.js
  var chart_axis_tick_Size = {
    "name": "--pf-chart-axis--tick--Size",
    "value": 5,
    "var": "var(--pf-chart-axis--tick--Size, 5)"
  };
  var chart_axis_tick_Size_default = chart_axis_tick_Size;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_Width.js
  var chart_axis_tick_Width = {
    "name": "--pf-chart-axis--tick--Width",
    "value": 1,
    "var": "var(--pf-chart-axis--tick--Width, 1)"
  };
  var chart_axis_tick_Width_default = chart_axis_tick_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_label_Fill.js
  var chart_axis_tick_label_Fill = {
    "name": "--pf-chart-axis--tick-label--Fill",
    "value": "#4f5255",
    "var": "var(--pf-chart-axis--tick-label--Fill, #4f5255)"
  };
  var chart_axis_tick_label_Fill_default = chart_axis_tick_label_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_Width.js
  var chart_bar_Width = {
    "name": "--pf-chart-bar--Width",
    "value": 10,
    "var": "var(--pf-chart-bar--Width, 10)"
  };
  var chart_bar_Width_default = chart_bar_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_stroke.js
  var chart_bar_data_stroke = {
    "name": "--pf-chart-bar--data--stroke",
    "value": "none",
    "var": "var(--pf-chart-bar--data--stroke, none)"
  };
  var chart_bar_data_stroke_default = chart_bar_data_stroke;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_Fill.js
  var chart_bar_data_Fill = {
    "name": "--pf-chart-bar--data--Fill",
    "value": "#151515",
    "var": "var(--pf-chart-bar--data--Fill, #151515)"
  };
  var chart_bar_data_Fill_default = chart_bar_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_Padding.js
  var chart_bar_data_Padding = {
    "name": "--pf-chart-bar--data--Padding",
    "value": 8,
    "var": "var(--pf-chart-bar--data--Padding, 8)"
  };
  var chart_bar_data_Padding_default = chart_bar_data_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_stroke_Width.js
  var chart_bar_data_stroke_Width = {
    "name": "--pf-chart-bar--data-stroke--Width",
    "value": 0,
    "var": "var(--pf-chart-bar--data-stroke--Width, 0)"
  };
  var chart_bar_data_stroke_Width_default = chart_bar_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_max_Padding.js
  var chart_boxplot_max_Padding = {
    "name": "--pf-chart-boxplot--max--Padding",
    "value": 8,
    "var": "var(--pf-chart-boxplot--max--Padding, 8)"
  };
  var chart_boxplot_max_Padding_default = chart_boxplot_max_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_max_stroke_Color.js
  var chart_boxplot_max_stroke_Color = {
    "name": "--pf-chart-boxplot--max--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-boxplot--max--stroke--Color, #151515)"
  };
  var chart_boxplot_max_stroke_Color_default = chart_boxplot_max_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_max_stroke_Width.js
  var chart_boxplot_max_stroke_Width = {
    "name": "--pf-chart-boxplot--max--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-boxplot--max--stroke--Width, 1)"
  };
  var chart_boxplot_max_stroke_Width_default = chart_boxplot_max_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_median_Padding.js
  var chart_boxplot_median_Padding = {
    "name": "--pf-chart-boxplot--median--Padding",
    "value": 8,
    "var": "var(--pf-chart-boxplot--median--Padding, 8)"
  };
  var chart_boxplot_median_Padding_default = chart_boxplot_median_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_median_stroke_Color.js
  var chart_boxplot_median_stroke_Color = {
    "name": "--pf-chart-boxplot--median--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-boxplot--median--stroke--Color, #151515)"
  };
  var chart_boxplot_median_stroke_Color_default = chart_boxplot_median_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_median_stroke_Width.js
  var chart_boxplot_median_stroke_Width = {
    "name": "--pf-chart-boxplot--median--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-boxplot--median--stroke--Width, 1)"
  };
  var chart_boxplot_median_stroke_Width_default = chart_boxplot_median_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_min_Padding.js
  var chart_boxplot_min_Padding = {
    "name": "--pf-chart-boxplot--min--Padding",
    "value": 8,
    "var": "var(--pf-chart-boxplot--min--Padding, 8)"
  };
  var chart_boxplot_min_Padding_default = chart_boxplot_min_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_min_stroke_Width.js
  var chart_boxplot_min_stroke_Width = {
    "name": "--pf-chart-boxplot--min--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-boxplot--min--stroke--Width, 1)"
  };
  var chart_boxplot_min_stroke_Width_default = chart_boxplot_min_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_min_stroke_Color.js
  var chart_boxplot_min_stroke_Color = {
    "name": "--pf-chart-boxplot--min--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-boxplot--min--stroke--Color, #151515)"
  };
  var chart_boxplot_min_stroke_Color_default = chart_boxplot_min_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_lower_quartile_Padding.js
  var chart_boxplot_lower_quartile_Padding = {
    "name": "--pf-chart-boxplot--lower-quartile--Padding",
    "value": 8,
    "var": "var(--pf-chart-boxplot--lower-quartile--Padding, 8)"
  };
  var chart_boxplot_lower_quartile_Padding_default = chart_boxplot_lower_quartile_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_lower_quartile_Fill.js
  var chart_boxplot_lower_quartile_Fill = {
    "name": "--pf-chart-boxplot--lower-quartile--Fill",
    "value": "#8a8d90",
    "var": "var(--pf-chart-boxplot--lower-quartile--Fill, #8a8d90)"
  };
  var chart_boxplot_lower_quartile_Fill_default = chart_boxplot_lower_quartile_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_upper_quartile_Padding.js
  var chart_boxplot_upper_quartile_Padding = {
    "name": "--pf-chart-boxplot--upper-quartile--Padding",
    "value": 8,
    "var": "var(--pf-chart-boxplot--upper-quartile--Padding, 8)"
  };
  var chart_boxplot_upper_quartile_Padding_default = chart_boxplot_upper_quartile_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_upper_quartile_Fill.js
  var chart_boxplot_upper_quartile_Fill = {
    "name": "--pf-chart-boxplot--upper-quartile--Fill",
    "value": "#8a8d90",
    "var": "var(--pf-chart-boxplot--upper-quartile--Fill, #8a8d90)"
  };
  var chart_boxplot_upper_quartile_Fill_default = chart_boxplot_upper_quartile_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_box_Width.js
  var chart_boxplot_box_Width = {
    "name": "--pf-chart-boxplot--box--Width",
    "value": 20,
    "var": "var(--pf-chart-boxplot--box--Width, 20)"
  };
  var chart_boxplot_box_Width_default = chart_boxplot_box_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_data_stroke_Width.js
  var chart_candelstick_data_stroke_Width = {
    "name": "--pf-chart-candelstick--data--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-candelstick--data--stroke--Width, 1)"
  };
  var chart_candelstick_data_stroke_Width_default = chart_candelstick_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_data_stroke_Color.js
  var chart_candelstick_data_stroke_Color = {
    "name": "--pf-chart-candelstick--data--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-candelstick--data--stroke--Color, #151515)"
  };
  var chart_candelstick_data_stroke_Color_default = chart_candelstick_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_candle_positive_Color.js
  var chart_candelstick_candle_positive_Color = {
    "name": "--pf-chart-candelstick--candle--positive--Color",
    "value": "#fff",
    "var": "var(--pf-chart-candelstick--candle--positive--Color, #fff)"
  };
  var chart_candelstick_candle_positive_Color_default = chart_candelstick_candle_positive_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_candle_negative_Color.js
  var chart_candelstick_candle_negative_Color = {
    "name": "--pf-chart-candelstick--candle--negative--Color",
    "value": "#151515",
    "var": "var(--pf-chart-candelstick--candle--negative--Color, #151515)"
  };
  var chart_candelstick_candle_negative_Color_default = chart_candelstick_candle_negative_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_BorderWidth.js
  var chart_errorbar_BorderWidth = {
    "name": "--pf-chart-errorbar--BorderWidth",
    "value": 8,
    "var": "var(--pf-chart-errorbar--BorderWidth, 8)"
  };
  var chart_errorbar_BorderWidth_default = chart_errorbar_BorderWidth;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_Fill.js
  var chart_errorbar_data_Fill = {
    "name": "--pf-chart-errorbar--data--Fill",
    "value": "transparent",
    "var": "var(--pf-chart-errorbar--data--Fill, transparent)"
  };
  var chart_errorbar_data_Fill_default = chart_errorbar_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_Opacity.js
  var chart_errorbar_data_Opacity = {
    "name": "--pf-chart-errorbar--data--Opacity",
    "value": 1,
    "var": "var(--pf-chart-errorbar--data--Opacity, 1)"
  };
  var chart_errorbar_data_Opacity_default = chart_errorbar_data_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_stroke_Width.js
  var chart_errorbar_data_stroke_Width = {
    "name": "--pf-chart-errorbar--data-stroke--Width",
    "value": 2,
    "var": "var(--pf-chart-errorbar--data-stroke--Width, 2)"
  };
  var chart_errorbar_data_stroke_Width_default = chart_errorbar_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_stroke_Color.js
  var chart_errorbar_data_stroke_Color = {
    "name": "--pf-chart-errorbar--data-stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-errorbar--data-stroke--Color, #151515)"
  };
  var chart_errorbar_data_stroke_Color_default = chart_errorbar_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_gutter_Width.js
  var chart_legend_gutter_Width = {
    "name": "--pf-chart-legend--gutter--Width",
    "value": 20,
    "var": "var(--pf-chart-legend--gutter--Width, 20)"
  };
  var chart_legend_gutter_Width_default = chart_legend_gutter_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_orientation.js
  var chart_legend_orientation = {
    "name": "--pf-chart-legend--orientation",
    "value": "horizontal",
    "var": "var(--pf-chart-legend--orientation, horizontal)"
  };
  var chart_legend_orientation_default = chart_legend_orientation;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_title_orientation.js
  var chart_legend_title_orientation = {
    "name": "--pf-chart-legend--title--orientation",
    "value": "top",
    "var": "var(--pf-chart-legend--title--orientation, top)"
  };
  var chart_legend_title_orientation_default = chart_legend_title_orientation;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_data_type.js
  var chart_legend_data_type = {
    "name": "--pf-chart-legend--data--type",
    "value": "square",
    "var": "var(--pf-chart-legend--data--type, square)"
  };
  var chart_legend_data_type_default = chart_legend_data_type;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_title_Padding.js
  var chart_legend_title_Padding = {
    "name": "--pf-chart-legend--title--Padding",
    "value": 2,
    "var": "var(--pf-chart-legend--title--Padding, 2)"
  };
  var chart_legend_title_Padding_default = chart_legend_title_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_Fill.js
  var chart_line_data_Fill = {
    "name": "--pf-chart-line--data--Fill",
    "value": "transparent",
    "var": "var(--pf-chart-line--data--Fill, transparent)"
  };
  var chart_line_data_Fill_default = chart_line_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_Opacity.js
  var chart_line_data_Opacity = {
    "name": "--pf-chart-line--data--Opacity",
    "value": 1,
    "var": "var(--pf-chart-line--data--Opacity, 1)"
  };
  var chart_line_data_Opacity_default = chart_line_data_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_stroke_Width.js
  var chart_line_data_stroke_Width = {
    "name": "--pf-chart-line--data--stroke--Width",
    "value": 2,
    "var": "var(--pf-chart-line--data--stroke--Width, 2)"
  };
  var chart_line_data_stroke_Width_default = chart_line_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_stroke_Color.js
  var chart_line_data_stroke_Color = {
    "name": "--pf-chart-line--data--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-line--data--stroke--Color, #151515)"
  };
  var chart_line_data_stroke_Color_default = chart_line_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_Padding.js
  var chart_pie_Padding = {
    "name": "--pf-chart-pie--Padding",
    "value": 20,
    "var": "var(--pf-chart-pie--Padding, 20)"
  };
  var chart_pie_Padding_default = chart_pie_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_data_Padding.js
  var chart_pie_data_Padding = {
    "name": "--pf-chart-pie--data--Padding",
    "value": 8,
    "var": "var(--pf-chart-pie--data--Padding, 8)"
  };
  var chart_pie_data_Padding_default = chart_pie_data_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_data_stroke_Width.js
  var chart_pie_data_stroke_Width = {
    "name": "--pf-chart-pie--data--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-pie--data--stroke--Width, 1)"
  };
  var chart_pie_data_stroke_Width_default = chart_pie_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_data_stroke_Color.js
  var chart_pie_data_stroke_Color = {
    "name": "--pf-chart-pie--data--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-chart-pie--data--stroke--Color, transparent)"
  };
  var chart_pie_data_stroke_Color_default = chart_pie_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_labels_Padding.js
  var chart_pie_labels_Padding = {
    "name": "--pf-chart-pie--labels--Padding",
    "value": 8,
    "var": "var(--pf-chart-pie--labels--Padding, 8)"
  };
  var chart_pie_labels_Padding_default = chart_pie_labels_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_Height.js
  var chart_pie_Height = {
    "name": "--pf-chart-pie--Height",
    "value": 230,
    "var": "var(--pf-chart-pie--Height, 230)"
  };
  var chart_pie_Height_default = chart_pie_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_Width.js
  var chart_pie_Width = {
    "name": "--pf-chart-pie--Width",
    "value": 230,
    "var": "var(--pf-chart-pie--Width, 230)"
  };
  var chart_pie_Width_default = chart_pie_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_stroke_Color.js
  var chart_scatter_data_stroke_Color = {
    "name": "--pf-chart-scatter--data--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-chart-scatter--data--stroke--Color, transparent)"
  };
  var chart_scatter_data_stroke_Color_default = chart_scatter_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_stroke_Width.js
  var chart_scatter_data_stroke_Width = {
    "name": "--pf-chart-scatter--data--stroke--Width",
    "value": 0,
    "var": "var(--pf-chart-scatter--data--stroke--Width, 0)"
  };
  var chart_scatter_data_stroke_Width_default = chart_scatter_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_Opacity.js
  var chart_scatter_data_Opacity = {
    "name": "--pf-chart-scatter--data--Opacity",
    "value": 1,
    "var": "var(--pf-chart-scatter--data--Opacity, 1)"
  };
  var chart_scatter_data_Opacity_default = chart_scatter_data_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_Fill.js
  var chart_scatter_data_Fill = {
    "name": "--pf-chart-scatter--data--Fill",
    "value": "#151515",
    "var": "var(--pf-chart-scatter--data--Fill, #151515)"
  };
  var chart_scatter_data_Fill_default = chart_scatter_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_stack_data_stroke_Width.js
  var chart_stack_data_stroke_Width = {
    "name": "--pf-chart-stack--data--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-stack--data--stroke--Width, 1)"
  };
  var chart_stack_data_stroke_Width_default = chart_stack_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_corner_radius.js
  var chart_tooltip_corner_radius = {
    "name": "--pf-chart-tooltip--corner-radius",
    "value": 0,
    "var": "var(--pf-chart-tooltip--corner-radius, 0)"
  };
  var chart_tooltip_corner_radius_default = chart_tooltip_corner_radius;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_pointer_length.js
  var chart_tooltip_pointer_length = {
    "name": "--pf-chart-tooltip--pointer-length",
    "value": 10,
    "var": "var(--pf-chart-tooltip--pointer-length, 10)"
  };
  var chart_tooltip_pointer_length_default = chart_tooltip_pointer_length;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_Fill.js
  var chart_tooltip_Fill = {
    "name": "--pf-chart-tooltip--Fill",
    "value": "#f0f0f0",
    "var": "var(--pf-chart-tooltip--Fill, #f0f0f0)"
  };
  var chart_tooltip_Fill_default = chart_tooltip_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_corner_radius.js
  var chart_tooltip_flyoutStyle_corner_radius = {
    "name": "--pf-chart-tooltip--flyoutStyle--corner-radius",
    "value": 0,
    "var": "var(--pf-chart-tooltip--flyoutStyle--corner-radius, 0)"
  };
  var chart_tooltip_flyoutStyle_corner_radius_default = chart_tooltip_flyoutStyle_corner_radius;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_stroke_Width.js
  var chart_tooltip_flyoutStyle_stroke_Width = {
    "name": "--pf-chart-tooltip--flyoutStyle--stroke--Width",
    "value": 0,
    "var": "var(--pf-chart-tooltip--flyoutStyle--stroke--Width, 0)"
  };
  var chart_tooltip_flyoutStyle_stroke_Width_default = chart_tooltip_flyoutStyle_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_PointerEvents.js
  var chart_tooltip_flyoutStyle_PointerEvents = {
    "name": "--pf-chart-tooltip--flyoutStyle--PointerEvents",
    "value": "none",
    "var": "var(--pf-chart-tooltip--flyoutStyle--PointerEvents, none)"
  };
  var chart_tooltip_flyoutStyle_PointerEvents_default = chart_tooltip_flyoutStyle_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_stroke_Color.js
  var chart_tooltip_flyoutStyle_stroke_Color = {
    "name": "--pf-chart-tooltip--flyoutStyle--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-tooltip--flyoutStyle--stroke--Color, #151515)"
  };
  var chart_tooltip_flyoutStyle_stroke_Color_default = chart_tooltip_flyoutStyle_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_Fill.js
  var chart_tooltip_flyoutStyle_Fill = {
    "name": "--pf-chart-tooltip--flyoutStyle--Fill",
    "value": "#151515",
    "var": "var(--pf-chart-tooltip--flyoutStyle--Fill, #151515)"
  };
  var chart_tooltip_flyoutStyle_Fill_default = chart_tooltip_flyoutStyle_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_pointer_Width.js
  var chart_tooltip_pointer_Width = {
    "name": "--pf-chart-tooltip--pointer--Width",
    "value": 20,
    "var": "var(--pf-chart-tooltip--pointer--Width, 20)"
  };
  var chart_tooltip_pointer_Width_default = chart_tooltip_pointer_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_Padding.js
  var chart_tooltip_Padding = {
    "name": "--pf-chart-tooltip--Padding",
    "value": 8,
    "var": "var(--pf-chart-tooltip--Padding, 8)"
  };
  var chart_tooltip_Padding_default = chart_tooltip_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_PointerEvents.js
  var chart_tooltip_PointerEvents = {
    "name": "--pf-chart-tooltip--PointerEvents",
    "value": "none",
    "var": "var(--pf-chart-tooltip--PointerEvents, none)"
  };
  var chart_tooltip_PointerEvents_default = chart_tooltip_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_data_Fill.js
  var chart_voronoi_data_Fill = {
    "name": "--pf-chart-voronoi--data--Fill",
    "value": "transparent",
    "var": "var(--pf-chart-voronoi--data--Fill, transparent)"
  };
  var chart_voronoi_data_Fill_default = chart_voronoi_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_data_stroke_Color.js
  var chart_voronoi_data_stroke_Color = {
    "name": "--pf-chart-voronoi--data--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-chart-voronoi--data--stroke--Color, transparent)"
  };
  var chart_voronoi_data_stroke_Color_default = chart_voronoi_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_data_stroke_Width.js
  var chart_voronoi_data_stroke_Width = {
    "name": "--pf-chart-voronoi--data--stroke--Width",
    "value": 0,
    "var": "var(--pf-chart-voronoi--data--stroke--Width, 0)"
  };
  var chart_voronoi_data_stroke_Width_default = chart_voronoi_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_labels_Fill.js
  var chart_voronoi_labels_Fill = {
    "name": "--pf-chart-voronoi--labels--Fill",
    "value": "#f0f0f0",
    "var": "var(--pf-chart-voronoi--labels--Fill, #f0f0f0)"
  };
  var chart_voronoi_labels_Fill_default = chart_voronoi_labels_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_labels_Padding.js
  var chart_voronoi_labels_Padding = {
    "name": "--pf-chart-voronoi--labels--Padding",
    "value": 8,
    "var": "var(--pf-chart-voronoi--labels--Padding, 8)"
  };
  var chart_voronoi_labels_Padding_default = chart_voronoi_labels_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_labels_PointerEvents.js
  var chart_voronoi_labels_PointerEvents = {
    "name": "--pf-chart-voronoi--labels--PointerEvents",
    "value": "none",
    "var": "var(--pf-chart-voronoi--labels--PointerEvents, none)"
  };
  var chart_voronoi_labels_PointerEvents_default = chart_voronoi_labels_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_stroke_Width.js
  var chart_voronoi_flyout_stroke_Width = {
    "name": "--pf-chart-voronoi--flyout--stroke--Width",
    "value": 1,
    "var": "var(--pf-chart-voronoi--flyout--stroke--Width, 1)"
  };
  var chart_voronoi_flyout_stroke_Width_default = chart_voronoi_flyout_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_PointerEvents.js
  var chart_voronoi_flyout_PointerEvents = {
    "name": "--pf-chart-voronoi--flyout--PointerEvents",
    "value": "none",
    "var": "var(--pf-chart-voronoi--flyout--PointerEvents, none)"
  };
  var chart_voronoi_flyout_PointerEvents_default = chart_voronoi_flyout_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_stroke_Color.js
  var chart_voronoi_flyout_stroke_Color = {
    "name": "--pf-chart-voronoi--flyout--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-chart-voronoi--flyout--stroke--Color, #151515)"
  };
  var chart_voronoi_flyout_stroke_Color_default = chart_voronoi_flyout_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_stroke_Fill.js
  var chart_voronoi_flyout_stroke_Fill = {
    "name": "--pf-chart-voronoi--flyout--stroke--Fill",
    "value": "#151515",
    "var": "var(--pf-chart-voronoi--flyout--stroke--Fill, #151515)"
  };
  var chart_voronoi_flyout_stroke_Fill_default = chart_voronoi_flyout_stroke_Fill;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/base-theme.js
  var TYPOGRAPHY_FONT_FAMILY = chart_global_FontFamily_default.value.replace(/ /g, "");
  var TYPOGRAPHY_LETTER_SPACING = chart_global_letter_spacing_default.value;
  var TYPOGRAPHY_FONT_SIZE = chart_global_FontSize_sm_default.value;
  var LABEL_PROPS = {
    fontFamily: TYPOGRAPHY_FONT_FAMILY,
    fontSize: TYPOGRAPHY_FONT_SIZE,
    letterSpacing: TYPOGRAPHY_LETTER_SPACING,
    padding: chart_global_label_Padding_default.value,
    stroke: chart_global_label_stroke_default.var,
    fill: chart_global_label_Fill_default.var
  };
  var LABEL_CENTERED_PROPS = Object.assign(Object.assign({}, LABEL_PROPS), { textAnchor: chart_global_label_text_anchor_default.value });
  var LAYOUT_PROPS = {
    padding: chart_global_layout_Padding_default.value,
    height: chart_global_layout_Height_default.value,
    width: chart_global_layout_Width_default.value
  };
  var STROKE_LINE_CAP = chart_global_stroke_line_cap_default.value;
  var STROKE_LINE_JOIN = chart_global_stroke_line_join_default.value;
  var BaseTheme = {
    area: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_area_data_Fill_default.var,
        fillOpacity: chart_area_Opacity_default.value,
        // Omit stroke to add a line border from color scale
        // stroke: chart_global_label_stroke.value,
        strokeWidth: chart_area_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    axis: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      axis: {
        fill: chart_axis_axis_Fill_default.var,
        strokeWidth: chart_axis_axis_stroke_Width_default.value,
        stroke: chart_axis_axis_stroke_Color_default.var,
        strokeLinecap: STROKE_LINE_CAP,
        strokeLinejoin: STROKE_LINE_JOIN
      },
      axisLabel: Object.assign(Object.assign({}, LABEL_CENTERED_PROPS), { padding: chart_axis_axis_label_Padding_default.value, stroke: chart_axis_axis_label_stroke_Color_default.var }),
      grid: {
        fill: chart_axis_grid_Fill_default.var,
        stroke: "none",
        pointerEvents: chart_axis_grid_PointerEvents_default.value,
        strokeLinecap: STROKE_LINE_CAP,
        strokeLinejoin: STROKE_LINE_JOIN
      },
      ticks: {
        fill: chart_axis_tick_Fill_default.var,
        size: chart_axis_tick_Size_default.value,
        stroke: chart_axis_tick_stroke_Color_default.var,
        strokeLinecap: STROKE_LINE_CAP,
        strokeLinejoin: STROKE_LINE_JOIN,
        strokeWidth: chart_axis_tick_Width_default.value
      },
      tickLabels: Object.assign(Object.assign({}, LABEL_PROPS), { fill: chart_axis_tick_label_Fill_default.var })
    } }),
    bar: Object.assign(Object.assign({}, LAYOUT_PROPS), { barWidth: chart_bar_Width_default.value, style: {
      data: {
        fill: chart_bar_data_Fill_default.var,
        padding: chart_bar_data_Padding_default.value,
        stroke: chart_bar_data_stroke_default.var,
        strokeWidth: chart_bar_data_stroke_Width_default.value
      },
      labels: LABEL_PROPS
    } }),
    boxplot: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      max: {
        padding: chart_boxplot_max_Padding_default.value,
        stroke: chart_boxplot_max_stroke_Color_default.var,
        strokeWidth: chart_boxplot_max_stroke_Width_default.value
      },
      maxLabels: LABEL_PROPS,
      median: {
        padding: chart_boxplot_median_Padding_default.value,
        stroke: chart_boxplot_median_stroke_Color_default.var,
        strokeWidth: chart_boxplot_median_stroke_Width_default.value
      },
      medianLabels: LABEL_PROPS,
      min: {
        padding: chart_boxplot_min_Padding_default.value,
        stroke: chart_boxplot_min_stroke_Color_default.var,
        strokeWidth: chart_boxplot_min_stroke_Width_default.value
      },
      minLabels: LABEL_PROPS,
      q1: {
        fill: chart_boxplot_lower_quartile_Fill_default.var,
        padding: chart_boxplot_lower_quartile_Padding_default.value
      },
      q1Labels: LABEL_PROPS,
      q3: {
        fill: chart_boxplot_upper_quartile_Fill_default.var,
        padding: chart_boxplot_upper_quartile_Padding_default.value
      },
      q3Labels: LABEL_PROPS
    }, boxWidth: chart_boxplot_box_Width_default.value }),
    candlestick: Object.assign(Object.assign({}, LAYOUT_PROPS), { candleColors: {
      positive: chart_candelstick_candle_positive_Color_default.var,
      negative: chart_candelstick_candle_negative_Color_default.var
    }, style: {
      data: {
        stroke: chart_candelstick_data_stroke_Color_default.var,
        strokeWidth: chart_candelstick_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    chart: Object.assign({}, LAYOUT_PROPS),
    errorbar: Object.assign(Object.assign({}, LAYOUT_PROPS), { borderWidth: chart_errorbar_BorderWidth_default.value, style: {
      data: {
        fill: chart_errorbar_data_Fill_default.var,
        opacity: chart_errorbar_data_Opacity_default.value,
        stroke: chart_errorbar_data_stroke_Color_default.var,
        strokeWidth: chart_errorbar_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    group: Object.assign({}, LAYOUT_PROPS),
    legend: {
      gutter: chart_legend_gutter_Width_default.value,
      orientation: chart_legend_orientation_default.value,
      titleOrientation: chart_legend_title_orientation_default.value,
      style: {
        data: {
          type: chart_legend_data_type_default.value
        },
        labels: LABEL_PROPS,
        title: Object.assign(Object.assign({}, LABEL_PROPS), { fontSize: TYPOGRAPHY_FONT_SIZE, padding: chart_legend_title_Padding_default.value })
      }
    },
    line: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_line_data_Fill_default.var,
        opacity: chart_line_data_Opacity_default.value,
        stroke: chart_line_data_stroke_Color_default.var,
        strokeWidth: chart_line_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    pie: {
      padding: chart_pie_Padding_default.value,
      style: {
        data: {
          padding: chart_pie_data_Padding_default.value,
          stroke: chart_pie_data_stroke_Color_default.var,
          strokeWidth: chart_pie_data_stroke_Width_default.value
        },
        labels: Object.assign(Object.assign({}, LABEL_PROPS), { padding: chart_pie_labels_Padding_default.value })
      },
      height: chart_pie_Height_default.value,
      width: chart_pie_Width_default.value
    },
    scatter: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_scatter_data_Fill_default.var,
        opacity: chart_scatter_data_Opacity_default.value,
        stroke: chart_scatter_data_stroke_Color_default.var,
        strokeWidth: chart_scatter_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    stack: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        strokeWidth: chart_stack_data_stroke_Width_default.value
      }
    } }),
    tooltip: {
      cornerRadius: chart_tooltip_corner_radius_default.value,
      flyoutPadding: chart_tooltip_Padding_default.value,
      flyoutStyle: {
        cornerRadius: chart_tooltip_flyoutStyle_corner_radius_default.value,
        fill: chart_tooltip_flyoutStyle_Fill_default.var,
        pointerEvents: chart_tooltip_flyoutStyle_PointerEvents_default.var,
        stroke: chart_tooltip_flyoutStyle_stroke_Color_default.var,
        strokeWidth: chart_tooltip_flyoutStyle_stroke_Width_default.var
      },
      pointerLength: chart_tooltip_pointer_length_default.value,
      pointerWidth: chart_tooltip_pointer_Width_default.value,
      style: {
        fill: chart_tooltip_Fill_default.var,
        pointerEvents: chart_tooltip_PointerEvents_default.var
      }
    },
    voronoi: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_voronoi_data_Fill_default.var,
        stroke: chart_voronoi_data_stroke_Color_default.var,
        strokeWidth: chart_voronoi_data_stroke_Width_default.value
      },
      labels: Object.assign(Object.assign({}, LABEL_CENTERED_PROPS), { fill: chart_voronoi_labels_Fill_default.var, padding: chart_voronoi_labels_Padding_default.value, pointerEvents: chart_voronoi_labels_PointerEvents_default.value }),
      // Note: These properties override tooltip
      flyout: {
        fill: chart_voronoi_flyout_stroke_Fill_default.var,
        pointerEvents: chart_voronoi_flyout_PointerEvents_default.var,
        stroke: chart_voronoi_flyout_stroke_Color_default.var,
        strokeWidth: chart_voronoi_flyout_stroke_Width_default.var
      }
    } })
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/ChartTheme.js
  var ChartThemeColor = {
    blue: "blue",
    cyan: "cyan",
    default: "blue",
    gold: "gold",
    gray: "gray",
    green: "green",
    multi: "multi",
    multiOrdered: "multi-ordered",
    multiUnordered: "multi-unordered",
    orange: "orange",
    purple: "purple"
  };
  var ChartAxisTheme = AxisTheme;
  var ChartBaseTheme = BaseTheme;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_Margin.js
  var chart_global_label_Margin = {
    "name": "--pf-chart-global--label--Margin",
    "value": 8,
    "var": "var(--pf-chart-global--label--Margin, 8)"
  };
  var chart_global_label_Margin_default = chart_global_label_Margin;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_position.js
  var chart_legend_position = {
    "name": "--pf-chart-legend--position",
    "value": "right",
    "var": "var(--pf-chart-legend--position, right)"
  };
  var chart_legend_position_default = chart_legend_position;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/styles/common-styles.js
  var TYPOGRAPHY_FONT_FAMILY2 = chart_global_FontFamily_default.var;
  var TYPOGRAPHY_LETTER_SPACING2 = chart_global_letter_spacing_default.var;
  var TYPOGRAPHY_FONT_SIZE2 = chart_global_FontSize_sm_default.value;
  var CommonStyles = {
    label: {
      fontFamily: TYPOGRAPHY_FONT_FAMILY2,
      fontSize: TYPOGRAPHY_FONT_SIZE2,
      letterSpacing: TYPOGRAPHY_LETTER_SPACING2,
      margin: chart_global_label_Margin_default.value,
      fill: chart_global_label_Fill_default.var
    },
    legend: {
      margin: chart_legend_Margin_default.value,
      position: chart_legend_position_default.value
    }
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/ChartStyles.js
  var ChartCommonStyles = CommonStyles;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLabel/ChartLabel.js
  var ChartLabelDirection;
  (function(ChartLabelDirection2) {
    ChartLabelDirection2["rtl"] = "rtl";
    ChartLabelDirection2["ltr"] = "ltr";
    ChartLabelDirection2["inherit"] = "inherit";
  })(ChartLabelDirection || (ChartLabelDirection = {}));
  var ChartLabelPlacement;
  (function(ChartLabelPlacement2) {
    ChartLabelPlacement2["parallel"] = "parallel";
    ChartLabelPlacement2["perpendicular"] = "perpendicular";
    ChartLabelPlacement2["vertical"] = "vertical";
  })(ChartLabelPlacement || (ChartLabelPlacement = {}));
  var ChartLabel = (_a) => {
    var { style, textAnchor } = _a, rest = __rest(_a, ["style", "textAnchor"]);
    const applyDefaultStyle = (customStyle) => (0, import_defaults21.default)(Object.assign(Object.assign({}, customStyle), {
      textAnchor
      // textAnchor prop must override given theme styles
    }), {
      fill: ChartCommonStyles.label.fill,
      fontFamily: ChartCommonStyles.label.fontFamily,
      fontSize: ChartCommonStyles.label.fontSize,
      letterSpacing: ChartCommonStyles.label.letterSpacing
    });
    const newStyle = Array.isArray(style) ? style.map(applyDefaultStyle) : applyDefaultStyle(style);
    return React303.createElement(VictoryLabel, Object.assign({ style: newStyle, textAnchor }, rest));
  };
  ChartLabel.displayName = "ChartLabel";
  (0, import_hoist_non_react_statics.default)(ChartLabel, VictoryLabel);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTooltip/ChartTooltip.js
  var ChartTooltip = (_a) => {
    var {
      constrainToVisibleArea = false,
      labelComponent = React304.createElement(ChartLabel, null),
      // Note that Victory provides its own label component here
      labelTextAnchor,
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["constrainToVisibleArea", "labelComponent", "labelTextAnchor", "themeColor", "themeVariant", "theme"]);
    const chartLabelComponent = React304.cloneElement(labelComponent, Object.assign({ textAnchor: labelTextAnchor, theme }, labelComponent.props));
    return React304.createElement(VictoryTooltip, Object.assign({ constrainToVisibleArea, labelComponent: chartLabelComponent, theme }, rest));
  };
  ChartTooltip.displayName = "ChartTooltip";
  (0, import_hoist_non_react_statics2.default)(ChartTooltip, VictoryTooltip);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-helpers.js
  var canUseDOM2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
  var getClassName = ({ className }) => {
    let cleanClassName;
    if (className) {
      cleanClassName = className.replace(/VictoryContainer/g, "").replace(/pf-c-chart/g, "").replace(/\s+/g, " ").trim();
    }
    return cleanClassName && cleanClassName.length ? `pf-c-chart ${cleanClassName}` : "pf-c-chart";
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-origin.js
  var getPieOrigin = ({ height, padding: padding2, width }) => {
    const { top: top2, bottom: bottom2, left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding2 });
    const radius = helpers_exports.getRadius({ height, width, padding: padding2 });
    const offsetX = (width - radius * 2 - left2 - right2) / 2;
    const offsetY = (height - radius * 2 - top2 - bottom2) / 2;
    return {
      x: radius + left2 + offsetX,
      y: radius + top2 + offsetY
    };
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-label.js
  var getLabelTextSize = ({ text, theme }) => {
    const style = theme.legend.style.labels;
    return textsize_exports.approximateTextSize(text, Object.assign({}, style));
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-legend.js
  init_tslib_es6();
  var import_defaults23 = __toESM(require_defaults());

  // node_modules/victory-legend/es/victory-legend.js
  var import_react80 = __toESM(require_react());
  var import_prop_types59 = __toESM(require_prop_types());

  // node_modules/victory-legend/es/helper-methods.js
  var import_isNil2 = __toESM(require_isNil());
  var import_range5 = __toESM(require_range());
  var import_sum = __toESM(require_sum());
  var import_keys7 = __toESM(require_keys());
  var import_groupBy2 = __toESM(require_groupBy());
  var import_assign29 = __toESM(require_assign());
  var import_defaults22 = __toESM(require_defaults());
  function _toConsumableArray22(arr) {
    return _arrayWithoutHoles21(arr) || _iterableToArray21(arr) || _unsupportedIterableToArray23(arr) || _nonIterableSpread21();
  }
  function _nonIterableSpread21() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray23(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray23(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray23(o, minLen);
  }
  function _iterableToArray21(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles21(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray23(arr);
  }
  function _arrayLikeToArray23(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function ownKeys19(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread19(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys19(Object(source), true).forEach(function(key) {
        _defineProperty24(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys19(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty24(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var getColorScale2 = function(props) {
    var colorScale = props.colorScale;
    return typeof colorScale === "string" ? style_exports.getColorScale(colorScale) : colorScale || [];
  };
  var getLabelStyles = function(props) {
    var data = props.data, style = props.style;
    return data.map(function(datum, index) {
      var baseLabelStyles3 = (0, import_defaults22.default)({}, datum.labels, style.labels);
      return helpers_exports.evaluateStyle(baseLabelStyles3, {
        datum,
        index,
        data
      });
    });
  };
  var getStyles6 = function(props, styleObject) {
    var style = props.style || {};
    styleObject = styleObject || {};
    var parentStyleProps = {
      height: "100%",
      width: "100%"
    };
    return {
      parent: (0, import_defaults22.default)(style.parent, styleObject.parent, parentStyleProps),
      data: (0, import_defaults22.default)({}, style.data, styleObject.data),
      labels: (0, import_defaults22.default)({}, style.labels, styleObject.labels),
      border: (0, import_defaults22.default)({}, style.border, styleObject.border),
      title: (0, import_defaults22.default)({}, style.title, styleObject.title)
    };
  };
  var getCalculatedValues3 = function(props) {
    var orientation = props.orientation, theme = props.theme;
    var defaultStyles2 = theme && theme.legend && theme.legend.style ? theme.legend.style : {};
    var style = getStyles6(props, defaultStyles2);
    var colorScale = getColorScale2(props);
    var isHorizontal2 = orientation === "horizontal";
    var borderPadding = helpers_exports.getPadding({
      padding: props.borderPadding
    });
    return (0, import_assign29.default)({}, props, {
      style,
      isHorizontal: isHorizontal2,
      colorScale,
      borderPadding
    });
  };
  var getColumn = function(props, index) {
    var itemsPerRow = props.itemsPerRow, isHorizontal2 = props.isHorizontal;
    if (!itemsPerRow) {
      return isHorizontal2 ? index : 0;
    }
    return isHorizontal2 ? index % itemsPerRow : Math.floor(index / itemsPerRow);
  };
  var getRow = function(props, index) {
    var itemsPerRow = props.itemsPerRow, isHorizontal2 = props.isHorizontal;
    if (!itemsPerRow) {
      return isHorizontal2 ? 0 : index;
    }
    return isHorizontal2 ? Math.floor(index / itemsPerRow) : index % itemsPerRow;
  };
  var groupData = function(props) {
    var data = props.data;
    var style = props.style && props.style.data || {};
    var labelStyles2 = getLabelStyles(props);
    return data.map(function(datum, index) {
      var symbol = datum.symbol || {};
      var fontSize3 = labelStyles2[index].fontSize;
      var size = symbol.size || style.size || fontSize3 / 2.5;
      var symbolSpacer = props.symbolSpacer || Math.max(size, fontSize3);
      return _objectSpread19(_objectSpread19({}, datum), {}, {
        size,
        symbolSpacer,
        fontSize: fontSize3,
        textSize: textsize_exports.approximateTextSize(datum.name, labelStyles2[index]),
        column: getColumn(props, index),
        row: getRow(props, index)
      });
    });
  };
  var getColumnWidths = function(props, data) {
    var gutter = props.gutter || {};
    var gutterWidth = typeof gutter === "object" ? (gutter.left || 0) + (gutter.right || 0) : gutter || 0;
    var dataByColumn = (0, import_groupBy2.default)(data, "column");
    var columns = (0, import_keys7.default)(dataByColumn);
    return columns.reduce(function(memo2, curr, index) {
      var lengths = dataByColumn[curr].map(function(d) {
        return d.textSize.width + d.size + d.symbolSpacer + gutterWidth;
      });
      memo2[index] = Math.max.apply(Math, _toConsumableArray22(lengths));
      return memo2;
    }, []);
  };
  var getRowHeights = function(props, data) {
    var gutter = props.rowGutter || {};
    var gutterHeight = typeof gutter === "object" ? (gutter.top || 0) + (gutter.bottom || 0) : gutter || 0;
    var dataByRow = (0, import_groupBy2.default)(data, "row");
    return (0, import_keys7.default)(dataByRow).reduce(function(memo2, curr, index) {
      var rows = dataByRow[curr];
      var lengths = rows.map(function(d) {
        return d.textSize.height + d.symbolSpacer + gutterHeight;
      });
      memo2[index] = Math.max.apply(Math, _toConsumableArray22(lengths));
      return memo2;
    }, []);
  };
  var getTitleDimensions = function(props) {
    var style = props.style && props.style.title || {};
    var textSize = textsize_exports.approximateTextSize(props.title, style);
    var padding2 = style.padding || 0;
    return {
      height: textSize.height + 2 * padding2 || 0,
      width: textSize.width + 2 * padding2 || 0
    };
  };
  var getOffset3 = function(datum, rowHeights, columnWidths) {
    var column = datum.column, row = datum.row;
    return {
      x: (0, import_range5.default)(column).reduce(function(memo2, curr) {
        memo2 += columnWidths[curr];
        return memo2;
      }, 0),
      y: (0, import_range5.default)(row).reduce(function(memo2, curr) {
        memo2 += rowHeights[curr];
        return memo2;
      }, 0)
    };
  };
  var getAnchors2 = function(titleOrientation, centerTitle) {
    var standardAnchors = {
      textAnchor: titleOrientation === "right" ? "end" : "start",
      verticalAnchor: titleOrientation === "bottom" ? "end" : "start"
    };
    if (centerTitle) {
      var horizontal = titleOrientation === "top" || titleOrientation === "bottom";
      return {
        textAnchor: horizontal ? "middle" : standardAnchors.textAnchor,
        verticalAnchor: horizontal ? standardAnchors.verticalAnchor : "middle"
      };
    }
    return standardAnchors;
  };
  var getTitleStyle = function(props) {
    var titleOrientation = props.titleOrientation, centerTitle = props.centerTitle, titleComponent = props.titleComponent;
    var baseStyle = props.style && props.style.title || {};
    var componentStyle = titleComponent.props && titleComponent.props.style || {};
    var anchors = getAnchors2(titleOrientation, centerTitle);
    return Array.isArray(componentStyle) ? componentStyle.map(function(obj) {
      return (0, import_defaults22.default)({}, obj, baseStyle, anchors);
    }) : (0, import_defaults22.default)({}, componentStyle, baseStyle, anchors);
  };
  var getTitleProps = function(props, borderProps) {
    var title = props.title, titleOrientation = props.titleOrientation, centerTitle = props.centerTitle, borderPadding = props.borderPadding;
    var height = borderProps.height, width = borderProps.width;
    var style = getTitleStyle(props);
    var padding2 = Array.isArray(style) ? style[0].padding : style.padding;
    var horizontal = titleOrientation === "top" || titleOrientation === "bottom";
    var xOrientation = titleOrientation === "bottom" ? "bottom" : "top";
    var yOrientation = titleOrientation === "right" ? "right" : "left";
    var standardPadding = {
      x: centerTitle ? width / 2 : borderPadding[xOrientation] + (padding2 || 0),
      y: centerTitle ? height / 2 : borderPadding[yOrientation] + (padding2 || 0)
    };
    var getPadding3 = function() {
      return borderPadding[titleOrientation] + (padding2 || 0);
    };
    var xOffset = horizontal ? standardPadding.x : getPadding3();
    var yOffset = horizontal ? getPadding3() : standardPadding.y;
    return {
      x: titleOrientation === "right" ? props.x + width - xOffset : props.x + xOffset,
      y: titleOrientation === "bottom" ? props.y + height - yOffset : props.y + yOffset,
      style,
      text: title
    };
  };
  var getBorderProps = function(props, contentHeight, contentWidth) {
    var x2 = props.x, y2 = props.y, borderPadding = props.borderPadding, style = props.style;
    var height = (contentHeight || 0) + borderPadding.top + borderPadding.bottom;
    var width = (contentWidth || 0) + borderPadding.left + borderPadding.right;
    return {
      x: x2,
      y: y2,
      height,
      width,
      style: (0, import_assign29.default)({
        fill: "none"
      }, style.border)
    };
  };
  var getDimensions = function(props, fallbackProps10) {
    var modifiedProps = helpers_exports.modifyProps(props, fallbackProps10, "legend");
    props = (0, import_assign29.default)({}, modifiedProps, getCalculatedValues3(modifiedProps));
    var _props = props, title = _props.title, titleOrientation = _props.titleOrientation;
    var groupedData = groupData(props);
    var columnWidths = getColumnWidths(props, groupedData);
    var rowHeights = getRowHeights(props, groupedData);
    var titleDimensions = title ? getTitleDimensions(props) : {
      height: 0,
      width: 0
    };
    return {
      height: titleOrientation === "left" || titleOrientation === "right" ? Math.max((0, import_sum.default)(rowHeights), titleDimensions.height) : (0, import_sum.default)(rowHeights) + titleDimensions.height,
      width: titleOrientation === "left" || titleOrientation === "right" ? (0, import_sum.default)(columnWidths) + titleDimensions.width : Math.max((0, import_sum.default)(columnWidths), titleDimensions.width)
    };
  };
  var getBaseProps3 = function(props, fallbackProps10) {
    var modifiedProps = helpers_exports.modifyProps(props, fallbackProps10, "legend");
    props = (0, import_assign29.default)({}, modifiedProps, getCalculatedValues3(modifiedProps));
    var _props2 = props, data = _props2.data, standalone = _props2.standalone, theme = _props2.theme, padding2 = _props2.padding, style = _props2.style, colorScale = _props2.colorScale, gutter = _props2.gutter, rowGutter = _props2.rowGutter, borderPadding = _props2.borderPadding, title = _props2.title, titleOrientation = _props2.titleOrientation, name2 = _props2.name, _props2$x = _props2.x, x2 = _props2$x === void 0 ? 0 : _props2$x, _props2$y = _props2.y, y2 = _props2$y === void 0 ? 0 : _props2$y;
    var groupedData = groupData(props);
    var columnWidths = getColumnWidths(props, groupedData);
    var rowHeights = getRowHeights(props, groupedData);
    var labelStyles2 = getLabelStyles(props);
    var titleDimensions = title ? getTitleDimensions(props) : {
      height: 0,
      width: 0
    };
    var titleOffset = {
      x: titleOrientation === "left" ? titleDimensions.width : 0,
      y: titleOrientation === "top" ? titleDimensions.height : 0
    };
    var gutterOffset = {
      x: gutter && typeof gutter === "object" ? gutter.left || 0 : 0,
      y: rowGutter && typeof rowGutter === "object" ? rowGutter.top || 0 : 0
    };
    var _getDimensions = getDimensions(props, fallbackProps10), height = _getDimensions.height, width = _getDimensions.width;
    var borderProps = getBorderProps(props, height, width);
    var titleProps = getTitleProps(props, borderProps);
    var initialProps = {
      parent: {
        data,
        standalone,
        theme,
        padding: padding2,
        name: name2,
        height: props.height,
        width: props.width,
        style: style.parent
      },
      all: {
        border: borderProps,
        title: titleProps
      }
    };
    return groupedData.reduce(function(childProps, datum, i) {
      var color2 = colorScale[i % colorScale.length];
      var dataStyle = (0, import_defaults22.default)({}, datum.symbol, style.data, {
        fill: color2
      });
      var eventKey = !(0, import_isNil2.default)(datum.eventKey) ? datum.eventKey : i;
      var offset2 = getOffset3(datum, rowHeights, columnWidths);
      var originY = y2 + borderPadding.top + datum.symbolSpacer;
      var originX = x2 + borderPadding.left + datum.symbolSpacer;
      var dataProps2 = {
        index: i,
        data,
        datum,
        symbol: dataStyle.type || dataStyle.symbol || "circle",
        size: datum.size,
        style: dataStyle,
        y: originY + offset2.y + titleOffset.y + gutterOffset.y,
        x: originX + offset2.x + titleOffset.x + gutterOffset.x
      };
      var labelProps = {
        datum,
        data,
        text: datum.name,
        style: labelStyles2[i],
        y: dataProps2.y,
        x: dataProps2.x + datum.symbolSpacer + datum.size / 2
      };
      childProps[eventKey] = {
        data: dataProps2,
        labels: labelProps
      };
      return childProps;
    }, initialProps);
  };

  // node_modules/victory-legend/es/victory-legend.js
  function _toConsumableArray23(arr) {
    return _arrayWithoutHoles22(arr) || _iterableToArray22(arr) || _unsupportedIterableToArray24(arr) || _nonIterableSpread22();
  }
  function _nonIterableSpread22() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray24(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray24(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray24(o, minLen);
  }
  function _iterableToArray22(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles22(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray24(arr);
  }
  function _arrayLikeToArray24(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _classCallCheck16(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties15(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass16(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties15(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties15(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits14(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf13(subClass, superClass);
  }
  function _setPrototypeOf13(o, p2) {
    _setPrototypeOf13 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf13(o, p2);
  }
  function _createSuper13(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct13();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf13(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf13(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn14(this, result);
    };
  }
  function _possibleConstructorReturn14(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized13(self2);
  }
  function _assertThisInitialized13(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct13() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf13(o) {
    _getPrototypeOf13 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf13(o);
  }
  var fallbackProps6 = {
    orientation: "vertical",
    titleOrientation: "top",
    width: 450,
    height: 300,
    x: 0,
    y: 0
  };
  var defaultLegendData = [{
    name: "Series 1"
  }, {
    name: "Series 2"
  }];
  var VictoryLegend = /* @__PURE__ */ function(_React$Component) {
    _inherits14(VictoryLegend2, _React$Component);
    var _super = _createSuper13(VictoryLegend2);
    function VictoryLegend2() {
      _classCallCheck16(this, VictoryLegend2);
      return _super.apply(this, arguments);
    }
    _createClass16(VictoryLegend2, [{
      key: "renderChildren",
      value: function renderChildren(props) {
        var _this = this;
        var dataComponent = props.dataComponent, labelComponent = props.labelComponent, title = props.title;
        var dataComponents = this.dataKeys.map(function(_dataKey, index) {
          if (_dataKey === "all") {
            return void 0;
          }
          var dataProps2 = _this.getComponentProps(dataComponent, "data", index);
          return /* @__PURE__ */ import_react80.default.cloneElement(dataComponent, dataProps2);
        }).filter(Boolean);
        var labelComponents = this.dataKeys.map(function(_dataKey, index) {
          if (_dataKey === "all") {
            return void 0;
          }
          var labelProps = _this.getComponentProps(labelComponent, "labels", index);
          if (labelProps.text !== void 0 && labelProps.text !== null) {
            return /* @__PURE__ */ import_react80.default.cloneElement(labelComponent, labelProps);
          }
          return void 0;
        }).filter(Boolean);
        var borderProps = this.getComponentProps(props.borderComponent, "border", "all");
        var borderComponent = /* @__PURE__ */ import_react80.default.cloneElement(props.borderComponent, borderProps);
        if (title) {
          var titleProps = this.getComponentProps(props.title, "title", "all");
          var titleComponent = /* @__PURE__ */ import_react80.default.cloneElement(props.titleComponent, titleProps);
          return [borderComponent].concat(_toConsumableArray23(dataComponents), [titleComponent], _toConsumableArray23(labelComponents));
        }
        return [borderComponent].concat(_toConsumableArray23(dataComponents), _toConsumableArray23(labelComponents));
      }
    }, {
      key: "render",
      value: function render() {
        var role = this.constructor.role;
        var props = helpers_exports.modifyProps(this.props, fallbackProps6, role);
        var children = [this.renderChildren(props)];
        return props.standalone ? this.renderContainer(props.containerComponent, children) : /* @__PURE__ */ import_react80.default.cloneElement(props.groupComponent, {}, children);
      }
    }]);
    return VictoryLegend2;
  }(import_react80.default.Component);
  VictoryLegend.displayName = "VictoryLegend";
  VictoryLegend.role = "legend";
  VictoryLegend.propTypes = {
    borderComponent: import_prop_types59.default.element,
    borderPadding: import_prop_types59.default.oneOfType([import_prop_types59.default.number, import_prop_types59.default.shape({
      top: import_prop_types59.default.number,
      bottom: import_prop_types59.default.number,
      left: import_prop_types59.default.number,
      right: import_prop_types59.default.number
    })]),
    centerTitle: import_prop_types59.default.bool,
    colorScale: import_prop_types59.default.oneOfType([import_prop_types59.default.arrayOf(import_prop_types59.default.string), import_prop_types59.default.oneOf(["grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue"])]),
    containerComponent: import_prop_types59.default.element,
    data: import_prop_types59.default.arrayOf(import_prop_types59.default.shape({
      name: import_prop_types59.default.string.isRequired,
      label: import_prop_types59.default.object,
      symbol: import_prop_types59.default.object
    })),
    dataComponent: import_prop_types59.default.element,
    eventKey: import_prop_types59.default.oneOfType([import_prop_types59.default.func, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types59.default.string]),
    events: import_prop_types59.default.arrayOf(import_prop_types59.default.shape({
      target: import_prop_types59.default.oneOf(["data", "labels", "parent"]),
      eventKey: import_prop_types59.default.oneOfType([import_prop_types59.default.array, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types59.default.string]),
      eventHandlers: import_prop_types59.default.object
    })),
    externalEventMutations: import_prop_types59.default.arrayOf(import_prop_types59.default.shape({
      callback: import_prop_types59.default.func,
      childName: import_prop_types59.default.oneOfType([import_prop_types59.default.string, import_prop_types59.default.array]),
      eventKey: import_prop_types59.default.oneOfType([import_prop_types59.default.array, prop_types_exports.allOfType([prop_types_exports.integer, prop_types_exports.nonNegative]), import_prop_types59.default.string]),
      mutation: import_prop_types59.default.func,
      target: import_prop_types59.default.oneOfType([import_prop_types59.default.string, import_prop_types59.default.array])
    })),
    groupComponent: import_prop_types59.default.element,
    gutter: import_prop_types59.default.oneOfType([import_prop_types59.default.number, import_prop_types59.default.shape({
      left: import_prop_types59.default.number,
      right: import_prop_types59.default.number
    })]),
    height: prop_types_exports.nonNegative,
    itemsPerRow: prop_types_exports.nonNegative,
    labelComponent: import_prop_types59.default.element,
    name: import_prop_types59.default.string,
    orientation: import_prop_types59.default.oneOf(["horizontal", "vertical"]),
    padding: import_prop_types59.default.oneOfType([import_prop_types59.default.number, import_prop_types59.default.shape({
      top: import_prop_types59.default.number,
      bottom: import_prop_types59.default.number,
      left: import_prop_types59.default.number,
      right: import_prop_types59.default.number
    })]),
    rowGutter: import_prop_types59.default.oneOfType([import_prop_types59.default.number, import_prop_types59.default.shape({
      top: import_prop_types59.default.number,
      bottom: import_prop_types59.default.number
    })]),
    sharedEvents: import_prop_types59.default.shape({
      events: import_prop_types59.default.array,
      getEventState: import_prop_types59.default.func
    }),
    standalone: import_prop_types59.default.bool,
    style: import_prop_types59.default.shape({
      border: import_prop_types59.default.object,
      data: import_prop_types59.default.object,
      labels: import_prop_types59.default.object,
      parent: import_prop_types59.default.object,
      title: import_prop_types59.default.object
    }),
    symbolSpacer: import_prop_types59.default.number,
    theme: import_prop_types59.default.object,
    title: import_prop_types59.default.oneOfType([import_prop_types59.default.string, import_prop_types59.default.array]),
    titleComponent: import_prop_types59.default.element,
    titleOrientation: import_prop_types59.default.oneOf(["top", "bottom", "left", "right"]),
    width: prop_types_exports.nonNegative,
    x: prop_types_exports.nonNegative,
    y: prop_types_exports.nonNegative
  };
  VictoryLegend.defaultProps = {
    borderComponent: /* @__PURE__ */ import_react80.default.createElement(Border, null),
    data: defaultLegendData,
    containerComponent: /* @__PURE__ */ import_react80.default.createElement(VictoryContainer, null),
    dataComponent: /* @__PURE__ */ import_react80.default.createElement(Point, null),
    groupComponent: /* @__PURE__ */ import_react80.default.createElement("g", null),
    labelComponent: /* @__PURE__ */ import_react80.default.createElement(VictoryLabel, null),
    standalone: true,
    theme: VictoryTheme.grayscale,
    titleComponent: /* @__PURE__ */ import_react80.default.createElement(VictoryLabel, null)
  };
  VictoryLegend.getBaseProps = function(props) {
    return getBaseProps3(props, fallbackProps6);
  };
  VictoryLegend.getDimensions = function(props) {
    return getDimensions(props, fallbackProps6);
  };
  VictoryLegend.expectedComponents = ["borderComponent", "containerComponent", "dataComponent", "groupComponent", "labelComponent", "titleComponent"];
  var victory_legend_default = addEvents(VictoryLegend);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-legend.js
  var React306 = __toESM(require_react());
  var getComputedLegend = ({
    allowWrap = true,
    chartType = "chart",
    colorScale,
    dx = 0,
    dy = 0,
    height,
    legendComponent,
    padding: padding2,
    patternScale,
    position = ChartCommonStyles.legend.position,
    theme,
    width,
    // destructure last
    orientation = theme.legend.orientation
  }) => {
    const legendItemsProps = legendComponent.props ? legendComponent.props : {};
    const legendItemsPerRow = allowWrap ? getLegendItemsPerRow({
      chartType,
      dx,
      height,
      legendData: legendItemsProps.data,
      legendOrientation: legendItemsProps.legendOrientation ? legendItemsProps.legendOrientation : orientation,
      legendPosition: position,
      legendProps: legendItemsProps,
      padding: padding2,
      theme,
      width
    }) : void 0;
    const legendPositionProps = (0, import_defaults23.default)({}, legendComponent.props, {
      itemsPerRow: legendItemsPerRow
    });
    const legendX = getLegendX({
      chartType,
      dx,
      height,
      legendData: legendPositionProps.data,
      legendOrientation: legendPositionProps.legendOrientation ? legendPositionProps.legendOrientation : orientation,
      legendPosition: position,
      legendProps: legendPositionProps,
      padding: padding2,
      theme,
      width
    });
    const legendY = getLegendY({
      chartType,
      dy,
      height,
      legendData: legendPositionProps.data,
      legendOrientation: legendPositionProps.legendOrientation ? legendPositionProps.legendOrientation : orientation,
      legendProps: legendPositionProps,
      legendPosition: position,
      padding: padding2,
      theme,
      width
    });
    const legendProps = (0, import_defaults23.default)({}, legendComponent.props, {
      colorScale,
      itemsPerRow: legendItemsPerRow,
      orientation,
      patternScale,
      standalone: false,
      theme,
      x: legendX > 0 ? legendX : 0,
      y: legendY > 0 ? legendY : 0
    });
    return React306.cloneElement(legendComponent, legendProps);
  };
  var getLegendDimensions = ({ legendData, legendOrientation, legendProps, theme }) => {
    if (legendData || legendProps.data) {
      return victory_legend_default.getDimensions(Object.assign(
        { data: legendData, orientation: legendOrientation, theme },
        legendProps
        // override above
      ));
    }
    return {};
  };
  var doesLegendFit = ({ dx = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding2, theme, width }) => {
    const { left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding2 });
    const chartSize = {
      height,
      width: width - left2 - right2
    };
    const legendDimensions = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps,
      theme
    });
    let occupiedWidth = 0;
    switch (legendPosition) {
      case "bottom-left":
        occupiedWidth = left2 + dx;
        break;
      case "right":
        occupiedWidth = chartSize.width + ChartCommonStyles.legend.margin + left2 + dx;
        break;
      default:
        occupiedWidth = dx;
        break;
    }
    return width - occupiedWidth > legendDimensions.width;
  };
  var getLegendItemsPerRow = ({ dx, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding2, theme, width }) => {
    let itemsPerRow = legendData ? legendData.length : 0;
    for (let i = itemsPerRow; i > 0; i--) {
      const fits = doesLegendFit({
        dx,
        height,
        legendPosition,
        legendData,
        legendOrientation,
        legendProps: Object.assign(Object.assign({}, legendProps), { itemsPerRow: i }),
        padding: padding2,
        theme,
        width
      });
      if (fits) {
        itemsPerRow = i;
        break;
      }
    }
    return itemsPerRow;
  };
  var getLegendX = (_a) => {
    var { chartType } = _a, rest = __rest(_a, ["chartType"]);
    return chartType === "pie" ? getPieLegendX(rest) : getChartLegendX(rest);
  };
  var getLegendY = (_a) => {
    var { chartType } = _a, rest = __rest(_a, ["chartType"]);
    switch (chartType) {
      case "pie":
        return getPieLegendY(rest);
      case "bullet":
        return getBulletLegendY(rest);
      default:
        return getChartLegendY(rest);
    }
  };
  var getBulletLegendY = ({ dy = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding2, theme, width }) => {
    const { left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding2 });
    const chartSize = {
      height,
      width: width - left2 - right2
    };
    switch (legendPosition) {
      case "bottom":
      case "bottom-left":
        return chartSize.height + ChartCommonStyles.legend.margin + dy;
      case "right": {
        const legendDimensions = getLegendDimensions({
          legendData,
          legendOrientation,
          legendProps,
          theme
        });
        const legendPadding = (legendDataArr) => legendDataArr && legendDataArr.length > 0 ? 17 : 0;
        return (chartSize.height - legendDimensions.height) / 2 + legendPadding(legendData);
      }
      default:
        return dy;
    }
  };
  var getChartLegendX = ({ dx = 0, height, legendData, legendOrientation, legendPosition, legendProps, padding: padding2, theme, width }) => {
    const { top: top2, bottom: bottom2, left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding2 });
    const chartSize = {
      height: Math.abs(height - (bottom2 + top2)),
      width: Math.abs(width - (left2 + right2))
    };
    const legendDimensions = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps,
      theme
    });
    switch (legendPosition) {
      case "bottom":
        return width > legendDimensions.width ? Math.round((width - legendDimensions.width) / 2) + dx : dx;
      case "bottom-left":
        return left2 + dx;
      case "right":
        return chartSize.width + ChartCommonStyles.legend.margin + left2 + dx;
      default:
        return dx;
    }
  };
  var getChartLegendY = ({ dy = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding2, theme, width }) => {
    const { top: top2, bottom: bottom2, left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding2 });
    const chartSize = {
      height: Math.abs(height - (bottom2 + top2)),
      width: Math.abs(width - (left2 + right2))
    };
    switch (legendPosition) {
      case "bottom":
      case "bottom-left":
        return chartSize.height + ChartCommonStyles.legend.margin * 2 + top2 + dy;
      case "right": {
        const legendDimensions = getLegendDimensions({
          legendData,
          legendOrientation,
          legendProps,
          theme
        });
        const originX = chartSize.height / 2 + top2;
        const legendPadding = (legendDataArr) => legendDataArr && legendDataArr.length > 0 ? 2 : 0;
        return originX - legendDimensions.height / 2 + legendPadding(legendData);
      }
      default:
        return dy;
    }
  };
  var getPieLegendX = ({ dx = 0, height, legendData, legendOrientation, legendPosition, legendProps, padding: padding2, theme, width }) => {
    const origin = getPieOrigin({ height, padding: padding2, width });
    const radius = helpers_exports.getRadius({ height, width, padding: padding2 });
    const legendDimensions = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps,
      theme
    });
    switch (legendPosition) {
      case "bottom":
        return width > legendDimensions.width ? Math.round((width - legendDimensions.width) / 2) + dx : dx;
      case "right":
        return origin.x + ChartCommonStyles.label.margin + dx + radius;
      default:
        return dx;
    }
  };
  var getPieLegendY = ({ dy = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding2, theme, width }) => {
    const origin = getPieOrigin({ height, padding: padding2, width });
    const radius = helpers_exports.getRadius({ height, width, padding: padding2 });
    switch (legendPosition) {
      case "bottom":
        return origin.y + ChartCommonStyles.legend.margin + radius + dy;
      case "right": {
        const legendDimensions = getLegendDimensions({
          legendData,
          legendOrientation,
          legendProps,
          theme
        });
        const legendPadding = (legendDataArr) => legendDataArr && legendDataArr.length > 0 ? 2 : 0;
        return origin.y - legendDimensions.height / 2 + legendPadding(legendData);
      }
      default:
        return dy;
    }
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-padding.js
  var getPaddingForSide = (side, padding2, fallback) => {
    if (typeof padding2 == "number") {
      return padding2;
    } else if (typeof padding2 == "object" && Object.keys(padding2).length > 0) {
      return padding2[side] || 0;
    }
    return getPaddingForSide(side, fallback, 0);
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-patterns.js
  init_tslib_es6();
  var React307 = __toESM(require_react());
  var import_uniqueId4 = __toESM(require_uniqueId());
  var patterns = [
    // Set 1
    {
      // Left diagonal lines
      d: "M 0 0 L 5 5 M 4.5 -0.5 L 5.5 0.5 M -0.5 4.5 L 0.5 5.5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Right diagonal lines
      d: "M 0 5 L 5 0 M -0.5 0.5 L 0.5 -0.5 M 4.5 5.5 L 5.5 4.5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Vertical offset line
      d: "M 2 0 L 2 5 M 4 0 L 4 5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Horizontal lines
      d: "M 0 2 L 5 2 M 0 4 L 5 4",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Vertical wave
      d: "M 0 1.5 L 2.5 1.5 L 2.5 0 M 2.5 5 L 2.5 3.5 L 5 3.5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    // Set 2
    {
      // Horizontal wave
      d: "M 0 0 L 5 10 L 10 0",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Squares
      d: "M 3 3 L 8 3 L 8 8 L 3 8 Z",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Circles
      d: "M 5 5 m -4 0 a 4 4 0 1 1 8 0 a 4 4 0 1 1 -8 0",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Left diagonal lines (thin)
      d: "M 0 0 L 10 10 M 9 -1 L 11 1 M -1 9 L 1 11",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Right diagonal lines (thin)
      d: "M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    // Set 3
    {
      // Diamonds
      d: "M 2 5 L 5 2 L 8 5 L 5 8 Z",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Thin vertical lines
      d: "M 3 0 L 3 10 M 8 0 L 8 10",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Left zig zag
      d: "M 10 3 L 5 3 L 5 0 M 5 10 L 5 7 L 0 7",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Thin horizontal lines
      d: "M 0 3 L 10 3 M 0 8 L 10 8",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Right zig zag
      d: "M 0 3 L 5 3 L 5 0 M 5 10 L 5 7 L 10 7",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    }
  ];
  var getPatternId = () => (0, import_uniqueId4.default)("pf-pattern");
  var getPatternDefsId = (prefix, index) => {
    const id = `${prefix}:${index}`;
    return id;
  };
  var getPatternDefs = ({ colorScale, offset: offset2 = 0, patternId, patternUnshiftIndex = 0 }) => {
    const defaultPatterns = [...patterns];
    if (patternUnshiftIndex > 0 && patternUnshiftIndex < defaultPatterns.length) {
      defaultPatterns.unshift(defaultPatterns.splice(patternUnshiftIndex, 1)[0]);
    }
    const defs = React307.createElement(
      React307.Fragment,
      { key: `defs` },
      React307.createElement("defs", null, colorScale.map((color2, index) => {
        const _a = defaultPatterns[(index + offset2) % defaultPatterns.length], { d, fill, stroke = color2, strokeWidth } = _a, rest = __rest(_a, ["d", "fill", "stroke", "strokeWidth"]);
        const id = getPatternDefsId(patternId, index);
        return React307.createElement(
          "pattern",
          Object.assign({ id, key: id }, rest),
          React307.createElement("path", { d, stroke, strokeWidth, fill })
        );
      }))
    );
    return defs;
  };
  var getPatternScale = (colorScale, patternId) => colorScale.map((val, index) => `url(#${getPatternDefsId(patternId, index)})`);
  var getDefaultColorScale = (colorScale, themeColorScale) => {
    const result = [];
    const colors3 = colorScale ? colorScale : themeColorScale;
    colors3.forEach((val) => result.push(val));
    return result;
  };
  var getDefaultData = (data, patternScale) => {
    if (!patternScale) {
      return data;
    }
    return data.map((datum, index) => {
      const pattern = patternScale[index % patternScale.length];
      return Object.assign(Object.assign({}, pattern && { _fill: pattern }), datum);
    });
  };
  var getDefaultPatternScale = ({ colorScale, patternId, patternScale }) => {
    if (patternScale) {
      return patternScale;
    }
    const defaultPatternScale = getPatternScale(colorScale, patternId);
    return defaultPatternScale && defaultPatternScale.length > 0 ? defaultPatternScale : void 0;
  };
  var useDefaultPatternProps = ({ colorScale, hasPatterns, patternScale, themeColorScale }) => {
    const defaultColorScale = getDefaultColorScale(colorScale, themeColorScale);
    let defaultPatternScale = patternScale;
    let isPatternDefs = !patternScale && hasPatterns !== void 0;
    const patternId = React307.useMemo(() => isPatternDefs ? getPatternId() : void 0, [isPatternDefs]);
    if (isPatternDefs) {
      defaultPatternScale = getDefaultPatternScale({
        colorScale: defaultColorScale,
        patternId,
        patternScale
      });
    }
    if (Array.isArray(hasPatterns)) {
      for (let i = 0; i < defaultPatternScale.length; i++) {
        if (!(i < hasPatterns.length && hasPatterns[i])) {
          defaultPatternScale[i] = null;
        }
      }
    } else if (hasPatterns === false) {
      defaultPatternScale = void 0;
      isPatternDefs = false;
    }
    return { defaultColorScale, defaultPatternScale, isPatternDefs, patternId };
  };
  var renderChildrenWithPatterns = ({ children, patternScale }) => React307.Children.toArray(children).map((child, index) => {
    if (React307.isValidElement(child)) {
      const childProps = __rest(child.props, []);
      const style = childProps.style ? Object.assign({}, childProps.style) : {};
      if (patternScale) {
        const pattern = patternScale[index % patternScale.length];
        style.data = Object.assign(Object.assign({}, pattern && { fill: pattern }), style.data);
      }
      const _child = React307.cloneElement(child, Object.assign(Object.assign(Object.assign({}, patternScale && { patternScale }), childProps), {
        style
        // Override child props
      }));
      return _child;
    }
    return child;
  });

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-theme.js
  var import_cloneDeep = __toESM(require_cloneDeep());
  var import_merge = __toESM(require_merge());

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_100.js
  var chart_theme_blue_ColorScale_100 = {
    "name": "--pf-chart-theme--blue--ColorScale--100",
    "value": "#06c",
    "var": "var(--pf-chart-theme--blue--ColorScale--100, #06c)"
  };
  var chart_theme_blue_ColorScale_100_default = chart_theme_blue_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_200.js
  var chart_theme_blue_ColorScale_200 = {
    "name": "--pf-chart-theme--blue--ColorScale--200",
    "value": "#8bc1f7",
    "var": "var(--pf-chart-theme--blue--ColorScale--200, #8bc1f7)"
  };
  var chart_theme_blue_ColorScale_200_default = chart_theme_blue_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_300.js
  var chart_theme_blue_ColorScale_300 = {
    "name": "--pf-chart-theme--blue--ColorScale--300",
    "value": "#002f5d",
    "var": "var(--pf-chart-theme--blue--ColorScale--300, #002f5d)"
  };
  var chart_theme_blue_ColorScale_300_default = chart_theme_blue_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_400.js
  var chart_theme_blue_ColorScale_400 = {
    "name": "--pf-chart-theme--blue--ColorScale--400",
    "value": "#519de9",
    "var": "var(--pf-chart-theme--blue--ColorScale--400, #519de9)"
  };
  var chart_theme_blue_ColorScale_400_default = chart_theme_blue_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_500.js
  var chart_theme_blue_ColorScale_500 = {
    "name": "--pf-chart-theme--blue--ColorScale--500",
    "value": "#004b95",
    "var": "var(--pf-chart-theme--blue--ColorScale--500, #004b95)"
  };
  var chart_theme_blue_ColorScale_500_default = chart_theme_blue_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/color-theme.js
  var ColorTheme = (props) => {
    const { COLOR_SCALE: COLOR_SCALE10 } = props;
    return {
      area: {
        colorScale: COLOR_SCALE10,
        style: {
          data: {
            fill: COLOR_SCALE10[0]
          }
        }
      },
      axis: {
        colorScale: COLOR_SCALE10
      },
      bar: {
        colorScale: COLOR_SCALE10,
        style: {
          data: {
            fill: COLOR_SCALE10[0]
          }
        }
      },
      boxplot: {
        colorScale: COLOR_SCALE10
      },
      candlestick: {
        colorScale: COLOR_SCALE10
      },
      chart: {
        colorScale: COLOR_SCALE10
      },
      errorbar: {
        colorScale: COLOR_SCALE10
      },
      group: {
        colorScale: COLOR_SCALE10
      },
      legend: {
        colorScale: COLOR_SCALE10
      },
      line: {
        colorScale: COLOR_SCALE10,
        style: {
          data: {
            stroke: COLOR_SCALE10[0]
          }
        }
      },
      pie: {
        colorScale: COLOR_SCALE10
      },
      scatter: {
        colorScale: COLOR_SCALE10
      },
      stack: {
        colorScale: COLOR_SCALE10
      },
      voronoi: {
        colorScale: COLOR_SCALE10
      }
    };
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/blue-color-theme.js
  var COLOR_SCALE = [
    chart_theme_blue_ColorScale_100_default.var,
    chart_theme_blue_ColorScale_200_default.var,
    chart_theme_blue_ColorScale_300_default.var,
    chart_theme_blue_ColorScale_400_default.var,
    chart_theme_blue_ColorScale_500_default.var
  ];
  var LightBlueColorTheme = ColorTheme({
    COLOR_SCALE
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_100.js
  var chart_theme_cyan_ColorScale_100 = {
    "name": "--pf-chart-theme--cyan--ColorScale--100",
    "value": "#009596",
    "var": "var(--pf-chart-theme--cyan--ColorScale--100, #009596)"
  };
  var chart_theme_cyan_ColorScale_100_default = chart_theme_cyan_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_200.js
  var chart_theme_cyan_ColorScale_200 = {
    "name": "--pf-chart-theme--cyan--ColorScale--200",
    "value": "#a2d9d9",
    "var": "var(--pf-chart-theme--cyan--ColorScale--200, #a2d9d9)"
  };
  var chart_theme_cyan_ColorScale_200_default = chart_theme_cyan_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_300.js
  var chart_theme_cyan_ColorScale_300 = {
    "name": "--pf-chart-theme--cyan--ColorScale--300",
    "value": "#003737",
    "var": "var(--pf-chart-theme--cyan--ColorScale--300, #003737)"
  };
  var chart_theme_cyan_ColorScale_300_default = chart_theme_cyan_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_400.js
  var chart_theme_cyan_ColorScale_400 = {
    "name": "--pf-chart-theme--cyan--ColorScale--400",
    "value": "#73c5c5",
    "var": "var(--pf-chart-theme--cyan--ColorScale--400, #73c5c5)"
  };
  var chart_theme_cyan_ColorScale_400_default = chart_theme_cyan_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_500.js
  var chart_theme_cyan_ColorScale_500 = {
    "name": "--pf-chart-theme--cyan--ColorScale--500",
    "value": "#005f60",
    "var": "var(--pf-chart-theme--cyan--ColorScale--500, #005f60)"
  };
  var chart_theme_cyan_ColorScale_500_default = chart_theme_cyan_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/cyan-color-theme.js
  var COLOR_SCALE2 = [
    chart_theme_cyan_ColorScale_100_default.var,
    chart_theme_cyan_ColorScale_200_default.var,
    chart_theme_cyan_ColorScale_300_default.var,
    chart_theme_cyan_ColorScale_400_default.var,
    chart_theme_cyan_ColorScale_500_default.var
  ];
  var LightCyanColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE2
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_100.js
  var chart_theme_gold_ColorScale_100 = {
    "name": "--pf-chart-theme--gold--ColorScale--100",
    "value": "#f4c145",
    "var": "var(--pf-chart-theme--gold--ColorScale--100, #f4c145)"
  };
  var chart_theme_gold_ColorScale_100_default = chart_theme_gold_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_200.js
  var chart_theme_gold_ColorScale_200 = {
    "name": "--pf-chart-theme--gold--ColorScale--200",
    "value": "#f9e0a2",
    "var": "var(--pf-chart-theme--gold--ColorScale--200, #f9e0a2)"
  };
  var chart_theme_gold_ColorScale_200_default = chart_theme_gold_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_300.js
  var chart_theme_gold_ColorScale_300 = {
    "name": "--pf-chart-theme--gold--ColorScale--300",
    "value": "#c58c00",
    "var": "var(--pf-chart-theme--gold--ColorScale--300, #c58c00)"
  };
  var chart_theme_gold_ColorScale_300_default = chart_theme_gold_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_400.js
  var chart_theme_gold_ColorScale_400 = {
    "name": "--pf-chart-theme--gold--ColorScale--400",
    "value": "#f6d173",
    "var": "var(--pf-chart-theme--gold--ColorScale--400, #f6d173)"
  };
  var chart_theme_gold_ColorScale_400_default = chart_theme_gold_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_500.js
  var chart_theme_gold_ColorScale_500 = {
    "name": "--pf-chart-theme--gold--ColorScale--500",
    "value": "#f0ab00",
    "var": "var(--pf-chart-theme--gold--ColorScale--500, #f0ab00)"
  };
  var chart_theme_gold_ColorScale_500_default = chart_theme_gold_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/gold-color-theme.js
  var COLOR_SCALE3 = [
    chart_theme_gold_ColorScale_100_default.var,
    chart_theme_gold_ColorScale_200_default.var,
    chart_theme_gold_ColorScale_300_default.var,
    chart_theme_gold_ColorScale_400_default.var,
    chart_theme_gold_ColorScale_500_default.var
  ];
  var LightGoldColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE3
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_100.js
  var chart_theme_gray_ColorScale_100 = {
    "name": "--pf-chart-theme--gray--ColorScale--100",
    "value": "#b8bbbe",
    "var": "var(--pf-chart-theme--gray--ColorScale--100, #b8bbbe)"
  };
  var chart_theme_gray_ColorScale_100_default = chart_theme_gray_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_200.js
  var chart_theme_gray_ColorScale_200 = {
    "name": "--pf-chart-theme--gray--ColorScale--200",
    "value": "#f0f0f0",
    "var": "var(--pf-chart-theme--gray--ColorScale--200, #f0f0f0)"
  };
  var chart_theme_gray_ColorScale_200_default = chart_theme_gray_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_300.js
  var chart_theme_gray_ColorScale_300 = {
    "name": "--pf-chart-theme--gray--ColorScale--300",
    "value": "#6a6e73",
    "var": "var(--pf-chart-theme--gray--ColorScale--300, #6a6e73)"
  };
  var chart_theme_gray_ColorScale_300_default = chart_theme_gray_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_400.js
  var chart_theme_gray_ColorScale_400 = {
    "name": "--pf-chart-theme--gray--ColorScale--400",
    "value": "#d2d2d2",
    "var": "var(--pf-chart-theme--gray--ColorScale--400, #d2d2d2)"
  };
  var chart_theme_gray_ColorScale_400_default = chart_theme_gray_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_500.js
  var chart_theme_gray_ColorScale_500 = {
    "name": "--pf-chart-theme--gray--ColorScale--500",
    "value": "#8a8d90",
    "var": "var(--pf-chart-theme--gray--ColorScale--500, #8a8d90)"
  };
  var chart_theme_gray_ColorScale_500_default = chart_theme_gray_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/gray-color-theme.js
  var COLOR_SCALE4 = [
    chart_theme_gray_ColorScale_100_default.var,
    chart_theme_gray_ColorScale_200_default.var,
    chart_theme_gray_ColorScale_300_default.var,
    chart_theme_gray_ColorScale_400_default.var,
    chart_theme_gray_ColorScale_500_default.var
  ];
  var LightGrayColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE4
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_100.js
  var chart_theme_green_ColorScale_100 = {
    "name": "--pf-chart-theme--green--ColorScale--100",
    "value": "#4cb140",
    "var": "var(--pf-chart-theme--green--ColorScale--100, #4cb140)"
  };
  var chart_theme_green_ColorScale_100_default = chart_theme_green_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_200.js
  var chart_theme_green_ColorScale_200 = {
    "name": "--pf-chart-theme--green--ColorScale--200",
    "value": "#bde2b9",
    "var": "var(--pf-chart-theme--green--ColorScale--200, #bde2b9)"
  };
  var chart_theme_green_ColorScale_200_default = chart_theme_green_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_300.js
  var chart_theme_green_ColorScale_300 = {
    "name": "--pf-chart-theme--green--ColorScale--300",
    "value": "#23511e",
    "var": "var(--pf-chart-theme--green--ColorScale--300, #23511e)"
  };
  var chart_theme_green_ColorScale_300_default = chart_theme_green_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_400.js
  var chart_theme_green_ColorScale_400 = {
    "name": "--pf-chart-theme--green--ColorScale--400",
    "value": "#7cc674",
    "var": "var(--pf-chart-theme--green--ColorScale--400, #7cc674)"
  };
  var chart_theme_green_ColorScale_400_default = chart_theme_green_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_500.js
  var chart_theme_green_ColorScale_500 = {
    "name": "--pf-chart-theme--green--ColorScale--500",
    "value": "#38812f",
    "var": "var(--pf-chart-theme--green--ColorScale--500, #38812f)"
  };
  var chart_theme_green_ColorScale_500_default = chart_theme_green_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/green-color-theme.js
  var COLOR_SCALE5 = [
    chart_theme_green_ColorScale_100_default.var,
    chart_theme_green_ColorScale_200_default.var,
    chart_theme_green_ColorScale_300_default.var,
    chart_theme_green_ColorScale_400_default.var,
    chart_theme_green_ColorScale_500_default.var
  ];
  var LightGreenColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE5
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_100.js
  var chart_theme_multi_color_ordered_ColorScale_100 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--100",
    "value": "#06c",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--100, #06c)"
  };
  var chart_theme_multi_color_ordered_ColorScale_100_default = chart_theme_multi_color_ordered_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_200.js
  var chart_theme_multi_color_ordered_ColorScale_200 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--200",
    "value": "#4cb140",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--200, #4cb140)"
  };
  var chart_theme_multi_color_ordered_ColorScale_200_default = chart_theme_multi_color_ordered_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_300.js
  var chart_theme_multi_color_ordered_ColorScale_300 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--300",
    "value": "#009596",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--300, #009596)"
  };
  var chart_theme_multi_color_ordered_ColorScale_300_default = chart_theme_multi_color_ordered_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_400.js
  var chart_theme_multi_color_ordered_ColorScale_400 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--400",
    "value": "#f4c145",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--400, #f4c145)"
  };
  var chart_theme_multi_color_ordered_ColorScale_400_default = chart_theme_multi_color_ordered_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_500.js
  var chart_theme_multi_color_ordered_ColorScale_500 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--500",
    "value": "#ec7a08",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--500, #ec7a08)"
  };
  var chart_theme_multi_color_ordered_ColorScale_500_default = chart_theme_multi_color_ordered_ColorScale_500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_600.js
  var chart_theme_multi_color_ordered_ColorScale_600 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--600",
    "value": "#8bc1f7",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--600, #8bc1f7)"
  };
  var chart_theme_multi_color_ordered_ColorScale_600_default = chart_theme_multi_color_ordered_ColorScale_600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_700.js
  var chart_theme_multi_color_ordered_ColorScale_700 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--700",
    "value": "#23511e",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--700, #23511e)"
  };
  var chart_theme_multi_color_ordered_ColorScale_700_default = chart_theme_multi_color_ordered_ColorScale_700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_800.js
  var chart_theme_multi_color_ordered_ColorScale_800 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--800",
    "value": "#a2d9d9",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--800, #a2d9d9)"
  };
  var chart_theme_multi_color_ordered_ColorScale_800_default = chart_theme_multi_color_ordered_ColorScale_800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_900.js
  var chart_theme_multi_color_ordered_ColorScale_900 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--900",
    "value": "#f9e0a2",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--900, #f9e0a2)"
  };
  var chart_theme_multi_color_ordered_ColorScale_900_default = chart_theme_multi_color_ordered_ColorScale_900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1000.js
  var chart_theme_multi_color_ordered_ColorScale_1000 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1000",
    "value": "#8f4700",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1000, #8f4700)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1000_default = chart_theme_multi_color_ordered_ColorScale_1000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1100.js
  var chart_theme_multi_color_ordered_ColorScale_1100 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1100",
    "value": "#002f5d",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1100, #002f5d)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1100_default = chart_theme_multi_color_ordered_ColorScale_1100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1200.js
  var chart_theme_multi_color_ordered_ColorScale_1200 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1200",
    "value": "#bde2b9",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1200, #bde2b9)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1200_default = chart_theme_multi_color_ordered_ColorScale_1200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1300.js
  var chart_theme_multi_color_ordered_ColorScale_1300 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1300",
    "value": "#003737",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1300, #003737)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1300_default = chart_theme_multi_color_ordered_ColorScale_1300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1400.js
  var chart_theme_multi_color_ordered_ColorScale_1400 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1400",
    "value": "#c58c00",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1400, #c58c00)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1400_default = chart_theme_multi_color_ordered_ColorScale_1400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1500.js
  var chart_theme_multi_color_ordered_ColorScale_1500 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1500",
    "value": "#f4b678",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1500, #f4b678)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1500_default = chart_theme_multi_color_ordered_ColorScale_1500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1600.js
  var chart_theme_multi_color_ordered_ColorScale_1600 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1600",
    "value": "#519de9",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1600, #519de9)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1600_default = chart_theme_multi_color_ordered_ColorScale_1600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1700.js
  var chart_theme_multi_color_ordered_ColorScale_1700 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1700",
    "value": "#38812f",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1700, #38812f)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1700_default = chart_theme_multi_color_ordered_ColorScale_1700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1800.js
  var chart_theme_multi_color_ordered_ColorScale_1800 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1800",
    "value": "#73c5c5",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1800, #73c5c5)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1800_default = chart_theme_multi_color_ordered_ColorScale_1800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1900.js
  var chart_theme_multi_color_ordered_ColorScale_1900 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--1900",
    "value": "#f6d173",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--1900, #f6d173)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1900_default = chart_theme_multi_color_ordered_ColorScale_1900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2000.js
  var chart_theme_multi_color_ordered_ColorScale_2000 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--2000",
    "value": "#c46100",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--2000, #c46100)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2000_default = chart_theme_multi_color_ordered_ColorScale_2000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2100.js
  var chart_theme_multi_color_ordered_ColorScale_2100 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--2100",
    "value": "#004b95",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--2100, #004b95)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2100_default = chart_theme_multi_color_ordered_ColorScale_2100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2200.js
  var chart_theme_multi_color_ordered_ColorScale_2200 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--2200",
    "value": "#7cc674",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--2200, #7cc674)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2200_default = chart_theme_multi_color_ordered_ColorScale_2200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2300.js
  var chart_theme_multi_color_ordered_ColorScale_2300 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--2300",
    "value": "#005f60",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--2300, #005f60)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2300_default = chart_theme_multi_color_ordered_ColorScale_2300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2400.js
  var chart_theme_multi_color_ordered_ColorScale_2400 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--2400",
    "value": "#f0ab00",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--2400, #f0ab00)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2400_default = chart_theme_multi_color_ordered_ColorScale_2400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2500.js
  var chart_theme_multi_color_ordered_ColorScale_2500 = {
    "name": "--pf-chart-theme--multi-color-ordered--ColorScale--2500",
    "value": "#ef9234",
    "var": "var(--pf-chart-theme--multi-color-ordered--ColorScale--2500, #ef9234)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2500_default = chart_theme_multi_color_ordered_ColorScale_2500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/multi-color-ordered-theme.js
  var COLOR_SCALE6 = [
    chart_theme_multi_color_ordered_ColorScale_100_default.var,
    chart_theme_multi_color_ordered_ColorScale_200_default.var,
    chart_theme_multi_color_ordered_ColorScale_300_default.var,
    chart_theme_multi_color_ordered_ColorScale_400_default.var,
    chart_theme_multi_color_ordered_ColorScale_500_default.var,
    chart_theme_multi_color_ordered_ColorScale_600_default.var,
    chart_theme_multi_color_ordered_ColorScale_700_default.var,
    chart_theme_multi_color_ordered_ColorScale_800_default.var,
    chart_theme_multi_color_ordered_ColorScale_900_default.var,
    chart_theme_multi_color_ordered_ColorScale_1000_default.var,
    chart_theme_multi_color_ordered_ColorScale_1100_default.var,
    chart_theme_multi_color_ordered_ColorScale_1200_default.var,
    chart_theme_multi_color_ordered_ColorScale_1300_default.var,
    chart_theme_multi_color_ordered_ColorScale_1400_default.var,
    chart_theme_multi_color_ordered_ColorScale_1500_default.var,
    chart_theme_multi_color_ordered_ColorScale_1600_default.var,
    chart_theme_multi_color_ordered_ColorScale_1700_default.var,
    chart_theme_multi_color_ordered_ColorScale_1800_default.var,
    chart_theme_multi_color_ordered_ColorScale_1900_default.var,
    chart_theme_multi_color_ordered_ColorScale_2000_default.var,
    chart_theme_multi_color_ordered_ColorScale_2100_default.var,
    chart_theme_multi_color_ordered_ColorScale_2200_default.var,
    chart_theme_multi_color_ordered_ColorScale_2300_default.var,
    chart_theme_multi_color_ordered_ColorScale_2400_default.var,
    chart_theme_multi_color_ordered_ColorScale_2500_default.var
  ];
  var LightMultiColorOrderedTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE6
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_100.js
  var chart_theme_multi_color_unordered_ColorScale_100 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--100",
    "value": "#06c",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--100, #06c)"
  };
  var chart_theme_multi_color_unordered_ColorScale_100_default = chart_theme_multi_color_unordered_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_200.js
  var chart_theme_multi_color_unordered_ColorScale_200 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--200",
    "value": "#f4c145",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--200, #f4c145)"
  };
  var chart_theme_multi_color_unordered_ColorScale_200_default = chart_theme_multi_color_unordered_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_300.js
  var chart_theme_multi_color_unordered_ColorScale_300 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--300",
    "value": "#4cb140",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--300, #4cb140)"
  };
  var chart_theme_multi_color_unordered_ColorScale_300_default = chart_theme_multi_color_unordered_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_400.js
  var chart_theme_multi_color_unordered_ColorScale_400 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--400",
    "value": "#5752d1",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--400, #5752d1)"
  };
  var chart_theme_multi_color_unordered_ColorScale_400_default = chart_theme_multi_color_unordered_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_500.js
  var chart_theme_multi_color_unordered_ColorScale_500 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--500",
    "value": "#ec7a08",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--500, #ec7a08)"
  };
  var chart_theme_multi_color_unordered_ColorScale_500_default = chart_theme_multi_color_unordered_ColorScale_500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_600.js
  var chart_theme_multi_color_unordered_ColorScale_600 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--600",
    "value": "#009596",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--600, #009596)"
  };
  var chart_theme_multi_color_unordered_ColorScale_600_default = chart_theme_multi_color_unordered_ColorScale_600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_700.js
  var chart_theme_multi_color_unordered_ColorScale_700 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--700",
    "value": "#b8bbbe",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--700, #b8bbbe)"
  };
  var chart_theme_multi_color_unordered_ColorScale_700_default = chart_theme_multi_color_unordered_ColorScale_700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_800.js
  var chart_theme_multi_color_unordered_ColorScale_800 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--800",
    "value": "#8bc1f7",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--800, #8bc1f7)"
  };
  var chart_theme_multi_color_unordered_ColorScale_800_default = chart_theme_multi_color_unordered_ColorScale_800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_900.js
  var chart_theme_multi_color_unordered_ColorScale_900 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--900",
    "value": "#c58c00",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--900, #c58c00)"
  };
  var chart_theme_multi_color_unordered_ColorScale_900_default = chart_theme_multi_color_unordered_ColorScale_900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1000.js
  var chart_theme_multi_color_unordered_ColorScale_1000 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1000",
    "value": "#bde2b9",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1000, #bde2b9)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1000_default = chart_theme_multi_color_unordered_ColorScale_1000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1100.js
  var chart_theme_multi_color_unordered_ColorScale_1100 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1100",
    "value": "#2a265f",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1100, #2a265f)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1100_default = chart_theme_multi_color_unordered_ColorScale_1100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1200.js
  var chart_theme_multi_color_unordered_ColorScale_1200 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1200",
    "value": "#f4b678",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1200, #f4b678)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1200_default = chart_theme_multi_color_unordered_ColorScale_1200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1300.js
  var chart_theme_multi_color_unordered_ColorScale_1300 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1300",
    "value": "#003737",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1300, #003737)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1300_default = chart_theme_multi_color_unordered_ColorScale_1300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1400.js
  var chart_theme_multi_color_unordered_ColorScale_1400 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1400",
    "value": "#f0f0f0",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1400, #f0f0f0)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1400_default = chart_theme_multi_color_unordered_ColorScale_1400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1500.js
  var chart_theme_multi_color_unordered_ColorScale_1500 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1500",
    "value": "#002f5d",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1500, #002f5d)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1500_default = chart_theme_multi_color_unordered_ColorScale_1500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1600.js
  var chart_theme_multi_color_unordered_ColorScale_1600 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1600",
    "value": "#f9e0a2",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1600, #f9e0a2)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1600_default = chart_theme_multi_color_unordered_ColorScale_1600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1700.js
  var chart_theme_multi_color_unordered_ColorScale_1700 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1700",
    "value": "#23511e",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1700, #23511e)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1700_default = chart_theme_multi_color_unordered_ColorScale_1700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1800.js
  var chart_theme_multi_color_unordered_ColorScale_1800 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1800",
    "value": "#b2b0ea",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1800, #b2b0ea)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1800_default = chart_theme_multi_color_unordered_ColorScale_1800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1900.js
  var chart_theme_multi_color_unordered_ColorScale_1900 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--1900",
    "value": "#8f4700",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--1900, #8f4700)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1900_default = chart_theme_multi_color_unordered_ColorScale_1900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2000.js
  var chart_theme_multi_color_unordered_ColorScale_2000 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2000",
    "value": "#a2d9d9",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2000, #a2d9d9)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2000_default = chart_theme_multi_color_unordered_ColorScale_2000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2100.js
  var chart_theme_multi_color_unordered_ColorScale_2100 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2100",
    "value": "#6a6e73",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2100, #6a6e73)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2100_default = chart_theme_multi_color_unordered_ColorScale_2100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2200.js
  var chart_theme_multi_color_unordered_ColorScale_2200 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2200",
    "value": "#519de9",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2200, #519de9)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2200_default = chart_theme_multi_color_unordered_ColorScale_2200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2300.js
  var chart_theme_multi_color_unordered_ColorScale_2300 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2300",
    "value": "#f0ab00",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2300, #f0ab00)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2300_default = chart_theme_multi_color_unordered_ColorScale_2300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2400.js
  var chart_theme_multi_color_unordered_ColorScale_2400 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2400",
    "value": "#7cc674",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2400, #7cc674)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2400_default = chart_theme_multi_color_unordered_ColorScale_2400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2500.js
  var chart_theme_multi_color_unordered_ColorScale_2500 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2500",
    "value": "#3c3d99",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2500, #3c3d99)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2500_default = chart_theme_multi_color_unordered_ColorScale_2500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2600.js
  var chart_theme_multi_color_unordered_ColorScale_2600 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2600",
    "value": "#ef9234",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2600, #ef9234)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2600_default = chart_theme_multi_color_unordered_ColorScale_2600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2700.js
  var chart_theme_multi_color_unordered_ColorScale_2700 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2700",
    "value": "#005f60",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2700, #005f60)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2700_default = chart_theme_multi_color_unordered_ColorScale_2700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2800.js
  var chart_theme_multi_color_unordered_ColorScale_2800 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2800",
    "value": "#d2d2d2",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2800, #d2d2d2)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2800_default = chart_theme_multi_color_unordered_ColorScale_2800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2900.js
  var chart_theme_multi_color_unordered_ColorScale_2900 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--2900",
    "value": "#004b95",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--2900, #004b95)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2900_default = chart_theme_multi_color_unordered_ColorScale_2900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3000.js
  var chart_theme_multi_color_unordered_ColorScale_3000 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--3000",
    "value": "#f6d173",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--3000, #f6d173)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3000_default = chart_theme_multi_color_unordered_ColorScale_3000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3100.js
  var chart_theme_multi_color_unordered_ColorScale_3100 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--3100",
    "value": "#38812f",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--3100, #38812f)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3100_default = chart_theme_multi_color_unordered_ColorScale_3100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3200.js
  var chart_theme_multi_color_unordered_ColorScale_3200 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--3200",
    "value": "#8481dd",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--3200, #8481dd)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3200_default = chart_theme_multi_color_unordered_ColorScale_3200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3300.js
  var chart_theme_multi_color_unordered_ColorScale_3300 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--3300",
    "value": "#c46100",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--3300, #c46100)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3300_default = chart_theme_multi_color_unordered_ColorScale_3300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3400.js
  var chart_theme_multi_color_unordered_ColorScale_3400 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--3400",
    "value": "#73c5c5",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--3400, #73c5c5)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3400_default = chart_theme_multi_color_unordered_ColorScale_3400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3500.js
  var chart_theme_multi_color_unordered_ColorScale_3500 = {
    "name": "--pf-chart-theme--multi-color-unordered--ColorScale--3500",
    "value": "#8a8d90",
    "var": "var(--pf-chart-theme--multi-color-unordered--ColorScale--3500, #8a8d90)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3500_default = chart_theme_multi_color_unordered_ColorScale_3500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/multi-color-unordered-theme.js
  var COLOR_SCALE7 = [
    chart_theme_multi_color_unordered_ColorScale_100_default.var,
    chart_theme_multi_color_unordered_ColorScale_200_default.var,
    chart_theme_multi_color_unordered_ColorScale_300_default.var,
    chart_theme_multi_color_unordered_ColorScale_400_default.var,
    chart_theme_multi_color_unordered_ColorScale_500_default.var,
    chart_theme_multi_color_unordered_ColorScale_600_default.var,
    chart_theme_multi_color_unordered_ColorScale_700_default.var,
    chart_theme_multi_color_unordered_ColorScale_800_default.var,
    chart_theme_multi_color_unordered_ColorScale_900_default.var,
    chart_theme_multi_color_unordered_ColorScale_1000_default.var,
    chart_theme_multi_color_unordered_ColorScale_1100_default.var,
    chart_theme_multi_color_unordered_ColorScale_1200_default.var,
    chart_theme_multi_color_unordered_ColorScale_1300_default.var,
    chart_theme_multi_color_unordered_ColorScale_1400_default.var,
    chart_theme_multi_color_unordered_ColorScale_1500_default.var,
    chart_theme_multi_color_unordered_ColorScale_1600_default.var,
    chart_theme_multi_color_unordered_ColorScale_1700_default.var,
    chart_theme_multi_color_unordered_ColorScale_1800_default.var,
    chart_theme_multi_color_unordered_ColorScale_1900_default.var,
    chart_theme_multi_color_unordered_ColorScale_2000_default.var,
    chart_theme_multi_color_unordered_ColorScale_2100_default.var,
    chart_theme_multi_color_unordered_ColorScale_2200_default.var,
    chart_theme_multi_color_unordered_ColorScale_2300_default.var,
    chart_theme_multi_color_unordered_ColorScale_2400_default.var,
    chart_theme_multi_color_unordered_ColorScale_2500_default.var,
    chart_theme_multi_color_unordered_ColorScale_2600_default.var,
    chart_theme_multi_color_unordered_ColorScale_2700_default.var,
    chart_theme_multi_color_unordered_ColorScale_2800_default.var,
    chart_theme_multi_color_unordered_ColorScale_2900_default.var,
    chart_theme_multi_color_unordered_ColorScale_3000_default.var,
    chart_theme_multi_color_unordered_ColorScale_3100_default.var,
    chart_theme_multi_color_unordered_ColorScale_3200_default.var,
    chart_theme_multi_color_unordered_ColorScale_3300_default.var,
    chart_theme_multi_color_unordered_ColorScale_3400_default.var,
    chart_theme_multi_color_unordered_ColorScale_3500_default.var
  ];
  var LightMultiColorUnorderedTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE7
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_100.js
  var chart_theme_orange_ColorScale_100 = {
    "name": "--pf-chart-theme--orange--ColorScale--100",
    "value": "#ec7a08",
    "var": "var(--pf-chart-theme--orange--ColorScale--100, #ec7a08)"
  };
  var chart_theme_orange_ColorScale_100_default = chart_theme_orange_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_200.js
  var chart_theme_orange_ColorScale_200 = {
    "name": "--pf-chart-theme--orange--ColorScale--200",
    "value": "#f4b678",
    "var": "var(--pf-chart-theme--orange--ColorScale--200, #f4b678)"
  };
  var chart_theme_orange_ColorScale_200_default = chart_theme_orange_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_300.js
  var chart_theme_orange_ColorScale_300 = {
    "name": "--pf-chart-theme--orange--ColorScale--300",
    "value": "#8f4700",
    "var": "var(--pf-chart-theme--orange--ColorScale--300, #8f4700)"
  };
  var chart_theme_orange_ColorScale_300_default = chart_theme_orange_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_400.js
  var chart_theme_orange_ColorScale_400 = {
    "name": "--pf-chart-theme--orange--ColorScale--400",
    "value": "#ef9234",
    "var": "var(--pf-chart-theme--orange--ColorScale--400, #ef9234)"
  };
  var chart_theme_orange_ColorScale_400_default = chart_theme_orange_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_500.js
  var chart_theme_orange_ColorScale_500 = {
    "name": "--pf-chart-theme--orange--ColorScale--500",
    "value": "#c46100",
    "var": "var(--pf-chart-theme--orange--ColorScale--500, #c46100)"
  };
  var chart_theme_orange_ColorScale_500_default = chart_theme_orange_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/orange-color-theme.js
  var COLOR_SCALE8 = [
    chart_theme_orange_ColorScale_100_default.var,
    chart_theme_orange_ColorScale_200_default.var,
    chart_theme_orange_ColorScale_300_default.var,
    chart_theme_orange_ColorScale_400_default.var,
    chart_theme_orange_ColorScale_500_default.var
  ];
  var LightOrangeColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE8
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_100.js
  var chart_theme_purple_ColorScale_100 = {
    "name": "--pf-chart-theme--purple--ColorScale--100",
    "value": "#5752d1",
    "var": "var(--pf-chart-theme--purple--ColorScale--100, #5752d1)"
  };
  var chart_theme_purple_ColorScale_100_default = chart_theme_purple_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_200.js
  var chart_theme_purple_ColorScale_200 = {
    "name": "--pf-chart-theme--purple--ColorScale--200",
    "value": "#b2b0ea",
    "var": "var(--pf-chart-theme--purple--ColorScale--200, #b2b0ea)"
  };
  var chart_theme_purple_ColorScale_200_default = chart_theme_purple_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_300.js
  var chart_theme_purple_ColorScale_300 = {
    "name": "--pf-chart-theme--purple--ColorScale--300",
    "value": "#2a265f",
    "var": "var(--pf-chart-theme--purple--ColorScale--300, #2a265f)"
  };
  var chart_theme_purple_ColorScale_300_default = chart_theme_purple_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_400.js
  var chart_theme_purple_ColorScale_400 = {
    "name": "--pf-chart-theme--purple--ColorScale--400",
    "value": "#8481dd",
    "var": "var(--pf-chart-theme--purple--ColorScale--400, #8481dd)"
  };
  var chart_theme_purple_ColorScale_400_default = chart_theme_purple_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_500.js
  var chart_theme_purple_ColorScale_500 = {
    "name": "--pf-chart-theme--purple--ColorScale--500",
    "value": "#3c3d99",
    "var": "var(--pf-chart-theme--purple--ColorScale--500, #3c3d99)"
  };
  var chart_theme_purple_ColorScale_500_default = chart_theme_purple_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/light/purple-color-theme.js
  var COLOR_SCALE9 = [
    chart_theme_purple_ColorScale_100_default.var,
    chart_theme_purple_ColorScale_200_default.var,
    chart_theme_purple_ColorScale_300_default.var,
    chart_theme_purple_ColorScale_400_default.var,
    chart_theme_purple_ColorScale_500_default.var
  ];
  var LightPurpleColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE9
  });

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-theme.js
  var mergeTheme = (themeColor, customTheme) => (0, import_merge.default)(getTheme(themeColor), customTheme);
  var getAxisTheme = (themeColor) => mergeTheme(themeColor, ChartAxisTheme);
  var getChartTheme = (themeColor, showAxis) => {
    const theme = getTheme(themeColor);
    if (!showAxis) {
      theme.axis.padding = 0;
      theme.axis.style.axis.fill = "none";
      theme.axis.style.axis.stroke = "none";
      theme.axis.style.grid.fill = "none";
      theme.axis.style.grid.stroke = "none";
      theme.axis.style.ticks.fill = "none";
      theme.axis.style.ticks.stroke = "none";
      theme.axis.style.tickLabels.fill = "none";
    }
    return theme;
  };
  var getThemeColors = (themeColor) => {
    switch (themeColor) {
      case ChartThemeColor.blue:
        return LightBlueColorTheme;
      case ChartThemeColor.cyan:
        return LightCyanColorTheme;
      case ChartThemeColor.gold:
        return LightGoldColorTheme;
      case ChartThemeColor.gray:
        return LightGrayColorTheme;
      case ChartThemeColor.green:
        return LightGreenColorTheme;
      case ChartThemeColor.multi:
      case ChartThemeColor.multiOrdered:
        return LightMultiColorOrderedTheme;
      case ChartThemeColor.multiUnordered:
        return LightMultiColorUnorderedTheme;
      case ChartThemeColor.orange:
        return LightOrangeColorTheme;
      case ChartThemeColor.purple:
        return LightPurpleColorTheme;
      default:
        return LightBlueColorTheme;
    }
  };
  var getTheme = (themeColor) => {
    const baseTheme = Object.assign({}, JSON.parse(JSON.stringify(ChartBaseTheme)));
    return (0, import_merge.default)(baseTheme, getThemeColors(themeColor));
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartContainer/ChartContainer.js
  var ChartContainer = (_a) => {
    var {
      className,
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["className", "themeColor", "themeVariant", "theme"]);
    const chartClassName = getClassName({ className });
    return React308.createElement(VictoryContainer, Object.assign({ className: chartClassName, theme }, rest));
  };
  ChartContainer.displayName = "ChartContainer";
  (0, import_hoist_non_react_statics3.default)(ChartContainer, VictoryContainer);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLegend/ChartLegend.js
  init_tslib_es6();
  var React310 = __toESM(require_react());
  var import_hoist_non_react_statics4 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartPoint/ChartPoint.js
  init_tslib_es6();
  var React309 = __toESM(require_react());

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartPoint/path-helpers.js
  var PathHelpers = {
    circle: (x2, y2, size) => `M ${x2}, ${y2}
      m ${-size}, 0
      a ${size}, ${size} 0 1,0 ${size * 2},0
      a ${size}, ${size} 0 1,0 ${-size * 2},0`,
    dash: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const lineHeight = baseSize - baseSize * 0.3;
      const x0 = x2 - baseSize;
      const y1 = y2 + lineHeight / 2;
      const distance = (x2 + baseSize - x0) * 0.3;
      const padding2 = distance / 3;
      return `M ${x0}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z
      M ${x0 + distance + padding2}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z
      M ${x0 + distance * 2 + padding2 * 2}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z`;
    },
    diamond: (x2, y2, size) => {
      const baseSize = 0.87 * size;
      const length = Math.sqrt(2 * (baseSize * baseSize));
      return `M ${x2}, ${y2 + length}
      l ${length}, -${length}
      l -${length}, -${length}
      l -${length}, ${length}
      l ${length}, ${length}
      z`;
    },
    // The eye slash symbol is used to hide / show each data series individually
    // See https://github.com/patternfly/patternfly-next/issues/2352
    eyeSlash: (x2, y2, size) => {
      const baseSize = 0.87 * size;
      const x0 = x2 - baseSize;
      const y1 = y2 - size * 1.25;
      const data = ".013 .013 0 0 2.179 2.219c.7-.204 1.418-.307 2.152-.307 2.859 0 5.464 1.551 7.814 4.654.243 .321.268 .753.073 1.097l-.073.111-.236.305c-.632.801-1.282 1.491-1.951 2.071l1.773 1.806c.382.389 .382 1.012 0 1.401l-.058.059c-.387.394-1.02.4-1.414.013l-.013-.013-11.732-11.956c-.382-.389-.382-1.012 0-1.401l.058-.059c.387-.394 1.02-.4 1.414-.013zm-.674 3.71 1.407 1.436c-.329.604-.516 1.298-.516 2.038 0 2.323 1.848 4.206 4.127 4.206.726 0 1.408-.191 2-.526l.966.984c-.956.396-1.945.593-2.966.593-2.859 0-5.464-1.551-7.814-4.654-.243-.321-.268-.753-.073-1.097l.073-.111.236-.305c.823-1.042 1.676-1.897 2.56-2.565zm2.177 2.22 4.072 4.149c-.377.167-.793.259-1.23.259-1.71 0-3.096-1.412-3.096-3.155 0-.445.091-.869.254-1.253zm2.842-2.953c-.43 0-.845.067-1.234.191l.865.882c.121-.015.244-.022.369-.022 1.71 0 3.096 1.412 3.096 3.155 0 .127-.007.252-.022.375l.866.882c.122-.397.187-.819.187-1.257 0-2.323-1.848-4.206-4.127-4.206z";
      return `m${x0}, ${y1} ${data}`;
    },
    minus: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const lineHeight = baseSize - baseSize * 0.3;
      const x0 = x2 - baseSize;
      const y1 = y2 + lineHeight / 2;
      const distance = x2 + baseSize - x0;
      return `M ${x0}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z`;
    },
    plus: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const distance = baseSize / 1.5;
      return `
      M ${x2 - distance / 2}, ${y2 + baseSize}
      v-${distance}
      h-${distance}
      v-${distance}
      h${distance}
      v-${distance}
      h${distance}
      v${distance}
      h${distance}
      v${distance}
      h-${distance}
      v${distance}
      z`;
    },
    star: (x2, y2, size) => {
      const baseSize = 1.35 * size;
      const angle = Math.PI / 5;
      const starCoords = [...Array(10).keys()].map((index) => {
        const length = index % 2 === 0 ? baseSize : baseSize / 2;
        return `${length * Math.sin(angle * (index + 1)) + x2},
        ${length * Math.cos(angle * (index + 1)) + y2}`;
      });
      return `M ${starCoords.join("L")} z`;
    },
    square: (x2, y2, size) => {
      const baseSize = 0.87 * size;
      const x0 = x2 - baseSize;
      const y1 = y2 + baseSize;
      const distance = x2 + baseSize - x0;
      return `M ${x0}, ${y1}
      h${distance}
      v-${distance}
      h-${distance}
      z`;
    },
    threshold: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const lineHeight = baseSize - baseSize * 0.3;
      const x0 = x2 - baseSize;
      const y1 = y2 + lineHeight / 2;
      const distance = (x2 + baseSize - x0) * 0.5;
      const padding2 = distance / 3;
      return `M ${x0}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z
      M ${x0 + distance + padding2}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z`;
    },
    triangleDown: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - size;
      const x1 = x2 + size;
      const y0 = y2 - size;
      const y1 = y2 + height;
      return `M ${x0}, ${y0}
      L ${x1}, ${y0}
      L ${x2}, ${y1}
      z`;
    },
    triangleLeft: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - height;
      const x1 = x2 + size;
      const y0 = y2 - size;
      const y1 = y2 + size;
      return `M ${x1}, ${y0}
      L ${x1}, ${y1}
      L ${x0}, ${y2}
      z`;
    },
    triangleRight: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - size;
      const x1 = x2 + height;
      const y0 = y2 - size;
      const y1 = y2 + size;
      return `M ${x0}, ${y0}
      L ${x0}, ${y1}
      L ${x1}, ${y2}
      z`;
    },
    triangleUp: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - size;
      const x1 = x2 + size;
      const y0 = y2 - height;
      const y1 = y2 + size;
      return `M ${x0}, ${y1}
      L ${x1}, ${y1}
      L ${x2}, ${y0}
      z`;
    }
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartPoint/ChartPoint.js
  var getPath2 = (props) => {
    const { x: x2, y: y2 } = props;
    const size = helpers_exports.evaluateProp(props.size, props);
    if (props.getPath) {
      return props.getPath(x2, y2, size);
    }
    const pathFunctions = {
      circle: PathHelpers.circle,
      square: PathHelpers.square,
      diamond: PathHelpers.diamond,
      eyeSlash: PathHelpers.eyeSlash,
      triangleDown: PathHelpers.triangleDown,
      triangleLeft: PathHelpers.triangleLeft,
      triangleRight: PathHelpers.triangleRight,
      triangleUp: PathHelpers.triangleUp,
      plus: PathHelpers.plus,
      minus: PathHelpers.minus,
      star: PathHelpers.star,
      dash: PathHelpers.dash,
      threshold: PathHelpers.threshold
    };
    const symbol = helpers_exports.evaluateProp(props.symbol, props);
    const key = symbol;
    const symbolFunction = typeof pathFunctions[key] === "function" ? pathFunctions[key] : pathFunctions.square;
    return symbolFunction(x2, y2, size);
  };
  var ChartPoint = (_a) => {
    var { active, className, clipPath, datum, desc, events, pathComponent = React309.createElement(Path, null), role = "presentation", shapeRendering = "auto", tabIndex, transform: transform2 } = _a, rest = __rest(_a, ["active", "className", "clipPath", "datum", "desc", "events", "pathComponent", "role", "shapeRendering", "tabIndex", "transform"]);
    const props = Object.assign({
      active,
      className,
      clipPath,
      datum,
      desc,
      events,
      role,
      shapeRendering,
      tabIndex,
      transform: transform2
    }, rest);
    return React309.cloneElement(pathComponent, Object.assign(Object.assign({
      className,
      clipPath,
      d: getPath2(props),
      desc: helpers_exports.evaluateProp(desc, props)
    }, events), {
      role,
      shapeRendering,
      style: helpers_exports.evaluateStyle(rest.style, props),
      tabIndex: helpers_exports.evaluateProp(tabIndex, props),
      transform: transform2
    }));
  };
  ChartPoint.displayName = "ChartPoint";

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLegend/ChartLegend.js
  var ChartLegendOrientation;
  (function(ChartLegendOrientation2) {
    ChartLegendOrientation2["horizontal"] = "horizontal";
    ChartLegendOrientation2["vertical"] = "vertical";
  })(ChartLegendOrientation || (ChartLegendOrientation = {}));
  var ChartLegendPosition;
  (function(ChartLegendPosition2) {
    ChartLegendPosition2["bottom"] = "bottom";
    ChartLegendPosition2["bottomLeft"] = "bottom-left";
    ChartLegendPosition2["right"] = "right";
  })(ChartLegendPosition || (ChartLegendPosition = {}));
  var ChartLegendRowGutter;
  (function(ChartLegendRowGutter2) {
    ChartLegendRowGutter2["bottom"] = "bottom";
    ChartLegendRowGutter2["top"] = "top";
  })(ChartLegendRowGutter || (ChartLegendRowGutter = {}));
  var ChartLegend = (_a) => {
    var {
      colorScale,
      containerComponent = React310.createElement(ChartContainer, null),
      dataComponent = React310.createElement(ChartPoint, null),
      labelComponent = React310.createElement(ChartLabel, null),
      name: name2,
      patternScale,
      responsive = true,
      style,
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      titleComponent = React310.createElement(ChartLabel, null),
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["colorScale", "containerComponent", "dataComponent", "labelComponent", "name", "patternScale", "responsive", "style", "themeColor", "themeVariant", "titleComponent", "theme"]);
    const getDefaultStyle = () => {
      if (!patternScale) {
        return style;
      }
      const _style = style ? Object.assign({}, style) : {};
      _style.data = Object.assign({ fill: ({ index }) => {
        const themeColor2 = theme && theme.legend && theme.legend.colorScale ? theme.legend.colorScale[index % theme.legend.colorScale.length] : void 0;
        const color2 = colorScale ? colorScale[index % colorScale.length] : themeColor2;
        const pattern = patternScale[index % patternScale.length];
        return pattern ? pattern : color2;
      } }, _style.data);
      return _style;
    };
    const container = React310.cloneElement(containerComponent, Object.assign({
      responsive,
      theme
    }, containerComponent.props));
    const getLabelComponent = () => React310.cloneElement(labelComponent, Object.assign(Object.assign({}, name2 && { id: (props) => `${name2}-${labelComponent.type.displayName}-${props.index}` }), labelComponent.props));
    const getTitleComponent = () => React310.cloneElement(titleComponent, Object.assign(Object.assign({}, name2 && { id: () => `${name2}-${titleComponent.type.displayName}` }), titleComponent.props));
    return React310.createElement(victory_legend_default, Object.assign({ colorScale, containerComponent: container, dataComponent, labelComponent: getLabelComponent(), name: name2, style: getDefaultStyle(), theme, titleComponent: getTitleComponent() }, rest));
  };
  ChartLegend.displayName = "ChartLegend";
  (0, import_hoist_non_react_statics4.default)(ChartLegend, victory_legend_default, { getBaseProps: true });
  ChartLegend.getBaseProps = (props) => {
    const theme = getTheme(null);
    return victory_legend_default.getBaseProps(Object.assign({ titleComponent: React310.createElement(ChartLabel, null) }, props), {
      height: theme.chart.height,
      orientation: theme.legend.orientation,
      titleOrientation: theme.legend.titleOrientation,
      x: 0,
      y: 0,
      width: theme.chart.width
    });
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/Chart/Chart.js
  var Chart = (_a) => {
    var {
      ariaDesc,
      ariaTitle,
      children,
      colorScale,
      hasPatterns,
      legendAllowWrap = false,
      legendComponent = React311.createElement(ChartLegend, null),
      legendData,
      legendPosition = ChartCommonStyles.legend.position,
      name: name2,
      padding: padding2,
      patternScale,
      showAxis = true,
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      // destructure last
      theme = getChartTheme(themeColor, showAxis),
      containerComponent = React311.createElement(ChartContainer, null),
      legendOrientation = theme.legend.orientation,
      height = theme.chart.height,
      width = theme.chart.width
    } = _a, rest = __rest(_a, ["ariaDesc", "ariaTitle", "children", "colorScale", "hasPatterns", "legendAllowWrap", "legendComponent", "legendData", "legendPosition", "name", "padding", "patternScale", "showAxis", "themeColor", "themeVariant", "theme", "containerComponent", "legendOrientation", "height", "width"]);
    const defaultPadding = {
      bottom: getPaddingForSide("bottom", padding2, theme.chart.padding),
      left: getPaddingForSide("left", padding2, theme.chart.padding),
      right: getPaddingForSide("right", padding2, theme.chart.padding),
      top: getPaddingForSide("top", padding2, theme.chart.padding)
    };
    const { defaultColorScale, defaultPatternScale, isPatternDefs, patternId } = useDefaultPatternProps({
      colorScale,
      patternScale,
      hasPatterns,
      themeColorScale: theme.chart.colorScale
    });
    let labelComponent;
    if (containerComponent.props.labelComponent && containerComponent.props.labelComponent.type.displayName === "ChartLegendTooltip") {
      labelComponent = React311.cloneElement(containerComponent.props.labelComponent, Object.assign(Object.assign({ theme }, defaultPatternScale && { patternScale: defaultPatternScale }), containerComponent.props.labelComponent.props));
    }
    const container = React311.cloneElement(containerComponent, Object.assign(
      Object.assign(Object.assign({ desc: ariaDesc, title: ariaTitle, theme }, containerComponent.props), { className: getClassName({ className: containerComponent.props.className }) }),
      labelComponent && { labelComponent }
      // Override label component props
    ));
    const legend = React311.cloneElement(legendComponent, Object.assign(Object.assign(Object.assign({ data: legendData }, name2 && { name: `${name2}-${legendComponent.type.displayName}` }), { orientation: legendOrientation, theme }), legendComponent.props));
    const getLegend = () => {
      if (!legend.props.data) {
        return null;
      }
      let dx = 0;
      let dy = 0;
      let xAxisLabelHeight = 0;
      let legendTitleHeight = legend.props.title ? 10 : 0;
      React311.Children.toArray(children).map((child) => {
        if (child.type.role === "axis" && child.props.label && !child.props.dependentAxis) {
          xAxisLabelHeight = getLabelTextSize({ text: child.props.label, theme }).height + 10;
          legendTitleHeight = 0;
        }
      });
      if (legendPosition === ChartLegendPosition.bottom) {
        dy += xAxisLabelHeight + legendTitleHeight;
      } else if (legendPosition === ChartLegendPosition.bottomLeft) {
        dy += xAxisLabelHeight + legendTitleHeight;
        dx = -10;
      }
      if (!showAxis) {
        dy -= chart_legend_Margin_default.value;
      }
      return getComputedLegend(Object.assign({
        allowWrap: legendAllowWrap,
        chartType: "chart",
        colorScale,
        dx,
        dy,
        height,
        legendComponent: legend,
        padding: defaultPadding,
        position: legendPosition,
        theme,
        width
      }, defaultPatternScale && { patternScale: defaultPatternScale }));
    };
    const renderChildren = () => React311.Children.toArray(children).map((child, index) => {
      if (React311.isValidElement(child)) {
        const childProps = __rest(child.props, []);
        return React311.cloneElement(child, Object.assign(
          Object.assign(Object.assign(Object.assign(Object.assign({ colorScale }, defaultPatternScale && { patternScale: defaultPatternScale }), name2 && typeof child.name !== void 0 && {
            name: `${name2}-${child.type.displayName}-${index}`
          }), { theme }), childProps),
          child.type.displayName === "ChartPie" && {
            data: getDefaultData(childProps.data, defaultPatternScale)
          }
          // Override child props
        ));
      }
      return child;
    });
    return React311.createElement(
      VictoryChart,
      Object.assign({ colorScale, containerComponent: container, height, name: name2, padding: defaultPadding, theme, width }, rest),
      renderChildren(),
      getLegend(),
      isPatternDefs && getPatternDefs({ patternId, colorScale: defaultColorScale })
    );
  };
  Chart.displayName = "Chart";
  (0, import_hoist_non_react_statics5.default)(Chart, VictoryChart);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartArea/ChartArea.js
  init_tslib_es6();
  var React314 = __toESM(require_react());
  var import_hoist_non_react_statics6 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-area/es/victory-area.js
  var import_prop_types61 = __toESM(require_prop_types());
  var import_react82 = __toESM(require_react());

  // node_modules/victory-area/es/helper-methods.js
  var import_isNil3 = __toESM(require_isNil());
  var import_assign30 = __toESM(require_assign());
  var getDataWithBaseline = function(props, scale2) {
    var data = data_exports.getData(props);
    if (data.length < 2) {
      data = [];
    }
    var getDefaultMin = function(axis) {
      var defaultZero = scale_exports.getType(scale2[axis]) === "log" ? 1 / Number.MAX_SAFE_INTEGER : 0;
      var domain2 = scale2[axis].domain();
      var minY = collection_exports.getMinValue(domain2);
      var maxY = collection_exports.getMaxValue(domain2);
      var defaultMin = defaultZero;
      if (minY < 0 && maxY <= 0) {
        defaultMin = maxY;
      } else if (minY >= 0 && maxY > 0) {
        defaultMin = minY;
      }
      return collection_exports.containsDates(domain2) ? new Date(defaultMin) : defaultMin;
    };
    return data.map(function(datum) {
      var _y1 = datum._y1 !== void 0 ? datum._y1 : datum._y;
      var _y0 = datum._y0 !== void 0 ? datum._y0 : getDefaultMin("y");
      var _x1 = datum._x1 !== void 0 ? datum._x1 : datum._x;
      var _x0 = datum._x0 !== void 0 ? datum._x0 : getDefaultMin("x");
      return (0, import_assign30.default)({}, datum, {
        _y0,
        _y1,
        _x0,
        _x1
      });
    });
  };
  var getCalculatedValues4 = function(props) {
    var polar = props.polar;
    var defaultStyles2 = helpers_exports.getDefaultStyles(props, "area");
    var style = helpers_exports.getStyles(props.style, defaultStyles2);
    var range2 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    var domain2 = {
      x: domain_exports.getDomainWithZero(props, "x"),
      y: domain_exports.getDomainWithZero(props, "y")
    };
    var scale2 = {
      x: scale_exports.getBaseScale(props, "x").domain(domain2.x).range(props.horizontal ? range2.y : range2.x),
      y: scale_exports.getBaseScale(props, "y").domain(domain2.y).range(props.horizontal ? range2.x : range2.y)
    };
    var origin = polar ? props.origin || helpers_exports.getPolarOrigin(props) : void 0;
    var data = getDataWithBaseline(props, scale2);
    return {
      style,
      data,
      scale: scale2,
      domain: domain2,
      origin
    };
  };
  var getBaseProps4 = function(props, fallbackProps10) {
    var modifiedProps = helpers_exports.modifyProps(props, fallbackProps10, "area");
    props = (0, import_assign30.default)({}, modifiedProps, getCalculatedValues4(modifiedProps));
    var _props = props, data = _props.data, domain2 = _props.domain, events = _props.events, groupComponent = _props.groupComponent, height = _props.height, horizontal = _props.horizontal, interpolation = _props.interpolation, origin = _props.origin, padding2 = _props.padding, polar = _props.polar, scale2 = _props.scale, sharedEvents = _props.sharedEvents, standalone = _props.standalone, style = _props.style, theme = _props.theme, width = _props.width, labels = _props.labels, name2 = _props.name, disableInlineStyles = _props.disableInlineStyles;
    var initialChildProps = {
      parent: {
        style: style.parent,
        width,
        height,
        scale: scale2,
        data,
        domain: domain2,
        standalone,
        theme,
        polar,
        origin,
        padding: padding2,
        name: name2,
        horizontal
      },
      all: {
        data: {
          horizontal,
          polar,
          origin,
          scale: scale2,
          data,
          interpolation,
          groupComponent,
          style: disableInlineStyles ? {} : style.data,
          disableInlineStyles
        }
      }
    };
    return data.reduce(function(childProps, datum, index) {
      var text = label_helpers_exports.getText(props, datum, index);
      if (text !== void 0 && text !== null || labels && (events || sharedEvents)) {
        var eventKey = !(0, import_isNil3.default)(datum.eventKey) ? datum.eventKey : index;
        childProps[eventKey] = {
          labels: label_helpers_exports.getProps(props, index)
        };
      }
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-area/es/area.js
  var import_assign31 = __toESM(require_assign());
  var import_react81 = __toESM(require_react());
  var import_prop_types60 = __toESM(require_prop_types());
  function ownKeys20(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread20(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys20(Object(source), true).forEach(function(key) {
        _defineProperty25(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys20(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty25(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var defined2 = function(d) {
    var y2 = d._y1 !== void 0 ? d._y1 : d._y;
    return y2 !== null && y2 !== void 0 && d._y0 !== null;
  };
  var getXAccessor2 = function(scale2) {
    return function(d) {
      return scale2.x(d._x1 !== void 0 ? d._x1 : d._x);
    };
  };
  var getYAccessor2 = function(scale2) {
    return function(d) {
      return scale2.y(d._y1 !== void 0 ? d._y1 : d._y);
    };
  };
  var getY0Accessor = function(scale2) {
    return function(d) {
      return scale2.y(d._y0);
    };
  };
  var getAngleAccessor2 = function(scale2) {
    return function(d) {
      var x2 = scale2.x(d._x1 !== void 0 ? d._x1 : d._x);
      return -1 * x2 + Math.PI / 2;
    };
  };
  var getCartesianArea = function(props) {
    var horizontal = props.horizontal, scale2 = props.scale;
    var interpolationFunction = line_helpers_exports.getInterpolationFunction(props);
    return horizontal ? area_default().defined(defined2).curve(interpolationFunction).x0(getY0Accessor(scale2)).x1(getYAccessor2(scale2)).y(getXAccessor2(scale2)) : area_default().defined(defined2).curve(interpolationFunction).x(getXAccessor2(scale2)).y1(getYAccessor2(scale2)).y0(getY0Accessor(scale2));
  };
  var getAreaFunction = function(props) {
    var polar = props.polar, scale2 = props.scale;
    var interpolationFunction = line_helpers_exports.getInterpolationFunction(props);
    return polar ? areaRadial_default().defined(defined2).curve(interpolationFunction).angle(getAngleAccessor2(scale2)).outerRadius(getYAccessor2(scale2)).innerRadius(getY0Accessor(scale2)) : getCartesianArea(props);
  };
  var evaluateProps8 = function(props) {
    var ariaLabel = helpers_exports.evaluateProp(props.ariaLabel, props);
    var desc = helpers_exports.evaluateProp(props.desc, props);
    var id = helpers_exports.evaluateProp(props.id, props);
    var style = helpers_exports.evaluateStyle((0, import_assign31.default)({
      fill: "black"
    }, props.style), props);
    var tabIndex = helpers_exports.evaluateProp(props.tabIndex, props);
    return (0, import_assign31.default)({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var Area = function(props) {
    props = evaluateProps8(props);
    var _props = props, ariaLabel = _props.ariaLabel, role = _props.role, shapeRendering = _props.shapeRendering, className = _props.className, polar = _props.polar, origin = _props.origin, data = _props.data, pathComponent = _props.pathComponent, events = _props.events, groupComponent = _props.groupComponent, clipPath = _props.clipPath, id = _props.id, style = _props.style, desc = _props.desc, tabIndex = _props.tabIndex;
    var userProps = user_props_exports.getSafeUserProps(props);
    var defaultTransform = polar && origin ? "translate(".concat(origin.x, ", ").concat(origin.y, ")") : void 0;
    var transform2 = props.transform || defaultTransform;
    var renderLine = style.stroke && style.stroke !== "none" && style.stroke !== "transparent";
    var areaFunction = getAreaFunction(props);
    var lineFunction = renderLine && line_helpers_exports.getLineFunction(props);
    var areaStroke = style.stroke ? "none" : style.fill;
    var sharedProps = _objectSpread20(_objectSpread20({
      "aria-label": ariaLabel,
      className,
      role,
      shapeRendering,
      transform: transform2
    }, events), {}, {
      clipPath,
      tabIndex
    });
    var area = /* @__PURE__ */ import_react81.default.cloneElement(pathComponent, (0, import_assign31.default)({
      key: "".concat(id, "-area"),
      style: (0, import_assign31.default)({}, style, {
        stroke: areaStroke
      }),
      d: areaFunction(data),
      desc,
      tabIndex
    }, sharedProps, userProps));
    var line = renderLine ? /* @__PURE__ */ import_react81.default.cloneElement(pathComponent, (0, import_assign31.default)({
      key: "".concat(id, "-area-stroke"),
      style: (0, import_assign31.default)({}, style, {
        fill: "none"
      }),
      d: lineFunction(data)
    }, sharedProps)) : null;
    return renderLine ? /* @__PURE__ */ import_react81.default.cloneElement(groupComponent, userProps, [area, line]) : area;
  };
  Area.propTypes = _objectSpread20(_objectSpread20({}, CommonProps.primitiveProps), {}, {
    groupComponent: import_prop_types60.default.element,
    interpolation: import_prop_types60.default.oneOfType([import_prop_types60.default.string, import_prop_types60.default.func]),
    pathComponent: import_prop_types60.default.element
  });
  Area.defaultProps = {
    groupComponent: /* @__PURE__ */ import_react81.default.createElement("g", null),
    pathComponent: /* @__PURE__ */ import_react81.default.createElement(Path, null),
    role: "presentation",
    shapeRendering: "auto"
  };

  // node_modules/victory-area/es/victory-area.js
  function ownKeys21(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread21(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys21(Object(source), true).forEach(function(key) {
        _defineProperty26(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys21(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty26(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _classCallCheck17(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties16(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor)
        descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass17(Constructor, protoProps, staticProps) {
    if (protoProps)
      _defineProperties16(Constructor.prototype, protoProps);
    if (staticProps)
      _defineProperties16(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  function _inherits15(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass)
      _setPrototypeOf14(subClass, superClass);
  }
  function _setPrototypeOf14(o, p2) {
    _setPrototypeOf14 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf15(o2, p3) {
      o2.__proto__ = p3;
      return o2;
    };
    return _setPrototypeOf14(o, p2);
  }
  function _createSuper14(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct14();
    return function _createSuperInternal() {
      var Super = _getPrototypeOf14(Derived), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf14(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn15(this, result);
    };
  }
  function _possibleConstructorReturn15(self2, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized14(self2);
  }
  function _assertThisInitialized14(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  function _isNativeReflectConstruct14() {
    if (typeof Reflect === "undefined" || !Reflect.construct)
      return false;
    if (Reflect.construct.sham)
      return false;
    if (typeof Proxy === "function")
      return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  function _getPrototypeOf14(o) {
    _getPrototypeOf14 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf15(o2) {
      return o2.__proto__ || Object.getPrototypeOf(o2);
    };
    return _getPrototypeOf14(o);
  }
  var fallbackProps7 = {
    width: 450,
    height: 300,
    padding: 50,
    interpolation: "linear"
  };
  var options3 = {
    components: [{
      name: "parent",
      index: "parent"
    }, {
      name: "data",
      index: "all"
    }, {
      name: "labels"
    }]
  };
  var VictoryAreaBase = /* @__PURE__ */ function(_React$Component) {
    _inherits15(VictoryAreaBase2, _React$Component);
    var _super = _createSuper14(VictoryAreaBase2);
    function VictoryAreaBase2() {
      _classCallCheck17(this, VictoryAreaBase2);
      return _super.apply(this, arguments);
    }
    _createClass17(VictoryAreaBase2, [{
      key: "shouldAnimate",
      value: (
        // Overridden in native versions
        function shouldAnimate() {
          return !!this.props.animate;
        }
      )
    }, {
      key: "render",
      value: function render() {
        var animationWhitelist = VictoryAreaBase2.animationWhitelist, role = VictoryAreaBase2.role;
        var props = helpers_exports.modifyProps(this.props, fallbackProps7, role);
        if (this.shouldAnimate()) {
          return this.animateComponent(props, animationWhitelist);
        }
        var children = this.renderContinuousData(props);
        var component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
        return user_props_exports.withSafeUserProps(component, props);
      }
    }]);
    return VictoryAreaBase2;
  }(import_react82.default.Component);
  VictoryAreaBase.animationWhitelist = ["data", "domain", "height", "padding", "style", "width"];
  VictoryAreaBase.propTypes = _objectSpread21(_objectSpread21(_objectSpread21({}, CommonProps.baseProps), CommonProps.dataProps), {}, {
    interpolation: import_prop_types61.default.oneOfType([import_prop_types61.default.oneOf(["basis", "cardinal", "catmullRom", "linear", "monotoneX", "monotoneY", "natural", "step", "stepAfter", "stepBefore"]), import_prop_types61.default.func]),
    label: prop_types_exports.deprecated(import_prop_types61.default.string, "Use `labels` instead for individual data labels")
  });
  VictoryAreaBase.defaultProps = {
    containerComponent: /* @__PURE__ */ import_react82.default.createElement(VictoryContainer, null),
    dataComponent: /* @__PURE__ */ import_react82.default.createElement(Area, null),
    groupComponent: /* @__PURE__ */ import_react82.default.createElement(VictoryClipContainer, null),
    labelComponent: /* @__PURE__ */ import_react82.default.createElement(VictoryLabel, {
      renderInPortal: true
    }),
    samples: 50,
    sortKey: "x",
    sortOrder: "ascending",
    standalone: true,
    theme: VictoryTheme.grayscale
  };
  VictoryAreaBase.displayName = "VictoryArea";
  VictoryAreaBase.role = "area";
  VictoryAreaBase.continuous = true;
  VictoryAreaBase.defaultTransitions = default_transitions_exports.continuousTransitions();
  VictoryAreaBase.defaultPolarTransitions = default_transitions_exports.continuousPolarTransitions();
  VictoryAreaBase.getDomain = domain_exports.getDomainWithZero;
  VictoryAreaBase.getData = data_exports.getData;
  VictoryAreaBase.getBaseProps = function(props) {
    return getBaseProps4(props, fallbackProps7);
  };
  VictoryAreaBase.expectedComponents = ["dataComponent", "labelComponent", "groupComponent", "containerComponent"];
  var VictoryArea = addEvents(VictoryAreaBase, options3);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartArea/ChartArea.js
  var ChartAreaSortOrder;
  (function(ChartAreaSortOrder2) {
    ChartAreaSortOrder2["ascending"] = "ascending";
    ChartAreaSortOrder2["descending"] = "descending";
  })(ChartAreaSortOrder || (ChartAreaSortOrder = {}));
  var ChartArea = (_a) => {
    var {
      containerComponent = React314.createElement(ChartContainer, null),
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["containerComponent", "themeColor", "themeVariant", "theme"]);
    const container = React314.cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props));
    return React314.createElement(VictoryArea, Object.assign({ containerComponent: container, theme }, rest));
  };
  ChartArea.displayName = "ChartArea";
  (0, import_hoist_non_react_statics6.default)(ChartArea, VictoryArea);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartAxis/ChartAxis.js
  init_tslib_es6();
  var React315 = __toESM(require_react());
  var import_hoist_non_react_statics7 = __toESM(require_hoist_non_react_statics_cjs());
  var ChartAxis = (_a) => {
    var {
      axisLabelComponent = React315.createElement(ChartLabel, null),
      containerComponent = React315.createElement(ChartContainer, null),
      name: name2,
      showGrid = false,
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      tickLabelComponent = React315.createElement(ChartLabel, null),
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["axisLabelComponent", "containerComponent", "name", "showGrid", "themeColor", "themeVariant", "tickLabelComponent", "theme"]);
    const container = React315.cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props));
    const getAxisLabelComponent = () => React315.cloneElement(axisLabelComponent, Object.assign(Object.assign({}, name2 && {
      id: () => `${name2}-${axisLabelComponent.type.displayName}`
    }), axisLabelComponent.props));
    const getTickLabelComponent = () => React315.cloneElement(tickLabelComponent, Object.assign(Object.assign({}, name2 && {
      id: (props) => `${name2}-${tickLabelComponent.type.displayName}-${props.index}`
    }), tickLabelComponent.props));
    return React315.createElement(VictoryAxis, Object.assign({ axisLabelComponent: getAxisLabelComponent(), containerComponent: container, name: name2, theme: showGrid ? getAxisTheme(themeColor) : theme, tickLabelComponent: getTickLabelComponent() }, rest));
  };
  ChartAxis.displayName = "ChartAxis";
  (0, import_hoist_non_react_statics7.default)(ChartAxis, VictoryAxis);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartGroup/ChartGroup.js
  init_tslib_es6();
  var React318 = __toESM(require_react());
  var import_hoist_non_react_statics8 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-group/es/victory-group.js
  var import_isEmpty10 = __toESM(require_isEmpty());
  var import_defaults24 = __toESM(require_defaults());
  var import_assign33 = __toESM(require_assign());
  var import_prop_types62 = __toESM(require_prop_types());
  var import_react84 = __toESM(require_react());

  // node_modules/victory-group/es/helper-methods.js
  var import_assign32 = __toESM(require_assign());
  var import_react83 = __toESM(require_react());
  var import_react_fast_compare7 = __toESM(require_react_fast_compare());
  function _toConsumableArray24(arr) {
    return _arrayWithoutHoles23(arr) || _iterableToArray23(arr) || _unsupportedIterableToArray25(arr) || _nonIterableSpread23();
  }
  function _nonIterableSpread23() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArray23(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
      return Array.from(iter);
  }
  function _arrayWithoutHoles23(arr) {
    if (Array.isArray(arr))
      return _arrayLikeToArray25(arr);
  }
  function _slicedToArray6(arr, i) {
    return _arrayWithHoles6(arr) || _iterableToArrayLimit6(arr, i) || _unsupportedIterableToArray25(arr, i) || _nonIterableRest6();
  }
  function _nonIterableRest6() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray25(o, minLen) {
    if (!o)
      return;
    if (typeof o === "string")
      return _arrayLikeToArray25(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor)
      n = o.constructor.name;
    if (n === "Map" || n === "Set")
      return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
      return _arrayLikeToArray25(o, minLen);
  }
  function _arrayLikeToArray25(arr, len) {
    if (len == null || len > arr.length)
      len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _iterableToArrayLimit6(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null)
      return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i)
          break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null)
          _i["return"]();
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
  function _arrayWithHoles6(arr) {
    if (Array.isArray(arr))
      return arr;
  }
  function ownKeys22(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread23(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys22(Object(source), true).forEach(function(key) {
        _defineProperty27(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys22(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty27(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var fallbackProps8 = {
    width: 450,
    height: 300,
    padding: 50,
    offset: 0
  };
  function getCalculatedProps3(props, childComponents) {
    var role = "group";
    props = helpers_exports.modifyProps(props, fallbackProps8, role);
    var style = wrapper_exports.getStyle(props.theme, props.style, role);
    var _props = props, offset2 = _props.offset, colorScale = _props.colorScale, color2 = _props.color, polar = _props.polar, horizontal = _props.horizontal;
    var categories = props.categories || wrapper_exports.getCategories(props, childComponents, null);
    var datasets = props.datasets || wrapper_exports.getDataFromChildren(props, null);
    var domain2 = {
      x: wrapper_exports.getDomain((0, import_assign32.default)({}, props, {
        categories
      }), "x", childComponents),
      y: wrapper_exports.getDomain((0, import_assign32.default)({}, props, {
        categories
      }), "y", childComponents)
    };
    var range2 = props.range || {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    var baseScale = {
      x: scale_exports.getScaleFromProps(props, "x") || wrapper_exports.getScale(props, "x"),
      y: scale_exports.getScaleFromProps(props, "y") || wrapper_exports.getScale(props, "y")
    };
    var scale2 = {
      x: baseScale.x.domain(domain2.x).range(props.horizontal ? range2.y : range2.x),
      y: baseScale.y.domain(domain2.y).range(props.horizontal ? range2.x : range2.y)
    };
    var origin = polar ? props.origin : helpers_exports.getPolarOrigin(props);
    var padding2 = helpers_exports.getPadding(props);
    return {
      datasets,
      categories,
      range: range2,
      domain: domain2,
      horizontal,
      scale: scale2,
      style,
      colorScale,
      color: color2,
      offset: offset2,
      origin,
      padding: padding2
    };
  }
  var withoutSharedEvents = function(props) {
    var children = props.children;
    var modifiedChildren = import_react83.default.Children.toArray(children).map(function(child) {
      return _objectSpread23(_objectSpread23({}, child), {}, {
        props: helpers_exports.omit(child.props, ["sharedEvents"])
      });
    });
    props.children = modifiedChildren;
    return props;
  };
  function useMemoizedProps(initialProps) {
    var modifiedProps = withoutSharedEvents(initialProps);
    var _React$useState = import_react83.default.useState(modifiedProps), _React$useState2 = _slicedToArray6(_React$useState, 2), props = _React$useState2[0], setProps = _React$useState2[1];
    import_react83.default.useEffect(function() {
      if (!(0, import_react_fast_compare7.default)(modifiedProps, props)) {
        setProps(modifiedProps);
      }
    }, [props, setProps, modifiedProps]);
    return import_react83.default.useMemo(function() {
      return getCalculatedProps3(props, props.children);
    }, [props]);
  }
  function pixelsToValue(props, axis, calculatedProps) {
    if (!props.offset) {
      return 0;
    }
    var currentAxis = helpers_exports.getCurrentAxis(axis, props.horizontal);
    var domain2 = calculatedProps.domain[axis];
    var range2 = calculatedProps.range[currentAxis];
    var domainExtent = Math.max.apply(Math, _toConsumableArray24(domain2)) - Math.min.apply(Math, _toConsumableArray24(domain2));
    var rangeExtent = Math.max.apply(Math, _toConsumableArray24(range2)) - Math.min.apply(Math, _toConsumableArray24(range2));
    return domainExtent / rangeExtent * props.offset;
  }
  function getX0(props, calculatedProps, index, role) {
    var groupLength = role === "stack" ? calculatedProps.datasets[0].length : calculatedProps.datasets.length;
    var center = (groupLength - 1) / 2;
    var totalWidth = pixelsToValue(props, "x", calculatedProps);
    return (index - center) * totalWidth;
  }
  function getPolarX0(props, calculatedProps, index, role) {
    var groupLength = role === "stack" ? calculatedProps.datasets[0].length : calculatedProps.datasets.length;
    var center = (groupLength - 1) / 2;
    var width = getAngularWidth(props, calculatedProps);
    return (index - center) * width;
  }
  function getAngularWidth(props, calculatedProps) {
    var range2 = calculatedProps.range;
    var angularRange = Math.abs(range2.x[1] - range2.x[0]);
    var r = Math.max.apply(Math, _toConsumableArray24(range2.y));
    return props.offset / (2 * Math.PI * r) * angularRange;
  }
  function getLabels(props, datasets, index) {
    if (!props.labels) {
      return void 0;
    }
    return Math.floor(datasets.length / 2) === index ? props.labels : void 0;
  }
  function getChildProps2(props, calculatedProps) {
    var categories = calculatedProps.categories, domain2 = calculatedProps.domain, range2 = calculatedProps.range, scale2 = calculatedProps.scale, horizontal = calculatedProps.horizontal, origin = calculatedProps.origin, padding2 = calculatedProps.padding;
    var width = props.width, height = props.height, theme = props.theme, polar = props.polar;
    return {
      height,
      width,
      theme,
      polar,
      origin,
      categories,
      domain: domain2,
      range: range2,
      scale: scale2,
      horizontal,
      padding: padding2,
      standalone: false
    };
  }
  function getColorScale3(props, child) {
    var role = child.type && child.type.role;
    var colorScaleOptions = child.props.colorScale || props.colorScale;
    if (role !== "group" && role !== "stack") {
      return void 0;
    }
    return props.theme && props.theme.group ? colorScaleOptions || props.theme.group.colorScale : colorScaleOptions;
  }
  function getDataWithOffset(props) {
    var defaultDataset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var offset2 = arguments.length > 2 ? arguments[2] : void 0;
    var dataset = props.data || props.y ? data_exports.getData(props) : defaultDataset;
    var xOffset = offset2 || 0;
    return dataset.map(function(datum) {
      var _x1 = datum._x instanceof Date ? new Date(datum._x.getTime() + xOffset) : datum._x + xOffset;
      return (0, import_assign32.default)({}, datum, {
        _x1
      });
    });
  }
  function getChildren2(props, childComponents, calculatedProps) {
    props = helpers_exports.modifyProps(props, fallbackProps8, "stack");
    childComponents = childComponents || import_react83.default.Children.toArray(props.children);
    calculatedProps = calculatedProps || getCalculatedProps3(props, childComponents);
    var _calculatedProps = calculatedProps, datasets = _calculatedProps.datasets;
    var _props2 = props, labelComponent = _props2.labelComponent, polar = _props2.polar;
    var childProps = getChildProps2(props, calculatedProps);
    var parentName = props.name || "group";
    return childComponents.map(function(child, index) {
      var role = child.type && child.type.role;
      var xOffset = polar ? getPolarX0(props, calculatedProps, index, role) : getX0(props, calculatedProps, index, role);
      var style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : wrapper_exports.getChildStyle(child, index, calculatedProps);
      var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
      var name2 = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
      return /* @__PURE__ */ import_react83.default.cloneElement(child, (0, import_assign32.default)({
        labels,
        style,
        key: "".concat(name2, "-key-").concat(index),
        name: name2,
        data: getDataWithOffset(props, datasets[index], xOffset),
        colorScale: getColorScale3(props, child),
        labelComponent: labelComponent || child.props.labelComponent,
        xOffset
      }, childProps));
    });
  }

  // node_modules/victory-group/es/victory-group.js
  var import_react_fast_compare8 = __toESM(require_react_fast_compare());
  function ownKeys23(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread24(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys23(Object(source), true).forEach(function(key) {
        _defineProperty28(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys23(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty28(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  var fallbackProps9 = {
    width: 450,
    height: 300,
    padding: 50,
    offset: 0
  };
  var VictoryGroupBase = function(initialProps) {
    var role = VictoryGroup === null || VictoryGroup === void 0 ? void 0 : VictoryGroup.role;
    var _Hooks$useAnimationSt = hooks_exports.useAnimationState(), getAnimationProps = _Hooks$useAnimationSt.getAnimationProps, setAnimationState = _Hooks$useAnimationSt.setAnimationState, getProps2 = _Hooks$useAnimationSt.getProps;
    var props = getProps2(initialProps);
    var modifiedProps = helpers_exports.modifyProps(props, fallbackProps9, role);
    var eventKey = modifiedProps.eventKey, containerComponent = modifiedProps.containerComponent, standalone = modifiedProps.standalone, groupComponent = modifiedProps.groupComponent, externalEventMutations = modifiedProps.externalEventMutations, width = modifiedProps.width, height = modifiedProps.height, theme = modifiedProps.theme, polar = modifiedProps.polar, horizontal = modifiedProps.horizontal, name2 = modifiedProps.name;
    var childComponents = import_react84.default.Children.toArray(modifiedProps.children);
    var calculatedProps = useMemoizedProps(modifiedProps);
    var domain2 = calculatedProps.domain, scale2 = calculatedProps.scale, style = calculatedProps.style, origin = calculatedProps.origin;
    var newChildren = import_react84.default.useMemo(function() {
      var children = getChildren2(props, childComponents, calculatedProps);
      return children.map(function(child, index) {
        var childProps = (0, import_assign33.default)({
          animate: getAnimationProps(props, child, index)
        }, child.props);
        return /* @__PURE__ */ import_react84.default.cloneElement(child, childProps);
      });
    }, [props, childComponents, calculatedProps, getAnimationProps]);
    var containerProps = import_react84.default.useMemo(function() {
      if (standalone) {
        return {
          domain: domain2,
          scale: scale2,
          width,
          height,
          standalone,
          theme,
          style: style.parent,
          horizontal,
          polar,
          origin,
          name: name2
        };
      }
      return {};
    }, [standalone, domain2, scale2, width, height, theme, style, horizontal, polar, origin, name2]);
    var userProps = import_react84.default.useMemo(function() {
      return user_props_exports.getSafeUserProps(initialProps);
    }, [initialProps]);
    var container = import_react84.default.useMemo(function() {
      if (standalone) {
        var defaultContainerProps = (0, import_defaults24.default)({}, containerComponent.props, containerProps, userProps);
        return /* @__PURE__ */ import_react84.default.cloneElement(containerComponent, defaultContainerProps);
      }
      return /* @__PURE__ */ import_react84.default.cloneElement(groupComponent, userProps);
    }, [groupComponent, standalone, containerComponent, containerProps, userProps]);
    var events = import_react84.default.useMemo(function() {
      return wrapper_exports.getAllEvents(props);
    }, [props]);
    var previousProps = hooks_exports.usePreviousProps(initialProps);
    import_react84.default.useEffect(function() {
      return function() {
        if (initialProps.animate) {
          setAnimationState(previousProps, props);
        }
      };
    }, [setAnimationState, previousProps, initialProps, props]);
    if (!(0, import_isEmpty10.default)(events)) {
      return /* @__PURE__ */ import_react84.default.createElement(VictorySharedEvents, {
        container,
        eventKey,
        events,
        externalEventMutations
      }, newChildren);
    }
    return /* @__PURE__ */ import_react84.default.cloneElement(container, container.props, newChildren);
  };
  VictoryGroupBase.propTypes = _objectSpread24(_objectSpread24(_objectSpread24({}, CommonProps.baseProps), CommonProps.dataProps), {}, {
    children: import_prop_types62.default.oneOfType([import_prop_types62.default.arrayOf(import_prop_types62.default.node), import_prop_types62.default.node]),
    horizontal: import_prop_types62.default.bool,
    offset: import_prop_types62.default.number
  });
  VictoryGroupBase.defaultProps = {
    containerComponent: /* @__PURE__ */ import_react84.default.createElement(VictoryContainer, null),
    groupComponent: /* @__PURE__ */ import_react84.default.createElement("g", null),
    samples: 50,
    sortOrder: "ascending",
    standalone: true,
    theme: VictoryTheme.grayscale
  };
  var componentConfig = {
    role: "group",
    expectedComponents: ["groupComponent", "containerComponent", "labelComponent"],
    getChildren: getChildren2
  };
  var VictoryGroup = Object.assign(/* @__PURE__ */ import_react84.default.memo(VictoryGroupBase, import_react_fast_compare8.default), componentConfig);
  VictoryGroup.displayName = "VictoryGroup";

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartGroup/ChartGroup.js
  var ChartGroupSortOrder;
  (function(ChartGroupSortOrder2) {
    ChartGroupSortOrder2["ascending"] = "ascending";
    ChartGroupSortOrder2["descending"] = "descending";
  })(ChartGroupSortOrder || (ChartGroupSortOrder = {}));
  var ChartGroup = (_a) => {
    var {
      ariaDesc,
      ariaTitle,
      children,
      colorScale,
      containerComponent = React318.createElement(ChartContainer, null),
      hasPatterns,
      patternScale,
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["ariaDesc", "ariaTitle", "children", "colorScale", "containerComponent", "hasPatterns", "patternScale", "themeColor", "themeVariant", "theme"]);
    const container = React318.cloneElement(containerComponent, Object.assign(Object.assign({ desc: ariaDesc, title: ariaTitle, theme }, containerComponent.props), {
      className: getClassName({ className: containerComponent.props.className })
      // Override VictoryContainer class name
    }));
    const { defaultColorScale, defaultPatternScale, isPatternDefs, patternId } = useDefaultPatternProps({
      colorScale,
      hasPatterns,
      patternScale,
      themeColorScale: theme.group.colorScale
    });
    return React318.createElement(
      VictoryGroup,
      Object.assign({ colorScale, containerComponent: container, theme }, rest),
      renderChildrenWithPatterns({
        children,
        patternScale: defaultPatternScale
      }),
      isPatternDefs && getPatternDefs({ patternId, colorScale: defaultColorScale })
    );
  };
  ChartGroup.displayName = "ChartGroup";
  (0, import_hoist_non_react_statics8.default)(ChartGroup, VictoryGroup);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartVoronoiContainer/ChartVoronoiContainer.js
  init_tslib_es6();
  var React319 = __toESM(require_react());
  var import_hoist_non_react_statics9 = __toESM(require_hoist_non_react_statics_cjs());
  var ChartVoronoiDimension;
  (function(ChartVoronoiDimension2) {
    ChartVoronoiDimension2["x"] = "x";
    ChartVoronoiDimension2["y"] = "y";
  })(ChartVoronoiDimension || (ChartVoronoiDimension = {}));
  var ChartVoronoiContainer = (_a) => {
    var {
      className,
      constrainToVisibleArea = false,
      themeColor,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      themeVariant,
      // destructure last
      theme = getTheme(themeColor),
      labelComponent = React319.createElement(ChartTooltip, null)
    } = _a, rest = __rest(_a, ["className", "constrainToVisibleArea", "themeColor", "themeVariant", "theme", "labelComponent"]);
    const chartClassName = getClassName({ className });
    const chartLabelComponent = React319.cloneElement(labelComponent, Object.assign({
      constrainToVisibleArea,
      theme
    }, labelComponent.props));
    return (
      // Note: className is valid, but Victory is missing a type
      React319.createElement(victory_voronoi_container_default, Object.assign({ className: chartClassName, labelComponent: chartLabelComponent, theme }, rest))
    );
  };
  ChartVoronoiContainer.displayName = "ChartVoronoiContainer";
  ChartVoronoiContainer.defaultProps = victory_voronoi_container_default.defaultProps;
  (0, import_hoist_non_react_statics9.default)(ChartVoronoiContainer, victory_voronoi_container_default);

  // src/lib/monitor/serverMonitor.jsx
  var ServerMonitor = class extends import_react85.default.Component {
    constructor(props) {
      super(props);
      const initChart = [];
      for (let idx = 1; idx <= 10; idx++) {
        initChart.push({ name: "", x: idx.toString(), y: 0 });
      }
      this.state = {
        activeKey: 0,
        count: 10,
        port: 389,
        secure_port: 636,
        conn_highmark: 1e3,
        cpu_tick_values: [25, 50, 75, 100],
        mem_tick_values: [25, 50, 75, 100],
        conn_tick_values: [250, 500, 750, 1e3],
        mem_ratio: 0,
        chart_refresh: "",
        initChart,
        cpuChart: [...initChart],
        memVirtChart: [...initChart],
        memResChart: [...initChart],
        connChart: [...initChart]
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeKey: tabIndex
        });
      };
      this.startRefresh = this.startRefresh.bind(this);
      this.refreshCharts = this.refreshCharts.bind(this);
      this.stopRefresh = this.stopRefresh.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
      this.refreshCharts();
      this.startRefresh();
    }
    componentWillUnmount() {
      this.stopRefresh();
    }
    getPorts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get",
        "nsslapd-port",
        "nsslapd-secureport"
      ];
      log_cmd("getPorts", "Get the server port numbers", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          port: config2.attrs["nsslapd-port"][0],
          secure_port: config2.attrs["nsslapd-secureport"] === void 0 ? "-1" : config2.attrs["nsslapd-secureport"][0]
        });
      });
    }
    resetChartData() {
      this.setState({
        conn_highmark: 1e3,
        cpu_tick_values: [25, 50, 75, 100],
        mem_tick_values: [],
        conn_tick_values: [250, 500, 750, 1e3],
        cpuChart: [...this.state.initChart],
        memVirtChart: [...this.state.initChart],
        memResChart: [...this.state.initChart],
        connChart: [...this.state.initChart]
      });
    }
    convertMemory(mem_str) {
      mem_str = mem_str.replace(",", ".");
      if (mem_str.endsWith("m")) {
        const mem = mem_str.slice(0, -1);
        return parseInt(Math.round(mem * 1024));
      } else if (mem_str.endsWith("g")) {
        const mem = mem_str.slice(0, -1);
        return parseInt(Math.round(mem * 1024 * 1024));
      } else if (mem_str.endsWith("t")) {
        const mem = mem_str.slice(0, -1);
        return parseInt(Math.round(mem * 1024 * 1024 * 1024));
      } else if (mem_str.endsWith("p")) {
        const mem = mem_str.slice(0, -1);
        return parseInt(Math.round(mem * 1024 * 1024 * 1024 * 1024));
      } else {
        return mem_str;
      }
    }
    refreshCharts() {
      const cmd = "ps -ef | grep -v grep | grep dirsrv/slapd-" + this.props.serverId;
      let cpu = 0;
      let pid = 0;
      let max_mem = 0;
      let virt_mem = 0;
      let res_mem = 0;
      let current_conns = 0;
      let conn_highmark = this.state.conn_highmark;
      let cpu_tick_values = this.state.cpu_tick_values;
      let conn_tick_values = this.state.conn_tick_values;
      cockpit_default.script(cmd, [], { superuser: true, err: "message" }).done((output) => {
        pid = output.split(/\s+/)[1];
        const cpu_cmd = "top -n 1 -b -p " + pid + " | tail -1";
        cockpit_default.script(cpu_cmd, [], { superuser: true, err: "message" }).done((top_output) => {
          const top_parts = top_output.trim().split(/\s+/);
          virt_mem = this.convertMemory(top_parts[4]);
          res_mem = this.convertMemory(top_parts[5]);
          cpu = parseInt(top_parts[8]);
          const mem_cmd = "awk '/MemTotal/{print $2}' /proc/meminfo";
          cockpit_default.script(mem_cmd, [], { superuser: true, err: "message" }).done((mem_output) => {
            max_mem = parseInt(mem_output);
            const conn_cmd = "netstat -anp | grep ':" + this.state.port + "\\|:" + this.state.secure_port + "' | grep ESTABLISHED | grep ns-slapd | wc -l";
            cockpit_default.script(conn_cmd, [], { superuser: true, err: "message" }).done((conn_output) => {
              current_conns = parseInt(conn_output);
              let count = this.state.count + 1;
              if (count === 100) {
                count = 1;
              }
              if (cpu > 100) {
                let resize = true;
                for (const stat of this.state.cpuChart) {
                  if (stat.y > cpu) {
                    resize = false;
                    break;
                  }
                }
                if (resize) {
                  let incr = Math.ceil(cpu / 4);
                  cpu_tick_values = [incr, incr += incr, incr += incr, cpu];
                }
              } else {
                let okToReset = true;
                for (const stat of this.state.cpuChart) {
                  if (stat.y > 100) {
                    okToReset = false;
                    break;
                  }
                }
                if (okToReset) {
                  cpu_tick_values = [25, 50, 75, 100];
                }
              }
              if (current_conns > conn_highmark) {
                conn_highmark = Math.ceil(current_conns / 1e3) * 1e3;
                const conn_incr = Math.ceil(conn_highmark / 4);
                let tick = conn_incr;
                conn_tick_values = [
                  tick,
                  tick += conn_incr,
                  tick += conn_incr,
                  tick += conn_incr
                ];
              }
              const cpuChart = this.state.cpuChart;
              cpuChart.shift();
              cpuChart.push({ name: "CPU", x: count.toString(), y: parseInt(cpu) });
              const memVirtChart = this.state.memVirtChart;
              memVirtChart.shift();
              memVirtChart.push({ name: "Virtual Memory", x: count.toString(), y: parseInt(Math.round(virt_mem / max_mem * 100)) });
              const memResChart = this.state.memResChart;
              memResChart.shift();
              memResChart.push({ name: "Resident Memory", x: count.toString(), y: parseInt(Math.round(res_mem / max_mem * 100)) });
              const connChart = this.state.connChart;
              connChart.shift();
              connChart.push({ name: "Connections", x: count.toString(), y: parseInt(current_conns) });
              this.setState({
                count,
                cpu_tick_values,
                conn_tick_values,
                cpuChart,
                memVirtChart,
                memResChart,
                connChart,
                conn_highmark,
                current_conns,
                mem_virt_size: virt_mem,
                mem_res_size: res_mem,
                mem_ratio: Math.round(virt_mem / max_mem * 100),
                cpu
              });
            }).fail(() => {
              this.resetChartData();
            });
          }).fail(() => {
            this.resetChartData();
          });
        }).fail(() => {
          this.resetChartData();
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startRefresh() {
      this.setState({
        chart_refresh: setInterval(this.refreshCharts, 3e3)
      });
    }
    stopRefresh() {
      clearInterval(this.state.chart_refresh);
    }
    render() {
      const {
        cpu,
        connChart,
        cpuChart,
        current_conns,
        memResChart,
        memVirtChart,
        mem_virt_size,
        mem_res_size,
        mem_ratio
      } = this.state;
      const startTime = this.props.data.starttime[0];
      const currTime = this.props.data.currenttime[0];
      const startDate = get_date_string(this.props.data.starttime[0]);
      const uptime = get_date_diff(startTime, currTime);
      const conn_tick_values = this.state.conn_tick_values;
      let cpu_tick_values = this.state.cpu_tick_values;
      const mem_tick_values = this.state.mem_tick_values;
      if (cpu > 100) {
        let incr = Math.ceil(cpu / 4);
        cpu_tick_values = [incr, incr += incr, incr += incr, incr += incr];
      } else {
        let okToReset = true;
        for (const stat of cpuChart) {
          if (stat.y > 100) {
            okToReset = false;
            break;
          }
        }
        if (okToReset) {
          cpu_tick_values = [25, 50, 75, 100];
        }
      }
      return /* @__PURE__ */ import_react85.default.createElement("div", { id: "monitor-server-page" }, /* @__PURE__ */ import_react85.default.createElement(Grid, null, /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h3 }, "Server Statistics", /* @__PURE__ */ import_react85.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh suffix monitor",
          onClick: this.props.handleReload
        }
      ))))), /* @__PURE__ */ import_react85.default.createElement(Tabs, { isFilled: true, className: "ds-margin-top-lg", activeKey: this.state.activeKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react85.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react85.default.createElement(TabTitleText, null, "Resource Charts") }, /* @__PURE__ */ import_react85.default.createElement(Card, { className: "ds-margin-top-lg", isSelectable: true }, /* @__PURE__ */ import_react85.default.createElement(CardBody, null, /* @__PURE__ */ import_react85.default.createElement(Grid, null, /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: "2", className: "ds-center", title: "Established client connections to the server" }, /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h5 }, "Connections")), /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, current_conns)))), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: "10", style: { height: "175px", width: "600px" } }, /* @__PURE__ */ import_react85.default.createElement(
        Chart,
        {
          ariaDesc: "connection stats",
          ariaTitle: "Live Connection Statistics",
          containerComponent: /* @__PURE__ */ import_react85.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
          height: 175,
          minDomain: { y: 0 },
          padding: {
            bottom: 30,
            left: 50,
            top: 10,
            right: 15
          },
          width: 600
        },
        /* @__PURE__ */ import_react85.default.createElement(ChartAxis, null),
        /* @__PURE__ */ import_react85.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: conn_tick_values }),
        /* @__PURE__ */ import_react85.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react85.default.createElement(
          ChartArea,
          {
            data: connChart
          }
        ))
      ))))), /* @__PURE__ */ import_react85.default.createElement(Grid, { className: "ds-margin-top-lg", hasGutter: true }, /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react85.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react85.default.createElement(CardBody, null, /* @__PURE__ */ import_react85.default.createElement(Grid, null, /* @__PURE__ */ import_react85.default.createElement(GridItem, { className: "ds-center", span: "4" }, /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h5 }, "Memory Usage")), /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h3 }, /* @__PURE__ */ import_react85.default.createElement("b", null, mem_ratio, "%"))), /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { className: "ds-margin-top-lg", component: TextVariants.h5 }, "Virtual Size")), /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h3 }, /* @__PURE__ */ import_react85.default.createElement("b", null, displayKBytes(mem_virt_size)))), /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { className: "ds-margin-top-lg", component: TextVariants.h5 }, "Resident Size")), /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h3 }, /* @__PURE__ */ import_react85.default.createElement("b", null, displayKBytes(mem_res_size))))), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: "8", style: { height: "225px" } }, /* @__PURE__ */ import_react85.default.createElement(
        Chart,
        {
          ariaDesc: "Server Memory Utilization",
          ariaTitle: "Live Server Memory Statistics",
          containerComponent: /* @__PURE__ */ import_react85.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
          height: 225,
          minDomain: { y: 0 },
          padding: {
            bottom: 30,
            left: 40,
            top: 10,
            right: 15
          },
          themeColor: ChartThemeColor.multiUnordered
        },
        /* @__PURE__ */ import_react85.default.createElement(ChartAxis, null),
        /* @__PURE__ */ import_react85.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: mem_tick_values }),
        /* @__PURE__ */ import_react85.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react85.default.createElement(
          ChartArea,
          {
            data: memVirtChart,
            interpolation: "monotoneX"
          }
        ), /* @__PURE__ */ import_react85.default.createElement(
          ChartArea,
          {
            data: memResChart,
            interpolation: "monotoneX"
          }
        ))
      )))))), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react85.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react85.default.createElement(CardBody, null, /* @__PURE__ */ import_react85.default.createElement(Grid, null, /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: "4", className: "ds-center" }, /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h5 }, "CPU Usage")), /* @__PURE__ */ import_react85.default.createElement(TextContent, null, /* @__PURE__ */ import_react85.default.createElement(Text, { component: TextVariants.h3 }, /* @__PURE__ */ import_react85.default.createElement("b", null, cpu, "%")))), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: "8", style: { height: "225px" } }, /* @__PURE__ */ import_react85.default.createElement(
        Chart,
        {
          ariaDesc: "cpu",
          ariaTitle: "Server CPU Usage",
          containerComponent: /* @__PURE__ */ import_react85.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
          height: 225,
          minDomain: { y: 0 },
          padding: {
            bottom: 30,
            left: 40,
            top: 10,
            right: 15
          },
          themeColor: ChartThemeColor.multiUnordered
        },
        /* @__PURE__ */ import_react85.default.createElement(ChartAxis, null),
        /* @__PURE__ */ import_react85.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: cpu_tick_values }),
        /* @__PURE__ */ import_react85.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react85.default.createElement(
          ChartArea,
          {
            data: cpuChart,
            interpolation: "monotoneX"
          }
        ))
      )))))))), /* @__PURE__ */ import_react85.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react85.default.createElement(TabTitleText, null, "Server Stats") }, /* @__PURE__ */ import_react85.default.createElement(Grid, { hasGutter: true, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Server Instance"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react85.default.createElement("b", null, "slapd-" + this.props.serverId)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Version"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.version)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Server Started"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react85.default.createElement("b", null, startDate)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Server Uptime"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react85.default.createElement("b", null, uptime)), /* @__PURE__ */ import_react85.default.createElement("hr", null), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Worker Threads"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.threads)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Threads Waiting To Read"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.readwaiters)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Conns At Max Threads"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.currentconnectionsatmaxthreads)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Conns Exceeded Max Threads"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.maxthreadsperconnhits)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Total Connections"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.totalconnections)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Current Connections"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.currentconnections)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Operations Started"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.opsinitiated)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Operations Completed"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.opscompleted)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Entries Returned To Clients"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.entriessent)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 3 }, "Bytes Sent to Clients"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.data.bytessent)))), /* @__PURE__ */ import_react85.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react85.default.createElement(TabTitleText, null, "Connection Table") }, /* @__PURE__ */ import_react85.default.createElement(ConnectionTable, { conns: this.props.data.connection })), /* @__PURE__ */ import_react85.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react85.default.createElement(TabTitleText, null, "Disk Space") }, /* @__PURE__ */ import_react85.default.createElement(
        DiskTable,
        {
          rows: this.props.disks
        }
      ), /* @__PURE__ */ import_react85.default.createElement(
        Button,
        {
          className: "ds-margin-top",
          onClick: this.props.handleReloadDisks
        },
        "Refresh"
      )), /* @__PURE__ */ import_react85.default.createElement(Tab, { eventKey: 4, title: /* @__PURE__ */ import_react85.default.createElement(TabTitleText, null, "SNMP Counters") }, /* @__PURE__ */ import_react85.default.createElement(Grid, { className: "ds-margin-top-xlg", hasGutter: true }, /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Anonymous Binds"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.anonymousbinds)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Referrals"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.referrals)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Unauthenticated Binds"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.unauthbinds)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Returned Referrals"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.referralsreturned)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Simple Auth Binds"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.simpleauthbinds)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Bind Security Errors"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.bindsecurityerrors)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Strong Auth Binds"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.strongauthbinds)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Security Errors"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.securityerrors)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Initiated Operations"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.inops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Errors"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.errors)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Compare Operations"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.compareops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Current Connections"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.connections)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Add Operations"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.addentryops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Total Connections"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.connectionseq)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Delete Operations"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.removeentryops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Conns in Max Threads"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.connectionsinmaxthreads)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Modify Operations"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.modifyentryops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Conns Exceeded Max Threads"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.connectionsmaxthreadscount)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "ModRDN Operations"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.modifyrdnops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Bytes Received"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.bytesrecv)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Search Operations"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.searchops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Bytes Sent"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.bytessent)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "One Level Searches"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.onelevelsearchops)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Entries Returned"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.entriesreturned)), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 4 }, "Whole Tree Searches"), /* @__PURE__ */ import_react85.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react85.default.createElement("b", null, this.props.snmpData.wholesubtreesearchops))))));
    }
  };
  ServerMonitor.propTypes = {
    serverId: import_prop_types63.default.string,
    data: import_prop_types63.default.object,
    handleReload: import_prop_types63.default.func,
    enableTree: import_prop_types63.default.func
  };
  ServerMonitor.defaultProps = {
    serverId: "",
    data: {}
  };
  var serverMonitor_default = ServerMonitor;

  // src/lib/monitor/dbMonitor.jsx
  var import_react86 = __toESM(require_react(), 1);
  var import_prop_types64 = __toESM(require_prop_types(), 1);
  var DatabaseMonitor = class extends import_react86.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        data: {},
        loading: true,
        // refresh charts
        cache_refresh: "",
        count: 10,
        ndnCount: 5,
        dbCacheList: [],
        ndnCacheList: [],
        ndnCacheUtilList: []
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.startCacheRefresh = this.startCacheRefresh.bind(this);
      this.refreshCache = this.refreshCache.bind(this);
    }
    componentDidMount() {
      this.resetChartData();
      this.refreshCache();
      this.startCacheRefresh();
      this.props.enableTree();
    }
    componentWillUnmount() {
      this.stopCacheRefresh();
    }
    resetChartData() {
      this.setState({
        data: {
          dbcachehitratio: [0],
          dbcachetries: [0],
          dbcachehits: [0],
          dbcachepagein: [0],
          dbcachepageout: [0],
          dbcacheroevict: [0],
          dbcacherwevict: [0],
          normalizeddncachehitratio: [0],
          maxnormalizeddncachesize: [0],
          currentnormalizeddncachesize: [0],
          normalizeddncachetries: [0],
          normalizeddncachehits: [0],
          normalizeddncacheevictions: [0],
          currentnormalizeddncachecount: [0],
          normalizeddncachethreadsize: [0],
          normalizeddncachethreadslots: [0]
        },
        dbCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 },
          { name: "", x: "6", y: 0 },
          { name: "", x: "7", y: 0 },
          { name: "", x: "8", y: 0 },
          { name: "", x: "9", y: 0 },
          { name: "", x: "10", y: 0 }
        ],
        ndnCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ],
        ndnCacheUtilList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ]
      });
    }
    refreshCache() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "ldbm"
      ];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let count = this.state.count + 1;
        const ndnCount = this.state.ndnCount + 1;
        if (count > 100) {
          count = 1;
        }
        const dbratio = config2.attrs.dbcachehitratio[0];
        const chart_data = this.state.dbCacheList;
        chart_data.shift();
        chart_data.push({ name: "Cache Hit Ratio", x: count.toString(), y: parseInt(dbratio) });
        const ndnratio = config2.attrs.normalizeddncachehitratio[0];
        const ndn_chart_data = this.state.ndnCacheList;
        ndn_chart_data.shift();
        ndn_chart_data.push({ name: "Cache Hit Ratio", x: count.toString(), y: parseInt(ndnratio) });
        const ndn_util_chart_data = this.state.ndnCacheUtilList;
        const currNDNSize = parseInt(config2.attrs.currentnormalizeddncachesize[0]);
        const maxNDNSize = parseInt(config2.attrs.maxnormalizeddncachesize[0]);
        const ndn_utilization = currNDNSize / maxNDNSize * 100;
        ndn_util_chart_data.shift();
        ndn_util_chart_data.push({ name: "Cache Utilization", x: ndnCount.toString(), y: parseInt(ndn_utilization) });
        this.setState({
          data: config2.attrs,
          loading: false,
          dbCacheList: chart_data,
          ndnCacheList: ndn_chart_data,
          ndnCacheUtilList: ndn_util_chart_data,
          count,
          ndnCount
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startCacheRefresh() {
      this.setState({
        cache_refresh: setInterval(this.refreshCache, 2e3)
      });
    }
    stopCacheRefresh() {
      clearInterval(this.state.cache_refresh);
    }
    render() {
      let chartColor = ChartThemeColor.green;
      let ndnChartColor = ChartThemeColor.green;
      let ndnUtilColor = ChartThemeColor.green;
      let dbcachehit = 0;
      let ndncachehit = 0;
      let ndncachemax = 0;
      let ndncachecurr = 0;
      let utilratio = 0;
      let content = /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react86.default.createElement(TextContent, null, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h3 }, "Loading database monitor information ...")), /* @__PURE__ */ import_react86.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      if (!this.state.loading) {
        dbcachehit = parseInt(this.state.data.dbcachehitratio[0]);
        ndncachehit = parseInt(this.state.data.normalizeddncachehitratio[0]);
        ndncachemax = parseInt(this.state.data.maxnormalizeddncachesize[0]);
        ndncachecurr = parseInt(this.state.data.currentnormalizeddncachesize[0]);
        utilratio = Math.round(ndncachecurr / ndncachemax * 100);
        if (utilratio === 0) {
          utilratio = 1;
        }
        if (dbcachehit > 89) {
          chartColor = ChartThemeColor.green;
        } else if (dbcachehit > 74) {
          chartColor = ChartThemeColor.orange;
        } else {
          chartColor = ChartThemeColor.purple;
        }
        if (ndncachehit > 89) {
          ndnChartColor = ChartThemeColor.green;
        } else if (ndncachehit > 74) {
          ndnChartColor = ChartThemeColor.orange;
        } else {
          ndnChartColor = ChartThemeColor.purple;
        }
        if (utilratio > 95) {
          ndnUtilColor = ChartThemeColor.purple;
        } else if (utilratio > 90) {
          ndnUtilColor = ChartThemeColor.orange;
        } else {
          ndnUtilColor = ChartThemeColor.green;
        }
        content = /* @__PURE__ */ import_react86.default.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react86.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react86.default.createElement(TabTitleText, null, "Database Cache") }, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react86.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react86.default.createElement(CardBody, null, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react86.default.createElement(TextContent, { className: "ds-margin-top-xlg", title: "The database cache hit ratio (dbcachehitratio)." }, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h3 }, "Cache Hit Ratio")), /* @__PURE__ */ import_react86.default.createElement(TextContent, null, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, dbcachehit, "%")))), /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-margin-left", style: { height: "200px", width: "500px" } }, /* @__PURE__ */ import_react86.default.createElement(
          Chart,
          {
            ariaDesc: "Database Cache",
            ariaTitle: "Live Database Cache Statistics",
            containerComponent: /* @__PURE__ */ import_react86.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
            height: 200,
            maxDomain: { y: 100 },
            minDomain: { y: 0 },
            padding: {
              bottom: 30,
              left: 40,
              top: 10,
              right: 10
            },
            width: 500,
            themeColor: chartColor
          },
          /* @__PURE__ */ import_react86.default.createElement(ChartAxis, null),
          /* @__PURE__ */ import_react86.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
          /* @__PURE__ */ import_react86.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react86.default.createElement(
            ChartArea,
            {
              data: this.state.dbCacheList
            }
          ))
        )))))), /* @__PURE__ */ import_react86.default.createElement(Grid, { hasGutter: true, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "Database Cache Hit Ratio:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, this.state.data.dbcachehitratio, "%")), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "Database Cache Tries:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.dbcachetries))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "Database Cache Hits:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.dbcachehits))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "Cache Pages Read:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.dbcachepagein))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "Cache Pages Written:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.dbcachepageout))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "Read-Only Page Evictions:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.dbcacheroevict))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "Read-Write Page Evictions:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.dbcacherwevict))))), /* @__PURE__ */ import_react86.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react86.default.createElement(TabTitleText, null, "Normalized DN Cache") }, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react86.default.createElement(Grid, { hasGutter: true }, /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react86.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react86.default.createElement(CardBody, null, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react86.default.createElement(TextContent, { className: "ds-margin-top-xlg", title: "The normalized DN cache hit ratio (normalizeddncachehitratio)." }, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h3 }, "Cache Hit Ratio")), /* @__PURE__ */ import_react86.default.createElement(TextContent, null, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, ndncachehit, "%")))), /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" } }, /* @__PURE__ */ import_react86.default.createElement(
          Chart,
          {
            ariaDesc: "NDN Cache",
            ariaTitle: "Live Normalized DN Cache Statistics",
            containerComponent: /* @__PURE__ */ import_react86.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
            height: 200,
            maxDomain: { y: 100 },
            minDomain: { y: 0 },
            padding: {
              bottom: 40,
              left: 60,
              top: 10,
              right: 15
            },
            width: 350,
            themeColor: ndnChartColor
          },
          /* @__PURE__ */ import_react86.default.createElement(ChartAxis, null),
          /* @__PURE__ */ import_react86.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
          /* @__PURE__ */ import_react86.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react86.default.createElement(
            ChartArea,
            {
              data: this.state.ndnCacheList
            }
          ))
        )))))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react86.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react86.default.createElement(CardBody, null, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react86.default.createElement(TextContent, { className: "ds-margin-top-lg", title: "The amount of the cache that is being used: max size (maxnormalizeddncachesize) vs current size (currentnormalizeddncachesize)" }, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h2 }, "Cache Utilization")), /* @__PURE__ */ import_react86.default.createElement(TextContent, null, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h3 }, /* @__PURE__ */ import_react86.default.createElement("b", null, utilratio, "%"))), /* @__PURE__ */ import_react86.default.createElement(TextContent, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react86.default.createElement(Text, { component: TextVariants.h5 }, "Cached DN's")), /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.currentnormalizeddncachecount[0]))), /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" } }, /* @__PURE__ */ import_react86.default.createElement(
          Chart,
          {
            ariaDesc: "NDN Cache Utilization",
            ariaTitle: "Live Normalized DN Cache Utilization Statistics",
            containerComponent: /* @__PURE__ */ import_react86.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
            height: 200,
            maxDomain: { y: 100 },
            minDomain: { y: 0 },
            padding: {
              bottom: 40,
              left: 60,
              top: 10,
              right: 15
            },
            width: 350,
            themeColor: ndnUtilColor
          },
          /* @__PURE__ */ import_react86.default.createElement(ChartAxis, null),
          /* @__PURE__ */ import_react86.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
          /* @__PURE__ */ import_react86.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react86.default.createElement(
            ChartArea,
            {
              data: this.state.ndnCacheUtilList
            }
          ))
        ))))))), /* @__PURE__ */ import_react86.default.createElement(Grid, { hasGutter: true, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache Hit Ratio:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, this.state.data.normalizeddncachehitratio, "%")), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache Max Size:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, displayBytes(this.state.data.maxnormalizeddncachesize))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache Tries:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.normalizeddncachetries))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Current Cache Size:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, displayBytes(this.state.data.currentnormalizeddncachesize))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache Hits:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.normalizeddncachehits))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache DN Count:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.currentnormalizeddncachecount))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache Evictions:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.normalizeddncacheevictions))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache Thread Size:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.normalizeddncachethreadsize))), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 3 }, "NDN Cache Thread Slots:"), /* @__PURE__ */ import_react86.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react86.default.createElement("b", null, numToCommas(this.state.data.normalizeddncachethreadslots)))))));
      }
      return /* @__PURE__ */ import_react86.default.createElement("div", { id: "db-content" }, /* @__PURE__ */ import_react86.default.createElement(TextContent, null, /* @__PURE__ */ import_react86.default.createElement(Text, { className: "ds-sub-header", component: TextVariants.h2 }, "Database Performance Statistics")), /* @__PURE__ */ import_react86.default.createElement("div", { className: "ds-margin-top-lg" }, content));
    }
  };
  DatabaseMonitor.propTypes = {
    serverId: import_prop_types64.default.string,
    enableTree: import_prop_types64.default.func
  };
  DatabaseMonitor.defaultProps = {
    serverId: ""
  };
  var dbMonitor_default = DatabaseMonitor;

  // src/lib/monitor/suffixMonitor.jsx
  var import_react87 = __toESM(require_react(), 1);
  var import_prop_types65 = __toESM(require_prop_types(), 1);
  var SuffixMonitor = class extends import_react87.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        data: {},
        loading: true,
        // refresh charts
        cache_refresh: "",
        count: 10,
        utilCount: 5,
        entryCacheList: [],
        entryUtilCacheList: [],
        dnCacheList: [],
        dnCacheUtilList: []
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.startCacheRefresh = this.startCacheRefresh.bind(this);
      this.refreshSuffixCache = this.refreshSuffixCache.bind(this);
    }
    componentDidMount() {
      this.resetChartData();
      this.refreshSuffixCache();
      this.startCacheRefresh();
      this.props.enableTree();
    }
    componentWillUnmount() {
      this.stopCacheRefresh();
    }
    resetChartData() {
      this.setState({
        data: {
          // Entry cache
          entrycachehitratio: [0],
          entrycachetries: [0],
          entrycachehits: [0],
          maxentrycachesize: [0],
          currententrycachesize: [0],
          maxentrycachecount: [0],
          currententrycachecount: [0],
          // DN cache
          dncachehitratio: [0],
          dncachetries: [0],
          dncachehits: [0],
          maxdncachesize: [0],
          currentdncachesize: [0],
          maxdncachecount: [0],
          currentdncachecount: [0]
        },
        entryCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 },
          { name: "", x: "6", y: 0 },
          { name: "", x: "7", y: 0 },
          { name: "", x: "8", y: 0 },
          { name: "", x: "9", y: 0 },
          { name: "", x: "10", y: 0 }
        ],
        entryUtilCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ],
        dnCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 },
          { name: "", x: "6", y: 0 },
          { name: "", x: "7", y: 0 },
          { name: "", x: "8", y: 0 },
          { name: "", x: "9", y: 0 },
          { name: "", x: "10", y: 0 }
        ],
        dnCacheUtilList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ]
      });
    }
    refreshSuffixCache() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "backend",
        this.props.suffix
      ];
      log_cmd("refreshSuffixCache", "Get suffix monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let count = this.state.count + 1;
        const utilCount = this.state.utilCount + 1;
        if (count > 100) {
          count = 1;
        }
        const entryRatio = config2.attrs.entrycachehitratio[0];
        const entry_data = this.state.entryCacheList;
        entry_data.shift();
        entry_data.push({ name: "Cache Hit Ratio", x: count.toString(), y: parseInt(entryRatio) });
        const entry_util_data = this.state.entryUtilCacheList;
        let maxsize = config2.attrs.maxentrycachesize[0];
        let currsize = config2.attrs.currententrycachesize[0];
        let utilratio = Math.round(currsize / maxsize * 100);
        if (utilratio === 0) {
          utilratio = 1;
        }
        entry_util_data.shift();
        entry_util_data.push({ name: "Cache Utilization", x: utilCount.toString(), y: parseInt(utilratio) });
        const dnratio = config2.attrs.dncachehitratio[0];
        const dn_data = this.state.dnCacheList;
        dn_data.shift();
        dn_data.push({ name: "Cache Hit Ratio", x: count.toString(), y: parseInt(dnratio) });
        const dn_util_data = this.state.dnCacheUtilList;
        currsize = parseInt(config2.attrs.currentdncachesize[0]);
        maxsize = parseInt(config2.attrs.maxdncachesize[0]);
        utilratio = currsize / maxsize * 100;
        if (utilratio === 0) {
          utilratio = 1;
        }
        dn_util_data.shift();
        dn_util_data.push({ name: "Cache Utilization", x: utilCount.toString(), y: parseInt(utilratio) });
        this.setState({
          data: config2.attrs,
          loading: false,
          entryCacheList: entry_data,
          entryUtilCacheList: entry_util_data,
          dnCacheList: dn_data,
          dnCacheUtilList: dn_util_data,
          count,
          utilCount
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startCacheRefresh() {
      this.setState({
        cache_refresh: setInterval(this.refreshSuffixCache, 2e3)
      });
    }
    stopCacheRefresh() {
      clearInterval(this.state.cache_refresh);
    }
    render() {
      let entryChartColor = ChartThemeColor.green;
      let entryUtilChartColor = ChartThemeColor.green;
      let dnChartColor = ChartThemeColor.green;
      let dnUtilChartColor = ChartThemeColor.green;
      let cachehit = 1;
      let cachemax = 0;
      let cachecurr = 0;
      let cachecount = 0;
      let utilratio = 1;
      let dncachehit = 0;
      let dncachemax = 0;
      let dncachecurr = 0;
      let dncachecount = 0;
      let dnutilratio = 1;
      let suffixIcon = faTree;
      if (this.props.dbtype === "subsuffix") {
        suffixIcon = faLeaf;
      }
      let content = /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { component: TextVariants.h3 }, "Loading Suffix Monitor Information ...")), /* @__PURE__ */ import_react87.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      if (!this.state.loading) {
        cachehit = parseInt(this.state.data.entrycachehitratio[0]);
        cachemax = parseInt(this.state.data.maxentrycachesize[0]);
        cachecurr = parseInt(this.state.data.currententrycachesize[0]);
        cachecount = parseInt(this.state.data.currententrycachecount[0]);
        utilratio = Math.round(cachecurr / cachemax * 100);
        dncachehit = parseInt(this.state.data.dncachehitratio[0]);
        dncachemax = parseInt(this.state.data.maxdncachesize[0]);
        dncachecurr = parseInt(this.state.data.currentdncachesize[0]);
        dncachecount = parseInt(this.state.data.currentdncachecount[0]);
        dnutilratio = Math.round(dncachecurr / dncachemax * 100);
        if (utilratio === 0) {
          utilratio = 1;
        }
        if (dnutilratio === 0) {
          dnutilratio = 1;
        }
        if (cachehit > 89) {
          entryChartColor = ChartThemeColor.green;
        } else if (cachehit > 74) {
          entryChartColor = ChartThemeColor.orange;
        } else {
          entryChartColor = ChartThemeColor.purple;
        }
        if (utilratio > 95) {
          entryUtilChartColor = ChartThemeColor.purple;
        } else if (utilratio > 90) {
          entryUtilChartColor = ChartThemeColor.orange;
        } else {
          entryUtilChartColor = ChartThemeColor.green;
        }
        if (dncachehit > 89) {
          dnChartColor = ChartThemeColor.green;
        } else if (dncachehit > 74) {
          dnChartColor = ChartThemeColor.orange;
        } else {
          dnChartColor = ChartThemeColor.purple;
        }
        if (dnutilratio > 95) {
          dnUtilChartColor = ChartThemeColor.purple;
        } else if (dnutilratio > 90) {
          dnUtilChartColor = ChartThemeColor.orange;
        } else {
          dnUtilChartColor = ChartThemeColor.green;
        }
        content = /* @__PURE__ */ import_react87.default.createElement("div", { id: "monitor-suffix-page" }, /* @__PURE__ */ import_react87.default.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react87.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react87.default.createElement(TabTitleText, null, "Entry Cache") }, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react87.default.createElement(Grid, { hasGutter: true }, /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react87.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react87.default.createElement(CardBody, null, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react87.default.createElement(TextContent, { title: "The entry cache hit ratio (entrycachehitratio)" }, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h3 }, "Cache Hit Ratio")), /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, cachehit, "%")))), /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" } }, /* @__PURE__ */ import_react87.default.createElement(
          Chart,
          {
            ariaDesc: "Entry Cache",
            ariaTitle: "Live Entry Cache Statistics",
            containerComponent: /* @__PURE__ */ import_react87.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
            height: 200,
            maxDomain: { y: 100 },
            minDomain: { y: 0 },
            padding: {
              bottom: 40,
              left: 60,
              top: 10,
              right: 15
            },
            width: 350,
            themeColor: entryChartColor
          },
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, null),
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
          /* @__PURE__ */ import_react87.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react87.default.createElement(
            ChartArea,
            {
              data: this.state.entryCacheList
            }
          ))
        )))))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react87.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react87.default.createElement(CardBody, null, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react87.default.createElement(TextContent, { title: "The amount of the cache that is being used: max size (maxentrycachesize) vs current size (currententrycachesize)" }, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h3 }, "Cache Utilization")), /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, utilratio, "%"))), /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top-lg", component: TextVariants.h5 }, "Cached Entries")), /* @__PURE__ */ import_react87.default.createElement("b", null, cachecount)), /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" } }, /* @__PURE__ */ import_react87.default.createElement(
          Chart,
          {
            ariaDesc: "Entry Cache Utilization",
            ariaTitle: "Live Entry Cache Utilization Statistics",
            containerComponent: /* @__PURE__ */ import_react87.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
            height: 200,
            maxDomain: { y: 100 },
            minDomain: { y: 0 },
            padding: {
              bottom: 40,
              left: 60,
              top: 10,
              right: 15
            },
            width: 350,
            themeColor: entryUtilChartColor
          },
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, null),
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
          /* @__PURE__ */ import_react87.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react87.default.createElement(
            ChartArea,
            {
              data: this.state.entryUtilCacheList
            }
          ))
        )))))))), /* @__PURE__ */ import_react87.default.createElement(Grid, { hasGutter: true, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "Entry Cache Hit Ratio:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, this.state.data.entrycachehitratio[0], "%")), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "Entry Cache Max Size:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, displayBytes(cachemax), " ")), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "Entry Cache Hits:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.entrycachehits[0]))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "Entry Cache Current Size:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, displayBytes(cachecurr))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "Entry Cache Tries:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.entrycachetries[0]))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "Entry Cache Max Entries:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.maxentrycachecount[0]))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "Entry Cache Count:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.currententrycachecount[0]))))), /* @__PURE__ */ import_react87.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react87.default.createElement(TabTitleText, null, "DN Cache") }, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react87.default.createElement(Grid, { hasGutter: true }, /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react87.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react87.default.createElement(CardBody, null, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react87.default.createElement(TextContent, { title: "The DN cache hit ratio (dncachehitratio)" }, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h3 }, "Cache Hit Ratio")), /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, dncachehit, "%")))), /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" } }, /* @__PURE__ */ import_react87.default.createElement(
          Chart,
          {
            ariaDesc: "DN Cache",
            ariaTitle: "Live DN Cache Statistics",
            containerComponent: /* @__PURE__ */ import_react87.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
            height: 200,
            maxDomain: { y: 100 },
            minDomain: { y: 0 },
            padding: {
              bottom: 40,
              left: 60,
              top: 10,
              right: 15
            },
            width: 350,
            themeColor: dnChartColor
          },
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, null),
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
          /* @__PURE__ */ import_react87.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react87.default.createElement(
            ChartArea,
            {
              data: this.state.dnCacheList
            }
          ))
        )))))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react87.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react87.default.createElement(CardBody, null, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-center" }, /* @__PURE__ */ import_react87.default.createElement(TextContent, { title: "The amount of the cache that is being used: max size (maxdncachesize) vs current size (currentdncachesize)" }, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top", component: TextVariants.h3 }, "Cache Utilization")), /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, dnutilratio, "%"))), /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { className: "ds-margin-top-lg", component: TextVariants.h5 }, "Cached DN's")), /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(dncachecount))), /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" } }, /* @__PURE__ */ import_react87.default.createElement(
          Chart,
          {
            ariaDesc: "DN Cache Utilization",
            ariaTitle: "Live DN Cache Utilization Statistics",
            containerComponent: /* @__PURE__ */ import_react87.default.createElement(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
            height: 200,
            maxDomain: { y: 100 },
            minDomain: { y: 0 },
            padding: {
              bottom: 40,
              left: 60,
              top: 10,
              right: 15
            },
            width: 350,
            themeColor: dnUtilChartColor
          },
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, null),
          /* @__PURE__ */ import_react87.default.createElement(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
          /* @__PURE__ */ import_react87.default.createElement(ChartGroup, null, /* @__PURE__ */ import_react87.default.createElement(
            ChartArea,
            {
              data: this.state.dnCacheUtilList
            }
          ))
        )))))))), /* @__PURE__ */ import_react87.default.createElement(Grid, { hasGutter: true, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "DN Cache Hit Ratio:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, this.state.data.dncachehitratio[0], "%")), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "DN Cache Max Size:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, displayBytes(dncachemax))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "DN Cache Hits:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.dncachehits[0]))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "DN Cache Current Size:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, displayBytes(dncachecurr))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "DN Cache Tries:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.dncachetries[0]))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "DN Cache Max Count:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.maxdncachecount[0]))), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 3 }, "DN Cache Current Count:"), /* @__PURE__ */ import_react87.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react87.default.createElement("b", null, numToCommas(this.state.data.currentdncachecount[0])))))));
      }
      return /* @__PURE__ */ import_react87.default.createElement("div", null, /* @__PURE__ */ import_react87.default.createElement(TextContent, null, /* @__PURE__ */ import_react87.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react87.default.createElement(FontAwesomeIcon, { size: "sm", icon: suffixIcon }), " ", this.props.suffix, " (", /* @__PURE__ */ import_react87.default.createElement("b", null, this.props.bename), ")")), /* @__PURE__ */ import_react87.default.createElement("div", { className: "ds-margin-top-lg" }, content));
    }
  };
  SuffixMonitor.propTypes = {
    serverId: import_prop_types65.default.string,
    suffix: import_prop_types65.default.string,
    bename: import_prop_types65.default.string,
    enableTree: import_prop_types65.default.func
  };
  SuffixMonitor.defaultProps = {
    serverId: "",
    suffix: "",
    bename: ""
  };
  var suffixMonitor_default = SuffixMonitor;

  // src/lib/monitor/chainingMonitor.jsx
  var import_react88 = __toESM(require_react(), 1);
  var import_prop_types66 = __toESM(require_prop_types(), 1);
  var ChainingMonitor = class extends import_react88.default.Component {
    componentDidMount() {
      this.props.enableTree();
    }
    render() {
      return /* @__PURE__ */ import_react88.default.createElement("div", { id: "monitor-server-page" }, /* @__PURE__ */ import_react88.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react88.default.createElement(TextContent, null, /* @__PURE__ */ import_react88.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react88.default.createElement(FontAwesomeIcon, { size: "sm", icon: faLink }), " ", this.props.suffix, " (", /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.bename), ")", /* @__PURE__ */ import_react88.default.createElement(
        FontAwesomeIcon,
        {
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh chaining monitor",
          onClick: () => this.props.reload(this.props.suffix)
        }
      ))), /* @__PURE__ */ import_react88.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Add Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsaddcount)), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Delete Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsdeletecount))), /* @__PURE__ */ import_react88.default.createElement(Grid, null, /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Modify Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsmodifycount)), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "ModRDN Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsrenamecount))), /* @__PURE__ */ import_react88.default.createElement(Grid, null, /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Base Searches"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nssearchbasecount)), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "One-Level Searches"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nssearchonelevelcount))), /* @__PURE__ */ import_react88.default.createElement(Grid, null, /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Subtree Searches"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nssearchsubtreecount)), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Abandon Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsabandoncount))), /* @__PURE__ */ import_react88.default.createElement(Grid, null, /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Bind Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsbindcount)), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Unbind Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsunbindcount))), /* @__PURE__ */ import_react88.default.createElement(Grid, null, /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Compare Operations"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nscomparecount)), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Outgoing Connections"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsopenopconnectioncount))), /* @__PURE__ */ import_react88.default.createElement(Grid, null, /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, "Outgoing Bind Connections"), /* @__PURE__ */ import_react88.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react88.default.createElement("b", null, this.props.data.nsopenbindconnectioncount)))));
    }
  };
  ChainingMonitor.propTypes = {
    suffix: import_prop_types66.default.string,
    bename: import_prop_types66.default.string,
    data: import_prop_types66.default.object,
    enableTree: import_prop_types66.default.func
  };
  ChainingMonitor.defaultProps = {
    suffix: "",
    bename: "",
    data: {}
  };
  var chainingMonitor_default = ChainingMonitor;

  // src/lib/monitor/accesslog.jsx
  var import_react89 = __toESM(require_react(), 1);
  var import_prop_types67 = __toESM(require_prop_types(), 1);
  var AccessLogMonitor = class extends import_react89.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        accesslogData: "",
        accessReloading: false,
        accesslog_cont_refresh: "",
        accessRefreshing: false,
        accessLines: "50"
      };
      this.handleRefreshAccessLog = this.handleRefreshAccessLog.bind(this);
      this.handleAccessChange = this.handleAccessChange.bind(this);
      this.accessRefreshCont = this.accessRefreshCont.bind(this);
    }
    componentDidUpdate() {
      const textarea = document.getElementById("accesslog-area");
      textarea.scrollTop = textarea.scrollHeight;
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshAccessLog();
    }
    componentWillUnmount() {
      clearInterval(this.state.accesslog_cont_refresh);
    }
    accessRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          accesslog_cont_refresh: setInterval(this.handleRefreshAccessLog, 2e3),
          accessRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.accesslog_cont_refresh);
        this.setState({
          accessRefreshing: e.target.checked
        });
      }
    }
    handleAccessChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        accessLines: value
      }), this.handleRefreshAccessLog);
    }
    handleRefreshAccessLog() {
      this.setState({
        accessReloading: true
      });
      const cmd = ["tail", "-" + this.state.accessLines, this.props.logLocation];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          accesslogData: content,
          accessReloading: false
        }));
      }).fail(() => {
        this.setState({
          accessReloading: false
        });
      });
    }
    render() {
      let spinner = "";
      if (this.state.accessReloading) {
        spinner = /* @__PURE__ */ import_react89.default.createElement("div", null, /* @__PURE__ */ import_react89.default.createElement(Spinner, { isSVG: true, size: "sm" }), "Reloading access log...");
      }
      return /* @__PURE__ */ import_react89.default.createElement("div", { id: "monitor-log-access-page" }, /* @__PURE__ */ import_react89.default.createElement(Grid, null, /* @__PURE__ */ import_react89.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react89.default.createElement(TextContent, null, /* @__PURE__ */ import_react89.default.createElement(Text, { component: TextVariants.h3 }, "Access Log", /* @__PURE__ */ import_react89.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh access log",
          onClick: this.handleRefreshAccessLog
        }
      )))), /* @__PURE__ */ import_react89.default.createElement(GridItem, { span: 9, className: "ds-float-left" }, spinner)), /* @__PURE__ */ import_react89.default.createElement(Grid, { className: "ds-margin-top-lg ds-indent" }, /* @__PURE__ */ import_react89.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react89.default.createElement(
        FormSelect,
        {
          id: "accessLines",
          value: this.state.accessLines,
          onChange: (value, event) => {
            this.handleAccessChange(event);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "50", value: "50", label: "50" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "100", value: "100", label: "100" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "200", value: "200", label: "200" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "300", value: "300", label: "300" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "400", value: "400", label: "400" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "500", value: "500", label: "500" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "1000", value: "1000", label: "1000" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "2000", value: "2000", label: "2000" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "5000", value: "5000", label: "5000" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "10000", value: "10000", label: "10000" }),
        /* @__PURE__ */ import_react89.default.createElement(FormSelectOption, { key: "50000", value: "50000", label: "50000" })
      )), /* @__PURE__ */ import_react89.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react89.default.createElement("div", { className: "ds-float-right" }, /* @__PURE__ */ import_react89.default.createElement(
        Checkbox,
        {
          id: "accessRefreshing",
          isChecked: this.state.accessRefreshing,
          onChange: (checked, e) => {
            this.accessRefreshCont(e);
          },
          label: "Continuously Refresh"
        }
      ))), /* @__PURE__ */ import_react89.default.createElement(
        TextArea,
        {
          id: "accesslog-area",
          resizeOrientation: "vertical",
          className: "ds-logarea ds-margin-top-lg",
          value: this.state.accesslogData,
          "aria-label": "text area example"
        }
      )));
    }
  };
  AccessLogMonitor.propTypes = {
    logLocation: import_prop_types67.default.string,
    enableTree: import_prop_types67.default.func
  };
  AccessLogMonitor.defaultProps = {
    logLocation: ""
  };
  var accesslog_default = AccessLogMonitor;

  // src/lib/monitor/auditlog.jsx
  var import_react90 = __toESM(require_react(), 1);
  var import_prop_types68 = __toESM(require_prop_types(), 1);
  var AuditLogMonitor = class extends import_react90.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        auditlogData: "",
        auditReloading: false,
        auditlog_cont_refresh: "",
        auditRefreshing: false,
        auditLines: "50"
      };
      this.handleRefreshAuditLog = this.handleRefreshAuditLog.bind(this);
      this.handleAuditChange = this.handleAuditChange.bind(this);
      this.auditRefreshCont = this.auditRefreshCont.bind(this);
    }
    componentWillUnmount() {
      clearInterval(this.state.auditlog_cont_refresh);
    }
    componentDidUpdate() {
      const textarea = document.getElementById("auditlog-area");
      textarea.scrollTop = textarea.scrollHeight;
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshAuditLog();
    }
    handleRefreshAuditLog() {
      this.setState({
        auditReloading: true
      });
      const cmd = ["tail", "-" + this.state.auditLines, this.props.logLocation];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          auditlogData: content,
          auditReloading: false
        }));
      });
    }
    auditRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          auditlog_cont_refresh: setInterval(this.handleRefreshAuditLog, 2e3),
          auditRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.auditlog_cont_refresh);
        this.setState({
          auditRefreshing: e.target.checked
        });
      }
    }
    handleAuditChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        auditLines: value
      }), this.handleRefreshAuditLog);
    }
    render() {
      let spinner = "";
      if (this.state.auditReloading) {
        spinner = /* @__PURE__ */ import_react90.default.createElement("div", null, /* @__PURE__ */ import_react90.default.createElement(Spinner, { size: "sm" }), "Reloading audit log...");
      }
      return /* @__PURE__ */ import_react90.default.createElement("div", { id: "monitor-log-audit-page" }, /* @__PURE__ */ import_react90.default.createElement(Grid, null, /* @__PURE__ */ import_react90.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react90.default.createElement(TextContent, null, /* @__PURE__ */ import_react90.default.createElement(Text, { component: TextVariants.h3 }, "Audit Log", /* @__PURE__ */ import_react90.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh audit log",
          onClick: this.handleRefreshAuditLog
        }
      )))), /* @__PURE__ */ import_react90.default.createElement(GridItem, { span: 9, className: "ds-float-left" }, spinner)), /* @__PURE__ */ import_react90.default.createElement(Grid, { className: "ds-margin-top-lg ds-indent" }, /* @__PURE__ */ import_react90.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react90.default.createElement(
        FormSelect,
        {
          id: "accessLines",
          value: this.state.auditLines,
          onChange: (value, event) => {
            this.handleAuditChange(event);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "50", value: "50", label: "50" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "100", value: "100", label: "100" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "200", value: "200", label: "200" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "300", value: "300", label: "300" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "400", value: "400", label: "400" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "500", value: "500", label: "500" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "1000", value: "1000", label: "1000" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "2000", value: "2000", label: "2000" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "5000", value: "5000", label: "5000" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "10000", value: "10000", label: "10000" }),
        /* @__PURE__ */ import_react90.default.createElement(FormSelectOption, { key: "50000", value: "50000", label: "50000" })
      )), /* @__PURE__ */ import_react90.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react90.default.createElement("div", { className: "ds-float-right" }, /* @__PURE__ */ import_react90.default.createElement(
        Checkbox,
        {
          id: "auditRefreshing",
          isChecked: this.state.auditRefreshing,
          onChange: (checked, e) => {
            this.auditRefreshCont(e);
          },
          label: "Continuously Refresh"
        }
      ))), /* @__PURE__ */ import_react90.default.createElement(
        TextArea,
        {
          id: "auditlog-area",
          resizeOrientation: "vertical",
          className: "ds-logarea ds-margin-top-lg",
          value: this.state.auditlogData,
          "aria-label": "text area example"
        }
      )));
    }
  };
  AuditLogMonitor.propTypes = {
    logLocation: import_prop_types68.default.string,
    enableTree: import_prop_types68.default.func
  };
  AuditLogMonitor.defaultProps = {
    logLocation: ""
  };
  var auditlog_default = AuditLogMonitor;

  // src/lib/monitor/auditfaillog.jsx
  var import_react91 = __toESM(require_react(), 1);
  var import_prop_types69 = __toESM(require_prop_types(), 1);
  var AuditFailLogMonitor = class extends import_react91.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        auditfaillogData: "",
        auditfailReloading: false,
        auditfaillog_cont_refresh: "",
        auditfailRefreshing: false,
        auditfailLines: "50"
      };
      this.handleRefreshAuditFailLog = this.handleRefreshAuditFailLog.bind(this);
      this.handleAuditFailChange = this.handleAuditFailChange.bind(this);
      this.auditFailRefreshCont = this.auditFailRefreshCont.bind(this);
    }
    componentWillUnmount() {
      clearInterval(this.state.auditfaillog_cont_refresh);
    }
    componentDidUpdate() {
      const textarea = document.getElementById("auditfaillog-area");
      textarea.scrollTop = textarea.scrollHeight;
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshAuditFailLog();
    }
    handleRefreshAuditFailLog() {
      this.setState({
        auditfailReloading: true
      });
      const cmd = ["tail", "-" + this.state.auditfailLines, this.props.logLocation];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          auditfaillogData: content,
          auditfailReloading: false
        }));
      });
    }
    auditFailRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          auditfaillog_cont_refresh: setInterval(this.handleRefreshAuditFailLog, 2e3),
          auditfailRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.auditfaillog_cont_refresh);
        this.setState({
          auditfailRefreshing: e.target.checked
        });
      }
    }
    handleAuditFailChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        auditfailLines: value
      }), this.handleRefreshAuditFailLog);
    }
    render() {
      let spinner = "";
      if (this.state.auditfailReloading) {
        spinner = /* @__PURE__ */ import_react91.default.createElement("div", null, /* @__PURE__ */ import_react91.default.createElement(Spinner, { size: "sm" }), "Reloading audit failure log...");
      }
      return /* @__PURE__ */ import_react91.default.createElement("div", { id: "monitor-log-auditfail-page" }, /* @__PURE__ */ import_react91.default.createElement(Grid, null, /* @__PURE__ */ import_react91.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react91.default.createElement(TextContent, null, /* @__PURE__ */ import_react91.default.createElement(Text, { component: TextVariants.h3 }, "Audit Failure Log", /* @__PURE__ */ import_react91.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh audit failure log",
          onClick: this.handleRefreshAuditFailLog
        }
      )))), /* @__PURE__ */ import_react91.default.createElement(GridItem, { span: 9, className: "ds-float-left" }, spinner)), /* @__PURE__ */ import_react91.default.createElement(Grid, { className: "ds-margin-top-lg ds-indent" }, /* @__PURE__ */ import_react91.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react91.default.createElement(
        FormSelect,
        {
          id: "auditfailLines",
          value: this.state.auditfailLines,
          onChange: (value, event) => {
            this.handleAuditFailChange(event);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "50", value: "50", label: "50" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "100", value: "100", label: "100" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "200", value: "200", label: "200" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "300", value: "300", label: "300" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "400", value: "400", label: "400" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "500", value: "500", label: "500" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "1000", value: "1000", label: "1000" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "2000", value: "2000", label: "2000" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "5000", value: "5000", label: "5000" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "10000", value: "10000", label: "10000" }),
        /* @__PURE__ */ import_react91.default.createElement(FormSelectOption, { key: "50000", value: "50000", label: "50000" })
      )), /* @__PURE__ */ import_react91.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react91.default.createElement("div", { className: "ds-float-right" }, /* @__PURE__ */ import_react91.default.createElement(
        Checkbox,
        {
          id: "auditfailRefreshing",
          isChecked: this.state.auditfailRefreshing,
          onChange: (checked, e) => {
            this.auditFailRefreshCont(e);
          },
          label: "Continuously Refresh"
        }
      ))), /* @__PURE__ */ import_react91.default.createElement(
        TextArea,
        {
          id: "auditfaillog-area",
          resizeOrientation: "vertical",
          className: "ds-logarea ds-margin-top-lg",
          value: this.state.auditfaillogData,
          "aria-label": "text area example"
        }
      )));
    }
  };
  AuditFailLogMonitor.propTypes = {
    logLocation: import_prop_types69.default.string,
    enableTree: import_prop_types69.default.func
  };
  AuditFailLogMonitor.defaultProps = {
    logLocation: ""
  };
  var auditfaillog_default = AuditFailLogMonitor;

  // src/lib/monitor/errorlog.jsx
  var import_react92 = __toESM(require_react(), 1);
  var import_prop_types70 = __toESM(require_prop_types(), 1);
  var ErrorLogMonitor = class extends import_react92.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        errorlogData: "",
        errorReloading: false,
        errorlog_cont_refresh: "",
        errorRefreshing: false,
        errorSevLevel: "Everything",
        errorLines: "50"
      };
      const sev_emerg = " - EMERG - ";
      const sev_crit = " - CRIT - ";
      const sev_alert = " - ALERT - ";
      const sev_err = " - ERR - ";
      const sev_warn = " - WARN - ";
      const sev_notice = " - NOTICE - ";
      const sev_info = " - INFO - ";
      const sev_debug = " - DEBUG - ";
      this.sev_levels = {
        Emergency: sev_emerg,
        Critical: sev_crit,
        Alert: sev_alert,
        Error: sev_err,
        Warning: sev_warn,
        Notice: sev_notice,
        Info: sev_info,
        Debug: sev_debug
      };
      this.sev_all_errs = [sev_emerg, sev_crit, sev_alert, sev_err];
      this.sev_all_info = [sev_warn, sev_notice, sev_info, sev_debug];
      this.handleRefreshErrorLog = this.handleRefreshErrorLog.bind(this);
      this.errorRefreshCont = this.errorRefreshCont.bind(this);
      this.handleErrorChange = this.handleErrorChange.bind(this);
      this.handleSevChange = this.handleSevChange.bind(this);
    }
    componentDidUpdate() {
      const textarea = document.getElementById("errorslog-area");
      textarea.scrollTop = textarea.scrollHeight;
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshErrorLog();
    }
    componentWillUnmount() {
      clearInterval(this.state.errorlog_cont_refresh);
    }
    handleRefreshErrorLog() {
      this.setState({
        errorReloading: true
      });
      const cmd = ["tail", "-" + this.state.errorLines, this.props.logLocation];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
        if (this.state.errorSevLevel !== "Everything") {
          const lines = data.split("\n");
          let new_data = "";
          for (let i = 0; i < lines.length; i++) {
            let line = "";
            if (this.state.errorSevLevel === "Error Messages") {
              for (const lev of this.sev_all_errs) {
                if (lines[i].indexOf(lev) !== -1) {
                  line = lines[i] + "\n";
                }
              }
            } else if (this.state.errorSevLevel === "Info Messages") {
              for (const lev of this.sev_all_info) {
                if (lines[i].indexOf(lev) !== -1) {
                  line = lines[i] + "\n";
                }
              }
            } else if (lines[i].indexOf(this.sev_levels[this.state.errorSevLevel]) !== -1) {
              line = lines[i] + "\n";
            }
            new_data += line;
          }
          data = new_data;
        }
        this.setState(() => ({
          errorlogData: data,
          errorReloading: false
        }));
      });
    }
    errorRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          errorlog_cont_refresh: setInterval(this.handleRefreshErrorLog, 2e3),
          errorRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.errorlog_cont_refresh);
        this.setState({
          errorRefreshing: e.target.checked
        });
      }
    }
    handleErrorChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        errorLines: value
      }), this.handleRefreshErrorLog);
    }
    handleSevChange(e) {
      const value = e.target.value;
      this.setState({
        errorSevLevel: value
      }, this.handleRefreshErrorLog);
    }
    render() {
      let spinner = "";
      if (this.state.errorReloading) {
        spinner = /* @__PURE__ */ import_react92.default.createElement("div", null, /* @__PURE__ */ import_react92.default.createElement(Spinner, { size: "sm" }), "Reloading errors log...");
      }
      return /* @__PURE__ */ import_react92.default.createElement("div", { id: "monitor-log-errors-page" }, /* @__PURE__ */ import_react92.default.createElement(Grid, null, /* @__PURE__ */ import_react92.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react92.default.createElement(TextContent, null, /* @__PURE__ */ import_react92.default.createElement(Text, { component: TextVariants.h3 }, "Errors Log", /* @__PURE__ */ import_react92.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh error log",
          onClick: this.handleRefreshErrorLog
        }
      )))), /* @__PURE__ */ import_react92.default.createElement(GridItem, { span: 9, className: "ds-float-left" }, spinner)), /* @__PURE__ */ import_react92.default.createElement(Grid, { className: "ds-margin-top-lg ds-indent" }, /* @__PURE__ */ import_react92.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react92.default.createElement(
        FormSelect,
        {
          id: "errorLines",
          value: this.state.errorLines,
          onChange: (value, event) => {
            this.handleErrorChange(event);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "50", value: "50", label: "50" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "100", value: "100", label: "100" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "200", value: "200", label: "200" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "300", value: "300", label: "300" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "400", value: "400", label: "400" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "500", value: "500", label: "500" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "1000", value: "1000", label: "1000" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "2000", value: "2000", label: "2000" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "5000", value: "5000", label: "5000" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "10000", value: "10000", label: "10000" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "50000", value: "50000", label: "50000" })
      )), /* @__PURE__ */ import_react92.default.createElement(GridItem, { offset: 4, span: 4 }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "ds-label" }, "Filter"), /* @__PURE__ */ import_react92.default.createElement(
        FormSelect,
        {
          className: "ds-left-margin",
          value: this.state.errorSevLevel,
          onChange: (value, event) => {
            this.handleSevChange(event);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Everything", value: "Everything", label: "Everything" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Error Messages", value: "Error Messages", label: "Error Messages" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Info Messages", value: "Info Messages", label: "Info Messages" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { isDisabled: true, key: "disabled", value: "disabled", label: "---------------" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Emergency", value: "Emergency", label: "Emergency" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Alert", value: "Alert", label: "Alert" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Critical", value: "Critical", label: "Critical" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Warning", value: "Warning", label: "Warning" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Notice", value: "Notice", label: "Notice" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Info", value: "Info", label: "Info" }),
        /* @__PURE__ */ import_react92.default.createElement(FormSelectOption, { key: "Debug", value: "Debug", label: "Debug" })
      ))), /* @__PURE__ */ import_react92.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "ds-float-right" }, /* @__PURE__ */ import_react92.default.createElement(
        Checkbox,
        {
          id: "errorRefreshing",
          isChecked: this.state.errorRefreshing,
          onChange: (checked, e) => {
            this.errorRefreshCont(e);
          },
          label: "Continuously Refresh"
        }
      ))), /* @__PURE__ */ import_react92.default.createElement(
        TextArea,
        {
          id: "errorslog-area",
          resizeOrientation: "vertical",
          className: "ds-logarea ds-margin-top-lg",
          value: this.state.errorlogData,
          "aria-label": "text area example"
        }
      )));
    }
  };
  ErrorLogMonitor.propTypes = {
    logLocation: import_prop_types70.default.string,
    enableTree: import_prop_types70.default.func
  };
  ErrorLogMonitor.defaultProps = {
    logLocation: ""
  };
  var errorlog_default = ErrorLogMonitor;

  // src/lib/monitor/securitylog.jsx
  var import_react93 = __toESM(require_react(), 1);
  var import_prop_types71 = __toESM(require_prop_types(), 1);
  var SecurityLogMonitor = class extends import_react93.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        securitylogData: "",
        securityReloading: false,
        securitylog_cont_refresh: "",
        securityRefreshing: false,
        securityLines: "50"
      };
      this.handleRefreshSecurityLog = this.handleRefreshSecurityLog.bind(this);
      this.handleSecurityChange = this.handleSecurityChange.bind(this);
      this.securityRefreshCont = this.securityRefreshCont.bind(this);
    }
    componentDidUpdate() {
      const textarea = document.getElementById("securitylog-area");
      textarea.scrollTop = textarea.scrollHeight;
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshSecurityLog();
    }
    componentWillUnmount() {
      clearInterval(this.state.securitylog_cont_refresh);
    }
    securityRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          securitylog_cont_refresh: setInterval(this.handleRefreshSecurityLog, 2e3),
          securityRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.securitylog_cont_refresh);
        this.setState({
          securityRefreshing: e.target.checked
        });
      }
    }
    handleSecurityChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        securityLines: value
      }), this.handleRefreshSecurityLog);
    }
    handleRefreshSecurityLog() {
      this.setState({
        securityReloading: true
      });
      const cmd = ["tail", "-" + this.state.securityLines, this.props.logLocation];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          securitylogData: content,
          securityReloading: false
        }));
      }).fail(() => {
        this.setState({
          securityReloading: false
        });
      });
    }
    render() {
      let spinner = "";
      if (this.state.securityReloading) {
        spinner = /* @__PURE__ */ import_react93.default.createElement("div", null, /* @__PURE__ */ import_react93.default.createElement(Spinner, { isSVG: true, size: "sm" }), "Reloading security log...");
      }
      return /* @__PURE__ */ import_react93.default.createElement("div", { id: "monitor-log-security-page" }, /* @__PURE__ */ import_react93.default.createElement(Grid, null, /* @__PURE__ */ import_react93.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react93.default.createElement(TextContent, null, /* @__PURE__ */ import_react93.default.createElement(Text, { component: TextVariants.h3 }, "Security Log", /* @__PURE__ */ import_react93.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh security log",
          onClick: this.handleRefreshSecurityLog
        }
      )))), /* @__PURE__ */ import_react93.default.createElement(GridItem, { span: 9, className: "ds-float-left" }, spinner)), /* @__PURE__ */ import_react93.default.createElement(Grid, { className: "ds-margin-top-lg ds-indent" }, /* @__PURE__ */ import_react93.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react93.default.createElement(
        FormSelect,
        {
          id: "securityLines",
          value: this.state.securityLines,
          onChange: (value, event) => {
            this.handleSecurityChange(event);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "50", value: "50", label: "50" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "100", value: "100", label: "100" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "200", value: "200", label: "200" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "300", value: "300", label: "300" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "400", value: "400", label: "400" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "500", value: "500", label: "500" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "1000", value: "1000", label: "1000" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "2000", value: "2000", label: "2000" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "5000", value: "5000", label: "5000" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "10000", value: "10000", label: "10000" }),
        /* @__PURE__ */ import_react93.default.createElement(FormSelectOption, { key: "50000", value: "50000", label: "50000" })
      )), /* @__PURE__ */ import_react93.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react93.default.createElement("div", { className: "ds-float-right" }, /* @__PURE__ */ import_react93.default.createElement(
        Checkbox,
        {
          id: "securityRefreshing",
          isChecked: this.state.securityRefreshing,
          onChange: (checked, e) => {
            this.securityRefreshCont(e);
          },
          label: "Continuously Refresh"
        }
      ))), /* @__PURE__ */ import_react93.default.createElement(
        TextArea,
        {
          id: "securitylog-area",
          resizeOrientation: "vertical",
          className: "ds-logarea ds-margin-top-lg",
          value: this.state.securitylogData,
          "aria-label": "text area example"
        }
      )));
    }
  };
  SecurityLogMonitor.propTypes = {
    logLocation: import_prop_types71.default.string,
    enableTree: import_prop_types71.default.func
  };
  SecurityLogMonitor.defaultProps = {
    logLocation: ""
  };
  var securitylog_default = SecurityLogMonitor;

  // src/lib/monitor/replMonitor.jsx
  var import_react95 = __toESM(require_react(), 1);
  var import_prop_types73 = __toESM(require_prop_types(), 1);

  // src/lib/monitor/monitorModals.jsx
  var import_react94 = __toESM(require_react(), 1);
  var import_prop_types72 = __toESM(require_prop_types(), 1);
  var import_outlined_question_circle_icon2 = __toESM(require_outlined_question_circle_icon(), 1);
  var TaskLogModal = class extends import_react94.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        logData
      } = this.props;
      return /* @__PURE__ */ import_react94.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Task Log",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react94.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Close")
          ]
        },
        /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react94.default.createElement(
          TextArea,
          {
            resizeOrientation: "vertical",
            className: "ds-logarea",
            value: logData,
            "aria-label": "text area example"
          }
        ))
      );
    }
  };
  var AgmtDetailsModal = class extends import_react94.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        agmt
      } = this.props;
      const convertedDate = {};
      const dateAttrs = [
        "last-update-start",
        "last-update-end",
        "last-init-start",
        "last-init-end"
      ];
      for (const attr of dateAttrs) {
        if (agmt[attr][0] === "19700101000000Z") {
          convertedDate[attr] = "Unavailable";
        } else {
          convertedDate[attr] = get_date_string(agmt[attr][0]);
        }
      }
      const btnList = [
        /* @__PURE__ */ import_react94.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
      ];
      const title = "Replication Agreement Details (" + agmt["agmt-name"] + ")";
      return /* @__PURE__ */ import_react94.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: btnList
        },
        /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Replica")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, agmt.replica))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Agreement Enabled")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, agmt["replica-enabled"]))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Last Init Started")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, convertedDate["last-init-start"]))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Last Init Ended")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, convertedDate["last-init-end"]))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Last Initialization Status")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement(
          TextArea,
          {
            resizeOrientation: "vertical",
            className: "ds-textarea",
            value: agmt["last-init-status"],
            "aria-label": "text area example"
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Replication In Progress")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, agmt["update-in-progress"]))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Changes Sent")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, agmt["number-changes-sent"]))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Last Update Started")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, convertedDate["last-update-start"]))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Last Update Ended")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement("i", null, convertedDate["last-update-end"]))), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Last Update Status")), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement(
          TextArea,
          {
            resizeOrientation: "vertical",
            className: "ds-textarea",
            value: agmt["last-update-status"],
            "aria-label": "text area example"
          }
        ))))
      );
    }
  };
  var ConflictCompareModal = class extends import_react94.default.Component {
    render() {
      const {
        showModal,
        conflictEntry,
        validEntry,
        closeHandler,
        saveHandler,
        handleChange,
        handleRadioChange,
        convertConflictRadio,
        deleteConflictRadio,
        swapConflictRadio,
        newRDN
      } = this.props;
      const ignoreAttrs = [
        "createtimestamp",
        "creatorsname",
        "modifytimestamp",
        "modifiersname",
        "entryid",
        "entrydn",
        "parentid",
        "numsubordinates"
      ];
      let conflict = "dn: " + conflictEntry.dn + "\n";
      let valid = "dn: " + validEntry.dn + "\n";
      let conflictChildren = "0";
      let validChildren = "0";
      let orig_rdn = newRDN;
      if (newRDN === "") {
        orig_rdn = conflictEntry.dn.split("+");
        orig_rdn = orig_rdn[0] + "-MUST_CHANGE";
      }
      for (const key in conflictEntry.attrs) {
        if (key === "numsubordinates") {
          conflictChildren = conflictEntry.attrs[key];
        }
        if (!ignoreAttrs.includes(key)) {
          for (const attr of conflictEntry.attrs[key]) {
            conflict += key + ": " + attr + "\n";
          }
        }
      }
      for (const key in validEntry.attrs) {
        if (key === "numsubordinates") {
          validChildren = /* @__PURE__ */ import_react94.default.createElement("font", { color: "red" }, validEntry.attrs[key]);
        }
        if (!ignoreAttrs.includes(key)) {
          for (const attr of validEntry.attrs[key]) {
            valid += key + ": " + attr + "\n";
          }
        }
      }
      return /* @__PURE__ */ import_react94.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Resolve Replication Conflict",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react94.default.createElement(Button, { key: "confirm", variant: "primary", onClick: () => saveHandler(conflictEntry.dn) }, "Resolve Conflict"),
            /* @__PURE__ */ import_react94.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react94.default.createElement(TextContent, null, /* @__PURE__ */ import_react94.default.createElement(Text, { component: TextVariants.h4 }, "Valid Entry"))), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react94.default.createElement("p", { className: "ds-margin-top ds-right-align ds-font-size-sm" }, "Child Entries: ", /* @__PURE__ */ import_react94.default.createElement("b", null, validChildren))), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react94.default.createElement(TextArea, { id: "conflictValid", resizeOrientation: "vertical", className: "ds-conflict", value: valid, isReadOnly: true })), /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-margin-top-lg", span: 6 }, /* @__PURE__ */ import_react94.default.createElement(TextContent, null, /* @__PURE__ */ import_react94.default.createElement(Text, { component: TextVariants.h4 }, "Conflict Entry"))), /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-margin-top-lg", span: 6 }, /* @__PURE__ */ import_react94.default.createElement("p", { className: "ds-margin-top ds-right-align ds-font-size-sm" }, "Child Entries: ", /* @__PURE__ */ import_react94.default.createElement("b", null, conflictChildren))), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react94.default.createElement(TextArea, { id: "conflictConflict", resizeOrientation: "vertical", className: "ds-conflict", value: conflict, isReadOnly: true })), /* @__PURE__ */ import_react94.default.createElement("hr", null), /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react94.default.createElement(
          Radio,
          {
            name: "resolve-choice",
            onChange: handleRadioChange,
            label: "Delete Conflict Entry",
            id: "deleteConflictRadio",
            isChecked: deleteConflictRadio
          }
        ), /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-left-margin" }, /* @__PURE__ */ import_react94.default.createElement(
          Tooltip,
          {
            position: "top",
            content: /* @__PURE__ */ import_react94.default.createElement("div", null, 'This will delete the conflict entry, and the "valid" entry will remain intact.')
          },
          /* @__PURE__ */ import_react94.default.createElement(import_outlined_question_circle_icon2.OutlinedQuestionCircleIcon, null)
        ))), /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-container ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(
          Radio,
          {
            name: "resolve-choice",
            onChange: handleRadioChange,
            label: "Swap Conflict Entry With Valid Entry",
            id: "swapConflictRadio",
            isChecked: swapConflictRadio
          }
        ), /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-left-margin" }, /* @__PURE__ */ import_react94.default.createElement(
          Tooltip,
          {
            className: "ds-margin-left",
            position: "top",
            content: /* @__PURE__ */ import_react94.default.createElement("div", null, 'This will replace the "valid" entry with the conflict entry, but keeping the valid entry DN intact.')
          },
          /* @__PURE__ */ import_react94.default.createElement(import_outlined_question_circle_icon2.OutlinedQuestionCircleIcon, null)
        ))), /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-container ds-margin-top" }, /* @__PURE__ */ import_react94.default.createElement(
          Radio,
          {
            name: "resolve-choice",
            onChange: handleRadioChange,
            label: "Convert Conflict Entry Into New Entry",
            id: "convertConflictRadio",
            isChecked: convertConflictRadio
          }
        ), /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-left-margin" }, /* @__PURE__ */ import_react94.default.createElement(
          Tooltip,
          {
            position: "top",
            content: /* @__PURE__ */ import_react94.default.createElement("div", null, `The conflict entry uses a multi-valued RDN to specify the original DN and it's nsUniqueID.  To convert the conflict entry to a new entry you must provide a new RDN attribute/value for the new entry. "RDN_ATTRIBUTE=VALUE".  For example: cn=my_new_entry`)
          },
          /* @__PURE__ */ import_react94.default.createElement(import_outlined_question_circle_icon2.OutlinedQuestionCircleIcon, null)
        ))), /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-margin-top ds-margin-left-sm" }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            placeholder: "Enter new RDN here",
            type: "text",
            onChange: handleChange,
            "aria-label": "new rdn label",
            id: "convertRDN",
            value: orig_rdn,
            isDisabled: !convertConflictRadio
          }
        ))))
      );
    }
  };
  var ReportCredentialsModal = class extends import_react94.default.Component {
    render() {
      const {
        handleFieldChange,
        showModal,
        closeHandler,
        newEntry,
        hostname,
        port,
        binddn,
        pwInputInterractive,
        bindpw,
        addConfig,
        editConfig,
        onMinusConfig,
        onPlusConfig,
        onConfigChange
      } = this.props;
      const title = (newEntry ? "Add" : "Edit") + " Report Credentials";
      return /* @__PURE__ */ import_react94.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react94.default.createElement(
              Button,
              {
                key: "save",
                variant: "primary",
                onClick: newEntry ? addConfig : editConfig,
                isDisabled: hostname === "" || binddn === "" || bindpw === "" && !pwInputInterractive
              },
              "Save"
            ),
            /* @__PURE__ */ import_react94.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Hostname"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: hostname,
            type: "text",
            id: "credsHostname",
            "aria-describedby": "cachememsize",
            name: "credsHostname",
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Port"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          NumberInput,
          {
            value: port,
            min: 1,
            max: 65534,
            onMinus: () => {
              onMinusConfig("credsPort");
            },
            onChange: (e) => {
              onConfigChange(e, "credsPort", 1);
            },
            onPlus: () => {
              onPlusConfig("credsPort");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Bind DN for the specified instances" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: binddn,
            type: "text",
            id: "credsBinddn",
            "aria-describedby": "cachememsize",
            name: "credsBinddn",
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Bind password for the specified instances" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: bindpw,
            type: "password",
            id: "credsBindpw",
            "aria-describedby": "cachememsize",
            name: "credsBindpw",
            isDisabled: pwInputInterractive,
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Input the password interactively" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Interractive Input"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          Checkbox,
          {
            isChecked: pwInputInterractive,
            id: "pwInputInterractive",
            onChange: (checked, e) => {
              handleFieldChange(e);
            }
          }
        ))))))
      );
    }
  };
  var ReportConnectionModal = class extends import_react94.default.Component {
    render() {
      const {
        handleFieldChange,
        showModal,
        closeHandler,
        name: name2,
        hostname,
        port,
        binddn,
        pwInputInterractive,
        bindpw,
        addConn,
        onMinusConfig,
        onPlusConfig,
        onConfigChange
      } = this.props;
      return /* @__PURE__ */ import_react94.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Add Replica Connection",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react94.default.createElement(
              Button,
              {
                key: "save",
                variant: "primary",
                onClick: addConn,
                isDisabled: name2 === "" || hostname === "" || port === "" || binddn === "" || bindpw === "" && !pwInputInterractive
              },
              "Save"
            ),
            /* @__PURE__ */ import_react94.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Connection Name"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: name2,
            type: "text",
            id: "connName",
            "aria-describedby": "connName",
            name: "connName",
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Hostname"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: hostname,
            type: "text",
            id: "connHostname",
            "aria-describedby": "connHostname",
            name: "connHostname",
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Port"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          NumberInput,
          {
            value: port,
            min: 1,
            max: 65534,
            onMinus: () => {
              onMinusConfig("connPort");
            },
            onChange: (e) => {
              onConfigChange(e, "connPort", 1);
            },
            onPlus: () => {
              onPlusConfig("connPort");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Bind DN for the specified instances" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: binddn,
            type: "text",
            id: "connBindDN",
            "aria-describedby": "connBindDN",
            name: "connBindDN",
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Bind password for the specified instance.  You can also speciy a password file but the filename needs to be inside of brackets [/PATH/FILE]" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: bindpw,
            type: "password",
            id: "connCred",
            "aria-describedby": "connCred",
            name: "connCred",
            isDisabled: pwInputInterractive,
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Input the password interactively, stores '*' as the password value in .dsrc" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Interractive Input"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          Checkbox,
          {
            isChecked: pwInputInterractive,
            id: "pwInputInterractive",
            onChange: (checked, e) => {
              handleFieldChange(e);
            }
          }
        ))))))
      );
    }
  };
  var ReportAliasesModal = class extends import_react94.default.Component {
    render() {
      const {
        handleFieldChange,
        showModal,
        closeHandler,
        newEntry,
        hostname,
        port,
        alias,
        addConfig,
        editConfig,
        onMinusConfig,
        onPlusConfig,
        onConfigChange
      } = this.props;
      const title = (newEntry ? "Add" : "Edit") + " Report Alias";
      return /* @__PURE__ */ import_react94.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react94.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: newEntry ? addConfig : editConfig,
                isDisabled: alias === "" || hostname === ""
              },
              "Save"
            ),
            /* @__PURE__ */ import_react94.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Alias name for the instance" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Alias"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: alias,
            type: "text",
            id: "aliasName",
            "aria-describedby": "aliasName",
            name: "aliasName",
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "An instance hostname" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Hostname"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: hostname,
            type: "text",
            id: "aliasHostname",
            "aria-describedby": "aliasHostname",
            name: "aliasHostname",
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "An instance port" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Port"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          NumberInput,
          {
            value: port,
            min: 1,
            max: 65534,
            onMinus: () => {
              onMinusConfig("aliasPort");
            },
            onChange: (e) => {
              onConfigChange(e, "aliasPort", 1);
            },
            onPlus: () => {
              onPlusConfig("aliasPort");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))))))
      );
    }
  };
  var ReportLoginModal = class extends import_react94.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        processCredsInput,
        instanceName,
        disableBinddn,
        loginBinddn,
        loginBindpw
      } = this.props;
      const title = "Replication Login Credentials for " + instanceName;
      return /* @__PURE__ */ import_react94.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react94.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                isDisabled: loginBinddn === "" || loginBindpw === "",
                onClick: processCredsInput
              },
              "Confirm Credentials Input"
            ),
            /* @__PURE__ */ import_react94.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react94.default.createElement(TextContent, null, /* @__PURE__ */ import_react94.default.createElement(Text, { component: TextVariants.h5 }, "In order to get the replication agreement lag times and state, the authentication credentials to the remote replicas must be provided.")), /* @__PURE__ */ import_react94.default.createElement("hr", null), /* @__PURE__ */ import_react94.default.createElement(TextContent, null, /* @__PURE__ */ import_react94.default.createElement(Text, { component: TextVariants.h5 }, "Bind DN was acquired from ", /* @__PURE__ */ import_react94.default.createElement("b", null, "Replica Credentials"), " table. If you want to bind as another user, change or remove the Bind DN there.")), /* @__PURE__ */ import_react94.default.createElement(Grid, { className: "ds-margin-top-lg", title: "Bind DN for the instance" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: loginBinddn,
            type: "text",
            id: "loginBinddn",
            "aria-describedby": "loginBinddn",
            name: "loginBinddn",
            isDisabled: disableBinddn,
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react94.default.createElement(Grid, { title: "Password for the Bind DN" }, /* @__PURE__ */ import_react94.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password"), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react94.default.createElement(
          TextInput,
          {
            value: loginBindpw,
            type: "password",
            id: "loginBindpw",
            "aria-describedby": "loginBindpw",
            name: "loginBindpw",
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))))
      );
    }
  };
  var FullReportContent = class extends import_react94.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        oneTableReport: false,
        showDisabledAgreements: false
      };
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
    }
    handleSwitchChange(e) {
      if (typeof e === "boolean") {
        this.setState({
          oneTableReport: e
        });
      } else {
        this.setState({
          [e.target.id]: e.target.checked
        });
      }
    }
    render() {
      const {
        reportData,
        handleRefresh,
        reportRefreshing,
        reportLoading
      } = this.props;
      let suppliers = [];
      let supplierName;
      let supplierData;
      let resultGrids = [];
      let spinner = "";
      if (reportLoading) {
        spinner = /* @__PURE__ */ import_react94.default.createElement("div", { title: "Do the refresh every few seconds" }, reportRefreshing ? "Refreshing" : "Loading", " the report...", /* @__PURE__ */ import_react94.default.createElement(Spinner, { className: "ds-left-margin", size: "lg" }));
      }
      let reportHeader = /* @__PURE__ */ import_react94.default.createElement(TextContent, null, /* @__PURE__ */ import_react94.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h4 }, "There is no report, you must first generate the report in the ", /* @__PURE__ */ import_react94.default.createElement("b", null, "Prepare Report"), " tab."));
      if (reportData.length > 0) {
        reportHeader = /* @__PURE__ */ import_react94.default.createElement("div", null, /* @__PURE__ */ import_react94.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react94.default.createElement(Grid, null, /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react94.default.createElement(
          Checkbox,
          {
            title: "Display all agreements including the disabled ones and the ones we failed to connect to",
            isChecked: this.state.showDisabledAgreements,
            id: "showDisabledAgreements",
            onChange: (checked, e) => {
              this.handleSwitchChange(e);
            },
            label: "Show Disabled Agreements"
          }
        )), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react94.default.createElement(
          Button,
          {
            key: "refresh",
            variant: "secondary",
            onClick: handleRefresh,
            className: "ds-float-right"
          },
          "Refresh Report"
        )), /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react94.default.createElement(
          Checkbox,
          {
            isChecked: this.state.oneTableReport,
            onChange: (checked, e) => {
              this.handleSwitchChange(e);
            },
            id: "oneTableReport",
            title: "Show all data in one table (it makes it easier to check lag times)",
            label: "Table View"
          }
        )))));
      }
      if (this.state.oneTableReport) {
        for (const supplier of reportData) {
          for (const replica of supplier.data) {
            let idx = replica.agmts_status.length;
            const agmts = JSON.parse(JSON.stringify(replica.agmts_status));
            while (idx--) {
              if (!this.state.showDisabledAgreements && "replica-enabled" in agmts[idx] && agmts[idx]["replica-enabled"][0] === "off") {
                agmts.splice(idx, 1);
              }
            }
            resultGrids = resultGrids.concat(agmts);
          }
        }
        suppliers = [/* @__PURE__ */ import_react94.default.createElement("div", { key: "supp1" }, /* @__PURE__ */ import_react94.default.createElement(
          ReportSingleTable,
          {
            key: resultGrids,
            rows: resultGrids,
            viewAgmt: this.props.viewAgmt
          }
        ))];
      } else {
        for (const supplier of reportData) {
          const s_data = supplier.data;
          if (s_data.length === 1 && (s_data[0].replica_status.startsWith("Unavailable") || s_data[0].replica_status.startsWith("Unreachable"))) {
            supplierData = /* @__PURE__ */ import_react94.default.createElement("div", null, /* @__PURE__ */ import_react94.default.createElement(TextContent, null, /* @__PURE__ */ import_react94.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h4 }, /* @__PURE__ */ import_react94.default.createElement("b", null, "Can not get replication information from Replica:"), "\xA0\xA0", s_data[0].replica_status)));
          } else {
            const supData = JSON.parse(JSON.stringify(supplier.data));
            for (const replica of supData) {
              let idx = replica.agmts_status.length;
              while (idx--) {
                if (!this.state.showDisabledAgreements && "replica-enabled" in replica.agmts_status[idx] && replica.agmts_status[idx]["replica-enabled"][0] === "off") {
                  replica.agmts_status.splice(idx, 1);
                }
              }
            }
            supplierData = supData.map((replica) => /* @__PURE__ */ import_react94.default.createElement(
              Grid,
              {
                key: replica.replica_root + replica.replica_id,
                className: "ds-margin-top-lg"
              },
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 2 }, "Replica Root"),
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react94.default.createElement("b", null, replica.replica_root)),
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 2 }, "Replica ID"),
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react94.default.createElement("b", null, replica.replica_id)),
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 2 }, "Max CSN"),
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react94.default.createElement("b", null, replica.maxcsn)),
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 2 }, "Replica Status"),
              /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react94.default.createElement("b", null, replica.replica_status)),
              "agmts_status" in replica && replica.agmts_status.length > 0 && "agmt-name" in replica.agmts_status[0] ? /* @__PURE__ */ import_react94.default.createElement(
                ReportConsumersTable,
                {
                  key: replica.agmts_status,
                  rows: replica.agmts_status,
                  viewAgmt: this.props.viewAgmt
                }
              ) : /* @__PURE__ */ import_react94.default.createElement(TextContent, null, /* @__PURE__ */ import_react94.default.createElement(Text, { component: TextVariants.h4 }, /* @__PURE__ */ import_react94.default.createElement("b", null, /* @__PURE__ */ import_react94.default.createElement("i", null, "No Agreements Were Found"))))
            ));
          }
          supplierName = /* @__PURE__ */ import_react94.default.createElement("div", { className: "ds-margin-top-xlg", key: supplier.name }, /* @__PURE__ */ import_react94.default.createElement(TextContent, { title: "Supplier host:port (and alias if applicable)" }, /* @__PURE__ */ import_react94.default.createElement(Text, { component: TextVariants.h2 }, /* @__PURE__ */ import_react94.default.createElement(CopyIcon, null), "\xA0\xA0", /* @__PURE__ */ import_react94.default.createElement("b", null, "Supplier:"), "\xA0\xA0", supplier.name)), /* @__PURE__ */ import_react94.default.createElement("hr", null), supplierData);
          suppliers.push(supplierName);
        }
      }
      let report = suppliers.map((supplier) => /* @__PURE__ */ import_react94.default.createElement("div", { key: supplier.key }, supplier));
      if (reportLoading) {
        report = /* @__PURE__ */ import_react94.default.createElement(GridItem, { span: 12, className: "ds-center ds-margin-top" }, spinner);
      }
      return /* @__PURE__ */ import_react94.default.createElement("div", null, reportHeader, report, /* @__PURE__ */ import_react94.default.createElement("hr", null));
    }
  };
  AgmtDetailsModal.propTypes = {
    showModal: import_prop_types72.default.bool,
    closeHandler: import_prop_types72.default.func,
    agmt: import_prop_types72.default.object
  };
  AgmtDetailsModal.defaultProps = {
    showModal: false,
    agmt: {}
  };
  TaskLogModal.propTypes = {
    showModal: import_prop_types72.default.bool,
    closeHandler: import_prop_types72.default.func,
    logData: import_prop_types72.default.string
  };
  TaskLogModal.defaultProps = {
    showModal: false,
    agreement: ""
  };
  ConflictCompareModal.propTypes = {
    showModal: import_prop_types72.default.bool,
    conflictEntry: import_prop_types72.default.object,
    validEntry: import_prop_types72.default.object,
    closeHandler: import_prop_types72.default.func
  };
  ConflictCompareModal.defaultProps = {
    showModal: false,
    conflictEntry: { dn: "", attrs: [] },
    validEntry: {}
  };
  ReportCredentialsModal.propTypes = {
    showModal: import_prop_types72.default.bool,
    closeHandler: import_prop_types72.default.func,
    handleFieldChange: import_prop_types72.default.func,
    hostname: import_prop_types72.default.string,
    port: import_prop_types72.default.number,
    binddn: import_prop_types72.default.string,
    bindpw: import_prop_types72.default.string,
    pwInputInterractive: import_prop_types72.default.bool,
    newEntry: import_prop_types72.default.bool,
    addConfig: import_prop_types72.default.func,
    editConfig: import_prop_types72.default.func
  };
  ReportCredentialsModal.defaultProps = {
    showModal: false,
    hostname: "",
    port: 389,
    binddn: "",
    bindpw: "",
    pwInputInterractive: false,
    newEntry: false
  };
  ReportConnectionModal.propTypes = {
    showModal: import_prop_types72.default.bool,
    closeHandler: import_prop_types72.default.func,
    handleFieldChange: import_prop_types72.default.func,
    name: import_prop_types72.default.string,
    hostname: import_prop_types72.default.string,
    port: import_prop_types72.default.number,
    binddn: import_prop_types72.default.string,
    bindpw: import_prop_types72.default.string,
    pwInputInterractive: import_prop_types72.default.bool,
    addConn: import_prop_types72.default.func
  };
  ReportConnectionModal.defaultProps = {
    showModal: false,
    name: "",
    hostname: "",
    port: 636,
    binddn: "",
    bindpw: "",
    pwInputInterractive: false
  };
  ReportAliasesModal.propTypes = {
    showModal: import_prop_types72.default.bool,
    closeHandler: import_prop_types72.default.func,
    handleFieldChange: import_prop_types72.default.func,
    hostname: import_prop_types72.default.string,
    port: import_prop_types72.default.number,
    alias: import_prop_types72.default.string,
    newEntry: import_prop_types72.default.bool,
    addConfig: import_prop_types72.default.func,
    editConfig: import_prop_types72.default.func
  };
  ReportAliasesModal.defaultProps = {
    showModal: false,
    hostname: "",
    port: 389,
    alias: "",
    newEntry: false
  };
  ReportLoginModal.propTypes = {
    showModal: import_prop_types72.default.bool,
    closeHandler: import_prop_types72.default.func,
    handleChange: import_prop_types72.default.func,
    processCredsInput: import_prop_types72.default.func,
    instanceName: import_prop_types72.default.string,
    disableBinddn: import_prop_types72.default.bool,
    loginBinddn: import_prop_types72.default.string,
    loginBindpw: import_prop_types72.default.string
  };
  ReportLoginModal.defaultProps = {
    showModal: false,
    instanceName: "",
    disableBinddn: false,
    loginBinddn: "",
    loginBindpw: ""
  };
  FullReportContent.propTypes = {
    reportData: import_prop_types72.default.array,
    handleRefresh: import_prop_types72.default.func,
    reportRefreshing: import_prop_types72.default.bool
  };
  FullReportContent.defaultProps = {
    reportData: [],
    reportRefreshTimeout: 5,
    reportRefreshing: false
  };

  // src/lib/monitor/replMonitor.jsx
  var import_trash_alt_icon2 = __toESM(require_trash_alt_icon(), 1);
  var ReplMonitor = class extends import_react95.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeKey: 0,
        activeConfigKey: 0,
        logData: "",
        showBindModal: false,
        showLogModal: false,
        showFullReportModal: false,
        showReportLoginModal: false,
        showCredentialsModal: false,
        showAliasesModal: false,
        loadingDSRC: false,
        modalSpinning: false,
        modalChecked: false,
        lagAgmts: [],
        credsData: [],
        aliasData: [],
        reportData: [],
        agmt: "",
        binddn: "cn=Directory Manager",
        bindpw: "",
        errObj: {},
        aliasList: [],
        newEntry: false,
        initCreds: true,
        isExpanded: false,
        fullReportProcess: {},
        interruptLoginCredsInput: false,
        doFullReportCleanup: false,
        reportRefreshing: false,
        reportLoading: false,
        // dsrc
        credRows: [...this.props.credRows],
        aliasRows: [...this.props.aliasRows],
        showAddDSRCCredModal: false,
        showAddDSRCAliasModal: false,
        showConfirmDeleteDSRCCred: false,
        showConfirmDeleteDSRCAlias: false,
        showConfirmOverwriteDSRC: false,
        deleteConn: "",
        deleteAlias: "",
        credsInstanceName: "",
        disableBinddn: false,
        loginBinddn: "",
        loginBindpw: "",
        inputLoginData: false,
        credsHostname: "",
        credsPort: 389,
        credsBinddn: "cn=Directory Manager",
        credsBindpw: "",
        pwInputInterractive: false,
        aliasHostname: "",
        aliasPort: 389,
        aliasName: "",
        credentialsList: [],
        dynamicCredentialsList: [],
        credSortBy: {},
        aliasesList: [],
        aliasSortBy: {}
      };
      this.handleToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.maxValue = 65534;
      this.onFieldChange = this.onFieldChange.bind(this);
      this.handleNavConfigSelect = this.handleNavConfigSelect.bind(this);
      this.showAgmtModalRemote = this.showAgmtModalRemote.bind(this);
      this.closeAgmtModal = this.closeAgmtModal.bind(this);
      this.closeReportLoginModal = this.closeReportLoginModal.bind(this);
      this.addCreds = this.addCreds.bind(this);
      this.editCreds = this.editCreds.bind(this);
      this.removeCreds = this.removeCreds.bind(this);
      this.openCredsModal = this.openCredsModal.bind(this);
      this.handleShowAddCredsModal = this.handleShowAddCredsModal.bind(this);
      this.showEditCredsModal = this.showEditCredsModal.bind(this);
      this.closeCredsModal = this.closeCredsModal.bind(this);
      this.handleCredSort = this.handleCredSort.bind(this);
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.addAliases = this.addAliases.bind(this);
      this.editAliases = this.editAliases.bind(this);
      this.removeAliases = this.removeAliases.bind(this);
      this.openAliasesModal = this.openAliasesModal.bind(this);
      this.handleShowAddAliasesModal = this.handleShowAddAliasesModal.bind(this);
      this.showEditAliasesModal = this.showEditAliasesModal.bind(this);
      this.closeAliasesModal = this.closeAliasesModal.bind(this);
      this.handleAliasSort = this.handleAliasSort.bind(this);
      this.handleFullReport = this.handleFullReport.bind(this);
      this.processCredsInput = this.processCredsInput.bind(this);
      this.closeReportModal = this.closeReportModal.bind(this);
      this.refreshFullReport = this.refreshFullReport.bind(this);
      this.handleMinusConfig = this.handleMinusConfig.bind(this);
      this.handleConfigChange = this.handleConfigChange.bind(this);
      this.handlePlusConfig = this.handlePlusConfig.bind(this);
      this.loadDSRC = this.loadDSRC.bind(this);
      this.handleShowAddDSRCCred = this.handleShowAddDSRCCred.bind(this);
      this.handleShowAddDSRCAlias = this.handleShowAddDSRCAlias.bind(this);
      this.closeAddDSRCCred = this.closeAddDSRCCred.bind(this);
      this.closeAddDSRCAlias = this.closeAddDSRCAlias.bind(this);
      this.addDSRCCred = this.addDSRCCred.bind(this);
      this.addDSRCAlias = this.addDSRCAlias.bind(this);
      this.showConfirmDeleteDSRCCred = this.showConfirmDeleteDSRCCred.bind(this);
      this.showConfirmDeleteDSRCAlias = this.showConfirmDeleteDSRCAlias.bind(this);
      this.handleConfirmOverwriteDSRC = this.handleConfirmOverwriteDSRC.bind(this);
      this.closeConfirmDeleteDSRCCred = this.closeConfirmDeleteDSRCCred.bind(this);
      this.closeConfirmDeleteDSRCAlias = this.closeConfirmDeleteDSRCAlias.bind(this);
      this.closeConfirmOverwriteDSRC = this.closeConfirmOverwriteDSRC.bind(this);
      this.deleteDSRCCred = this.deleteDSRCCred.bind(this);
      this.deleteDSRCAlias = this.deleteDSRCAlias.bind(this);
      this.getAliasDeleteButton = this.getAliasDeleteButton.bind(this);
      this.getCredDeleteButton = this.getCredDeleteButton.bind(this);
      this.overwriteDSRC = this.overwriteDSRC.bind(this);
    }
    componentDidUpdate(prevProps, prevState) {
      if (!prevState.showReportLoginModal && this.state.showReportLoginModal) {
        if (this.timer)
          window.clearTimeout(this.timer);
        this.timer = window.setTimeout(() => {
          this.setState({
            showFullReportModal: false
          });
          this.timer = null;
        }, 300);
      }
      if (prevState.showReportLoginModal && !this.state.showReportLoginModal) {
        if (this.timer)
          window.clearTimeout(this.timer);
      }
    }
    componentWillUnmount() {
      if (this.timer)
        window.clearTimeout(this.timer);
    }
    loadDSRC() {
      this.setState({
        loadingDSRC: true
      });
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "display"];
      log_cmd("loadDSRC", "Check for replication monitor configurations in the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done((dsrc_content) => {
        const content = JSON.parse(dsrc_content);
        const credRows = [];
        const aliasRows = [];
        if ("repl-monitor-connections" in content) {
          const report_config = content["repl-monitor-connections"];
          for (const [connection, value] of Object.entries(report_config)) {
            const conn = connection + ":" + value;
            credRows.push(conn.split(":"));
          }
        }
        if ("repl-monitor-aliases" in content) {
          const report_config = content["repl-monitor-aliases"];
          for (const [alias_name, value] of Object.entries(report_config)) {
            const alias = alias_name + ":" + value;
            aliasRows.push(alias.split(":"));
          }
        }
        this.setState({
          credRows,
          aliasRows,
          loadingDSRC: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        console.log(`loadDSRC: Could not load .dsrc file: ${errMsg.desc}`);
        this.setState({
          loadingDSRC: false
        });
      });
    }
    componentDidMount() {
      if (this.state.initCreds) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "get",
          "nsslapd-port",
          "nsslapd-localhost",
          "nsslapd-rootdn"
        ];
        log_cmd("ReplMonitor", "add credentials during componentDidMount", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          const config2 = JSON.parse(content);
          this.setState((prevState) => ({
            credentialsList: [
              ...prevState.credentialsList,
              {
                connData: `${config2.attrs["nsslapd-localhost"][0]}:${config2.attrs["nsslapd-port"][0]}`,
                credsBinddn: config2.attrs["nsslapd-rootdn"][0],
                credsBindpw: "",
                pwInputInterractive: true
              }
            ],
            credRows: [...this.props.credRows],
            aliasRows: [...this.props.aliasRows]
          }));
          if ("replAgmts" in this.props.data) {
            for (const agmt of this.props.data.replAgmts) {
              this.setState((prevState) => ({
                credentialsList: [
                  ...prevState.credentialsList,
                  {
                    connData: `${agmt.replica}`,
                    credsBinddn: config2.attrs["nsslapd-rootdn"][0],
                    credsBindpw: "",
                    pwInputInterractive: true
                  }
                ],
                initCreds: false
              }));
            }
          }
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Failed to get config nsslapd-port, nsslapd-localhost and nasslapd-rootdn: ${errMsg.desc}`
          );
        });
      }
      this.props.enableTree();
    }
    handleMinusConfig(id) {
      this.setState({
        [id]: Number(this.state[id]) - 1
      });
    }
    handleConfigChange(event, id, min3) {
      const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
      this.setState({
        [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
      });
    }
    handlePlusConfig(id) {
      this.setState({
        [id]: Number(this.state[id]) + 1
      });
    }
    handleChange(value, evt) {
      if (evt.target.type === "number") {
        if (value) {
          value = parseInt(value);
        } else {
          value = 1;
        }
      }
      this.setState({
        [evt.target.id]: value
      });
    }
    onFieldChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      if (e.target.type === "number") {
        if (e.target.value) {
          value = parseInt(e.target.value);
        } else {
          value = 1;
        }
      }
      this.setState({
        [e.target.id]: value
      });
    }
    handleNavSelect(event, tabIndex) {
      this.setState({
        activeKey: tabIndex
      });
    }
    handleNavConfigSelect(event, tabIndex) {
      this.setState({
        activeConfigKey: tabIndex
      });
    }
    getCredDeleteButton(name2) {
      return /* @__PURE__ */ import_react95.default.createElement("a", null, /* @__PURE__ */ import_react95.default.createElement(
        import_trash_alt_icon2.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.showConfirmDeleteDSRCCred(name2);
          },
          title: "Delete replica connection"
        }
      ));
    }
    getAliasDeleteButton(name2) {
      return /* @__PURE__ */ import_react95.default.createElement("a", null, /* @__PURE__ */ import_react95.default.createElement(
        import_trash_alt_icon2.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.showConfirmDeleteDSRCAlias(name2);
          },
          title: "Delete replica alias"
        }
      ));
    }
    closeLogModal() {
      this.setState({
        showLogModal: false
      });
    }
    showAgmtModalRemote(supplierName, replicaName, agmtName) {
      if (!agmtName) {
        this.props.addNotification(
          "error",
          `The agreement doesn't exist!`
        );
      } else {
        for (const supplier of this.state.reportData) {
          if (supplier.name === supplierName) {
            for (const replica of supplier.data) {
              if (`${replica.replica_root}:${replica.replica_id}` === replicaName) {
                for (const agmt of replica.agmts_status) {
                  if (agmt["agmt-name"][0] === agmtName) {
                    this.setState({
                      showAgmtModal: true,
                      agmt
                    });
                    break;
                  }
                }
              }
            }
          }
        }
      }
    }
    closeAgmtModal() {
      this.setState({
        showAgmtModal: false
      });
    }
    changeCreds(action) {
      const {
        credentialsList,
        oldCredsHostname,
        oldCredsPort,
        credsHostname,
        credsPort,
        credsBinddn,
        credsBindpw,
        pwInputInterractive
      } = this.state;
      if (credsHostname === "" || credsPort === "" || credsBinddn === "") {
        this.props.addNotification("warning", "Host, Port, and Bind DN are required.");
      } else if (credsBindpw === "" && !pwInputInterractive) {
        this.props.addNotification("warning", "Password field can't be empty, if Interractive Input is not selected");
      } else {
        let credsExist = false;
        if (action === "add" && credentialsList.some((row) => row.connData === `${credsHostname}:${credsPort}`)) {
          credsExist = true;
        }
        if (action === "edit" && credentialsList.some((row) => row.connData === `${oldCredsHostname}:${oldCredsPort}`)) {
          this.setState({
            credentialsList: credentialsList.filter(
              (row) => row.connData !== `${oldCredsHostname}:${oldCredsPort}`
            )
          });
        }
        if (!credsExist) {
          this.setState((prevState) => ({
            credentialsList: [
              ...prevState.credentialsList,
              {
                connData: `${credsHostname}:${credsPort}`,
                credsBinddn,
                credsBindpw,
                pwInputInterractive
              }
            ]
          }));
        } else {
          this.props.addNotification(
            "error",
            `Credentials "${credsHostname}:${credsPort}" already exists`
          );
        }
        this.closeCredsModal();
      }
    }
    addCreds() {
      this.changeCreds("add");
    }
    editCreds() {
      this.changeCreds("edit");
    }
    removeCreds(connData) {
      this.setState({
        credentialsList: this.state.credentialsList.filter(
          (row) => row.connData !== connData
        )
      });
    }
    openCredsModal() {
      this.setState({
        showCredentialsModal: true
      });
    }
    handleShowAddCredsModal() {
      this.openCredsModal();
      this.setState({
        newEntry: true,
        oldCredsHostname: "",
        oldCredsPort: "",
        credsHostname: "",
        credsPort: 389,
        credsBinddn: "cn=Directory Manager",
        credsBindpw: "",
        pwInputInterractive: false
      });
    }
    showEditCredsModal(connData, bindDN, bindPW, pwInteractive) {
      this.openCredsModal();
      this.setState({
        newEntry: false,
        oldCredsHostname: connData.split(":")[0],
        oldCredsPort: connData.split(":")[1],
        credsHostname: connData.split(":")[0],
        credsPort: parseInt(connData.split(":")[1]),
        credsBinddn: bindDN,
        credsBindpw: bindPW,
        pwInputInterractive: pwInteractive
      });
    }
    closeCredsModal() {
      this.setState({
        showCredentialsModal: false
      });
    }
    handleCredSort(_event, index, direction) {
      const sorted_creds = [];
      const rows = [];
      for (const row of this.state.credentialsList) {
        sorted_creds.push({
          1: row.connData,
          2: row.credsBinddn,
          3: row.credsBindpw,
          4: row.pwInputInterractive
        });
      }
      sorted_creds.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_creds.reverse();
      }
      for (const cred of sorted_creds) {
        rows.push({
          connData: cred["1"],
          credsBinddn: cred["2"],
          credsBindpw: cred["3"],
          pwInputInterractive: cred["4"]
        });
      }
      this.setState({
        credSortBy: {
          index,
          direction
        },
        credentialsList: rows
      });
    }
    handleAliasSort(_event, index, direction) {
      const sorted_alias = [];
      const rows = [];
      for (const row of this.state.aliasesList) {
        sorted_alias.push({
          1: row[0],
          2: row[1]
        });
      }
      sorted_alias.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_alias.reverse();
      }
      for (const alias of sorted_alias) {
        rows.push([alias["1"], alias["2"]]);
      }
      this.setState({
        aliasSortBy: {
          index,
          direction
        },
        aliasesList: rows
      });
    }
    changeAlias(action) {
      const { aliasesList, aliasHostname, aliasPort, oldAliasName, aliasName } = this.state;
      let new_aliases = [...aliasesList];
      if (aliasPort === "" || aliasHostname === "" || aliasName === "") {
        this.props.addNotification("warning", "Host, Port, and Alias are required.");
      } else {
        let aliasExists = false;
        if (action === "add" && aliasesList.some((row) => row[0] === aliasName)) {
          aliasExists = true;
        }
        if (action === "edit" && aliasesList.some((row) => row[0] === oldAliasName)) {
          new_aliases = aliasesList.filter((row) => row[0] !== oldAliasName);
        }
        if (!aliasExists) {
          const connData = `${aliasHostname}:${aliasPort}`;
          new_aliases.push([aliasName, connData]);
          this.setState({
            aliasesList: new_aliases
          });
        } else {
          this.props.addNotification("error", `Alias "${aliasName}" already exists`);
        }
        this.closeAliasesModal();
      }
    }
    addAliases() {
      this.changeAlias("add");
    }
    editAliases() {
      this.changeAlias("edit");
    }
    removeAliases(alias) {
      this.setState({
        aliasesList: this.state.aliasesList.filter((row) => row[0] !== alias)
      });
    }
    openAliasesModal() {
      this.setState({
        showAliasesModal: true
      });
    }
    handleShowAddAliasesModal() {
      this.openAliasesModal();
      this.setState({
        newEntry: true,
        aliasHostname: "",
        aliasPort: 389,
        oldAliasName: "",
        aliasName: ""
      });
    }
    showEditAliasesModal(alias, connData) {
      this.openAliasesModal();
      this.setState({
        newEntry: false,
        aliasHostname: connData.split(":")[0],
        aliasPort: parseInt(connData.split(":")[1]),
        oldAliasName: alias,
        aliasName: alias
      });
    }
    closeAliasesModal() {
      this.setState({
        showAliasesModal: false
      });
    }
    handleConfirmOverwriteDSRC() {
      this.setState({
        showConfirmOverwriteDSRC: true
      });
    }
    closeConfirmOverwriteDSRC() {
      this.setState({
        showConfirmOverwriteDSRC: false
      });
    }
    overwriteDSRC() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "display"];
      log_cmd("overwriteDSRC", "gather conns and aliases from .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done((dsrc_content) => {
        const content = JSON.parse(dsrc_content);
        const dsrcCreds = [];
        const dsrcAliases = [];
        let deleteCmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon"];
        const addCmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon"];
        if ("repl-monitor-connections" in content) {
          const report_config = content["repl-monitor-connections"];
          for (const [cred] of Object.entries(report_config)) {
            dsrcCreds.push(cred);
          }
        }
        if ("repl-monitor-aliases" in content) {
          const report_config = content["repl-monitor-aliases"];
          for (const [alias] of Object.entries(report_config)) {
            dsrcAliases.push(alias);
          }
        }
        if (this.state.credentialsList.length > 0 && dsrcCreds.length > 0) {
          deleteCmd.push("--del-conn");
          for (const repl of dsrcCreds) {
            deleteCmd.push(repl);
          }
        }
        if (this.state.aliasesList.length > 0 && dsrcAliases.length > 0) {
          deleteCmd.push("--del-alias");
          for (const alias of dsrcAliases) {
            deleteCmd.push(alias);
          }
        }
        if (deleteCmd.length === 5) {
          deleteCmd = "echo";
        }
        if (this.state.credentialsList.length > 0) {
          addCmd.push("--add-conn");
          for (const rowIdx in this.state.credentialsList) {
            const row = this.state.credentialsList[rowIdx];
            let password = row.credsBindpw;
            if (row.pwInputInterractive) {
              password = "*";
            }
            const idx = parseInt(rowIdx) + 1;
            const cred = `replica_${idx}:${row.connData}:${row.credsBinddn}:${password}`;
            addCmd.push(cred);
          }
        }
        if (this.state.aliasesList.length > 0) {
          addCmd.push("--add-alias");
          for (const row of this.state.aliasesList) {
            const alias = `${row[0]}:${row[1]}`;
            addCmd.push(alias);
          }
        }
        log_cmd("overwriteDSRC", "delete conns and aliases in the .dsrc file", deleteCmd);
        cockpit_default.spawn(deleteCmd, { superuser: true, err: "message" }).done(() => {
          log_cmd("overwriteDSRC", "add conns and aliases in the .dsrc file", addCmd);
          cockpit_default.spawn(addCmd, { superuser: true, err: "message" }).done(() => {
            this.setState({
              showConfirmOverwriteDSRC: false
            }, this.loadDSRC);
            this.props.addNotification(
              "success",
              "Successfully saved monitor configuration to the .dsrc file"
            );
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.setState({
              showConfirmOverwriteDSRC: false
            });
            this.props.addNotification(
              "error",
              `Failed to delete from .dsrc file: ${errMsg.desc}`
            );
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Failed to add to .dsrc content: ${errMsg.desc}`
          );
          this.setState({
            showConfirmOverwriteDSRC: false
          });
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to get .dsrc content: ${errMsg.desc}`
        );
        this.setState({
          showConfirmOverwriteDSRC: false
        });
      });
    }
    refreshFullReport() {
      this.handleFullReport();
      this.setState({
        reportRefreshing: true
      });
    }
    handleFullReport(dsrc) {
      this.setState({
        reportLoading: true,
        activeKey: 2
      });
      let password = "";
      const credentials = [];
      const printCredentials = [];
      const aliases = [];
      if (dsrc) {
        for (const row of this.state.credRows) {
          credentials.push(`${row[1]}:${row[2]}:${row[3]}:${row[4]}`);
          printCredentials.push(`${row[1]}:${row[2]}:${row[3]}:********`);
        }
        for (const row of this.state.aliasRows) {
          aliases.push(`${row[0]}=${row[1]}:${row[2]}`);
        }
      } else {
        for (const row of this.state.credentialsList) {
          if (row.pwInputInterractive) {
            password = "*";
          } else {
            password = `${row.credsBindpw}`;
          }
          credentials.push(`${row.connData}:${row.credsBinddn}:${password}`);
          printCredentials.push(`${row.connData}:${row.credsBinddn}:********`);
        }
        for (const row of this.state.aliasesList) {
          aliases.push(`${row[0]}=${row[1]}`);
        }
      }
      let buffer = "";
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "monitor"
      ];
      if (aliases.length !== 0) {
        cmd = [...cmd, "-a"];
        for (const value of aliases) {
          cmd = [...cmd, value];
        }
      }
      let printCmd = cmd;
      if (credentials.length !== 0) {
        cmd = [...cmd, "-c"];
        for (const value of credentials) {
          cmd = [...cmd, value];
        }
        printCmd = [...printCmd, "-c"];
        for (const value of printCredentials) {
          printCmd = [...printCmd, value];
        }
      }
      log_cmd("handleFullReport", "Get the report for the current instance topology", printCmd);
      const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message", directory: self.path });
      this.setState({
        fullReportProcess: proc
      });
      proc.done((data) => {
        const report = JSON.parse(buffer);
        let agmts_reparsed = [];
        let replica_reparsed = [];
        const supplier_reparsed = [];
        for (const supplier of report.items) {
          replica_reparsed = [];
          for (const replica of supplier.data) {
            agmts_reparsed = [];
            let agmts_done = false;
            if ("agmts_status" in replica) {
              for (const agmt of replica.agmts_status) {
                agmt.supplierName = [supplier.name];
                agmt.replicaName = [`${replica.replica_root}:${replica.replica_id}`];
                agmt.replicaStatus = [`${replica.replica_status}`];
                agmt.rowKey = [`${supplier.name}:${replica.replica_root}:${replica.replica_id}:${agmt["agmt-name"]}`];
                agmts_reparsed.push(agmt);
                agmts_done = true;
              }
            }
            if (!agmts_done) {
              const agmt_empty = {};
              agmt_empty.supplierName = [supplier.name];
              if (replica.replica_root || replica.replica_id) {
                agmt_empty.replicaName = [`${replica.replica_root || ""}:${replica.replica_id || ""}`];
              } else {
                agmt_empty.replicaName = [""];
              }
              agmt_empty.replicaStatus = [`${replica.replica_status}`];
              agmt_empty.rowKey = [`${supplier.name}:${replica.replica_root}:${replica.replica_id}:None`];
              agmts_reparsed.push(agmt_empty);
            }
            replica_reparsed.push({ ...replica, agmts_status: agmts_reparsed });
          }
          supplier_reparsed.push({ ...supplier, data: replica_reparsed });
        }
        const report_reparsed = { ...report, items: supplier_reparsed };
        this.setState({
          reportData: report_reparsed.items,
          showFullReportModal: true,
          reportLoading: false,
          doFullReportCleanup: true
        });
      }).fail((_) => {
        const errMsg = JSON.parse(buffer);
        this.props.addNotification(
          "error",
          `Sync report has failed - ${errMsg.desc}`
        );
        this.setState({
          dynamicCredentialsList: [],
          reportLoading: false,
          doFullReportCleanup: true,
          activeReportKey: 1
        });
      }).stream((data) => {
        buffer += data;
        const lines = buffer.split("\n");
        const last_line = lines[lines.length - 1];
        let found_creds = false;
        if (last_line.startsWith("Enter a bind DN") && last_line.endsWith(": ")) {
          buffer = "";
          this.setState({
            credsInstanceName: data.split("a bind DN for ")[1].split(": ")[0]
          });
          for (const creds of this.state.dynamicCredentialsList) {
            if (creds.credsInstanceName === this.state.credsInstanceName) {
              found_creds = true;
              proc.input(`${creds.binddn}
`, true);
            }
          }
          if (!found_creds) {
            this.setState({
              showReportLoginModal: true,
              binddnRequired: true,
              disableBinddn: false,
              credsInstanceName: this.state.credsInstanceName,
              loginBinddn: "",
              loginBindpw: ""
            });
          }
        } else if ((last_line.startsWith("Enter a password") || last_line.startsWith("File ")) && last_line.endsWith(": ")) {
          buffer = "";
          this.setState({
            credsInstanceName: data.split(" on ")[1].split(": ")[0]
          });
          for (const creds of this.state.dynamicCredentialsList) {
            if (creds.credsInstanceName === this.state.credsInstanceName) {
              found_creds = true;
              proc.input(`${creds.bindpw}
`, true);
              this.setState({
                credsInstanceName: ""
              });
            }
          }
          if (!found_creds) {
            this.setState({
              showReportLoginModal: true,
              bindpwRequired: true,
              credsInstanceName: this.state.credsInstanceName,
              disableBinddn: true,
              loginBinddn: data.split("nter a password for ")[1].split(" on")[0],
              loginBindpw: ""
            });
          }
        }
      });
    }
    closeReportLoginModal() {
      this.setState({
        showReportLoginModal: false,
        reportLoading: false,
        activeReportKey: 1
      });
    }
    processCredsInput() {
      const {
        loginBinddn,
        loginBindpw,
        credsInstanceName,
        fullReportProcess
      } = this.state;
      if (loginBinddn === "" || loginBindpw === "") {
        this.props.addNotification("warning", "Bind DN and password are required.");
      } else {
        this.setState({
          showReportLoginModal: false,
          reportLoading: false
        });
        this.setState((prevState) => ({
          dynamicCredentialsList: [
            ...prevState.dynamicCredentialsList,
            {
              binddn: loginBinddn,
              bindpw: loginBindpw,
              credsInstanceName
            }
          ]
        }));
        if (this.state.binddnRequired) {
          fullReportProcess.input(`${loginBinddn}
`, true);
          this.setState({
            binddnRequired: false
          });
        } else if (this.state.bindpwRequired) {
          fullReportProcess.input(loginBindpw + "\n", true);
          this.setState({
            bindpwRequired: false
          });
        }
      }
    }
    closeReportModal() {
      this.setState({
        showFullReportModal: false,
        reportLoading: false
      });
    }
    // dsrc
    handleShowAddDSRCCred() {
      this.setState({
        showAddDSRCCredModal: true,
        modalChecked: false,
        modalSpinning: false,
        connName: "",
        connHostname: "",
        connPort: 636,
        connBindDN: "",
        credsCred: ""
      });
    }
    closeAddDSRCCred() {
      this.setState({
        showAddDSRCCredModal: false
      });
    }
    handleShowAddDSRCAlias() {
      this.setState({
        showAddDSRCAliasModal: true,
        modalChecked: false,
        modalSpinning: false,
        newEntry: true,
        aliasName: "",
        aliasPort: 636,
        aliasHostname: ""
      });
    }
    closeAddDSRCAlias() {
      this.setState({
        showAddDSRCAliasModal: false
      });
    }
    showConfirmDeleteDSRCCred(name2) {
      this.setState({
        showConfirmDeleteDSRCCred: true,
        connName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteDSRCCred() {
      this.setState({
        showConfirmDeleteDSRCCred: false
      });
    }
    showConfirmDeleteDSRCAlias(name2) {
      this.setState({
        showConfirmDeleteDSRCAlias: true,
        aliasName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteDSRCAlias() {
      this.setState({
        showConfirmDeleteDSRCAlias: false
      });
    }
    deleteDSRCCred() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--del-conn=" + this.state.connName];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("deleteDSRCCred", "Delete a replica connection from the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.loadDSRC();
        this.setState({
          showConfirmDeleteDSRCCred: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to update .dsrc information: ${errMsg.desc}`
        );
        this.loadDSRC();
      });
    }
    deleteDSRCAlias() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--del-alias=" + this.state.aliasName];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("deleteDSRCCred", "Delete a replication monitor alias from the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.loadDSRC();
        this.setState({
          showConfirmDeleteDSRCAlias: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to update .dsrc information: ${errMsg.desc}`
        );
        this.loadDSRC();
      });
    }
    addDSRCCred() {
      const {
        connName,
        connHostname,
        connPort,
        connBindDN,
        connCred
      } = this.state;
      const conn = connName + ":" + connHostname + ":" + connPort + ":" + connBindDN + ":" + connCred;
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--add-conn=" + conn];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("addDSRCCred", "Add a replica connection to the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.setState({
          showAddDSRCCredModal: false
        });
        this.props.addNotification(
          "success",
          "Successfully added connection to .dsrc config file"
        );
        this.loadDSRC();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to update .dsrc information: ${errMsg.desc}`
        );
        this.loadDSRC();
      });
    }
    addDSRCAlias() {
      const alias = this.state.aliasName + ":" + this.state.aliasHostname + ":" + this.state.aliasPort;
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--add-alias=" + alias];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("addDSRCAlias", "Add an alias to the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.setState({
          showAddDSRCAliasModal: false
        });
        this.props.addNotification(
          "success",
          "Successfully added alias to .dsrc config file"
        );
        this.loadDSRC();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to update .dsrc information: ${errMsg.desc}`
        );
        this.loadDSRC();
      });
    }
    render() {
      const reportData = this.state.reportData;
      const credentialsList = this.state.credentialsList;
      const aliasesList = this.state.aliasesList;
      const fullReportModal = "";
      let reportLoginModal = "";
      let reportCredentialsModal = "";
      let reportAliasesModal = "";
      let agmtDetailModal = "";
      const winsyncAgmtDetailModal = "";
      if (this.state.showReportLoginModal) {
        reportLoginModal = /* @__PURE__ */ import_react95.default.createElement(
          ReportLoginModal,
          {
            showModal: this.state.showReportLoginModal,
            closeHandler: this.closeReportLoginModal,
            handleChange: this.onFieldChange,
            processCredsInput: this.processCredsInput,
            instanceName: this.state.credsInstanceName,
            disableBinddn: this.state.disableBinddn,
            loginBinddn: this.state.loginBinddn,
            loginBindpw: this.state.loginBindpw
          }
        );
      }
      if (this.state.showCredentialsModal) {
        reportCredentialsModal = /* @__PURE__ */ import_react95.default.createElement(
          ReportCredentialsModal,
          {
            showModal: this.state.showCredentialsModal,
            closeHandler: this.closeCredsModal,
            handleFieldChange: this.onFieldChange,
            onMinusConfig: this.handleMinusConfig,
            onConfigChange: this.handleConfigChange,
            onPlusConfig: this.handlePlusConfig,
            newEntry: this.state.newEntry,
            hostname: this.state.credsHostname,
            port: this.state.credsPort,
            binddn: this.state.credsBinddn,
            bindpw: this.state.credsBindpw,
            pwInputInterractive: this.state.pwInputInterractive,
            addConfig: this.addCreds,
            editConfig: this.editCreds
          }
        );
      }
      if (this.state.showAliasesModal) {
        reportAliasesModal = /* @__PURE__ */ import_react95.default.createElement(
          ReportAliasesModal,
          {
            showModal: this.state.showAliasesModal,
            closeHandler: this.closeAliasesModal,
            handleFieldChange: this.onFieldChange,
            onMinusConfig: this.handleMinusConfig,
            onConfigChange: this.handleConfigChange,
            onPlusConfig: this.handlePlusConfig,
            newEntry: this.state.newEntry,
            hostname: this.state.aliasHostname,
            port: this.state.aliasPort,
            alias: this.state.aliasName,
            addConfig: this.addAliases,
            editConfig: this.editAliases
          }
        );
      }
      if (this.state.showAgmtModal) {
        agmtDetailModal = /* @__PURE__ */ import_react95.default.createElement(
          AgmtDetailsModal,
          {
            showModal: this.state.showAgmtModal,
            closeHandler: this.closeAgmtModal,
            agmt: this.state.agmt
          }
        );
      }
      let reportBtnName = "Generate Report";
      const extraPrimaryProps = {};
      if (this.state.reportLoading) {
        reportBtnName = "Generating ...";
        extraPrimaryProps.spinnerAriaValueText = "Generating";
      }
      let reportContent = /* @__PURE__ */ import_react95.default.createElement("div", { className: "ds-margin-top-lg ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react95.default.createElement(Tabs, { isFilled: true, activeKey: this.state.activeKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react95.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react95.default.createElement(TabTitleText, null, "Saved Report Configuration") }, /* @__PURE__ */ import_react95.default.createElement(Tabs, { className: "ds-margin-top-lg", isBox: true, activeKey: this.state.activeConfigKey, onSelect: this.handleNavConfigSelect }, /* @__PURE__ */ import_react95.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react95.default.createElement(TabTitleText, null, "Replica Credentials") }, /* @__PURE__ */ import_react95.default.createElement(
        ReplDSRCTable,
        {
          key: this.state.credRows,
          rows: this.state.credRows,
          getDeleteButton: this.getCredDeleteButton
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          variant: "secondary",
          onClick: this.handleShowAddDSRCCred,
          title: "Add a replica credential to the .dsrc file"
        },
        "Add Connection"
      )), /* @__PURE__ */ import_react95.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react95.default.createElement(TabTitleText, null, "Replica Naming Aliases") }, /* @__PURE__ */ import_react95.default.createElement(
        ReplDSRCAliasTable,
        {
          key: this.state.aliasRows,
          rows: this.state.aliasRows,
          getDeleteButton: this.getAliasDeleteButton
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          variant: "secondary",
          onClick: this.handleShowAddDSRCAlias,
          title: "Add a replica alias to the .dsrc file"
        },
        "Add Alias"
      ))), /* @__PURE__ */ import_react95.default.createElement("hr", null), this.state.credRows.length > 0 && /* @__PURE__ */ import_react95.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: () => {
            this.handleFullReport(1);
          },
          title: "Use the specified credentials and display full topology report",
          isLoading: this.state.reportLoading,
          isDisabled: this.state.reportLoading,
          spinnerAriaValueText: this.state.reportLoading ? "Generating" : void 0,
          ...extraPrimaryProps
        },
        reportBtnName
      )), /* @__PURE__ */ import_react95.default.createElement(Tab, { eventKey: 1, id: "prepare-new-report", title: /* @__PURE__ */ import_react95.default.createElement(TabTitleText, null, "Prepare New Report") }, /* @__PURE__ */ import_react95.default.createElement(
        ExpandableSection,
        {
          toggleText: this.state.isExpanded ? "Hide Help" : "Show Help",
          onToggle: this.handleToggle,
          isExpanded: this.state.isExpanded,
          className: "ds-margin-top-lg ds-left-margin"
        },
        /* @__PURE__ */ import_react95.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react95.default.createElement(TextContent, null, /* @__PURE__ */ import_react95.default.createElement(Text, { component: TextVariants.h3 }, "How To Use Replication Sync Report")), /* @__PURE__ */ import_react95.default.createElement("ol", { className: "ds-left-indent-md ds-margin-top" }, /* @__PURE__ */ import_react95.default.createElement("li", null, "Update The ", /* @__PURE__ */ import_react95.default.createElement("b", null, "Replication Credentials"), /* @__PURE__ */ import_react95.default.createElement("ul", null, /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 Initially, the table is populated with the local instance's replication agreements, which includes the local instance."), /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 Add the remaining replica server credentials from your replication topology."), /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 It is advised to use an ", /* @__PURE__ */ import_react95.default.createElement("b", null, "Interactive Input"), " option for the password because it's more secure."))), /* @__PURE__ */ import_react95.default.createElement("li", null, "Add ", /* @__PURE__ */ import_react95.default.createElement("b", null, "Replica Aliases"), " (if desired)", /* @__PURE__ */ import_react95.default.createElement("ul", null, /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 Adding aliases will make the report more readable."), /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 Each Replica can have one alias. For example, you can give names like this:", /* @__PURE__ */ import_react95.default.createElement("b", null, " Alias"), "=Main Supplier, ", /* @__PURE__ */ import_react95.default.createElement("b", null, "Hostname"), "=192.168.122.01, ", /* @__PURE__ */ import_react95.default.createElement("b", null, "Port"), "=38901"), /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 In the report result, the report will have an entry like this:", /* @__PURE__ */ import_react95.default.createElement("b", null, " Supplier: Main Supplier (192.168.122.01:38901)"), "."))), /* @__PURE__ */ import_react95.default.createElement("li", null, "Press ", /* @__PURE__ */ import_react95.default.createElement("b", null, "Generate Report"), " Button", /* @__PURE__ */ import_react95.default.createElement("ul", null, /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 It will initiate the report creation."), /* @__PURE__ */ import_react95.default.createElement("li", null, "\u2022 You may be asked for the credentials while the process is running through the agreements.")))), /* @__PURE__ */ import_react95.default.createElement("p", null))
      ), /* @__PURE__ */ import_react95.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          variant: "primary",
          onClick: this.handleFullReport,
          title: "Use the specified credentials and display full topology report",
          isLoading: this.state.reportLoading,
          isDisabled: this.state.reportLoading,
          spinnerAriaValueText: this.state.reportLoading ? "Generating" : void 0,
          ...extraPrimaryProps
        },
        reportBtnName
      ), /* @__PURE__ */ import_react95.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg ds-left-margin",
          variant: "secondary",
          onClick: this.handleConfirmOverwriteDSRC,
          title: "Save the report configuration in the .dsrc file for future use."
        },
        "Save Report Configuration"
      ), /* @__PURE__ */ import_react95.default.createElement("hr", null), /* @__PURE__ */ import_react95.default.createElement(
        ReportCredentialsTable,
        {
          rows: credentialsList,
          deleteConfig: this.removeCreds,
          editConfig: this.showEditCredsModal,
          sortBy: this.state.credSortBy,
          onSort: this.handleCredSort
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        Button,
        {
          className: "ds-margin-top",
          variant: "secondary",
          onClick: this.handleShowAddCredsModal
        },
        "Add Credentials"
      ), /* @__PURE__ */ import_react95.default.createElement(
        ReportAliasesTable,
        {
          rows: aliasesList,
          deleteConfig: this.removeAliases,
          editConfig: this.showEditAliasesModal,
          sortBy: this.state.aliasSortBy,
          onSort: this.handleAliasSort
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        Button,
        {
          className: "ds-margin-top",
          variant: "secondary",
          onClick: this.handleShowAddAliasesModal
        },
        "Add Alias"
      )), reportData.length > 0 && /* @__PURE__ */ import_react95.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react95.default.createElement(TabTitleText, null, "Report Result") }, /* @__PURE__ */ import_react95.default.createElement("div", { className: "ds-indent ds-margin-top-lg" }, /* @__PURE__ */ import_react95.default.createElement(
        FullReportContent,
        {
          reportData,
          viewAgmt: this.showAgmtModalRemote,
          handleRefresh: this.refreshFullReport,
          reportRefreshing: this.state.reportRefreshing,
          reportLoading: this.state.reportLoading
        }
      )))));
      if (this.state.loadingDSRC) {
        reportContent = /* @__PURE__ */ import_react95.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react95.default.createElement(TextContent, null, /* @__PURE__ */ import_react95.default.createElement(Text, { component: TextVariants.h3 }, "Loading Replication DSRC Information ...")), /* @__PURE__ */ import_react95.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      }
      let overwriteWarning = "Only one monitor configuraton can be saved in the server's '~/.dsrc' file.  There is already an existing monitor configuration, and if you proceed it will be completely overwritten with the new configuraton.";
      if (this.state.credRows.length === 0 && this.state.aliasRows.length === 0) {
        overwriteWarning = "This will save the current credentials and aliases to the server's '~/.dsrc' file so it can be reused in the future.";
      }
      return /* @__PURE__ */ import_react95.default.createElement("div", { id: "repl-monitor-page", className: "ds-tab-table" }, /* @__PURE__ */ import_react95.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react95.default.createElement(TextContent, null, /* @__PURE__ */ import_react95.default.createElement(Text, { component: TextVariants.h3 }, "Synchronization Report", /* @__PURE__ */ import_react95.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh replication monitor",
          onClick: this.props.handleReload
        }
      )))), reportContent, fullReportModal, reportLoginModal, reportCredentialsModal, reportAliasesModal, agmtDetailModal, winsyncAgmtDetailModal, /* @__PURE__ */ import_react95.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteDSRCCred,
          closeHandler: this.closeConfirmDeleteDSRCCred,
          handleChange: this.onFieldChange,
          actionHandler: this.deleteDSRCCred,
          spinning: this.state.modalSpinning,
          item: this.state.connName,
          checked: this.state.modalChecked,
          mTitle: "Delete Replica Connection",
          mMsg: "Are you really sure you want to delete this connection from the '~/.dsrc' file?",
          mSpinningMsg: "Deleting Connection ...",
          mBtnName: "Delete Connection"
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteDSRCAlias,
          closeHandler: this.closeConfirmDeleteDSRCAlias,
          handleChange: this.onFieldChange,
          actionHandler: this.deleteDSRCAlias,
          spinning: this.state.modalSpinning,
          item: this.state.aliasName,
          checked: this.state.modalChecked,
          mTitle: "Delete Replica Alias",
          mMsg: "Are you really sure you want to delete this alias from the '~/.dsrc' file?",
          mSpinningMsg: "Deleting Alias ...",
          mBtnName: "Delete Alias"
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmOverwriteDSRC,
          closeHandler: this.closeConfirmOverwriteDSRC,
          handleChange: this.onFieldChange,
          actionHandler: this.overwriteDSRC,
          spinning: this.state.modalSpinning,
          item: "Are you sure you want to proceed?",
          checked: this.state.modalChecked,
          mTitle: "Overwrite Monitor Configuration",
          mMsg: overwriteWarning,
          mSpinningMsg: "Writing DSRC ...",
          mBtnName: "Write DSRC"
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        ReportAliasesModal,
        {
          showModal: this.state.showAddDSRCAliasModal,
          closeHandler: this.closeAddDSRCAlias,
          handleFieldChange: this.onFieldChange,
          onMinusConfig: this.handleMinusConfig,
          onConfigChange: this.handleConfigChange,
          onPlusConfig: this.handlePlusConfig,
          newEntry: this.state.newEntry,
          hostname: this.state.aliasHostname,
          port: this.state.aliasPort,
          alias: this.state.aliasName,
          addConfig: this.addDSRCAlias,
          editConfig: this.addDSRCAlias
        }
      ), /* @__PURE__ */ import_react95.default.createElement(
        ReportConnectionModal,
        {
          showModal: this.state.showAddDSRCCredModal,
          closeHandler: this.closeAddDSRCCred,
          handleFieldChange: this.onFieldChange,
          onMinusConfig: this.handleMinusConfig,
          onConfigChange: this.handleConfigChange,
          onPlusConfig: this.handlePlusConfig,
          name: this.state.connName,
          hostname: this.state.connHostname,
          port: this.state.connPort,
          binddn: this.state.connBindDN,
          bindpw: this.state.connCred,
          pwInputInterractive: this.state.pwInputInterractive,
          addConn: this.addDSRCCred
        }
      ));
    }
  };
  ReplMonitor.propTypes = {
    data: import_prop_types73.default.object,
    suffix: import_prop_types73.default.string,
    serverId: import_prop_types73.default.string,
    credRows: import_prop_types73.default.array,
    aliasRows: import_prop_types73.default.array,
    addNotification: import_prop_types73.default.func,
    reloadConflicts: import_prop_types73.default.func,
    enableTree: import_prop_types73.default.func
  };
  ReplMonitor.defaultProps = {
    data: {},
    suffix: "",
    serverId: "",
    credRows: [],
    aliasRows: []
  };
  var replMonitor_default = ReplMonitor;

  // src/lib/monitor/replMonAgmts.jsx
  var import_react96 = __toESM(require_react(), 1);
  var import_prop_types74 = __toESM(require_prop_types(), 1);
  var ReplAgmtMonitor = class extends import_react96.default.Component {
    constructor(props) {
      super(props);
      this.state = {};
      this.pokeAgmt = this.pokeAgmt.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    pokeAgmt(evt) {
      const agmt_name = evt.target.id;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "poke",
        "--suffix=" + this.props.suffix,
        agmt_name
      ];
      log_cmd("pokeAgmt", "Awaken the agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Replication agreement has been poked`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to poke replication agreement ${agmt_name} - ${errMsg.desc}`
        );
      });
    }
    render() {
      const replAgmts = this.props.data.replAgmts;
      return /* @__PURE__ */ import_react96.default.createElement("div", null, /* @__PURE__ */ import_react96.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react96.default.createElement(TextContent, null, /* @__PURE__ */ import_react96.default.createElement(Text, { component: TextVariants.h3 }, "Monitor Replication Agreements", /* @__PURE__ */ import_react96.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh replication monitor",
          onClick: this.props.handleReload
        }
      )))), /* @__PURE__ */ import_react96.default.createElement(
        AgmtTable,
        {
          agmts: replAgmts,
          handlePokeAgmt: this.pokeAgmt
        }
      ));
    }
  };
  ReplAgmtMonitor.propTypes = {
    data: import_prop_types74.default.object,
    suffix: import_prop_types74.default.string,
    serverId: import_prop_types74.default.string,
    addNotification: import_prop_types74.default.func,
    enableTree: import_prop_types74.default.func
  };
  ReplAgmtMonitor.defaultProps = {
    data: {},
    suffix: "",
    serverId: ""
  };
  var replMonAgmts_default = ReplAgmtMonitor;

  // src/lib/monitor/replMonWinsync.jsx
  var import_react97 = __toESM(require_react(), 1);
  var import_prop_types75 = __toESM(require_prop_types(), 1);
  var ReplAgmtWinsync = class extends import_react97.default.Component {
    constructor(props) {
      super(props);
      this.state = {};
      this.pokeAgmt = this.pokeAgmt.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    pokeAgmt(evt) {
      const agmt_name = evt.target.id;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "poke",
        "--suffix=" + this.props.suffix,
        agmt_name
      ];
      log_cmd("pokeAgmt", "Awaken the agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Replication Winysnc agreement has been poked`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to poke replication winsync agreement ${agmt_name} - ${errMsg.desc}`
        );
      });
    }
    render() {
      const replWinsyncAgmts = this.props.data.replWinsyncAgmts;
      return /* @__PURE__ */ import_react97.default.createElement("div", null, /* @__PURE__ */ import_react97.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react97.default.createElement(TextContent, null, /* @__PURE__ */ import_react97.default.createElement(Text, { component: TextVariants.h3 }, "Monitor Winsync Agreements", /* @__PURE__ */ import_react97.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh replication monitor",
          onClick: this.props.handleReload
        }
      )))), /* @__PURE__ */ import_react97.default.createElement(
        WinsyncAgmtTable,
        {
          agmts: replWinsyncAgmts,
          handlePokeAgmt: this.pokeAgmt
        }
      ));
    }
  };
  ReplAgmtWinsync.propTypes = {
    data: import_prop_types75.default.object,
    suffix: import_prop_types75.default.string,
    serverId: import_prop_types75.default.string,
    addNotification: import_prop_types75.default.func,
    enableTree: import_prop_types75.default.func
  };
  ReplAgmtWinsync.defaultProps = {
    data: {},
    suffix: "",
    serverId: ""
  };
  var replMonWinsync_default = ReplAgmtWinsync;

  // src/lib/monitor/replMonTasks.jsx
  var import_react98 = __toESM(require_react(), 1);
  var import_prop_types76 = __toESM(require_prop_types(), 1);
  var ReplMonTasks = class extends import_react98.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showLogModal: false,
        logData: "",
        activeTabTaskKey: 0
      };
      this.handleNavTaskSelect = (event, tabIndex) => {
        this.setState({
          activeTabTaskKey: tabIndex
        });
      };
      this.viewCleanLog = this.viewCleanLog.bind(this);
      this.viewAbortLog = this.viewAbortLog.bind(this);
      this.closeLogModal = this.closeLogModal.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    viewCleanLog(name2) {
      let logData = "";
      for (const task of this.props.data.cleanTasks) {
        if (task.attrs.cn[0] === name2) {
          logData = task.attrs.nstasklog[0];
          break;
        }
      }
      this.setState({
        showLogModal: true,
        logData
      });
    }
    viewAbortLog(name2) {
      let logData = "";
      for (const task of this.props.data.abortTasks) {
        if (task.attrs.cn[0] === name2) {
          logData = task.attrs.nstasklog[0];
          break;
        }
      }
      this.setState({
        showLogModal: true,
        logData
      });
    }
    closeLogModal() {
      this.setState({
        showLogModal: false
      });
    }
    render() {
      const cleanTasks = this.props.data.cleanTasks;
      const abortTasks = this.props.data.abortTasks;
      return /* @__PURE__ */ import_react98.default.createElement("div", null, /* @__PURE__ */ import_react98.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react98.default.createElement(TextContent, null, /* @__PURE__ */ import_react98.default.createElement(Text, { component: TextVariants.h3 }, "Monitor Replication Tasks", /* @__PURE__ */ import_react98.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh replication monitor",
          onClick: this.props.handleReload
        }
      )))), /* @__PURE__ */ import_react98.default.createElement(Tabs, { isBox: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabTaskKey, onSelect: this.handleNavTaskSelect }, /* @__PURE__ */ import_react98.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react98.default.createElement(TabTitleText, null, "CleanAllRUV Tasks ", /* @__PURE__ */ import_react98.default.createElement("font", { size: "2" }, "(", cleanTasks.length, ")")) }, /* @__PURE__ */ import_react98.default.createElement("div", { className: "ds-indent ds-margin-top-lg" }, /* @__PURE__ */ import_react98.default.createElement(
        CleanALLRUVTable,
        {
          tasks: cleanTasks,
          viewLog: this.viewCleanLog
        }
      ))), /* @__PURE__ */ import_react98.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react98.default.createElement(TabTitleText, null, "Abort CleanAllRUV Tasks ", /* @__PURE__ */ import_react98.default.createElement("font", { size: "2" }, "(", abortTasks.length, ")")) }, /* @__PURE__ */ import_react98.default.createElement("div", { className: "ds-indent ds-margin-top-lg" }, /* @__PURE__ */ import_react98.default.createElement(
        AbortCleanALLRUVTable,
        {
          tasks: abortTasks,
          viewLog: this.viewAbortLog
        }
      )))), /* @__PURE__ */ import_react98.default.createElement(
        TaskLogModal,
        {
          showModal: this.state.showLogModal,
          closeHandler: this.closeLogModal,
          logData: this.state.logData
        }
      ));
    }
  };
  ReplMonTasks.propTypes = {
    data: import_prop_types76.default.object,
    enableTree: import_prop_types76.default.func
  };
  ReplMonTasks.defaultProps = {
    data: {}
  };
  var replMonTasks_default = ReplMonTasks;

  // src/lib/monitor/replMonConflict.jsx
  var import_react99 = __toESM(require_react(), 1);
  var import_prop_types77 = __toESM(require_prop_types(), 1);
  var ReplMonConflict = class extends import_react99.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showConfirmConvertConflict: false,
        showConfirmSwapConflict: false,
        showConfirmDeleteConflict: false,
        showCompareModal: false,
        showConfirmDeleteGlue: false,
        showConfirmConvertGlue: false,
        swapConflictRadio: false,
        deleteConflictRadio: false,
        convertConflictRadio: false,
        convertRDN: "",
        glueEntry: "",
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false,
        activeTabConflictKey: 0
      };
      this.handleNavConflictSelect = (event, tabIndex) => {
        this.setState({
          activeTabConflictKey: tabIndex
        });
      };
      this.convertConflict = this.convertConflict.bind(this);
      this.swapConflict = this.swapConflict.bind(this);
      this.deleteConflict = this.deleteConflict.bind(this);
      this.resolveConflict = this.resolveConflict.bind(this);
      this.convertGlue = this.convertGlue.bind(this);
      this.deleteGlue = this.deleteGlue.bind(this);
      this.closeCompareModal = this.closeCompareModal.bind(this);
      this.confirmDeleteGlue = this.confirmDeleteGlue.bind(this);
      this.confirmConvertGlue = this.confirmConvertGlue.bind(this);
      this.closeConfirmDeleteGlue = this.closeConfirmDeleteGlue.bind(this);
      this.closeConfirmConvertGlue = this.closeConfirmConvertGlue.bind(this);
      this.onRadioChange = this.onRadioChange.bind(this);
      this.onChange = this.onChange.bind(this);
      this.onConflictConversion = this.onConflictConversion.bind(this);
      this.confirmDeleteConflict = this.confirmDeleteConflict.bind(this);
      this.confirmConvertConflict = this.confirmConvertConflict.bind(this);
      this.confirmSwapConflict = this.confirmSwapConflict.bind(this);
      this.closeConfirmDeleteConflict = this.closeConfirmDeleteConflict.bind(this);
      this.closeConfirmConvertConflict = this.closeConfirmConvertConflict.bind(this);
      this.closeConfirmSwapConflict = this.closeConfirmSwapConflict.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    onRadioChange(value, evt) {
      const radioID = {
        swapConflictRadio: false,
        deleteConflictRadio: false,
        convertConflictRadio: false
      };
      radioID[evt.target.id] = value;
      this.setState({
        swapConflictRadio: radioID.swapConflictRadio,
        deleteConflictRadio: radioID.deleteConflictRadio,
        convertConflictRadio: radioID.convertConflictRadio
      });
    }
    onChange(value, evt) {
      if (evt.target.type === "number") {
        if (value) {
          value = parseInt(value);
        } else {
          value = 1;
        }
      }
      this.setState({
        [evt.target.id]: value
      });
    }
    convertConflict() {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "convert",
        this.state.conflictEntry,
        "--new-rdn=" + this.state.convertRDN
      ];
      log_cmd("convertConflict", "convert conflict entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts();
        this.props.addNotification(
          "success",
          `Replication conflict entry was converted into a valid entry`
        );
        this.setState({
          showCompareModal: false
        });
        this.closeConfirmConvertConflict();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to convert conflict entry entry: ${this.state.conflictEntry} - ${errMsg.desc}`
        );
        this.closeConfirmConvertConflict();
      });
    }
    swapConflict() {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "swap",
        this.state.conflictEntry
      ];
      log_cmd("swapConflict", "swap in conflict entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts();
        this.props.addNotification(
          "success",
          `Replication Conflict Entry is now the Valid Entry`
        );
        this.setState({
          showCompareModal: false
        });
        this.closeConfirmSwapConflict();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to swap in conflict entry: ${this.state.conflictEntry} - ${errMsg.desc}`
        );
        this.closeConfirmSwapConflict();
      });
    }
    deleteConflict() {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "delete",
        this.state.conflictEntry
      ];
      log_cmd("deleteConflict", "Delete conflict entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts();
        this.props.addNotification(
          "success",
          `Replication conflict entry was deleted`
        );
        this.setState({
          showCompareModal: false
        });
        this.closeConfirmConvertConflict();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to delete conflict entry: ${this.state.conflictEntry} - ${errMsg.desc}`
        );
        this.closeConfirmDeleteConflict();
      });
    }
    resolveConflict(dn) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "compare",
        dn
      ];
      log_cmd("resolveConflict", "Compare conflict entry with valid entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const entries = JSON.parse(content);
        this.setState({
          cmpConflictEntry: entries.items[0],
          cmpValidEntry: entries.items[1],
          showCompareModal: true,
          deleteConflictRadio: true,
          swapConflictRadio: false,
          convertConflictRadio: false,
          convertRDN: ""
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to get conflict entries: ${dn} - ${errMsg.desc}`
        );
      });
    }
    confirmConvertGlue(dn) {
      this.setState({
        showConfirmConvertGlue: true,
        glueEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmConvertGlue() {
      this.setState({
        showConfirmConvertGlue: false,
        glueEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    convertGlue() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "convert-glue",
        this.state.glueEntry
      ];
      log_cmd("convertGlue", "Convert glue entry to normal entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts();
        this.props.addNotification(
          "success",
          `Replication glue entry was converted`
        );
        this.closeConfirmConvertGlue();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to convert glue entry: ${this.state.glueEntry} - ${errMsg.desc}`
        );
        this.closeConfirmConvertGlue();
      });
    }
    confirmDeleteGlue(dn) {
      this.setState({
        showConfirmDeleteGlue: true,
        glueEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    deleteGlue() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "delete-glue",
        this.state.glueEntry
      ];
      log_cmd("deleteGlue", "Delete glue entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts();
        this.props.addNotification(
          "success",
          `Replication glue entry was deleted`
        );
        this.closeConfirmDeleteGlue();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to delete glue entry: ${this.state.glueEntry} - ${errMsg.desc}`
        );
        this.closeConfirmDeleteGlue();
      });
    }
    closeConfirmDeleteGlue() {
      this.setState({
        showConfirmDeleteGlue: false,
        glueEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    onConflictConversion(dn) {
      if (this.state.deleteConflictRadio) {
        this.confirmDeleteConflict(dn);
      } else if (this.state.swapConflictRadio) {
        this.confirmSwapConflict(dn);
      } else {
        this.confirmConvertConflict(dn);
      }
    }
    confirmConvertConflict(dn) {
      if (this.state.convertRDN === "") {
        this.props.addNotification(
          "error",
          `You must provide a RDN if you want to convert the Conflict Entry`
        );
        return;
      }
      this.setState({
        showConfirmConvertConflict: true,
        conflictEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmConvertConflict() {
      this.setState({
        showConfirmConvertConflict: false,
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false,
        convertRDN: ""
      });
    }
    confirmSwapConflict(dn) {
      this.setState({
        showConfirmSwapConflict: true,
        conflictEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmSwapConflict() {
      this.setState({
        showConfirmSwapConflict: false,
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    confirmDeleteConflict(dn) {
      this.setState({
        showConfirmDeleteConflict: true,
        conflictEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteConflict() {
      this.setState({
        showConfirmDeleteConflict: false,
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeCompareModal() {
      this.setState({
        showCompareModal: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    render() {
      const conflictEntries = this.props.data.conflicts;
      const glueEntries = this.props.data.glues;
      return /* @__PURE__ */ import_react99.default.createElement("div", null, /* @__PURE__ */ import_react99.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react99.default.createElement(TextContent, null, /* @__PURE__ */ import_react99.default.createElement(Text, { component: TextVariants.h3 }, "Monitor Conflict and Glue Entries", /* @__PURE__ */ import_react99.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh replication monitor",
          onClick: this.props.handleReload
        }
      )))), /* @__PURE__ */ import_react99.default.createElement(Tabs, { isBox: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabConflictKey, onSelect: this.handleNavConflictSelect }, /* @__PURE__ */ import_react99.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react99.default.createElement(TabTitleText, null, "Conflict Entries ", /* @__PURE__ */ import_react99.default.createElement("font", { size: "2" }, "(", conflictEntries.length, ")")) }, /* @__PURE__ */ import_react99.default.createElement("div", { className: "ds-indent ds-margin-top-lg" }, /* @__PURE__ */ import_react99.default.createElement(
        Tooltip,
        {
          content: /* @__PURE__ */ import_react99.default.createElement("div", null, "Replication conflict entries occur when two entries are created with the same DN (or name) on different servers at about the same time.  The automatic conflict resolution procedure renames the entry created last.  Its RDN is changed into a multi-valued RDN that includes the entry's original RDN and it's unique identifier (nsUniqueId).  There are several ways to resolve a conflict, but choosing which option to use is up to you.")
        },
        /* @__PURE__ */ import_react99.default.createElement("a", { className: "ds-indent ds-font-size-sm" }, "What Is A Replication Conflict Entry?")
      ), /* @__PURE__ */ import_react99.default.createElement(
        ConflictTable,
        {
          conflicts: conflictEntries,
          resolveConflict: this.resolveConflict,
          key: conflictEntries
        }
      ))), /* @__PURE__ */ import_react99.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react99.default.createElement(TabTitleText, null, "Glue Entries ", /* @__PURE__ */ import_react99.default.createElement("font", { size: "2" }, "(", glueEntries.length, ")")) }, /* @__PURE__ */ import_react99.default.createElement("div", { className: "ds-indent ds-margin-top-lg" }, /* @__PURE__ */ import_react99.default.createElement(
        Tooltip,
        {
          content: /* @__PURE__ */ import_react99.default.createElement("div", null, "When a ", /* @__PURE__ */ import_react99.default.createElement("b", null, "Delete"), ' operation is replicated and the consumer server finds that the entry to be deleted has child entries, the conflict resolution procedure creates a "', /* @__PURE__ */ import_react99.default.createElement("i", null, "glue entry"), '" to avoid having orphaned entries in the database.  In the same way, when an ', /* @__PURE__ */ import_react99.default.createElement("b", null, "Add"), ' operation is replicated and the consumer server cannot find the parent entry, the conflict resolution procedure creates a "', /* @__PURE__ */ import_react99.default.createElement("i", null, "glue entry"), '", representing the "parent entry", so that the new entry is not an orphaned entry.  You can choose to convert the glue entry, or remove the glue entry and all its child entries.')
        },
        /* @__PURE__ */ import_react99.default.createElement("a", { className: "ds-indent ds-font-size-sm" }, "What Is A Replication Glue Entry?")
      ), /* @__PURE__ */ import_react99.default.createElement(
        GlueTable,
        {
          glues: glueEntries,
          convertGlue: this.confirmConvertGlue,
          deleteGlue: this.confirmDeleteGlue,
          key: glueEntries
        }
      )))), /* @__PURE__ */ import_react99.default.createElement(
        ConflictCompareModal,
        {
          showModal: this.state.showCompareModal,
          conflictEntry: this.state.cmpConflictEntry,
          validEntry: this.state.cmpValidEntry,
          swapConflictRadio: this.state.swapConflictRadio,
          convertConflictRadio: this.state.convertConflictRadio,
          deleteConflictRadio: this.state.deleteConflictRadio,
          newRDN: this.state.convertRDN,
          closeHandler: this.closeCompareModal,
          saveHandler: this.onConflictConversion,
          handleChange: this.onChange,
          handleRadioChange: this.onRadioChange
        }
      ), /* @__PURE__ */ import_react99.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteGlue,
          closeHandler: this.closeConfirmDeleteGlue,
          handleChange: this.onFieldChange,
          actionHandler: this.deleteGlue,
          spinning: this.state.modalSpinning,
          item: this.state.glueEntry,
          checked: this.state.modalChecked,
          mTitle: "Delete Glue Entry",
          mMsg: "Are you really sure you want to delete this glue entry and its child entries?",
          mSpinningMsg: "Deleting Glue Entry ...",
          mBtnName: "Delete Glue"
        }
      ), /* @__PURE__ */ import_react99.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmConvertGlue,
          closeHandler: this.closeConfirmConvertGlue,
          handleChange: this.onFieldChange,
          actionHandler: this.convertGlue,
          spinning: this.state.modalSpinning,
          item: this.state.glueEntry,
          checked: this.state.modalChecked,
          mTitle: "Convert Glue Entry",
          mMsg: "Are you really sure you want to convert this glue entry to a regular entry?",
          mSpinningMsg: "Converting Glue Entry ...",
          mBtnName: "Convert Glue"
        }
      ), /* @__PURE__ */ import_react99.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmConvertConflict,
          closeHandler: this.closeConfirmConvertConflict,
          handleChange: this.onFieldChange,
          actionHandler: this.convertConflict,
          spinning: this.state.modalSpinning,
          item: this.state.conflictEntry,
          checked: this.state.modalChecked,
          mTitle: "Convert Conflict Entry Into New Entry",
          mMsg: "Are you really sure you want to convert this conflict entry?",
          mSpinningMsg: "Converting Conflict Entry ...",
          mBtnName: "Convert Conflict"
        }
      ), /* @__PURE__ */ import_react99.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmSwapConflict,
          closeHandler: this.closeConfirmSwapConflict,
          handleChange: this.onFieldChange,
          actionHandler: this.swapConflict,
          spinning: this.state.modalSpinning,
          item: this.state.conflictEntry,
          checked: this.state.modalChecked,
          mTitle: "Swap Conflict Entry",
          mMsg: "Are you really sure you want to swap this conflict entry with the valid entry?",
          mSpinningMsg: "Swapping Conflict Entry ...",
          mBtnName: "Swap Conflict"
        }
      ), /* @__PURE__ */ import_react99.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteConflict,
          closeHandler: this.closeConfirmDeleteConflict,
          handleChange: this.onFieldChange,
          actionHandler: this.deleteConflict,
          spinning: this.state.modalSpinning,
          item: this.state.conflictEntry,
          checked: this.state.modalChecked,
          mTitle: "Delete Replication Conflict Entry",
          mMsg: "Are you really sure you want to delete this conflict entry?",
          mSpinningMsg: "Deleting Conflict Entry ...",
          mBtnName: "Delete Conflict"
        }
      ));
    }
  };
  ReplMonConflict.propTypes = {
    data: import_prop_types77.default.object,
    serverId: import_prop_types77.default.string,
    addNotification: import_prop_types77.default.func,
    enableTree: import_prop_types77.default.func
  };
  ReplMonConflict.defaultProps = {
    data: {},
    serverId: ""
  };
  var replMonConflict_default = ReplMonConflict;

  // src/monitor.jsx
  var Monitor = class extends import_react100.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        nodes: [],
        node_name: "",
        node_text: "",
        node_type: "",
        node_item: "",
        loaded: false,
        snmpData: {},
        ldbmData: {},
        serverData: {},
        disks: [],
        loadingMsg: "",
        disableTree: false,
        activeItems: [{
          name: "Database",
          icon: /* @__PURE__ */ import_react100.default.createElement(DatabaseIcon, null),
          id: "server-monitor",
          type: "server",
          children: [],
          defaultExpanded: true
        }],
        // Suffix
        suffixLoading: false,
        serverLoading: false,
        ldbmLoading: false,
        chainingLoading: false,
        // replication
        replLoading: false,
        replInitLoaded: false,
        replSuffix: "",
        replRole: "",
        replRid: "",
        replicatedSuffixes: [],
        credRows: [],
        aliasRows: [],
        // Logging
        accesslogLocation: "",
        errorlogLocation: "",
        auditlogLocation: "",
        auditfaillogLocation: "",
        securitylogLocation: ""
      };
      this.loadSuffixTree = this.loadSuffixTree.bind(this);
      this.enableTree = this.enableTree.bind(this);
      this.update_tree_nodes = this.update_tree_nodes.bind(this);
      this.handleTreeClick = this.handleTreeClick.bind(this);
      this.disableSuffixLoading = this.disableSuffixLoading.bind(this);
      this.loadMonitorLDBM = this.loadMonitorLDBM.bind(this);
      this.loadMonitorSNMP = this.loadMonitorSNMP.bind(this);
      this.reloadSNMP = this.reloadSNMP.bind(this);
      this.loadMonitorServer = this.loadMonitorServer.bind(this);
      this.reloadServer = this.reloadServer.bind(this);
      this.loadMonitorChaining = this.loadMonitorChaining.bind(this);
      this.loadDiskSpace = this.loadDiskSpace.bind(this);
      this.reloadDisks = this.reloadDisks.bind(this);
      this.onHandleLoadMonitorReplication = this.onHandleLoadMonitorReplication.bind(this);
      this.loadCleanTasks = this.loadCleanTasks.bind(this);
      this.loadAbortTasks = this.loadAbortTasks.bind(this);
      this.loadReplicatedSuffixes = this.loadReplicatedSuffixes.bind(this);
      this.loadWinsyncAgmts = this.loadWinsyncAgmts.bind(this);
      this.reloadReplAgmts = this.reloadReplAgmts.bind(this);
      this.reloadReplWinsyncAgmts = this.reloadReplWinsyncAgmts.bind(this);
      this.loadConflicts = this.loadConflicts.bind(this);
      this.loadGlues = this.loadGlues.bind(this);
      this.gatherAllReplicaHosts = this.gatherAllReplicaHosts.bind(this);
      this.getAgmts = this.getAgmts.bind(this);
      this.loadMonitor = this.loadMonitor.bind(this);
    }
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(6)) {
        if (this.state.firstLoad) {
          this.loadMonitor();
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.loadSuffixTree(false);
          }
        }
      }
    }
    processTree(suffixData) {
      for (const suffix of suffixData) {
        if (suffix.type === "suffix") {
          suffix.icon = /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faTree });
        } else if (suffix.type === "subsuffix") {
          suffix.icon = /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faLeaf });
        } else {
          suffix.icon = /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faLink });
        }
        if (suffix.children.length === 0) {
          delete suffix.children;
        } else {
          this.processTree(suffix.children);
        }
      }
    }
    processReplSuffixes(suffixTree) {
      for (const suffix of this.state.replicatedSuffixes) {
        suffixTree.push({
          name: suffix,
          icon: /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faTree }),
          id: "replication-suffix-" + suffix,
          type: "replication-suffix",
          defaultExpanded: false,
          children: [
            {
              name: "Agreements",
              icon: /* @__PURE__ */ import_react100.default.createElement(MonitoringIcon, null),
              id: suffix + "-agmts",
              item: "agmt-mon",
              type: "repl-mon",
              suffix
            },
            {
              name: "Winsync Agreements",
              icon: /* @__PURE__ */ import_react100.default.createElement(MonitoringIcon, null),
              id: suffix + "-winsync",
              item: "winsync-mon",
              type: "repl-mon",
              suffix
            },
            {
              name: "Tasks",
              icon: /* @__PURE__ */ import_react100.default.createElement(MonitoringIcon, null),
              id: suffix + "-tasks",
              item: "task-mon",
              type: "repl-mon",
              suffix
            },
            {
              name: "Conflict Entries",
              icon: /* @__PURE__ */ import_react100.default.createElement(MonitoringIcon, null),
              id: suffix + "-conflict",
              item: "conflict-mon",
              type: "repl-mon",
              suffix
            }
          ]
        });
      }
    }
    loadSuffixTree(fullReset) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "get-tree"
      ];
      log_cmd("getTree", "Start building the suffix tree", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const treeData = JSON.parse(content);
        this.processTree(treeData);
        const basicData = [
          {
            name: "Server Statistics",
            icon: /* @__PURE__ */ import_react100.default.createElement(ClusterIcon, null),
            id: "server-monitor",
            type: "server"
          },
          {
            name: "Replication",
            icon: /* @__PURE__ */ import_react100.default.createElement(TopologyIcon, null),
            id: "replication-monitor",
            type: "replication",
            defaultExpanded: true,
            children: [
              {
                name: "Synchronization Report",
                icon: /* @__PURE__ */ import_react100.default.createElement(MonitoringIcon, null),
                id: "sync-report",
                item: "sync-report",
                type: "repl-mon"
              }
            ]
          },
          {
            name: "Database",
            icon: /* @__PURE__ */ import_react100.default.createElement(DatabaseIcon, null),
            id: "database-monitor",
            type: "database",
            children: [],
            defaultExpanded: true
          },
          {
            name: "Logging",
            icon: /* @__PURE__ */ import_react100.default.createElement(CatalogIcon, null),
            id: "log-monitor",
            defaultExpanded: true,
            children: [
              {
                name: "Access Log",
                icon: /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
                id: "access-log-monitor",
                type: "log"
              },
              {
                name: "Audit Log",
                icon: /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
                id: "audit-log-monitor",
                type: "log"
              },
              {
                name: "Audit Failure Log",
                icon: /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
                id: "auditfail-log-monitor",
                type: "log"
              },
              {
                name: "Errors Log",
                icon: /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
                id: "error-log-monitor",
                type: "log"
              },
              {
                name: "Security Log",
                icon: /* @__PURE__ */ import_react100.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
                id: "security-log-monitor",
                type: "log"
              }
            ]
          }
        ];
        let current_node = this.state.node_name;
        let type = this.state.node_type;
        if (fullReset) {
          current_node = "server-monitor";
          type = "server";
        }
        basicData[2].children = treeData;
        this.processReplSuffixes(basicData[1].children);
        this.setState(() => ({
          nodes: basicData,
          node_name: current_node,
          node_type: type
        }), this.update_tree_nodes);
      });
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (treeViewItem.id === "log-monitor" || treeViewItem.id === "replication-monitor" || treeViewItem.id.startsWith("replication-suffix")) {
        return;
      }
      if (this.state.activeItems.length === 0 || treeViewItem === this.state.activeItems[0]) {
        this.setState({
          activeItems: [treeViewItem, parentItem]
        });
        return;
      }
      this.setState({
        disableTree: true
        // Disable the tree to allow node to be fully loaded
      });
      if (treeViewItem.id === "database-monitor" || treeViewItem.id === "server-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            disableTree: false,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "access-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "audit-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "auditfail-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "error-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "sync-report") {
        this.gatherAllReplicaHosts(treeViewItem, parentItem);
      } else {
        if (treeViewItem.type === "repl-mon") {
          this.onHandleLoadMonitorReplication(treeViewItem, parentItem);
        } else if (treeViewItem.id in this.state && ("chainingData" in this.state[treeViewItem.id] || "suffixData" in this.state[treeViewItem.id])) {
          this.setState((prevState) => {
            return {
              activeItems: [treeViewItem, parentItem],
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              node_type: treeViewItem.type,
              disableTree: false,
              bename: treeViewItem.be
            };
          });
        } else {
          if (treeViewItem.type === "dblink") {
            this.loadMonitorChaining(treeViewItem.id);
          }
          this.setState((prevState) => {
            return {
              activeItems: [treeViewItem, parentItem],
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              node_type: treeViewItem.type,
              bename: treeViewItem.be
            };
          });
        }
      }
    }
    update_tree_nodes() {
      this.setState({
        loaded: true,
        disableTree: false
      }, () => {
        const className = "pf-c-tree-view__list-item";
        const element = document.getElementById("monitor-tree");
        if (element) {
          const elements = element.getElementsByClassName(className);
          for (const el of elements) {
            el.setAttribute("title", el.innerText);
          }
        }
        this.loadDSRC();
      });
    }
    loadMonitor() {
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get",
        "nsslapd-auditlog",
        "nsslapd-accesslog",
        "nsslapd-errorlog",
        "nsslapd-auditfaillog",
        "nsslapd-securitylog"
      ];
      log_cmd("loadLogLocations", "Get log locations", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          accesslogLocation: config2.attrs["nsslapd-accesslog"][0],
          auditlogLocation: config2.attrs["nsslapd-auditlog"][0],
          auditfaillogLocation: config2.attrs["nsslapd-auditfaillog"][0],
          errorlogLocation: config2.attrs["nsslapd-errorlog"][0],
          securitylogLocation: config2.attrs["nsslapd-securitylog"][0]
        });
      }, this.loadReplicatedSuffixes());
    }
    loadReplicatedSuffixes() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "list"
      ];
      log_cmd("loadReplicatedSuffixes", "Load replication suffixes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let replSuffix = "";
        if (config2.items.length > 0) {
          replSuffix = config2.items[0];
        }
        this.setState({
          replicatedSuffixes: config2.items,
          replSuffix
        });
      }, this.loadDiskSpace());
    }
    loadMonitorLDBM() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "ldbm"
      ];
      log_cmd("loadMonitorLDBM", "Load database monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          ldbmData: config2.attrs
        });
      }, this.loadMonitorServer());
    }
    loadMonitorServer() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "server"
      ];
      log_cmd("loadMonitorServer", "Load server monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          serverData: config2.attrs
        });
      }, this.loadMonitorSNMP());
    }
    reloadServer() {
      this.setState({
        serverLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "server"
      ];
      log_cmd("reloadServer", "Load server monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          serverLoading: false,
          serverData: config2.attrs
        }, this.reloadDisks());
      });
    }
    loadMonitorSNMP() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "snmp"
      ];
      log_cmd("loadMonitorSNMP", "Load snmp monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          snmpData: config2.attrs
        }, this.loadSuffixTree(true));
      });
    }
    loadDiskSpace() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "disk"
      ];
      log_cmd("loadDiskSpace", "Load disk space info", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const disks = JSON.parse(content);
        const rows = [];
        for (const disk of disks.items) {
          rows.push([disk.mount, disk.size, disk.used + " (" + disk.percent + "%)", disk.avail]);
        }
        this.setState({
          disks: rows
        });
      }, this.loadMonitorLDBM());
    }
    reloadDisks() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "disk"
      ];
      log_cmd("reloadDisks", "Reload disk stats", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const disks = JSON.parse(content);
        const rows = [];
        for (const disk of disks.items) {
          rows.push([disk.mount, disk.size, disk.used + " (" + disk.percent + "%)", disk.avail]);
        }
        this.setState({
          disks: rows
        });
      });
    }
    reloadSNMP() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "snmp"
      ];
      log_cmd("reloadSNMP", "Load snmp monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          snmpData: config2.attrs
        });
      });
    }
    loadMonitorChaining(suffix) {
      this.setState({
        chainingLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "chaining",
        suffix
      ];
      log_cmd("loadMonitorChaining", "Load suffix monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            chainingData: config2.attrs
          },
          chainingLoading: false
        });
      }).fail(() => {
        this.setState({
          chainingLoading: false
        });
      });
    }
    disableSuffixLoading() {
      this.setState({
        suffixLoading: false
      });
    }
    loadCleanTasks(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-tasks",
        "list-cleanruv-tasks",
        "--suffix=" + replSuffix
      ];
      log_cmd("loadCleanTasks", "Load clean tasks", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            cleanTasks: config2.items
          }
        }, this.loadAbortTasks(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadAbortTasks(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-tasks",
        "list-abortruv-tasks",
        "--suffix=" + replSuffix
      ];
      log_cmd("loadAbortCleanTasks", "Load abort tasks", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            abortTasks: config2.items
          }
        }, this.loadConflicts(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadConflicts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "list",
        replSuffix
      ];
      log_cmd("loadConflicts", "Load conflict entries", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            conflicts: config2.items,
            glues: []
          }
        }, this.loadGlues(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadGlues(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "list-glue",
        replSuffix
      ];
      log_cmd("loadGlues", "Load glue entries", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            glues: config2.items
          },
          replInitLoaded: true,
          replLoading: false
        });
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadDSRC() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "display"];
      log_cmd("loadDSRC", "Check for replication monitor configurations in the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done((dsrc_content) => {
        const content = JSON.parse(dsrc_content);
        const credRows = [];
        const aliasRows = [];
        if ("repl-monitor-connections" in content) {
          const report_config = content["repl-monitor-connections"];
          for (const [connection, value] of Object.entries(report_config)) {
            const conn = connection + ":" + value;
            credRows.push(conn.split(":"));
          }
        }
        if ("repl-monitor-aliases" in content) {
          const report_config = content["repl-monitor-aliases"];
          for (const [alias_name, value] of Object.entries(report_config)) {
            const alias = alias_name + ":" + value;
            aliasRows.push(alias.split(":"));
          }
        }
        this.setState({
          credRows,
          aliasRows,
          replInitLoaded: true
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        console.log(`loadDSRC: Could not load .dsrc file: ${errMsg.desc}`);
        this.setState({
          replLoading: false
        });
      });
    }
    loadWinsyncAgmts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "winsync-status",
        "--suffix=" + replSuffix
      ];
      log_cmd("loadWinsyncAgmts", "Load winsync agmt status", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            replWinsyncAgmts: config2.items
          }
        }, this.loadCleanTasks(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    getAgmts(suffixList, idx) {
      const new_idx = idx + 1;
      if (new_idx > suffixList.length) {
        this.setState({
          replLoading: false,
          disableTree: false
        });
        return;
      }
      const suffix = suffixList[idx];
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "status",
        "--suffix=" + suffix
      ];
      log_cmd("gatherAllReplicaHosts", "Get replication hosts for repl report", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            replAgmts: config2.items,
            abortTasks: [],
            cleanTasks: [],
            replWinsyncAgmts: []
          }
        }, () => {
          this.getAgmts(suffixList, new_idx);
        });
      }).fail(() => {
        this.setState({
          replLoading: false,
          disableTree: false
        });
      });
    }
    gatherAllReplicaHosts(treeViewItem, parentItem) {
      if (treeViewItem.name !== "") {
        this.setState({
          replLoading: true,
          activeItems: [treeViewItem, parentItem],
          node_name: treeViewItem.id,
          node_text: treeViewItem.name,
          node_type: treeViewItem.type,
          node_item: treeViewItem.item
        }, () => {
          this.getAgmts(this.state.replicatedSuffixes, 0);
        });
      } else {
        this.enableTree();
      }
    }
    onHandleLoadMonitorReplication(treeViewItem, parentItem) {
      if (treeViewItem.name !== "") {
        this.setState({
          replLoading: true
        });
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "replication",
          "status",
          "--suffix=" + treeViewItem.suffix
        ];
        log_cmd("onHandleLoadMonitorReplication", "Load replication suffix info", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          const config2 = JSON.parse(content);
          this.loadDSRC();
          this.setState({
            [treeViewItem.suffix]: {
              ...this.state[treeViewItem.suffix],
              replAgmts: config2.items,
              abortTasks: [],
              cleanTasks: [],
              replWinsyncAgmts: []
            },
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            node_item: treeViewItem.item,
            replSuffix: treeViewItem.suffix,
            disableTree: false
          }, this.loadWinsyncAgmts(treeViewItem.suffix));
        }).fail(() => {
          this.setState({
            replLoading: false
          }, this.loadDSRC);
        });
      } else {
        this.enableTree();
      }
    }
    reloadReplAgmts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "status",
        "--suffix=" + replSuffix
      ];
      log_cmd("reloadReplAgmts", "Load replication agmts", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            replAgmts: config2.items
          }
        });
      });
    }
    reloadReplWinsyncAgmts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "winsync-status",
        "--suffix=" + replSuffix
      ];
      log_cmd("reloadReplWinsyncAgmts", "Load winysnc agmts", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            replWinsyncAgmts: config2.items
          }
        });
      });
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    render() {
      const { nodes } = this.state;
      let monitorPage = "";
      let monitor_element = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (this.state.loaded) {
        if (this.state.node_name === "database-monitor" || this.state.node_name === "") {
          if (this.state.ldbmLoading) {
            monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react100.default.createElement(TextContent, null, /* @__PURE__ */ import_react100.default.createElement(Text, { component: TextVariants.h3 }, "Loading Database Monitor Information ...")), /* @__PURE__ */ import_react100.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
          } else {
            monitor_element = /* @__PURE__ */ import_react100.default.createElement(
              dbMonitor_default,
              {
                data: this.state.ldbmData,
                enableTree: this.enableTree,
                serverId: this.props.serverId
              }
            );
          }
        } else if (this.state.node_name === "server-monitor") {
          if (this.state.serverLoading) {
            monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react100.default.createElement(TextContent, null, /* @__PURE__ */ import_react100.default.createElement(Text, { component: TextVariants.h3 }, "Loading Server Monitor Information ...")), /* @__PURE__ */ import_react100.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
          } else {
            monitor_element = /* @__PURE__ */ import_react100.default.createElement(
              serverMonitor_default,
              {
                data: this.state.serverData,
                handleReload: this.reloadServer,
                serverId: this.props.serverId,
                disks: this.state.disks,
                handleReloadDisks: this.reloadDisks,
                snmpData: this.state.snmpData,
                snmpReload: this.reloadSNMP,
                enableTree: this.enableTree
              }
            );
          }
        } else if (this.state.node_name === "access-log-monitor") {
          monitor_element = /* @__PURE__ */ import_react100.default.createElement(
            accesslog_default,
            {
              logLocation: this.state.accesslogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "audit-log-monitor") {
          monitor_element = /* @__PURE__ */ import_react100.default.createElement(
            auditlog_default,
            {
              logLocation: this.state.auditlogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "auditfail-log-monitor") {
          monitor_element = /* @__PURE__ */ import_react100.default.createElement(
            auditfaillog_default,
            {
              logLocation: this.state.auditfaillogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "error-log-monitor") {
          monitor_element = /* @__PURE__ */ import_react100.default.createElement(
            errorlog_default,
            {
              logLocation: this.state.errorlogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "security-log-monitor") {
          monitor_element = /* @__PURE__ */ import_react100.default.createElement(
            securitylog_default,
            {
              logLocation: this.state.securitylogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_type === "repl-mon") {
          if (this.state.replLoading) {
            monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react100.default.createElement(TextContent, null, /* @__PURE__ */ import_react100.default.createElement(Text, { component: TextVariants.h3 }, "Loading Replication Monitor Information ...")), /* @__PURE__ */ import_react100.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
          } else {
            if (this.state.node_name === "sync-report") {
              monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", null, /* @__PURE__ */ import_react100.default.createElement(
                replMonitor_default,
                {
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  credRows: this.state.credRows,
                  aliasRows: this.state.aliasRows,
                  addNotification: this.props.addNotification,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication,
                  key: this.state.node_name
                }
              ));
            } else if (this.state.node_item === "agmt-mon") {
              monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", null, /* @__PURE__ */ import_react100.default.createElement(
                replMonAgmts_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  reloadAgmts: this.reloadReplAgmts,
                  enableTree: this.enableTree,
                  handelReload: this.onHandleLoadMonitorReplication,
                  key: this.state.node_name
                }
              ));
            } else if (this.state.node_item === "winsync-mon") {
              monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", null, /* @__PURE__ */ import_react100.default.createElement(
                replMonWinsync_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  reloadAgmts: this.reloadReplWinsyncAgmts,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication,
                  key: this.state.node_name
                }
              ));
            } else if (this.state.node_item === "task-mon") {
              monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", null, /* @__PURE__ */ import_react100.default.createElement(
                replMonTasks_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication,
                  key: this.state.node_name
                }
              ));
            } else if (this.state.node_item === "conflict-mon") {
              monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", null, /* @__PURE__ */ import_react100.default.createElement(
                replMonConflict_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  reloadConflicts: this.loadConflicts,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication,
                  key: this.state.node_name
                }
              ));
            }
          }
        } else if (this.state.node_name !== "") {
          if (this.state.chainingLoading) {
            monitor_element = /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react100.default.createElement(TextContent, null, /* @__PURE__ */ import_react100.default.createElement(Text, { component: TextVariants.h3 }, "Loading Chaining Monitor Information For ", /* @__PURE__ */ import_react100.default.createElement("b", null, this.state.node_text, " ..."))), /* @__PURE__ */ import_react100.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
          } else {
            if (this.state.node_type === "dblink") {
              monitor_element = /* @__PURE__ */ import_react100.default.createElement(
                chainingMonitor_default,
                {
                  suffix: this.state.node_text,
                  bename: this.state.bename,
                  reload: this.loadMonitorChaining,
                  data: this.state[this.state.node_text].chainingData,
                  enableTree: this.enableTree,
                  key: this.state.node_text
                }
              );
            } else {
              monitor_element = /* @__PURE__ */ import_react100.default.createElement(
                suffixMonitor_default,
                {
                  serverId: this.props.serverId,
                  suffix: this.state.node_text,
                  bename: this.state.bename,
                  enableTree: this.enableTree,
                  key: this.state.node_text,
                  addNotification: this.props.addNotification
                }
              );
            }
          }
        }
        monitorPage = /* @__PURE__ */ import_react100.default.createElement("div", { className: "container-fluid" }, /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react100.default.createElement("div", null, /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-tree" }, /* @__PURE__ */ import_react100.default.createElement("div", { className: disabled, id: "monitor-tree" }, /* @__PURE__ */ import_react100.default.createElement(
          TreeView,
          {
            hasSelectableNodes: true,
            data: nodes,
            activeItems: this.state.activeItems,
            onSelect: this.handleTreeClick
          }
        )))), /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-tree-content" }, monitor_element)));
      } else {
        monitorPage = /* @__PURE__ */ import_react100.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react100.default.createElement(TextContent, null, /* @__PURE__ */ import_react100.default.createElement(Text, { component: TextVariants.h3 }, "Loading Monitor Information ...")), /* @__PURE__ */ import_react100.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      }
      return /* @__PURE__ */ import_react100.default.createElement("div", null, monitorPage);
    }
  };
  Monitor.propTypes = {
    addNotification: import_prop_types78.default.func,
    serverId: import_prop_types78.default.string
  };
  Monitor.defaultProps = {
    serverId: ""
  };

  // src/schema.jsx
  var import_react103 = __toESM(require_react(), 1);

  // src/lib/schema/schemaTables.jsx
  var import_react101 = __toESM(require_react(), 1);
  var import_prop_types79 = __toESM(require_prop_types(), 1);
  var ObjectClassesTable = class extends import_react101.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        noRows: true,
        columns: [
          {
            title: "Objectclass Name",
            transforms: [sortable],
            cellFormatters: [expandable]
          },
          { title: "OID", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          not_user_defined: this.state.rows[idx].disableActions
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2]
          ],
          disableActions: srow.not_user_defined
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(row) {
      const kinds = ["STRUCTURAL", "ABSTRACT", "AUXILIARY"];
      const desc = row.desc ? row.desc[0] : /* @__PURE__ */ import_react101.default.createElement("i", null, "No description");
      const x_org = row.x_origin.join(" ");
      return /* @__PURE__ */ import_react101.default.createElement(Grid, { className: "ds-left-indent-lg" }, /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Description:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, desc)), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "X-Origin:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, x_org)), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Superior Objectclass:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.sup[0])), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Kind:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, kinds[row.kind])), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Requires Attributes:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.must.join(", "))), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Allowed Attributes:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.may.join(", "))));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let count = 0;
      let noRows = false;
      for (const row of this.props.rows) {
        let user_defined = false;
        if (row.x_origin.length > 0 && row.x_origin.indexOf("user defined") !== -1) {
          user_defined = true;
        }
        rows.push(
          {
            isOpen: false,
            cells: [row.name[0], row.oid[0]],
            disableActions: !user_defined
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        noRows = true;
        rows = [{ cells: ["No Objectclasses"] }];
        columns = [{ title: "Objectclasses" }];
      }
      this.setState({
        rows,
        columns,
        noRows
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        let user_defined = false;
        const val = value.toLowerCase();
        if (val !== "" && row.name[0].toLowerCase().indexOf(val) === -1 && row.oid[0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        if (row.x_origin.length > 0 && row.x_origin.indexOf("user defined") !== -1) {
          user_defined = true;
        }
        rows.push(
          {
            isOpen: false,
            cells: [row.name[0], row.oid[0]],
            disableActions: !user_defined
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Objectclass",
          onClick: (event, rowId, rowData, extra) => this.props.editModalHandler(rowData.cells[0])
        },
        {
          title: "Delete Objectclass",
          onClick: (event, rowId, rowData, extra) => this.props.deleteHandler(rowData.cells[0])
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, noRows, columns } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      let content = /* @__PURE__ */ import_react101.default.createElement("div", { className: "ds-center ds-margin-top-xlg" }, /* @__PURE__ */ import_react101.default.createElement(TextContent, null, /* @__PURE__ */ import_react101.default.createElement(Text, { component: TextVariants.h3 }, "Loading Objectclasses ...")), /* @__PURE__ */ import_react101.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      if (!this.props.loading) {
        content = /* @__PURE__ */ import_react101.default.createElement("div", null, /* @__PURE__ */ import_react101.default.createElement(Grid, null, /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react101.default.createElement(
          SearchInput,
          {
            placeholder: "Search Objectclasses",
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ))), /* @__PURE__ */ import_react101.default.createElement(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "oc table",
            cells: columns,
            rows: tableRows,
            variant: TableVariant.compact,
            sortBy,
            onSort: this.handleSort,
            onCollapse: this.handleCollapse,
            actions: noRows ? null : this.actions(),
            dropdownPosition: "right",
            dropdownDirection: "bottom"
          },
          /* @__PURE__ */ import_react101.default.createElement(TableHeader, null),
          /* @__PURE__ */ import_react101.default.createElement(TableBody, null)
        ), /* @__PURE__ */ import_react101.default.createElement(
          Pagination,
          {
            itemCount: this.state.rows.length / 2,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: PaginationVariant.bottom,
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        ));
      }
      return /* @__PURE__ */ import_react101.default.createElement("div", { className: "ds-margin-top-lg" }, content);
    }
  };
  ObjectClassesTable.propTypes = {
    rows: import_prop_types79.default.array,
    editModalHandler: import_prop_types79.default.func,
    deleteHandler: import_prop_types79.default.func
  };
  ObjectClassesTable.defaultProps = {
    rows: []
  };
  var AttributesTable = class extends import_react101.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        noRows: true,
        columns: [
          {
            title: "Attribute Name",
            transforms: [sortable],
            cellFormatters: [expandable]
          },
          { title: "OID", transforms: [sortable] },
          { title: "Syntax", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
          // reset page back to 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          3: this.state.rows[idx].cells[2],
          not_user_defined: this.state.rows[idx].disableActions
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2],
            srow[2]
          ],
          disableActions: srow.not_user_defined
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(row) {
      const desc = row.desc ? row.desc[0] : /* @__PURE__ */ import_react101.default.createElement("i", null, "No description");
      const x_org = row.x_origin.join(", ");
      const usage = ["userApplications", "directoryOperation", "distributedOperation", "dSAOperation"];
      return /* @__PURE__ */ import_react101.default.createElement(Grid, { className: "ds-left-indent-lg" }, /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Description:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, desc)), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "X-Origin:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, x_org)), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Aliases:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.aliases ? row.aliases.join(", ") : "")), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Parent Attribute:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.sup.join(", "))), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Read Only:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.no_user_mod ? "Yes" : "No")), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Multivalued:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.single_value ? "No" : "Yes")), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Usage:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, usage[row.usage])), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Equality Matching Rules:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.equality ? row.equality.join(", ") : "")), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Substring Matching Rules:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.substr ? row.substr.join(", ") : "")), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, "Ordering Matching Rules:"), /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react101.default.createElement("b", null, row.ordering ? row.ordering.join(", ") : "")));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let count = 0;
      let noRows = false;
      for (const row of this.props.rows) {
        let user_defined = false;
        if (row.x_origin.length > 0 && row.x_origin.indexOf("user defined") !== -1) {
          user_defined = true;
        }
        rows.push(
          {
            isOpen: false,
            cells: [row.name[0], row.oid[0], row.syntax[0]],
            disableActions: !user_defined
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        noRows = true;
        rows = [{ cells: ["No Attributes"] }];
        columns = [{ title: "Attributes" }];
      }
      this.setState({
        rows,
        columns,
        noRows
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        let user_defined = false;
        const val = value.toLowerCase();
        if (val !== "" && row.name[0].toLowerCase().indexOf(val) === -1 && row.oid[0].toLowerCase().indexOf(val) === -1 && row.syntax[0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        if (row.x_origin.length > 0 && row.x_origin.indexOf("user defined") !== -1) {
          user_defined = true;
        }
        rows.push(
          {
            isOpen: false,
            cells: [row.name[0], row.oid[0], row.syntax[0]],
            disableActions: !user_defined
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Attribute",
          onClick: (event, rowId, rowData, extra) => this.props.editModalHandler(rowData.cells[0])
        },
        {
          title: "Delete Attribute",
          onClick: (event, rowId, rowData, extra) => this.props.deleteHandler(rowData.cells[0])
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, noRows, columns } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      let content = /* @__PURE__ */ import_react101.default.createElement("div", { className: "ds-center ds-margin-top-xlg" }, /* @__PURE__ */ import_react101.default.createElement(TextContent, null, /* @__PURE__ */ import_react101.default.createElement(Text, { component: TextVariants.h3 }, "Loading Attributes ...")), /* @__PURE__ */ import_react101.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      if (!this.props.loading) {
        content = /* @__PURE__ */ import_react101.default.createElement("div", null, /* @__PURE__ */ import_react101.default.createElement(Grid, null, /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react101.default.createElement(
          SearchInput,
          {
            placeholder: "Search Attributes",
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ))), /* @__PURE__ */ import_react101.default.createElement(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "attr table",
            cells: columns,
            rows: tableRows,
            variant: TableVariant.compact,
            sortBy,
            onSort: this.handleSort,
            onCollapse: this.handleCollapse,
            actions: noRows ? null : this.actions(),
            dropdownPosition: "right",
            dropdownDirection: "bottom"
          },
          /* @__PURE__ */ import_react101.default.createElement(TableHeader, null),
          /* @__PURE__ */ import_react101.default.createElement(TableBody, null)
        ), /* @__PURE__ */ import_react101.default.createElement(
          Pagination,
          {
            itemCount: this.state.rows.length / 2,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: PaginationVariant.bottom,
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        ));
      }
      return /* @__PURE__ */ import_react101.default.createElement("div", { className: "ds-margin-top-lg" }, content);
    }
  };
  AttributesTable.propTypes = {
    rows: import_prop_types79.default.array,
    editModalHandler: import_prop_types79.default.func,
    deleteHandler: import_prop_types79.default.func,
    loading: import_prop_types79.default.bool
  };
  AttributesTable.defaultProps = {
    rows: [],
    syntaxes: [],
    loading: false
  };
  var MatchingRulesTable = class extends import_react101.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          {
            title: "Matching Rule",
            transforms: [sortable],
            cellFormatters: [expandable]
          },
          { title: "OID", transforms: [sortable] },
          { title: "Syntax", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
          // reset page back to 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          3: this.state.rows[idx].cells[2]
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2],
            srow[2]
          ]
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(row) {
      let desc = "No description";
      if (row.desc) {
        desc = row.desc[0];
      }
      return /* @__PURE__ */ import_react101.default.createElement(Grid, null, /* @__PURE__ */ import_react101.default.createElement(GridItem, { offset: 1, span: 10 }, desc));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let count = 0;
      for (const row of this.props.rows) {
        rows.push(
          {
            isOpen: false,
            cells: [{ title: row.name[0] }, row.oid[0], row.syntax[0]]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Matching Rules"] }];
        columns = [{ title: "Matching Rules" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        const val = value.toLowerCase();
        let name2 = "";
        if (row.names.length > 0) {
          name2 = row.name[0].toLowerCase();
        }
        if (val !== "" && name2.indexOf(val) === -1 && row.oid[0].indexOf(val) === -1 && row.syntax[0].indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [{ title: name2 === "" ? /* @__PURE__ */ import_react101.default.createElement("i", null, "<No Name>") : name2 }, row.oid[0], row.syntax[0]]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react101.default.createElement("div", null, /* @__PURE__ */ import_react101.default.createElement(Grid, null, /* @__PURE__ */ import_react101.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react101.default.createElement(
        SearchInput,
        {
          placeholder: "Search Matching Rules",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ))), /* @__PURE__ */ import_react101.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "attr table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          onCollapse: this.handleCollapse
        },
        /* @__PURE__ */ import_react101.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react101.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react101.default.createElement(
        Pagination,
        {
          itemCount: this.state.rows.length / 2,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  MatchingRulesTable.propTypes = {
    rows: import_prop_types79.default.array
  };
  MatchingRulesTable.defaultProps = {
    rows: []
  };

  // src/lib/schema/schemaModals.jsx
  var import_react102 = __toESM(require_react(), 1);
  var import_prop_types80 = __toESM(require_prop_types(), 1);
  var ObjectClassModal = class extends import_react102.default.Component {
    render() {
      const {
        newOcEntry,
        ocModalViewOnly,
        addHandler,
        editHandler,
        handleFieldChange,
        objectclasses,
        attributes,
        ocName,
        ocDesc,
        ocOID,
        ocParent,
        ocKind,
        ocMust,
        ocMay,
        objectclassModalShow,
        closeModal,
        loading,
        isRequiredAttrsOpen,
        isAllowedAttrsOpen,
        onRequiredAttrsToggle,
        onRequiredAttrsClear,
        onRequiredAttrsSelect,
        onRequiredAttrsCreateOption,
        onAllowedAttrsToggle,
        onAllowedAttrsClear,
        onAllowedAttrsSelect,
        onAllowedAttrsCreateOption,
        error,
        saveBtnDisabled
      } = this.props;
      const modalTitle = ocModalViewOnly ? `View ObjectClass - ${ocName}` : /* @__PURE__ */ import_react102.default.createElement("div", null, newOcEntry ? "Add" : "Edit", " ObjectClass", ocName !== "" ? ` - ${ocName}` : "", " ");
      const btnList = [
        /* @__PURE__ */ import_react102.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeModal }, "Close")
      ];
      if (!ocModalViewOnly) {
        let btnText = "Save";
        const extraPrimaryProps = {};
        if (loading) {
          btnText = "Saving...";
          extraPrimaryProps.spinnerAriaValueText = "Loading";
        }
        btnList.unshift(
          /* @__PURE__ */ import_react102.default.createElement(
            Button,
            {
              key: "oc",
              isLoading: loading,
              spinnerAriaValueText: loading ? "Loading" : void 0,
              variant: "primary",
              onClick: newOcEntry ? addHandler : editHandler,
              ...extraPrimaryProps,
              isDisabled: saveBtnDisabled || loading
            },
            btnText
          )
        );
      }
      return /* @__PURE__ */ import_react102.default.createElement("div", null, /* @__PURE__ */ import_react102.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: modalTitle,
          isOpen: objectclassModalShow,
          onClose: closeModal,
          actions: btnList
        },
        /* @__PURE__ */ import_react102.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "Name of the objectClass" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Objectclass Name"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          TextInput,
          {
            value: ocName,
            type: "text",
            id: "ocName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "ocName",
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            validated: error.ocName ? ValidatedOptions.error : ValidatedOptions.default,
            isDisabled: !newOcEntry
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "Describes what is the objectClass's purpose" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Description"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          TextInput,
          {
            value: ocDesc,
            type: "text",
            id: "ocDesc",
            "aria-describedby": "horizontal-form-name-helper",
            name: "ocDesc",
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            validated: error.ocDesc ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "Object identifier" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "OID (optional)"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          TextInput,
          {
            value: ocOID,
            type: "text",
            id: "ocOID",
            "aria-describedby": "horizontal-form-name-helper",
            name: "ocOID",
            isDisabled: ocModalViewOnly,
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An objectClass's parent" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Parent Objectclass"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          FormSelect,
          {
            id: "ocParent",
            value: ocParent,
            isDisabled: ocModalViewOnly,
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          objectclasses.map((obj, index) => /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: index, value: obj, label: obj }))
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An objectClass's kind" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Objectclass Kind"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          FormSelect,
          {
            id: "ocKind",
            value: ocKind,
            isDisabled: ocModalViewOnly,
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: 0, value: "STRUCTURAL", label: "STRUCTURAL" }),
          /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: 1, value: "ABSTRACT", label: "ABSTRACT" }),
          /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: 2, value: "AUXILIARY", label: "AUXILIARY" })
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "A must attribute name" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Required Attributes"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: onRequiredAttrsToggle,
            onSelect: onRequiredAttrsSelect,
            onClear: onRequiredAttrsClear,
            selections: ocMust,
            id: "ocMust",
            isOpen: isRequiredAttrsOpen,
            "aria-labelledby": "typeAhead-required-attrs",
            placeholderText: "Type an attribute name...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: onRequiredAttrsCreateOption,
            direction: "up",
            maxHeight: "225px"
          },
          attributes.map((attr, index) => /* @__PURE__ */ import_react102.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "A may attribute name" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Allowed Attributes"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: onAllowedAttrsToggle,
            onSelect: onAllowedAttrsSelect,
            onClear: onAllowedAttrsClear,
            selections: ocMay,
            id: "ocMay",
            isOpen: isAllowedAttrsOpen,
            "aria-labelledby": "typeAhead-allowed-attrs",
            placeholderText: "Type an attribute name...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: onAllowedAttrsCreateOption,
            direction: "up",
            maxHeight: "225px"
          },
          attributes.map((attr, index) => /* @__PURE__ */ import_react102.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))))
      ));
    }
  };
  ObjectClassModal.propTypes = {
    addHandler: import_prop_types80.default.func,
    editHandler: import_prop_types80.default.func,
    newOcEntry: import_prop_types80.default.bool,
    ocModalViewOnly: import_prop_types80.default.bool,
    handleTypeaheadChange: import_prop_types80.default.func,
    handleFieldChange: import_prop_types80.default.func,
    objectclasses: import_prop_types80.default.array,
    attributes: import_prop_types80.default.array,
    ocName: import_prop_types80.default.string,
    ocDesc: import_prop_types80.default.string,
    ocOID: import_prop_types80.default.string,
    ocParent: import_prop_types80.default.string,
    ocKind: import_prop_types80.default.string,
    ocMust: import_prop_types80.default.array,
    ocMay: import_prop_types80.default.array,
    objectclassModalShow: import_prop_types80.default.bool,
    closeModal: import_prop_types80.default.func,
    loading: import_prop_types80.default.bool
  };
  ObjectClassModal.defaultProps = {
    newOcEntry: true,
    ocModalViewOnly: false,
    objectclasses: [],
    attributes: [],
    ocName: "",
    ocDesc: "",
    ocOID: "",
    ocParent: "",
    ocKind: "",
    ocMust: [],
    ocMay: [],
    objectclassModalShow: false,
    loading: false
  };
  var AttributeTypeModal = class extends import_react102.default.Component {
    render() {
      const {
        atName,
        atDesc,
        atOID,
        atParent,
        atSyntax,
        atUsage,
        atMultivalued,
        atNoUserMod,
        atAlias,
        atEqMr,
        atOrder,
        atSubMr,
        atModalViewOnly,
        attributeModalShow,
        newAtEntry,
        addHandler,
        editHandler,
        handleFieldChange,
        attributes,
        syntaxes,
        matchingrules,
        closeModal,
        loading,
        isParentAttrOpen,
        isAliasNameOpen,
        isEqualityMROpen,
        isOrderMROpen,
        isSubstringMROpen,
        onParentAttrToggle,
        onParentAttrClear,
        onParentAttrSelect,
        onAliasNameToggle,
        onAliasNameClear,
        onAliasNameSelect,
        onAliasNameCreateOption,
        onEqualityMRToggle,
        onEqualityMRClear,
        onEqualityMRSelect,
        onOrderMRToggle,
        onOrderMRClear,
        onOrderMRSelect,
        onSubstringMRToggle,
        onSubstringMRClear,
        onSubstringMRSelect,
        error,
        saveBtnDisabled
      } = this.props;
      const modalTitle = atModalViewOnly ? `View Attribute - ${atName}` : /* @__PURE__ */ import_react102.default.createElement("div", null, newAtEntry ? "Add" : "Edit", " Attribute", atName !== "" ? ` - ${atName}` : "", " ");
      const btnList = [
        /* @__PURE__ */ import_react102.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeModal }, "Close")
      ];
      if (!atModalViewOnly) {
        let btnText = "Save";
        const extraPrimaryProps = {};
        if (loading) {
          btnText = "Saving...";
          extraPrimaryProps.spinnerAriaValueText = "Loading";
        }
        btnList.unshift(
          /* @__PURE__ */ import_react102.default.createElement(
            Button,
            {
              key: "at",
              isLoading: loading,
              spinnerAriaValueText: loading ? "Loading" : void 0,
              variant: "primary",
              onClick: newAtEntry ? addHandler : editHandler,
              ...extraPrimaryProps,
              isDisabled: saveBtnDisabled || loading
            },
            btnText
          )
        );
      }
      return /* @__PURE__ */ import_react102.default.createElement("div", null, /* @__PURE__ */ import_react102.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: modalTitle,
          isOpen: attributeModalShow,
          onClose: closeModal,
          actions: btnList
        },
        /* @__PURE__ */ import_react102.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "Name of the attribute" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Attribute Name"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          TextInput,
          {
            value: atName,
            type: "text",
            id: "atName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "atName",
            isDisabled: !newAtEntry,
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            validated: error.atName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "Describes what is the attribute's purpose" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Description"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          TextInput,
          {
            value: atDesc,
            type: "text",
            id: "atDesc",
            "aria-describedby": "horizontal-form-name-helper",
            name: "atDesc",
            isDisabled: atModalViewOnly,
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            validated: error.atDesc ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "Object identifier" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "OID (optional)"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          TextInput,
          {
            value: atOID,
            type: "text",
            id: "atOID",
            "aria-describedby": "horizontal-form-name-helper",
            name: "atOID",
            isDisabled: atModalViewOnly,
            onChange: (str, e) => {
              handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An attribute's parent/superior " }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Parent Attribute"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type an attribute name",
            onToggle: onParentAttrToggle,
            onSelect: onParentAttrSelect,
            onClear: onParentAttrClear,
            selections: atParent,
            isOpen: isParentAttrOpen,
            "aria-labelledby": "typeAhead-parent-attr",
            placeholderText: "Type an attribute name...",
            noResultsFoundText: "There are no matching entries"
          },
          attributes.map((attr, index) => /* @__PURE__ */ import_react102.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An attribute's syntax" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Syntax Name"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          FormSelect,
          {
            id: "atSyntax",
            value: atSyntax,
            isDisabled: atModalViewOnly,
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          syntaxes.map((syntax, index) => /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: index, value: syntax.id, label: syntax.label }))
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An attribute's usage purpose" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Attribute Usage"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          FormSelect,
          {
            id: "atUsage",
            value: atUsage,
            isDisabled: atModalViewOnly,
            onChange: (str, e) => {
              handleFieldChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: 0, value: "userApplications", label: "userApplications" }),
          /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: 1, value: "directoryOperation", label: "directoryOperation" }),
          /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: 2, value: "distributedOperation", label: "distributedOperation" }),
          /* @__PURE__ */ import_react102.default.createElement(FormSelectOption, { key: 3, value: "dSAOperation", label: "dSAOperation" })
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "If attribute can have a multiple values" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Multivalued Attribute"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Checkbox,
          {
            id: "atMultivalued",
            isChecked: atMultivalued,
            title: "If attribute can have a multiple values",
            onChange: (checked, e) => {
              handleFieldChange(e);
            },
            isDisabled: atModalViewOnly
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "If attribute is not modifiable by a client application" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Not Modifiable By A User"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Checkbox,
          {
            id: "atNoUserMod",
            isChecked: atNoUserMod,
            title: "If attribute is not modifiable by a client application",
            onChange: (checked, e) => {
              handleFieldChange(e);
            },
            isDisabled: atModalViewOnly
          }
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An alias name for the attribute" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Alias Names"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an alias name",
            onToggle: onAliasNameToggle,
            onSelect: onAliasNameSelect,
            onClear: onAliasNameClear,
            selections: atAlias,
            isOpen: isAliasNameOpen,
            "aria-labelledby": "typeAhead-alias-name",
            placeholderText: "Type an alias name...",
            noResultsFoundText: "There are no matching entries",
            isCreatable: true,
            onCreateOption: onAliasNameCreateOption
          },
          atAlias.map((alias, index) => /* @__PURE__ */ import_react102.default.createElement(
            SelectOption,
            {
              key: index,
              value: alias
            }
          ))
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An equality matching rule" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Equality Matching Rule"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type a matching rule",
            onToggle: onEqualityMRToggle,
            onSelect: onEqualityMRSelect,
            onClear: onEqualityMRClear,
            selections: atEqMr,
            isOpen: isEqualityMROpen,
            "aria-labelledby": "typeAhead-equality-mr",
            placeholderText: "Type an Equality matching rule...",
            noResultsFoundText: "There are no matching rules"
          },
          matchingrules.map((mr, index) => /* @__PURE__ */ import_react102.default.createElement(
            SelectOption,
            {
              key: index,
              value: mr
            }
          ))
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "An order matching rule" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Order Matching Rule"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type a matching rule",
            onToggle: onOrderMRToggle,
            onSelect: onOrderMRSelect,
            onClear: onOrderMRClear,
            selections: atOrder,
            isOpen: isOrderMROpen,
            "aria-labelledby": "typeAhead-order-mr",
            placeholderText: "Type an Ordering matching rule..",
            noResultsFoundText: "There are no matching rules"
          },
          matchingrules.map((mr, index) => /* @__PURE__ */ import_react102.default.createElement(
            SelectOption,
            {
              key: index,
              value: mr
            }
          ))
        ))), /* @__PURE__ */ import_react102.default.createElement(Grid, { title: "A substring matching rule" }, /* @__PURE__ */ import_react102.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Substring Matching Rule"), /* @__PURE__ */ import_react102.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react102.default.createElement(
          Select,
          {
            variant: SelectVariant.typeahead,
            typeAheadAriaLabel: "Type a matching rule",
            onToggle: onSubstringMRToggle,
            onSelect: onSubstringMRSelect,
            onClear: onSubstringMRClear,
            selections: atSubMr,
            isOpen: isSubstringMROpen,
            placeholderText: "Type a Substring matching rule...",
            noResultsFoundText: "There are no matching rules"
          },
          matchingrules.map((mr, index) => /* @__PURE__ */ import_react102.default.createElement(
            SelectOption,
            {
              key: index,
              value: mr
            }
          ))
        ))))
      ));
    }
  };
  AttributeTypeModal.propTypes = {
    addHandler: import_prop_types80.default.func,
    editHandler: import_prop_types80.default.func,
    handleTypeaheadChange: import_prop_types80.default.func,
    handleFieldChange: import_prop_types80.default.func,
    attributes: import_prop_types80.default.array,
    matchingrules: import_prop_types80.default.array,
    syntaxes: import_prop_types80.default.array,
    atName: import_prop_types80.default.string,
    atDesc: import_prop_types80.default.string,
    atOID: import_prop_types80.default.string,
    atParent: import_prop_types80.default.string,
    atSyntax: import_prop_types80.default.string,
    atUsage: import_prop_types80.default.string,
    atMultivalued: import_prop_types80.default.bool,
    atNoUserMod: import_prop_types80.default.bool,
    atAlias: import_prop_types80.default.array,
    atEqMr: import_prop_types80.default.string,
    atOrder: import_prop_types80.default.string,
    atSubMr: import_prop_types80.default.string,
    atModalViewOnly: import_prop_types80.default.bool,
    attributeModalShow: import_prop_types80.default.bool,
    newAtEntry: import_prop_types80.default.bool,
    closeModal: import_prop_types80.default.func,
    loading: import_prop_types80.default.bool
  };
  AttributeTypeModal.defaultProps = {
    attributes: [],
    matchingrules: [],
    syntaxes: [],
    atName: "",
    atDesc: "",
    atOID: "",
    atParent: "",
    atSyntax: "",
    atUsage: "userApplications",
    atMultivalued: false,
    atNoUserMod: false,
    atAlias: [],
    atEqMr: "",
    atOrder: "",
    atSubMr: "",
    atModalViewOnly: false,
    attributeModalShow: false,
    newAtEntry: true,
    loading: false
  };

  // src/schema.jsx
  var import_prop_types81 = __toESM(require_prop_types(), 1);
  var Schema = class extends import_react103.default.Component {
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(4)) {
        if (this.state.firstLoad) {
          this.loadSyntaxesFirst();
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.loadSyntaxesFirst();
          }
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        loading: false,
        activeTabKey: 0,
        objectclassRows: [],
        filteredObjectclassRows: [],
        attributesRows: [],
        filteredAttributesRows: [],
        matchingrulesRows: [],
        syntaxes: [],
        attributes: [],
        objectclasses: [],
        matchingrules: [],
        deleteName: "",
        ocTableKey: 0,
        attrTableKey: 0,
        errObj: {},
        saveBtnDisabled: true,
        ocModalViewOnly: false,
        ocName: "",
        ocDesc: "",
        ocOID: "",
        ocParent: "",
        ocParentOptions: [],
        ocKind: "",
        ocMust: [],
        ocMustOptions: [],
        ocMay: [],
        ocMayOptions: [],
        ocUserDefined: false,
        objectclassModalShow: false,
        newOcEntry: true,
        ocTableLoading: false,
        ocModalLoading: false,
        atName: "",
        atDesc: "",
        atOID: "",
        atParent: "",
        atParentOptions: [],
        atSyntax: "",
        atUsage: "userApplications",
        atMultivalued: false,
        atNoUserMod: false,
        atAlias: [],
        atAliasOptions: [],
        atEqMr: "",
        atOrder: "",
        atSubMr: "",
        atUserDefined: false,
        atModalViewOnly: false,
        attributeModalShow: false,
        newAtEntry: true,
        atTableLoading: false,
        atModalLoading: false,
        isParentObjOpen: false,
        isRequiredAttrsOpen: false,
        isAllowedAttrsOpen: false,
        isParentAttrOpen: false,
        isAliasNameOpen: false,
        isEqualityMROpen: false,
        isOrderMROpen: false,
        isSubstringMROpen: false
      };
      this.handleSubstringMRToggle = (isSubstringMROpen) => {
        this.setState({
          isSubstringMROpen
        });
      };
      this.handleSubstringMRClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atSubMr: "",
          isSubstringMROpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleSubstringMRSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atSubMr === selection) {
          this.setState({
            atSubMr: selection,
            isSubstringMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState({
            atSubMr: selection,
            isSubstringMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        }
      };
      this.handleOrderMRToggle = (isOrderMROpen) => {
        this.setState({
          isOrderMROpen
        });
      };
      this.handleOrderMRClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atOrder: "",
          isOrderMROpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleOrderMRSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atOrder === selection) {
          this.setState({
            atOrder: "",
            isOrderMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState({
            atOrder: selection,
            isOrderMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        }
      };
      this.handleEqualityMRToggle = (isEqualityMROpen) => {
        this.setState({
          isEqualityMROpen
        });
      };
      this.handleEqualityMRClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atEqMr: "",
          isEqualityMROpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleEqualityMRSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atEqMr === selection) {
          this.setState({
            atEqMr: "",
            isEqualityMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState({
            atEqMr: selection,
            isEqualityMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        }
      };
      this.handleAliasNameToggle = (isAliasNameOpen) => {
        this.setState({
          isAliasNameOpen
        });
      };
      this.handleAliasNameClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atAlias: [],
          isAliasNameOpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleAliasNameSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atAlias.includes(selection)) {
          this.setState(
            (prevState) => ({
              atAlias: prevState.atAlias.filter((item) => item !== selection),
              isAliasNameOpen: false
            }),
            () => {
              this.onAttrChange(e);
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              atAlias: [...prevState.atAlias, selection],
              isAliasNameOpen: false
            }),
            () => {
              this.onAttrChange(e);
            }
          );
        }
      };
      this.handleAliasNameCreateOption = (newValue) => {
        if (!this.state.atAliasOptions.includes(newValue)) {
          this.setState({
            atAliasOptions: [...this.state.atAliasOptions, { value: newValue }]
          });
        }
      };
      this.handleParentAttrToggle = (isParentAttrOpen) => {
        this.setState({
          isParentAttrOpen
        });
      };
      this.handleParentAttrClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atParent: "",
          isParentAttrOpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleParentAttrSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atParent === selection) {
          this.setState({
            atParent: "",
            isParentAttrOpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState(
            (prevState) => ({
              atParent: selection,
              isParentAttrOpen: false
            }),
            () => {
              this.onAttrChange(e);
            }
          );
        }
      };
      this.handleRequiredAttrsToggle = (isRequiredAttrsOpen) => {
        this.setState({
          isRequiredAttrsOpen
        });
      };
      this.handleRequiredAttrsClear = () => {
        this.setState({
          ocMust: [],
          isRequiredAttrsOpen: false
        });
      };
      this.handleRequiredAttrsSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.ocMust.includes(selection)) {
          this.setState(
            (prevState) => ({
              ocMust: prevState.ocMust.filter((item) => item !== selection),
              isRequiredAttrsOpen: false
            }),
            () => {
              this.onOCChange(e);
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              ocMust: [...prevState.ocMust, selection],
              isRequiredAttrsOpen: false
            }),
            () => {
              this.onOCChange(e);
            }
          );
        }
      };
      this.handleRequiredAttrsCreateOption = (newValue) => {
        if (!this.state.ocMustOptions.includes(newValue)) {
          this.setState({
            ocMustOptions: [...this.state.ocParentocMustOptionsOptions, { value: newValue }]
          });
        }
      };
      this.handleAllowedAttrsToggle = (isAllowedAttrsOpen) => {
        this.setState({
          isAllowedAttrsOpen
        });
      };
      this.handleAllowedAttrsClear = () => {
        this.setState({
          ocMay: [],
          isAllowedAttrsOpen: false
        });
      };
      this.handleAllowedAttrsSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.ocMay.includes(selection)) {
          this.setState(
            (prevState) => ({
              ocMay: prevState.ocMay.filter((item) => item !== selection),
              isAllowedAttrsOpen: false
            }),
            () => {
              this.onOCChange(e);
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              ocMay: [...prevState.ocMay, selection],
              isAllowedAttrsOpen: false
            }),
            () => {
              this.onOCChange(e);
            }
          );
        }
      };
      this.handleAllowedAttrsCreateOption = (newValue) => {
        if (!this.state.ocMayOptions.includes(newValue)) {
          this.setState({
            ocMayOptions: [...this.state.ocMayOptions, { value: newValue }]
          });
        }
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.validateForm = this.validateForm.bind(this);
      this.onAttrChange = this.onAttrChange.bind(this);
      this.onOCChange = this.onOCChange.bind(this);
      this.onFieldChange = this.onFieldChange.bind(this);
      this.loadSchemaData = this.loadSchemaData.bind(this);
      this.loadSyntaxesFirst = this.loadSyntaxesFirst.bind(this);
      this.toggleLoading = this.toggleLoading.bind(this);
      this.showEditObjectclassModal = this.showEditObjectclassModal.bind(this);
      this.handleShowAddObjectclassModal = this.handleShowAddObjectclassModal.bind(this);
      this.openObjectclassModal = this.openObjectclassModal.bind(this);
      this.closeObjectclassModal = this.closeObjectclassModal.bind(this);
      this.doDeleteOC = this.doDeleteOC.bind(this);
      this.addObjectclass = this.addObjectclass.bind(this);
      this.editObjectclass = this.editObjectclass.bind(this);
      this.cmdOperationObjectclass = this.cmdOperationObjectclass.bind(this);
      this.showConfirmOCDelete = this.showConfirmOCDelete.bind(this);
      this.closeConfirmOCDelete = this.closeConfirmOCDelete.bind(this);
      this.showEditAttributeModal = this.showEditAttributeModal.bind(this);
      this.handleShowAddAttributeModal = this.handleShowAddAttributeModal.bind(this);
      this.openAttributeModal = this.openAttributeModal.bind(this);
      this.closeAttributeModal = this.closeAttributeModal.bind(this);
      this.doDeleteAttr = this.doDeleteAttr.bind(this);
      this.addAttribute = this.addAttribute.bind(this);
      this.editAttribute = this.editAttribute.bind(this);
      this.showConfirmAttrDelete = this.showConfirmAttrDelete.bind(this);
      this.closeConfirmAttrDelete = this.closeConfirmAttrDelete.bind(this);
    }
    toggleLoading(item) {
      if (item === "allSchema") {
        this.setState((prevState) => ({
          loading: !prevState.loading
        }));
      } else if (item === "ocTable") {
        this.setState((prevState) => ({
          ocTableLoading: !prevState.ocTableLoading
        }));
      } else if (item === "ocModal") {
        this.setState((prevState) => ({
          ocModalLoading: !prevState.ocModalLoading
        }));
      } else if (item === "atTable") {
        this.setState((prevState) => ({
          atTableLoading: !prevState.atTableLoading
        }));
      } else if (item === "atModal") {
        this.setState((prevState) => ({
          atModalLoading: !prevState.atModalLoading
        }));
      }
    }
    loadSyntaxesFirst() {
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      this.toggleLoading("allSchema");
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "get_syntaxes"
      ];
      log_cmd("loadSyntaxes", "Get syntaxes for attributetypes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        this.setState({
          syntaxes: myObject.items
        });
        this.loadSchemaData(true);
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = JSON.parse(err);
          console.log("loadSyntaxes failed: ", errMsg.desc);
        }
      });
    }
    loadSchemaData(initialLoading) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "list"
      ];
      log_cmd("loadSchemaData", "Get schema objects in one batch", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const attrs = [];
        const ocs = [];
        const mrs = [];
        const ocKey = this.state.ocTableKey + 1;
        const attrKey = this.state.attrTableKey + 1;
        for (const content2 of myObject.attributetypes.items) {
          attrs.push(content2.name[0]);
        }
        for (const content2 of myObject.objectclasses.items) {
          ocs.push(content2.name[0]);
        }
        for (const content2 of myObject.matchingrules.items) {
          if (content2.name[0] !== "") {
            mrs.push(content2.name[0]);
          } else {
            content2.name[0] = /* @__PURE__ */ import_react103.default.createElement("i", null, "<No Name>");
          }
        }
        this.setState({
          objectclassRows: myObject.objectclasses.items,
          attributesRows: myObject.attributetypes.items,
          matchingrulesRows: myObject.matchingrules.items,
          attributes: attrs,
          matchingrules: mrs,
          objectclasses: ocs
        });
        if (this.state.ocUserDefined) {
          this.setState({
            filteredObjectclassRows: searchFilter(
              "user defined",
              ["x_origin"],
              myObject.objectclasses.items
            ),
            ocTableKey: ocKey
          });
        } else {
          this.setState({
            filteredObjectclassRows: myObject.objectclasses.items,
            ocTableKey: ocKey
          });
        }
        if (this.state.atUserDefined) {
          this.setState({
            filteredAttributesRows: searchFilter(
              "user defined",
              ["x_origin"],
              myObject.attributetypes.items
            ),
            attrTableKey: attrKey
          });
        } else {
          this.setState({
            filteredAttributesRows: myObject.attributetypes.items,
            attrTableKey: attrKey
          });
        }
        if (initialLoading) {
          this.toggleLoading("allSchema");
        } else {
          this.setState({
            atTableLoading: false,
            ocTableLoading: false
          });
        }
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = JSON.parse(err);
          console.log("loadSchemaData failed: ", errMsg.desc);
        }
        if (initialLoading) {
          this.toggleLoading("allSchema");
        } else {
          this.setState({
            atTableLoading: false,
            ocTableLoading: false
          });
        }
      });
    }
    showEditObjectclassModal(name2) {
      this.setState({
        ocModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: {}
      });
      this.openObjectclassModal(name2);
    }
    handleShowAddObjectclassModal(rowData) {
      this.setState({
        ocModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: { ocName: true, ocDesc: true }
      });
      this.openObjectclassModal();
    }
    openObjectclassModal(name2) {
      if (!name2) {
        this.setState({
          ocName: "",
          ocDesc: "",
          ocOID: "",
          ocParent: "top",
          ocKind: "",
          ocMust: [],
          ocMay: [],
          objectclassModalShow: true,
          newOcEntry: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "objectclasses",
          "query",
          name2
        ];
        log_cmd("openObjectclassModal", "Fetch ObjectClass data from schema", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const obj = JSON.parse(content);
          const item = obj.oc;
          let ocMustList = [];
          let ocMayList = [];
          const kindOpts = ["STRUCTURAL", "ABSTRACT", "AUXILIARY"];
          this.setState({
            objectclassModalShow: true,
            newOcEntry: false,
            ocName: item.name === void 0 ? "" : item.name[0],
            ocDesc: item.desc === null ? "" : item.desc[0],
            ocOID: item.oid === void 0 ? "" : item.oid[0],
            ocKind: item.kind === void 0 ? "" : kindOpts[item.kind],
            ocParent: item.sup === void 0 ? [] : item.sup[0],
            // Store original values
            _ocName: item.name === void 0 ? "" : item.name[0],
            _ocDesc: item.desc === null ? "" : item.desc[0],
            _ocOID: item.oid === void 0 ? "" : item.oid[0],
            _ocKind: item.kind === void 0 ? "" : kindOpts[item.kind],
            _ocParent: item.sup === void 0 ? [] : item.sup[0]
          });
          if (item.must === void 0) {
            this.setState({ ocMust: [], _ocMust: [] });
          } else {
            for (const value of item.must) {
              ocMustList = [...ocMustList, value];
            }
            this.setState({
              ocMust: ocMustList,
              _ocMust: ocMustList
            });
          }
          if (item.may === void 0) {
            this.setState({ ocMay: [], _ocMay: [] });
          } else {
            for (const value of item.may) {
              ocMayList = [...ocMayList, value];
            }
            this.setState({
              ocMay: ocMayList,
              _ocMay: ocMayList
            });
          }
        }).fail((_) => {
          this.setState({
            ocName: "",
            ocDesc: "",
            ocOID: "",
            ocParent: "",
            ocKind: "",
            ocMust: [],
            ocMay: [],
            objectclassModalShow: true,
            newOcEntry: true
          });
        });
      }
    }
    closeObjectclassModal() {
      this.setState({ objectclassModalShow: false });
    }
    closeConfirmOCDelete() {
      this.setState({
        showConfirmDeleteOC: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    showConfirmOCDelete(oc_name) {
      this.setState({
        showConfirmDeleteOC: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: oc_name
      });
    }
    doDeleteOC() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "objectclasses",
        "remove",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      this.toggleLoading("ocTable");
      log_cmd("deleteObjectclass", "Delete ObjectClass from schema", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteObjectclass", "Result", content);
        this.props.addNotification("success", `ObjectClass ${this.state.deleteName} was successfully deleted`);
        this.loadSchemaData();
        this.closeConfirmOCDelete();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during ObjectClass removal operation - ${errMsg.desc}`
        );
        this.loadSchemaData();
        this.closeConfirmOCDelete();
      });
    }
    addObjectclass() {
      this.cmdOperationObjectclass("add");
    }
    editObjectclass() {
      this.cmdOperationObjectclass("replace");
    }
    cmdOperationObjectclass(action) {
      const { ocName, ocDesc, ocOID, ocParent, ocKind, ocMust, ocMay } = this.state;
      if (ocName === "") {
        this.props.addNotification("warning", "ObjectClass Name is required.");
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "objectclasses",
          action,
          ocName
        ];
        if (ocOID !== "") {
          cmd = [...cmd, "--oid", ocOID];
        }
        if (ocParent !== "") {
          cmd = [...cmd, "--sup", ocParent];
        }
        if (ocKind !== "") {
          cmd = [...cmd, "--kind", ocKind];
        }
        if (ocDesc !== "") {
          cmd = [...cmd, "--desc", ocDesc];
        }
        if (ocMust.length !== 0) {
          cmd = [...cmd, "--must"];
          for (const value of ocMust) {
            cmd = [...cmd, value];
          }
        }
        if (ocMay.length !== 0) {
          cmd = [...cmd, "--may"];
          for (const value of ocMay) {
            cmd = [...cmd, value];
          }
        }
        this.toggleLoading("ocModal");
        this.toggleLoading("ocTable");
        log_cmd("cmdOperationObjectclass", `Do the ${action} operation on ObjectClass`, cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info("cmdOperationObjectclass", "Result", content);
          this.props.addNotification(
            "success",
            `ObjectClass ${ocName} - ${action} operation was successfull`
          );
          this.loadSchemaData();
          this.closeObjectclassModal();
          this.toggleLoading("ocModal");
        }).fail((err) => {
          let errMsg = JSON.parse(err);
          if ("info" in errMsg) {
            errMsg = errMsg.desc + " " + errMsg.info;
          } else {
            errMsg = errMsg.desc;
          }
          this.props.addNotification(
            "error",
            `Error during the ObjectClass ${action} operation - ${errMsg}`
          );
          this.loadSchemaData();
          this.closeObjectclassModal();
          this.toggleLoading("ocModal");
        });
      }
    }
    showEditAttributeModal(name2) {
      this.setState({
        atModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: {}
      });
      this.openAttributeModal(name2);
    }
    handleShowAddAttributeModal(rowData) {
      this.setState({
        atModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: { atName: true, atDesc: true }
      });
      this.openAttributeModal();
    }
    openAttributeModal(name2) {
      if (!name2) {
        this.setState({
          atName: "",
          atDesc: "",
          atOID: "",
          atParent: "",
          atSyntax: "1.3.6.1.4.1.1466.115.121.1.15",
          atUsage: "userApplications",
          atMultivalued: false,
          atNoUserMod: false,
          atAlias: [],
          atEqMr: "",
          atOrder: "",
          atSubMr: "",
          attributeModalShow: true,
          newAtEntry: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "attributetypes",
          "query",
          name2
        ];
        log_cmd("openAttributeModal", "Fetch Attribute data from schema", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const obj = JSON.parse(content);
          const item = obj.at;
          let atAliasList = [];
          const atUsageOpts = [
            "userApplications",
            "directoryOperation",
            "distributedOperation",
            "dSAOperation"
          ];
          this.setState({
            attributeModalShow: true,
            newAtEntry: false,
            atName: item.name === void 0 ? "" : item.name[0],
            atDesc: item.desc === null ? "" : item.desc[0],
            atOID: item.oid === void 0 ? "" : item.oid[0],
            atParent: item.sup.length === 0 ? "" : item.sup[0],
            atSyntax: item.syntax === void 0 ? "" : item.syntax[0],
            atUsage: item.usage === void 0 ? "" : atUsageOpts[item.usage],
            atMultivalued: !item.single_value,
            atNoUserMod: item.no_user_mod,
            atEqMr: item.equality === null ? "" : item.equality[0],
            atOrder: item.ordering === null ? "" : item.ordering[0],
            atSubMr: item.substr === null ? "" : item.substr[0],
            // store orig valuses
            _atName: item.name === void 0 ? "" : item.name[0],
            _atDesc: item.desc === null ? "" : item.desc[0],
            _atOID: item.oid === void 0 ? "" : item.oid[0],
            _atParent: item.sup[0],
            _atSyntax: item.syntax === void 0 ? "" : item.syntax[0],
            _atUsage: item.usage === void 0 ? "" : atUsageOpts[item.usage],
            _atMultivalued: !item.single_value,
            _atNoUserMod: item.no_user_mod,
            _atEqMr: item.equality === null ? "" : item.equality[0],
            _atOrder: item.ordering === null ? "" : item.ordering[0],
            _atSubMr: item.substr === null ? "" : item.substr[0]
          });
          if (item.aliases === null) {
            this.setState({ atAlias: [], _atAlias: [] });
          } else {
            for (const value of item.aliases) {
              atAliasList = [...atAliasList, value];
            }
            this.setState({
              atAlias: atAliasList,
              _atAlias: atAliasList
            });
          }
        }).fail((_) => {
          this.setState({
            atName: "",
            atDesc: "",
            atOID: "",
            atParent: "",
            atSyntax: "",
            atUsage: "userApplications",
            atMultivalued: false,
            atNoUserMod: false,
            atAlias: [],
            atEqMr: "",
            atOrder: "",
            atSubMr: "",
            attributeModalShow: true,
            newAtEntry: true
          });
        });
      }
    }
    closeAttributeModal() {
      this.setState({
        attributeModalShow: false
      });
    }
    closeConfirmAttrDelete() {
      this.setState({
        showConfirmAttrDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    showConfirmAttrDelete(attr_name) {
      this.setState({
        showConfirmAttrDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: attr_name
      });
    }
    doDeleteAttr() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "remove",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      this.toggleLoading("atTable");
      log_cmd("deleteAttribute", "Delete Attribute from schema", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteAttribute", "Result", content);
        this.props.addNotification("success", `Attribute ${this.state.deleteName} was successfully deleted`);
        this.loadSchemaData();
        this.closeConfirmAttrDelete();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error during Attribute removal operation - ${errMsg.desc}`
        );
        this.loadSchemaData();
        this.closeConfirmAttrDelete();
      });
    }
    addAttribute() {
      const {
        atName,
        atDesc,
        atOID,
        atParent,
        atSyntax,
        atUsage,
        atMultivalued,
        atNoUserMod,
        atAlias,
        atEqMr,
        atOrder,
        atSubMr
      } = this.state;
      const eqMR = atEqMr;
      const orderMR = atOrder;
      const subMR = atSubMr;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "add",
        atName
      ];
      cmd = [...cmd, "--syntax", atSyntax];
      if (atAlias.length !== 0) {
        cmd = [...cmd, "--aliases"];
        for (const value of atAlias) {
          cmd = [...cmd, value];
        }
      }
      if (atParent !== "") {
        cmd = [...cmd, "--sup", atParent];
      }
      if (eqMR !== "") {
        cmd = [...cmd, "--equality", eqMR];
      }
      if (subMR !== "") {
        cmd = [...cmd, "--substr", subMR];
      }
      if (orderMR !== "") {
        cmd = [...cmd, "--ordering", orderMR];
      }
      if (atMultivalued) {
        cmd = [...cmd, "--multi-value"];
      } else {
        cmd = [...cmd, "--single-value"];
      }
      if (atNoUserMod) {
        cmd = [...cmd, "--no-user-mod"];
      } else {
        cmd = [...cmd, "--user-mod"];
      }
      if (atOID !== "") {
        cmd = [...cmd, "--oid", atOID];
      }
      if (atUsage !== "") {
        cmd = [...cmd, "--usage", atUsage];
      }
      if (atDesc !== "") {
        cmd = [...cmd, "--desc", atDesc];
      }
      this.toggleLoading("atModal");
      this.toggleLoading("atTable");
      log_cmd("cmdOperationAttribute", `Do the add operation on Attribute`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("cmdOperationAttribute", "Result", content);
        this.props.addNotification(
          "success",
          `Attribute ${atName} - add operation was successfull`
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      }).fail((err) => {
        let errMsg = JSON.parse(err);
        if ("info" in errMsg) {
          errMsg = errMsg.desc + " " + errMsg.info;
        } else {
          errMsg = errMsg.desc;
        }
        this.props.addNotification(
          "error",
          `Error during the Attribute add operation - ${errMsg}`
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      });
    }
    editAttribute(action) {
      const {
        atName,
        atDesc,
        atOID,
        atParent,
        atSyntax,
        atUsage,
        atMultivalued,
        atNoUserMod,
        atAlias,
        atEqMr,
        atOrder,
        atSubMr
      } = this.state;
      let eqMR = atEqMr;
      let orderMR = atOrder;
      let subMR = atSubMr;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "replace",
        atName
      ];
      cmd = [...cmd, "--syntax", atSyntax];
      if (!listsEqual(atAlias, this.state._atAlias)) {
        cmd = [...cmd, "--aliases"];
        for (const value of atAlias) {
          cmd = [...cmd, value];
        }
      }
      if (atParent !== "") {
        cmd = [...cmd, "--sup", atParent];
      } else if (this.state._atParent !== "") {
        eqMR = "";
        orderMR = "";
        subMR = "";
      }
      if (eqMR !== this.state._atEqMr) {
        cmd = [...cmd, "--equality", eqMR];
      }
      if (subMR !== this.state._atSubMr) {
        cmd = [...cmd, "--substr", subMR];
      }
      if (orderMR !== this.state._atOrder) {
        cmd = [...cmd, "--ordering", orderMR];
      }
      if (atMultivalued) {
        cmd = [...cmd, "--multi-value"];
      } else {
        cmd = [...cmd, "--single-value"];
      }
      if (atNoUserMod) {
        cmd = [...cmd, "--no-user-mod"];
      } else {
        cmd = [...cmd, "--user-mod"];
      }
      if (atOID !== this.state._atOID) {
        cmd = [...cmd, "--oid", atOID];
      }
      if (atUsage !== this.state._atUsage) {
        cmd = [...cmd, "--usage", atUsage];
      }
      if (atDesc !== this.state._atDesc) {
        cmd = [...cmd, "--desc", atDesc];
      }
      this.toggleLoading("atModal");
      this.toggleLoading("atTable");
      log_cmd("cmdOperationAttribute", `Do the replace operation on Attribute`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("cmdOperationAttribute", "Result", content);
        this.props.addNotification(
          "success",
          `Attribute ${atName} - replace operation was successfull`
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      }).fail((err) => {
        let errMsg = JSON.parse(err);
        if ("info" in errMsg) {
          errMsg = errMsg.desc + " " + errMsg.info;
        } else {
          errMsg = errMsg.desc;
        }
        this.props.addNotification(
          "error",
          `Error during the Attribute replace operation - ${errMsg}`
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      });
    }
    validateForm(attr, value, attrs, errObj) {
      let all_good = true;
      for (const check_attr of attrs) {
        errObj[check_attr] = false;
        if (attr !== check_attr) {
          if (this.state[check_attr] === "") {
            errObj[check_attr] = true;
            all_good = false;
          }
        } else if (value === "") {
          errObj[check_attr] = true;
          all_good = false;
        }
      }
      return all_good;
    }
    onAttrChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      const errObj = this.state.errObj;
      let all_good;
      const attrs = [
        "atName",
        "atDesc",
        "atOID",
        "atMultivalued",
        "atNoUserMod",
        "atSyntax",
        "atEqMr",
        "atOrder",
        "atSubMr",
        "atParent"
      ];
      const attrLists = [
        "atAlias"
      ];
      if (this.state.newAtEntry) {
        if (this.validateForm(attr, value, ["atName", "atDesc", "atSyntax"], errObj)) {
          saveBtnDisabled = false;
        }
      } else {
        all_good = this.validateForm(attr, value, ["atName", "atDesc", "atSyntax"], errObj);
        if (all_good) {
          for (const check_attr of attrs) {
            if (attr !== check_attr) {
              if (this.state[check_attr] !== this.state["_" + check_attr]) {
                saveBtnDisabled = false;
                break;
              }
            } else if (value !== this.state["_" + check_attr]) {
              saveBtnDisabled = false;
              break;
            }
          }
          for (const check_attr of attrLists) {
            if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
              saveBtnDisabled = false;
              break;
            }
          }
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled,
        errObj
      });
    }
    onOCChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      const errObj = this.state.errObj;
      let all_good;
      const attrs = [
        "ocName",
        "ocDesc",
        "ocOID",
        "ocParent"
      ];
      const attrLists = [
        "ocMust",
        "ocMay"
      ];
      if (this.state.newOcEntry) {
        if (this.validateForm(attr, value, ["ocName", "ocDesc", "ocParent"], errObj)) {
          saveBtnDisabled = false;
        }
      } else {
        all_good = this.validateForm(attr, value, ["ocName", "ocDesc", "ocParent"], errObj);
        if (all_good) {
          for (const check_attr of attrs) {
            if (attr !== check_attr) {
              if (this.state[check_attr] !== this.state["_" + check_attr]) {
                saveBtnDisabled = false;
                break;
              }
            } else if (value !== this.state["_" + check_attr]) {
              saveBtnDisabled = false;
              break;
            }
          }
          for (const check_attr of attrLists) {
            if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
              saveBtnDisabled = false;
              break;
            }
          }
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled,
        errObj
      });
    }
    onFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const ocKey = this.state.ocTableKey + 1;
      const attrKey = this.state.attrTableKey + 1;
      if (e.target.id === "ocUserDefined") {
        if (value) {
          this.setState({
            filteredObjectclassRows: searchFilter(
              "user defined",
              ["x_origin"],
              this.state.objectclassRows
            ),
            ocTableKey: ocKey
          });
        } else {
          this.setState({
            filteredObjectclassRows: this.state.objectclassRows,
            ocTableKey: ocKey
          });
        }
      } else if (e.target.id === "atUserDefined") {
        if (value) {
          this.setState({
            filteredAttributesRows: searchFilter(
              "user defined",
              ["x_origin"],
              this.state.attributesRows
            ),
            attrTableKey: attrKey
          });
        } else {
          this.setState({
            filteredAttributesRows: this.state.attributesRows,
            attrTableKey: attrKey
          });
        }
      }
      this.setState({
        [e.target.id]: value
      });
    }
    render() {
      let schemaPage = "";
      if (this.state.loading) {
        schemaPage = /* @__PURE__ */ import_react103.default.createElement("div", { className: "ds-center ds-margin-top-xlg" }, /* @__PURE__ */ import_react103.default.createElement(TextContent, null, /* @__PURE__ */ import_react103.default.createElement(Text, { component: TextVariants.h3 }, "Loading Schema Information ...")), /* @__PURE__ */ import_react103.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      } else {
        schemaPage = /* @__PURE__ */ import_react103.default.createElement("div", { className: "ds-indent ds-margin-top-xlg ds-margin-bottom-md" }, /* @__PURE__ */ import_react103.default.createElement(Tabs, { isBox: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react103.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react103.default.createElement(TabTitleText, null, "Objectclasses") }, /* @__PURE__ */ import_react103.default.createElement("div", { className: "ds-margin-top-xlg ds-indent" }, /* @__PURE__ */ import_react103.default.createElement(
          Checkbox,
          {
            id: "ocUserDefined",
            isChecked: this.state.ocUserDefined,
            title: "Show only the objectclasses that are defined by a user and have the X-ORIGIN set to 'user defined'",
            onChange: (checked, e) => {
              this.onFieldChange(e);
            },
            label: "Only Show Non-standard/Custom Schema"
          }
        ), /* @__PURE__ */ import_react103.default.createElement(
          ObjectClassesTable,
          {
            className: "ds-margin-top-lg",
            key: this.state.ocTableKey,
            rows: this.state.filteredObjectclassRows,
            editModalHandler: this.showEditObjectclassModal,
            deleteHandler: this.showConfirmOCDelete,
            loading: this.state.ocTableLoading
          }
        ), /* @__PURE__ */ import_react103.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowAddObjectclassModal
          },
          "Add ObjectClass"
        ), /* @__PURE__ */ import_react103.default.createElement(
          ObjectClassModal,
          {
            addHandler: this.addObjectclass,
            editHandler: this.editObjectclass,
            newOcEntry: this.state.newOcEntry,
            ocModalViewOnly: this.state.ocModalViewOnly,
            handleFieldChange: this.onOCChange,
            objectclasses: this.state.objectclasses,
            attributes: this.state.attributes,
            ocName: this.state.ocName,
            ocDesc: this.state.ocDesc,
            ocOID: this.state.ocOID,
            ocParent: this.state.ocParent,
            ocKind: this.state.ocKind,
            ocMust: this.state.ocMust,
            ocMay: this.state.ocMay,
            objectclassModalShow: this.state.objectclassModalShow,
            closeModal: this.closeObjectclassModal,
            loading: this.state.ocModalLoading,
            isParentObjOpen: this.state.isParentObjOpen,
            isRequiredAttrsOpen: this.state.isRequiredAttrsOpen,
            isAllowedAttrsOpen: this.state.isAllowedAttrsOpen,
            onRequiredAttrsToggle: this.handleRequiredAttrsToggle,
            onRequiredAttrsClear: this.handleRequiredAttrsClear,
            onRequiredAttrsSelect: this.handleRequiredAttrsSelect,
            onRequiredAttrsCreateOption: this.handleRequiredAttrsCreateOption,
            onAllowedAttrsToggle: this.handleAllowedAttrsToggle,
            onAllowedAttrsClear: this.handleAllowedAttrsClear,
            onAllowedAttrsSelect: this.handleAllowedAttrsSelect,
            onAllowedAttrsCreateOption: this.handleAllowedAttrsCreateOption,
            saveBtnDisabled: this.state.saveBtnDisabled,
            error: this.state.errObj
          }
        ))), /* @__PURE__ */ import_react103.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react103.default.createElement(TabTitleText, null, "Attributes") }, /* @__PURE__ */ import_react103.default.createElement("div", { className: "ds-margin-top-xlg ds-indent" }, /* @__PURE__ */ import_react103.default.createElement(
          Checkbox,
          {
            id: "atUserDefined",
            isChecked: this.state.atUserDefined,
            title: "Show only the attributes that are defined by a user, and have the X-ORIGIN set to 'user defined'",
            onChange: (checked, e) => {
              this.onFieldChange(e);
            },
            label: "Only Show Non-standard/Custom Schema"
          }
        ), /* @__PURE__ */ import_react103.default.createElement(
          AttributesTable,
          {
            className: "ds-margin-top-lg",
            key: this.state.attrTableKey,
            rows: this.state.filteredAttributesRows,
            editModalHandler: this.showEditAttributeModal,
            deleteHandler: this.showConfirmAttrDelete,
            syntaxes: this.state.syntaxes,
            loading: this.state.atTableLoading
          }
        ), /* @__PURE__ */ import_react103.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowAddAttributeModal
          },
          "Add Attribute"
        ), /* @__PURE__ */ import_react103.default.createElement(
          AttributeTypeModal,
          {
            addHandler: this.addAttribute,
            editHandler: this.editAttribute,
            newAtEntry: this.state.newAtEntry,
            atModalViewOnly: this.state.atModalViewOnly,
            handleFieldChange: this.onAttrChange,
            objectclasses: this.state.objectclasses,
            attributes: this.state.attributes,
            matchingrules: this.state.matchingrules,
            syntaxes: this.state.syntaxes,
            atName: this.state.atName,
            atDesc: this.state.atDesc,
            atOID: this.state.atOID,
            atParent: this.state.atParent,
            atSyntax: this.state.atSyntax,
            atUsage: this.state.atUsage,
            atMultivalued: this.state.atMultivalued,
            atNoUserMod: this.state.atNoUserMod,
            atAlias: this.state.atAlias,
            atEqMr: this.state.atEqMr,
            atOrder: this.state.atOrder,
            atSubMr: this.state.atSubMr,
            attributeModalShow: this.state.attributeModalShow,
            closeModal: this.closeAttributeModal,
            loading: this.state.atModalLoading,
            isParentAttrOpen: this.state.isParentAttrOpen,
            isAliasNameOpen: this.state.isAliasNameOpen,
            isEqualityMROpen: this.state.isEqualityMROpen,
            isOrderMROpen: this.state.isOrderMROpen,
            isSubstringMROpen: this.state.isSubstringMROpen,
            onParentAttrToggle: this.handleParentAttrToggle,
            onParentAttrClear: this.handleParentAttrClear,
            onParentAttrSelect: this.handleParentAttrSelect,
            onAliasNameToggle: this.handleAliasNameToggle,
            onAliasNameClear: this.handleAliasNameClear,
            onAliasNameSelect: this.handleAliasNameSelect,
            onAliasNameCreateOption: this.handleAliasNameCreateOption,
            onEqualityMRToggle: this.handleEqualityMRToggle,
            onEqualityMRClear: this.handleEqualityMRClear,
            onEqualityMRSelect: this.handleEqualityMRSelect,
            onOrderMRToggle: this.handleOrderMRToggle,
            onOrderMRClear: this.handleOrderMRClear,
            onOrderMRSelect: this.handleOrderMRSelect,
            onSubstringMRToggle: this.handleSubstringMRToggle,
            onSubstringMRClear: this.handleSubstringMRClear,
            onSubstringMRSelect: this.handleSubstringMRSelect,
            saveBtnDisabled: this.state.saveBtnDisabled,
            error: this.state.errObj
          }
        ))), /* @__PURE__ */ import_react103.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react103.default.createElement(TabTitleText, null, "Matching Rules") }, /* @__PURE__ */ import_react103.default.createElement("div", { className: "ds-margin-top-xlg ds-indent" }, /* @__PURE__ */ import_react103.default.createElement(
          MatchingRulesTable,
          {
            rows: this.state.matchingrulesRows
          }
        )))), /* @__PURE__ */ import_react103.default.createElement(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteOC,
            closeHandler: this.closeConfirmOCDelete,
            handleChange: this.onFieldChange,
            actionHandler: this.doDeleteOC,
            spinning: this.state.modalSpinning,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            mTitle: "Delete An Objectclass",
            mMsg: "Are you sure you want to delete this Objectclass?",
            mSpinningMsg: "Deleting objectclass ...",
            mBtnName: "Delete Objectclass"
          }
        ), /* @__PURE__ */ import_react103.default.createElement(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmAttrDelete,
            closeHandler: this.closeConfirmAttrDelete,
            handleChange: this.onFieldChange,
            actionHandler: this.doDeleteAttr,
            spinning: this.state.modalSpinning,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            mTitle: "Delete An Attribute",
            mMsg: "Are you sure you want to delete this Attribute?",
            mSpinningMsg: "Deleting attribute ...",
            mBtnName: "Delete Attribute"
          }
        ));
      }
      return /* @__PURE__ */ import_react103.default.createElement("div", null, schemaPage);
    }
  };
  Schema.propTypes = {
    addNotification: import_prop_types81.default.func,
    serverId: import_prop_types81.default.string
  };
  Schema.defaultProps = {
    serverId: ""
  };

  // src/replication.jsx
  var import_react112 = __toESM(require_react(), 1);

  // src/lib/replication/replSuffix.jsx
  var import_react111 = __toESM(require_react(), 1);

  // src/lib/replication/replChangelog.jsx
  var import_react104 = __toESM(require_react(), 1);
  var import_prop_types82 = __toESM(require_prop_types(), 1);
  var import_outlined_question_circle_icon3 = __toESM(require_outlined_question_circle_icon(), 1);
  var Changelog = class extends import_react104.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        errObj: {},
        showConfirmDelete: false,
        saveBtnDisabled: true,
        // Changelog settings
        clMaxEntries: Number(this.props.clMaxEntries) === 0 ? -1 : Number(this.props.clMaxEntries),
        clMaxAge: Number(this.props.clMaxAge.slice(0, -1)) === 0 ? -1 : Number(this.props.clMaxAge.slice(0, -1)),
        clMaxAgeUnit: this.props.clMaxAge !== "" ? this.props.clMaxAge.slice(-1).toLowerCase() : "s",
        clTrimInt: Number(this.props.clTrimInt) === 0 ? -1 : Number(this.props.clTrimInt),
        clEncrypt: this.props.clEncrypt,
        // Preserve original settings
        _clMaxEntries: Number(this.props.clMaxEntries) === 0 ? -1 : Number(this.props.clMaxEntries),
        _clMaxAge: Number(this.props.clMaxAge.slice(0, -1)) === 0 ? -1 : Number(this.props.clMaxAge.slice(0, -1)),
        _clMaxAgeUnit: this.props.clMaxAge !== "" ? this.props.clMaxAge.slice(-1).toLowerCase() : "s",
        _clTrimInt: Number(this.props.clTrimInt) === 0 ? -1 : Number(this.props.clTrimInt),
        _clEncrypt: this.props.clEncrypt
      };
      this.minValue = -1;
      this.maxValue = 2e7;
      this.onMinus = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onChange = (event, id) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlus = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSaveSettings = this.handleSaveSettings.bind(this);
    }
    handleSaveSettings() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "set-changelog",
        "--suffix",
        this.props.suffix
      ];
      let requires_restart = false;
      let msg = "Successfully updated changelog configuration.";
      if (this.state.clMaxEntries !== this.state._clMaxEntries) {
        cmd.push("--max-entries=" + this.state.clMaxEntries);
      }
      if (this.state.clMaxAge !== this.state._clMaxAge || this.state.clMaxAgeUnit !== this.state._clMaxAgeUnit) {
        cmd.push("--max-age=" + this.state.clMaxAge + this.state.clMaxAgeUnit);
      }
      if (this.state.clTrimInt !== this.state._clTrimInt) {
        cmd.push("--trim-interval=" + this.state.clTrimInt);
      }
      if (this.state.clEncrypt !== this.state._clEncrypt) {
        if (this.state.clEncrypt) {
          cmd.push("--encrypt");
          msg += "  This requires a server restart to take effect";
          requires_restart = true;
        } else {
          cmd.push("--disable-encrypt");
        }
      }
      if (cmd.length > 6) {
        this.setState({
          // Start the spinner
          saving: true
        });
        log_cmd("handleSaveSettings", "Applying replication changelog changes", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.reloadChangelog();
          this.props.addNotification(
            requires_restart ? "warning" : "success",
            msg
          );
          this.setState({
            saving: false,
            saveBtnDisabled: true
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.reloadChangelog();
          this.setState({
            saving: false
          });
          let msg2 = errMsg.desc;
          if ("info" in errMsg) {
            msg2 = errMsg.desc + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            `Error updating changelog configuration - ${msg2}`
          );
        });
      }
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      if (this.state.clMaxEntries !== this.state._clMaxEntries || this.state.clMaxAge !== this.state._clMaxAge || this.state.clMaxAgeUnit !== this.state._clMaxAgeUnit || this.state.clTrimInt !== this.state._clTrimInt || this.state.clEncrypt !== this.state._clEncrypt) {
        saveBtnDisabled = false;
      }
      this.setState({
        saveBtnDisabled
      });
    }
    handleChange(str, e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    reloadChangelog() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get-changelog",
        "--suffix",
        this.props.suffix
      ];
      log_cmd("reloadChangelog", "Load the replication changelog info", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let clMaxEntries = "";
        let clMaxAge = "";
        let clMaxAgeUnit = "s";
        let clTrimInt = "";
        let clEncrypt = false;
        for (const attr in config2.attrs) {
          const val = config2.attrs[attr][0];
          if (attr === "nsslapd-changelogmaxentries") {
            clMaxEntries = val;
          } else if (attr === "nsslapd-changelogmaxage") {
            clMaxAge = val.slice(0, -1);
            clMaxAgeUnit = val.slice(-1).toLowerCase();
          } else if (attr === "nsslapd-changelogtrim-interval") {
            clTrimInt = val;
          } else if (attr === "nsslapd-encryptionalgorithm") {
            clEncrypt = true;
          }
        }
        this.setState({
          clMaxEntries: Number(clMaxEntries) === 0 ? -1 : Number(clMaxEntries),
          clMaxAge: Number(clMaxAge) === 0 ? -1 : Number(clMaxAge),
          clMaxAgeUnit,
          clTrimInt: Number(clTrimInt) === 0 ? -1 : Number(clTrimInt),
          clEncrypt,
          // Preserve original settings
          _clMaxEntries: Number(clMaxEntries) === 0 ? -1 : Number(clMaxEntries),
          _clMaxAge: Number(clMaxAge) === 0 ? -1 : Number(clMaxAge),
          _clMaxAgeUnit: clMaxAgeUnit,
          _clTrimInt: Number(clTrimInt) === 0 ? -1 : Number(clTrimInt),
          _clEncrypt: clEncrypt,
          saveBtnDisabled: true,
          loading: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to reload changelog for "${this.props.suffix}" - ${errMsg.desc}`
        );
        this.setState({
          loading: false,
          saveBtnDisabled: true
        });
      });
    }
    render() {
      let clPage;
      let saveBtnName = "Save Settings";
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      } else if (this.loading) {
        clPage = /* @__PURE__ */ import_react104.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react104.default.createElement(TextContent, null, /* @__PURE__ */ import_react104.default.createElement(Text, { component: TextVariants.h3 }, "Loading Changelog Configuration ...")), /* @__PURE__ */ import_react104.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "md" }));
      } else {
        clPage = /* @__PURE__ */ import_react104.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react104.default.createElement(Form, { isHorizontal: true }, /* @__PURE__ */ import_react104.default.createElement(
          Grid,
          {
            title: "Changelog trimming parameter.  Set the maximum number of changelog entries allowed in the database (nsslapd-changelogmaxentries)."
          },
          /* @__PURE__ */ import_react104.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Changelog Maximum Entries"),
          /* @__PURE__ */ import_react104.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react104.default.createElement(
            NumberInput,
            {
              value: this.state.clMaxEntries,
              min: this.minValue,
              max: this.maxValue,
              onMinus: () => {
                this.onMinus("clMaxEntries");
              },
              onChange: (e) => {
                this.onChange(e, "clMaxEntries");
              },
              onPlus: () => {
                this.onPlus("clMaxEntries");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react104.default.createElement(
          Grid,
          {
            title: "Changelog trimming parameter.  This set the maximum age of a changelog entry (nsslapd-changelogmaxage)."
          },
          /* @__PURE__ */ import_react104.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Changelog Maximum Age"),
          /* @__PURE__ */ import_react104.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react104.default.createElement(
            NumberInput,
            {
              value: this.state.clMaxAge,
              min: this.minValue,
              max: this.maxValue,
              onMinus: () => {
                this.onMinus("clMaxAge");
              },
              onChange: (e) => {
                this.onChange(e, "clMaxAge");
              },
              onPlus: () => {
                this.onPlus("clMaxAge");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          )),
          /* @__PURE__ */ import_react104.default.createElement(GridItem, { className: "ds-margin-left", span: 3 }, /* @__PURE__ */ import_react104.default.createElement(
            FormSelect,
            {
              className: "ds-margin-left",
              id: "clMaxAgeUnit",
              value: this.state.clMaxAgeUnit,
              onChange: this.handleChange,
              "aria-label": "FormSelect Input",
              isDisabled: this.state.clMaxAge < 1
            },
            /* @__PURE__ */ import_react104.default.createElement(FormSelectOption, { key: "s", value: "s", label: "Seconds" }),
            /* @__PURE__ */ import_react104.default.createElement(FormSelectOption, { key: "m", value: "m", label: "Minutes" }),
            /* @__PURE__ */ import_react104.default.createElement(FormSelectOption, { key: "h", value: "h", label: "Hours" }),
            /* @__PURE__ */ import_react104.default.createElement(FormSelectOption, { key: "d", value: "d", label: "Days" }),
            /* @__PURE__ */ import_react104.default.createElement(FormSelectOption, { key: "w", value: "w", label: "Weeks" })
          ))
        ), /* @__PURE__ */ import_react104.default.createElement(
          Grid,
          {
            title: "The changelog trimming interval.  Set how often the changelog checks if there are entries that can be purged from the changelog based on the trimming parameters (nsslapd-changelogtrim-interval)."
          },
          /* @__PURE__ */ import_react104.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Changelog Trimming Interval"),
          /* @__PURE__ */ import_react104.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react104.default.createElement(
            NumberInput,
            {
              value: this.state.clTrimInt,
              min: this.minValue,
              max: this.maxValue,
              onMinus: () => {
                this.onMinus("clTrimInt");
              },
              onChange: (e) => {
                this.onChange(e, "clTrimInt");
              },
              onPlus: () => {
                this.onPlus("clTrimInt");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react104.default.createElement(Grid, null, /* @__PURE__ */ import_react104.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Changelog Encryption", /* @__PURE__ */ import_react104.default.createElement(
          Tooltip,
          {
            id: "CLtooltip",
            position: "bottom",
            content: /* @__PURE__ */ import_react104.default.createElement("div", null, "Changelog encryption requires that the server must already be configured for security/TLS.  This setting also requires that you export and import the changelog which must be done while the database is in read-only mode.  So first put the database into read-only mode, then export the changelog, enable changelog encryption, restart the server, import the changelog, and finally unset the database read-only mode.")
          },
          /* @__PURE__ */ import_react104.default.createElement(
            import_outlined_question_circle_icon3.OutlinedQuestionCircleIcon,
            {
              className: "ds-left-margin"
            }
          )
        )), /* @__PURE__ */ import_react104.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react104.default.createElement(
          Checkbox,
          {
            id: "clEncrypt",
            isChecked: this.state.clEncrypt,
            onChange: this.handleChange
          }
        )))), /* @__PURE__ */ import_react104.default.createElement(
          Button,
          {
            className: "ds-margin-top-xlg",
            variant: "primary",
            onClick: this.handleSaveSettings,
            isDisabled: this.state.saveBtnDisabled || this.state.saving,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        ));
      }
      return /* @__PURE__ */ import_react104.default.createElement("div", { className: this.state.saving ? "ds-disabled" : "" }, clPage);
    }
  };
  Changelog.propTypes = {
    serverId: import_prop_types82.default.string,
    clMaxEntries: import_prop_types82.default.string,
    clMaxAge: import_prop_types82.default.string,
    clTrimInt: import_prop_types82.default.string,
    clEncrypt: import_prop_types82.default.bool,
    addNotification: import_prop_types82.default.func,
    suffix: import_prop_types82.default.string
  };
  Changelog.defaultProps = {
    serverId: "",
    clMaxEntries: "",
    clMaxAge: "",
    clTrimInt: "",
    clEncrypt: false,
    suffix: ""
  };

  // src/lib/replication/replConfig.jsx
  var import_react107 = __toESM(require_react(), 1);

  // src/lib/replication/replTables.jsx
  var import_react105 = __toESM(require_react(), 1);
  var import_trash_alt_icon3 = __toESM(require_trash_alt_icon(), 1);
  var import_prop_types83 = __toESM(require_prop_types(), 1);
  var ReplAgmtTable = class extends import_react105.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Name", transforms: [sortable] },
          { title: "Host", transforms: [sortable] },
          { title: "Port", transforms: [sortable] },
          { title: "State", transforms: [sortable] },
          { title: "Last Init Status", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
    }
    componentDidMount() {
      this.setState({ page: this.props.page });
    }
    actions() {
      return [
        {
          title: "Edit Agreement",
          onClick: (event, rowId, rowData, extra) => this.props.edit(rowData.cells[0])
        },
        {
          title: "Initialize Agreement",
          onClick: (event, rowId, rowData, extra) => this.props.init(rowData.cells[0])
        },
        {
          title: "Poke Agreement",
          onClick: (event, rowId, rowData, extra) => this.props.poke(rowData.cells[0])
        },
        {
          title: "Disable/Enable Agreement",
          onClick: (event, rowId, rowData, extra) => this.props.enable(rowData.cells[0], rowData.cells[3])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Agreement",
          onClick: (event, rowId, rowData, extra) => this.props.delete(rowData.cells[0], rowData.cells[3])
        }
      ];
    }
    convertStatus(msg) {
      if (msg === "Initialized") {
        return /* @__PURE__ */ import_react105.default.createElement("i", null, "Initialized");
      } else if (msg === "Not Initialized") {
        return /* @__PURE__ */ import_react105.default.createElement("i", null, "Not Initialized");
      } else if (msg === "Initializing") {
        return /* @__PURE__ */ import_react105.default.createElement("div", null, /* @__PURE__ */ import_react105.default.createElement("i", null, "Initializing"), " ", /* @__PURE__ */ import_react105.default.createElement(Spinner, { size: "sm" }));
      } else {
        return /* @__PURE__ */ import_react105.default.createElement("i", null, msg);
      }
    }
    render() {
      const rows = [];
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      const rows_copy = JSON.parse(JSON.stringify(this.props.rows));
      for (const row of rows_copy) {
        rows.push({ cells: [row[0], row[1], row[2], row[3], { title: this.convertStatus(row[5]) }] });
      }
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: "Replication Agreements" }];
        tableRows = [{ cells: ["No Agreements"] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ import_react105.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react105.default.createElement(
        SearchInput,
        {
          className: "ds-margin-top-xlg",
          placeholder: "Search agreements",
          value: this.props.value,
          onChange: this.props.handleSearch,
          onClear: (evt) => this.props.search(evt, "")
        }
      ), /* @__PURE__ */ import_react105.default.createElement(
        Table,
        {
          className: "ds-margin-top-lg",
          "aria-label": "agmt table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy: this.props.sortBy,
          onSort: this.props.handleSort,
          actions: has_rows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react105.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react105.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react105.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var ManagerTable = class extends import_react105.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        rows: [],
        columns: ["", ""]
      };
      this.handleSort = this.handleSort.bind(this);
      this.getDeleteButton = this.getDeleteButton.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const managerRow of this.props.rows) {
        rows.push({
          cells: [managerRow, { props: { textCenter: true }, title: this.getDeleteButton(managerRow) }]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Replication Managers"] }];
        columns = [{ title: "" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedManagers = [...this.state.rows];
      sortedManagers.sort();
      if (direction !== SortByDirection.asc) {
        sortedManagers.reverse();
      }
      for (const managerRow of sortedManagers) {
        rows.push({ cells: [managerRow.cells[0], { props: { textCenter: true }, title: this.getDeleteButton(managerRow.cells[0]) }] });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getDeleteButton(name2) {
      return /* @__PURE__ */ import_react105.default.createElement("a", null, /* @__PURE__ */ import_react105.default.createElement(
        import_trash_alt_icon3.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.props.confirmDelete(name2);
          },
          title: "Delete Replication Manager"
        }
      ));
    }
    render() {
      return /* @__PURE__ */ import_react105.default.createElement(
        Table,
        {
          "aria-label": "manager table",
          cells: this.state.columns,
          rows: this.state.rows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react105.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react105.default.createElement(TableBody, null)
      );
    }
  };
  var RUVTable = class extends import_react105.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        rows: [],
        columns: [
          { title: "Replica ID", transforms: [sortable] },
          { title: "Replica LDAP URL", transforms: [sortable] },
          { title: "Max CSN", transforms: [sortable] },
          { title: "" }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
      this.getCleanButton = this.getCleanButton.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const row of this.props.rows) {
        rows.push({
          cells: [row.rid, row.url, row.maxcsn, { props: { textCenter: true }, title: this.getCleanButton(row.rid) }]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No RUV's"] }];
        columns = [{ title: "Remote RUV's" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    getCleanButton(rid) {
      return /* @__PURE__ */ import_react105.default.createElement(
        Button,
        {
          variant: "warning",
          onClick: () => {
            this.props.confirmDelete(rid);
          },
          title: "Remove this RUV/Replica ID from all the Replicas."
        },
        "Clean RUV"
      );
    }
    render() {
      return /* @__PURE__ */ import_react105.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react105.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "ruv table",
          cells: this.state.columns,
          rows: this.state.rows,
          variant: TableVariant.compact,
          sortBy: this.state.sortBy,
          onSort: this.handleSort
        },
        /* @__PURE__ */ import_react105.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react105.default.createElement(TableBody, null)
      ));
    }
  };
  var ReplicaLDIFTable = class extends import_react105.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "LDIF File", transforms: [sortable] },
          { title: "Creation Date", transforms: [sortable] },
          { title: "File Size", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const ldifRow of this.props.rows) {
        rows.push({
          cells: [
            ldifRow[0],
            ldifRow[1],
            ldifRow[2]
          ]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No LDIF files"] }];
        columns = [{ title: "LDIF File" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedLDIF = [...this.props.rows];
      sortedLDIF.sort();
      if (direction !== SortByDirection.asc) {
        sortedLDIF.reverse();
      }
      for (const ldifRow of sortedLDIF) {
        rows.push({
          cells: [
            ldifRow[0],
            ldifRow[1],
            ldifRow[2]
          ]
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ import_react105.default.createElement(
        Table,
        {
          "aria-label": "ldif table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react105.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react105.default.createElement(TableBody, null)
      );
    }
  };
  ReplAgmtTable.propTypes = {
    rows: import_prop_types83.default.array,
    edit: import_prop_types83.default.func,
    poke: import_prop_types83.default.func,
    init: import_prop_types83.default.func,
    enable: import_prop_types83.default.func,
    delete: import_prop_types83.default.func
  };
  ReplAgmtTable.defaultProps = {
    rows: []
  };
  ManagerTable.propTypes = {
    rows: import_prop_types83.default.array,
    confirmDelete: import_prop_types83.default.func
  };
  ManagerTable.defaultProps = {
    rows: []
  };
  RUVTable.propTypes = {
    rows: import_prop_types83.default.array,
    confirmDelete: import_prop_types83.default.func
  };
  RUVTable.defaultProps = {
    rows: []
  };
  ReplicaLDIFTable.propTypes = {
    rows: import_prop_types83.default.array
  };
  ReplicaLDIFTable.defaultProps = {
    rows: []
  };

  // src/lib/replication/replModals.jsx
  var import_react106 = __toESM(require_react(), 1);
  var import_prop_types84 = __toESM(require_prop_types(), 1);
  var import_exclamation_triangle_icon8 = __toESM(require_exclamation_triangle_icon(), 1);
  var WinsyncAgmtModal = class extends import_react106.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
    }
    hasMainErrors(errors) {
      const attrs = [
        "agmtName",
        "agmtHost",
        "agmtPort",
        "agmtBindDN",
        "agmtBindPW",
        "agmtBindPWConfirm"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasDomainErrors(errors) {
      const attrs = [
        "agmtWinDomain",
        "agmtWinSubtree",
        "agmtDSSubtree"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasScheduleErrors(errors) {
      const attrs = [
        "agmtStartTime",
        "agmtEndTime"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    render() {
      const {
        showModal,
        closeHandler,
        saveHandler,
        handleChange,
        handleTimeChange,
        handleFracChange,
        onSelectToggle,
        onSelectClear,
        spinning,
        agmtName,
        agmtHost,
        agmtPort,
        agmtProtocol,
        agmtBindDN,
        agmtBindPW,
        agmtBindPWConfirm,
        agmtFracAttrs,
        agmtSync,
        agmtSyncMon,
        agmtSyncTue,
        agmtSyncWed,
        agmtSyncThu,
        agmtSyncFri,
        agmtSyncSat,
        agmtSyncSun,
        agmtStartTime,
        agmtEndTime,
        agmtSyncGroups,
        agmtSyncUsers,
        agmtWinDomain,
        agmtWinSubtree,
        agmtDSSubtree,
        agmtOneWaySync,
        // "both", "toWindows", "fromWindows"
        agmtSyncInterval,
        agmtInit,
        availAttrs,
        error,
        isExcludeAttrOpen
      } = this.props;
      const saveDisabled = !this.props.saveOK;
      let title = "Create";
      let initRow = "";
      let name2 = "agmt-modal";
      const startHour = agmtStartTime.substring(0, 2);
      const startMin = agmtStartTime.substring(2, 4);
      const startTime = startHour + ":" + startMin;
      const endHour = agmtEndTime.substring(0, 2);
      const endMin = agmtEndTime.substring(2, 4);
      const endTime = endHour + ":" + endMin;
      let saveBtnName = "Save Agreement";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Saving Agreement ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let mainSettingsError = "";
      let scheduleError = "";
      let domainError = "";
      if (this.hasMainErrors(error)) {
        mainSettingsError = /* @__PURE__ */ import_react106.default.createElement(TabTitleIcon, { className: "ds-warning-icon" }, /* @__PURE__ */ import_react106.default.createElement(import_exclamation_triangle_icon8.ExclamationTriangleIcon, null));
      }
      if (this.hasDomainErrors(error)) {
        domainError = /* @__PURE__ */ import_react106.default.createElement(TabTitleIcon, { className: "ds-warning-icon" }, /* @__PURE__ */ import_react106.default.createElement(import_exclamation_triangle_icon8.ExclamationTriangleIcon, null));
      }
      if (this.hasScheduleErrors(error)) {
        scheduleError = /* @__PURE__ */ import_react106.default.createElement(TabTitleIcon, { className: "ds-warning-icon" }, /* @__PURE__ */ import_react106.default.createElement(import_exclamation_triangle_icon8.ExclamationTriangleIcon, null));
      }
      if (this.props.edit) {
        title = "Edit";
        name2 = "agmt-modal-edit";
      } else {
        initRow = /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Consumer Initialization"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            value: agmtInit,
            id: "agmtInit",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 0, value: "noinit", label: "Do Not Initialize" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 1, value: "online-init", label: "Do Online Initialization" })
        )));
      }
      let scheduleRow = /* @__PURE__ */ import_react106.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 12 }, "Days To Send Synchronization Updates")), /* @__PURE__ */ import_react106.default.createElement("div", { className: "ds-indent ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(Grid, null, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncMon",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncMon,
          label: "Monday",
          isValid: !error.agmtSyncMon
        }
      )), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncFri",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncFri,
          label: "Friday",
          isValid: !error.agmtSyncFri
        }
      ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncTue",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncTue,
          isValid: !error.agmtSyncTue,
          label: "Tuesday"
        }
      )), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncSat",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncSat,
          isValid: !error.agmtSyncSat,
          label: "Saturday"
        }
      ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncWed",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncWed,
          label: "Wednesday",
          isValid: !error.agmtSyncWed
        }
      )), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncSun",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncSun,
          isValid: !error.agmtSyncSun,
          label: "Sunday"
        }
      ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncThu",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncThu,
          isValid: !error.agmtSyncThu,
          label: "Thursday"
        }
      )))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg", title: "Time to start initiating replication sessions" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replication Start Time"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        TimePicker,
        {
          time: startTime,
          id: "agmtStartTime",
          onChange: (val) => {
            handleTimeChange(this.props.edit ? "edit" : "create", "agmtStartTime", val);
          },
          stepMinutes: 5,
          direction: "up",
          is24Hour: true
        }
      ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtStartTime }, "Start time must be before the End time"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { title: "Time to initiating replication sessions" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replication End Time"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        TimePicker,
        {
          time: endTime,
          id: "agmtEndTime",
          onChange: (val) => {
            handleTimeChange(this.props.edit ? "edit" : "create", "agmtEndTime", val);
          },
          stepMinutes: 5,
          direction: "up",
          is24Hour: true
        }
      ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtEndTime }, "End time must be after the Start time"))));
      if (!agmtSync) {
        scheduleRow = "";
      }
      title = title + " Winsync Agreement";
      return /* @__PURE__ */ import_react106.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          className: "ds-modal-winsync-agmt",
          "aria-labelledby": "ds-modal",
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react106.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                isDisabled: saveDisabled || spinning,
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react106.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react106.default.createElement("div", { className: spinning ? "ds-disabled" : "" }, /* @__PURE__ */ import_react106.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react106.default.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, mainSettingsError, /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Main Settings")) }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Agreement Name"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtName,
            type: "text",
            id: "agmtName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtName",
            onChange: (str, e) => {
              handleChange(e);
            },
            isDisabled: this.props.edit,
            validated: error.agmtName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Windows AD Host"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtHost,
            type: "text",
            id: "agmtHost",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtHost",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtHost ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Windows AD Port"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtPort,
            type: "number",
            id: "agmtPort",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtPort",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtPort ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtBindDN,
            type: "text",
            id: "agmtBindDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtBindDN",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtBindDN ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBindDN || agmtBindDN === "" }, "Value must be a valid DN"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtBindPW,
            type: "password",
            id: "agmtBindPW",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtBindPW",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtBindPW ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBindPW || agmtBindPW === "" || agmtBindPWConfirm === "" }, "Passwords must match"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Confirm Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtBindPWConfirm,
            type: "password",
            id: "agmtBindPWConfirm",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtBindPWConfirm",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBindPWConfirm || agmtBindPWConfirm === "" }, "Passwords must match"))), initRow), /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, domainError, /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Domain & Content")) }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Windows Domain Name"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtWinDomain,
            type: "text",
            id: "agmtWinDomain",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtWinDomain",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtWinDomain ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg", title: "The Active Directory subtree to synchronize" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Windows Subtree"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtWinSubtree,
            type: "text",
            id: "agmtWinSubtree",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtWinSubtree",
            onChange: (str, e) => {
              handleChange(e);
            },
            placeholder: "e.g. cn=Users,dc=domain,dc=com",
            validated: error.agmtWinSubtree ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtWinSubtree || agmtWinSubtree === "" }, "Value must be a valid DN"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top", title: "Directory Server subtree to synchronize" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "DS Subtree"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtDSSubtree,
            type: "text",
            id: "agmtDSSubtree",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtDSSubtree",
            onChange: (str, e) => {
              handleChange(e);
            },
            placeholder: "e.g. ou=People,dc=domain,dc=com",
            validated: error.agmtDSSubtree ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtDSSubtree || agmtDSSubtree === "" }, "Value must be a valid DN")))), /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Advanced Settings") }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Connection Protocol"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            value: agmtProtocol,
            id: "agmtProtocol",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 0, value: "LDAPS", label: "LDAPS" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 1, value: "StartTLS", label: "StartTLS" })
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Synchronization Direction"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            value: agmtOneWaySync,
            id: "agmtOneWaySync",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { title: "Synchronization in both directions (default behavior).", key: 0, value: "both", label: "both" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { title: "Only synchronize Directory Server updates to Windows.", key: 1, value: "toWindows", label: "toWindows" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { title: "Only synchronize Windows updates to Directory Server.", key: 2, value: "fromWindows", label: "fromWindows" })
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top", title: "The interval to check for updates on Windows.  Default is 300 seconds" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Synchronization Interval"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtSyncInterval,
            type: "number",
            id: "agmtSyncInterval",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtSyncInterval",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtSyncInterval ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top", title: "Attribute to exclude from replication" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclude Attributes"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: onSelectToggle,
            onSelect: (e, selection) => {
              handleFracChange(selection);
            },
            onClear: onSelectClear,
            selections: agmtFracAttrs,
            isOpen: isExcludeAttrOpen,
            "aria-labelledby": "typeAhead-exclude-attrs",
            placeholderText: "Start typing an attribute...",
            noResultsFoundText: "There are no matching entries"
          },
          availAttrs.map((attr, index) => /* @__PURE__ */ import_react106.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-med" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, null, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "agmtSyncGroups",
            onChange: (checked, e) => {
              handleChange(e);
            },
            name: name2,
            isChecked: agmtSyncGroups,
            label: "Synchronize New Windows Groups"
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, null, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "agmtSyncUsers",
            onChange: (checked, e) => {
              handleChange(e);
            },
            name: name2,
            isChecked: agmtSyncUsers,
            label: "Synchronize New Windows Users"
          }
        )))), /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, scheduleError, /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Scheduling")) }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h5 }, "By default replication updates are sent to the replica as soon as possible, but if there is a need for replication updates to only be sent on certains days and within certain windows of time then you can setup a custom replication schedule."))), /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-margin-top-lg", span: 12 }, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "agmtSync",
            isChecked: agmtSync,
            onChange: (checked, e) => {
              handleChange(e);
            },
            name: name2,
            label: "Use A Custom Schedule"
          }
        ))), scheduleRow))))
      );
    }
  };
  var ReplAgmtModal = class extends import_react106.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
    }
    hasMainErrors(errors) {
      const attrs = [
        "agmtName",
        "agmtHost",
        "agmtPort",
        "agmtBindDN",
        "agmtBindPW",
        "agmtBindPWConfirm"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasBootErrors(errors) {
      const attrs = [
        "agmtBootstrapBindDN",
        "agmtBootstrapBindPW",
        "agmtBootstrapBindPWConfirm"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasScheduleErrors(errors) {
      const attrs = [
        "agmtStartTime",
        "agmtEndTime"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    render() {
      const {
        showModal,
        closeHandler,
        saveHandler,
        handleChange,
        handleTimeChange,
        handleStripChange,
        handleFracChange,
        handleFracInitChange,
        onExcludeAttrsToggle,
        onExcludeAttrsClear,
        onExcludeAttrsInitToggle,
        onExcludeAttrsInitClear,
        onStripAttrsToggle,
        onStripAttrsClear,
        isExcludeAttrsOpen,
        isExcludeInitAttrsOpen,
        isStripAttrsOpen,
        spinning,
        agmtName,
        agmtHost,
        agmtPort,
        agmtProtocol,
        agmtBindMethod,
        agmtBindMethodOptions,
        agmtBindDN,
        agmtBindPW,
        agmtBindPWConfirm,
        agmtBootstrap,
        agmtBootstrapBindDN,
        agmtBootstrapBindPW,
        agmtBootstrapBindPWConfirm,
        agmtBootstrapProtocol,
        agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions,
        agmtStripAttrs,
        agmtFracAttrs,
        agmtFracInitAttrs,
        agmtSync,
        agmtSyncMon,
        agmtSyncTue,
        agmtSyncWed,
        agmtSyncThu,
        agmtSyncFri,
        agmtSyncSat,
        agmtSyncSun,
        agmtStartTime,
        agmtEndTime,
        agmtInit,
        availAttrs,
        error
      } = this.props;
      const saveDisabled = !this.props.saveOK;
      let title = "Create";
      let initRow = "";
      let name2 = "agmt-modal";
      const bootstrapTitle = "If you are using Bind Group's on the consumer replica you can configure bootstrap credentials that can be used to do online initializations, or bootstrap a session if the bind groups get out of synchronization";
      const startHour = agmtStartTime.substring(0, 2);
      const startMin = agmtStartTime.substring(2, 4);
      const startTime = startHour + ":" + startMin;
      const endHour = agmtEndTime.substring(0, 2);
      const endMin = agmtEndTime.substring(2, 4);
      const endTime = endHour + ":" + endMin;
      let saveBtnName = "Save Agreement";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Saving Agreement ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let mainSettingsError = "";
      let bootSettingsError = "";
      let scheduleSettingsError = "";
      if (this.hasMainErrors(error)) {
        mainSettingsError = /* @__PURE__ */ import_react106.default.createElement(TabTitleIcon, { className: "ds-warning-icon" }, /* @__PURE__ */ import_react106.default.createElement(import_exclamation_triangle_icon8.ExclamationTriangleIcon, null));
      }
      if (this.hasBootErrors(error)) {
        bootSettingsError = /* @__PURE__ */ import_react106.default.createElement(TabTitleIcon, { className: "ds-warning-icon" }, /* @__PURE__ */ import_react106.default.createElement(import_exclamation_triangle_icon8.ExclamationTriangleIcon, null));
      }
      if (this.hasScheduleErrors(error)) {
        scheduleSettingsError = /* @__PURE__ */ import_react106.default.createElement(TabTitleIcon, { className: "ds-warning-icon" }, /* @__PURE__ */ import_react106.default.createElement(import_exclamation_triangle_icon8.ExclamationTriangleIcon, null));
      }
      if (this.props.edit) {
        title = "Edit";
        name2 = "agmt-modal-edit";
      } else {
        initRow = /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Consumer Initialization"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            value: agmtInit,
            id: "agmtInit",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 0, value: "noinit", label: "Do Not Initialize" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 1, value: "online-init", label: "Do Online Initialization" })
        )));
      }
      let bootstrapRow = /* @__PURE__ */ import_react106.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg", title: "The Bind DN the agreement can use to bootstrap initialization" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        TextInput,
        {
          value: agmtBootstrapBindDN,
          type: "text",
          id: "agmtBootstrapBindDN",
          "aria-describedby": "horizontal-form-name-helper",
          name: "agmtBootstrapBindDN",
          onChange: (str, e) => {
            handleChange(e);
          },
          validated: error.agmtBootstrapBindDN ? ValidatedOptions.error : ValidatedOptions.default
        }
      ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBootstrapBindDN || agmtBootstrapBindDN === "" }, "Value must be a valid DN"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3, title: "The Bind DN password for bootstrap initialization" }, "Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        TextInput,
        {
          value: agmtBootstrapBindPW,
          type: "password",
          id: "agmtBootstrapBindPW",
          "aria-describedby": "horizontal-form-name-helper",
          name: "agmtBootstrapBindPW",
          onChange: (str, e) => {
            handleChange(e);
          },
          validated: error.agmtBootstrapBindPW ? ValidatedOptions.error : ValidatedOptions.default
        }
      ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBootstrapBindPW || agmtBootstrapBindPW === "" || error.agmtBootstrapBindPWConfirm === "" }, "Password must match"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3, title: "Confirm the Bind DN password for bootstrap initialization" }, "Confirm Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        TextInput,
        {
          value: agmtBootstrapBindPWConfirm,
          type: "password",
          id: "agmtBootstrapBindPWConfirm",
          "aria-describedby": "horizontal-form-name-helper",
          name: "agmtBootstrapBindPWConfirm",
          onChange: (str, e) => {
            handleChange(e);
          },
          validated: error.agmtBootstrapBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
        }
      ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBootstrapBindPWConfirm || agmtBootstrapBindPWConfirm === "" }, "Passwords must match"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3, title: "The connection protocol for bootstrap initialization" }, "Connection Protocol"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        FormSelect,
        {
          value: agmtBootstrapProtocol,
          id: "agmtBootstrapProtocol",
          onChange: (str, e) => {
            handleChange(e);
          },
          "aria-label": "FormSelect Input",
          validated: error.agmtBootstrapProtocol ? ValidatedOptions.error : ValidatedOptions.default
        },
        /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 0, value: "LDAP", label: "LDAP" }),
        /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 1, value: "LDAPS", label: "LDAPS" }),
        /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 2, value: "STARTTLS", label: "STARTTLS" })
      ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3, title: "The authentication method for bootstrap initialization" }, "Authentication Method"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        FormSelect,
        {
          value: agmtBootstrapBindMethod,
          id: "agmtBootstrapBindMethod",
          onChange: (str, e) => {
            handleChange(e);
          },
          "aria-label": "FormSelect Input",
          validated: error.agmtBootstrapBindMethod ? ValidatedOptions.error : ValidatedOptions.default
        },
        agmtBootstrapBindMethodOptions.map((option, index) => /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: index, value: option, label: option }))
      ))));
      let scheduleRow = /* @__PURE__ */ import_react106.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 12 }, "Days To Send Replication Updates")), /* @__PURE__ */ import_react106.default.createElement("div", { className: "ds-indent ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(Grid, null, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncMon",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncMon,
          label: "Monday",
          isValid: !error.agmtSyncMon
        }
      )), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncFri",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncFri,
          label: "Friday",
          isValid: !error.agmtSyncFri
        }
      ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncTue",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncTue,
          isValid: !error.agmtSyncTue,
          label: "Tuesday"
        }
      )), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncSat",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncSat,
          isValid: !error.agmtSyncSat,
          label: "Saturday"
        }
      ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncWed",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncWed,
          label: "Wednesday",
          isValid: !error.agmtSyncWed
        }
      )), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncSun",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncSun,
          isValid: !error.agmtSyncSun,
          label: "Sunday"
        }
      ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
        Checkbox,
        {
          id: "agmtSyncThu",
          onChange: (checked, e) => {
            handleChange(e);
          },
          name: name2,
          isChecked: agmtSyncThu,
          isValid: !error.agmtSyncThu,
          label: "Thursday"
        }
      )))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg", title: "Time to start initiating replication sessions" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replication Start Time"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        TimePicker,
        {
          time: startTime,
          id: "agmtStartTime",
          onChange: (val) => {
            handleTimeChange(this.props.edit ? "edit" : "create", "agmtStartTime", val);
          },
          stepMinutes: 5,
          is24Hour: true
        }
      ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtStartTime }, "Start time must be before the End time"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { title: "Time to initiating replication sessions" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replication End Time"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
        TimePicker,
        {
          time: endTime,
          id: "agmtEndTime",
          onChange: (val) => {
            handleTimeChange(this.props.edit ? "edit" : "create", "agmtEndTime", val);
          },
          stepMinutes: 5,
          is24Hour: true
        }
      ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtEndTime }, "End time must be after the Start time"))));
      if (!agmtSync) {
        scheduleRow = "";
      }
      if (!agmtBootstrap) {
        bootstrapRow = "";
      }
      title = title + " Replication Agreement";
      return /* @__PURE__ */ import_react106.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          className: "ds-modal-repl-agmt",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react106.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                isDisabled: saveDisabled || spinning,
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react106.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react106.default.createElement("div", { className: spinning ? "ds-disabled" : "" }, /* @__PURE__ */ import_react106.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react106.default.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, mainSettingsError, /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Main Settings")) }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Agreement Name"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtName,
            type: "text",
            id: "agmtName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtName",
            onChange: (str, e) => {
              handleChange(e);
            },
            isDisabled: this.props.edit,
            validated: error.agmtName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtName || agmtName === "" }, "Required field"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Consumer Host"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtHost,
            type: "text",
            id: "agmtHost",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtHost",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtHost ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtHost || agmtHost === "" }, "Required field"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Consumer Port"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtPort,
            type: "number",
            id: "agmtPort",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtPort",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtPort ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtPort }, "Port must be between 1 and 65535"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtBindDN,
            type: "text",
            id: "agmtBindDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtBindDN",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtBindDN ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBindDN }, "Value must be a valid DN"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtBindPW,
            type: "password",
            id: "agmtBindPW",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtBindPW",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtBindPW ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBindPW || error.agmtBindPW === "" || error.agmtBindPWConfirm === "" }, "Passwords must match"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Confirm Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: agmtBindPWConfirm,
            type: "password",
            id: "agmtBindPWConfirm",
            "aria-describedby": "horizontal-form-name-helper",
            name: "agmtBindPWConfirm",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.agmtBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react106.default.createElement(FormHelperText, { isError: true, isHidden: !error.agmtBindPWConfirm || agmtBindPWConfirm === "" }, "Passwords must match"))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Connection Protocol"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            value: agmtProtocol,
            id: "agmtProtocol",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input",
            validated: error.agmtProtocol ? ValidatedOptions.error : ValidatedOptions.default
          },
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 0, value: "LDAP", label: "LDAP" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 1, value: "LDAPS", label: "LDAPS" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 2, value: "STARTTLS", label: "STARTTLS" })
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Authentication Method"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            value: agmtBindMethod,
            id: "agmtBindMethod",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input",
            validated: error.agmtBindMethod ? ValidatedOptions.error : ValidatedOptions.default
          },
          agmtBindMethodOptions.map((option, index) => /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: index, value: option, label: option }))
        ))), initRow), /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Fractional Settings") }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg", title: "Attribute to exclude from replication" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclude Attributes"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: onExcludeAttrsToggle,
            onSelect: (e, selection) => {
              handleFracChange(selection);
            },
            onClear: onExcludeAttrsClear,
            selections: agmtFracAttrs,
            isOpen: isExcludeAttrsOpen,
            "aria-labelledby": "typeAhead-exclude-attrs",
            placeholderText: "Start typing an attribute..."
          },
          availAttrs.map((attr, index) => /* @__PURE__ */ import_react106.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top", title: "Attribute to exclude from replica Initializations" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Exclude Init Attributes"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: onExcludeAttrsInitToggle,
            onSelect: (e, selection) => {
              handleFracInitChange(selection);
            },
            onClear: onExcludeAttrsInitClear,
            selections: agmtFracInitAttrs,
            isOpen: isExcludeInitAttrsOpen,
            "aria-labelledby": "typeAhead-exclude-init-attrs",
            placeholderText: "Start typing an attribute...",
            noResultsFoundText: "There are no matching entries"
          },
          availAttrs.map((attr, index) => /* @__PURE__ */ import_react106.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top", title: "Attributes to strip from a replicatio<Selectn update" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Strip Attributes"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: onStripAttrsToggle,
            onSelect: (e, selection) => {
              handleStripChange(selection);
            },
            onClear: onStripAttrsClear,
            selections: agmtStripAttrs,
            isOpen: isStripAttrsOpen,
            "aria-labelledby": "typeAhead-strip-attrs",
            placeholderText: "Start typing an attribute...",
            noResultsFoundText: "There are no matching entries"
          },
          availAttrs.map((attr, index) => /* @__PURE__ */ import_react106.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        )))), /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, bootSettingsError, /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Bootstrap Settings")) }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-med" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "agmtBootstrap",
            isChecked: agmtBootstrap,
            onChange: (checked, e) => {
              handleChange(e);
            },
            name: name2,
            title: bootstrapTitle,
            label: "Enable Bootstrap Settings"
          }
        ))), bootstrapRow), /* @__PURE__ */ import_react106.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, scheduleSettingsError, /* @__PURE__ */ import_react106.default.createElement(TabTitleText, null, "Scheduling")) }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-med" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h5 }, "By default replication updates are sent to the replica as soon as possible, but if there is a need for replication updates to only be sent on certains days and within certain windows of time then you can setup a custom replication schedule."))), /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-margin-top-lg", span: 12 }, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "agmtSync",
            isChecked: agmtSync,
            onChange: (checked, e) => {
              handleChange(e);
            },
            name: name2,
            label: "Use A Custom Schedule"
          }
        ))), scheduleRow))))
      );
    }
  };
  var ChangeReplRoleModal = class extends import_react106.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showConfirmPromote: false,
        showConfirmDemote: false
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        role,
        spinning,
        checked,
        onMinus,
        onNumberChange,
        onPlus,
        newRID
      } = this.props;
      let spinner = "";
      let changeType = "";
      let roleOptions = [];
      let ridRow = "";
      const newRole = this.props.newRole;
      let saveDisabled = !checked;
      if (role === "Supplier") {
        changeType = "Demoting";
        roleOptions = ["Hub", "Consumer"];
      } else if (role === "Consumer") {
        changeType = "Promoting";
        roleOptions = ["Supplier", "Hub"];
      } else {
        if (newRole === "Supplier") {
          changeType = "Promoting";
        } else {
          changeType = "Demoting";
        }
        roleOptions = ["Supplier", "Consumer"];
      }
      if (newRole === "Supplier") {
        ridRow = /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg", title: "Supplier Replica Identifier.  This must be unique across all the Supplier replicas in your environment" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replica ID"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react106.default.createElement(
          NumberInput,
          {
            value: newRID,
            min: 1,
            max: 65534,
            onMinus,
            onChange: onNumberChange,
            onPlus,
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        )));
      }
      if (spinning) {
        spinner = /* @__PURE__ */ import_react106.default.createElement(Grid, null, /* @__PURE__ */ import_react106.default.createElement("div", { className: "ds-margin-top ds-modal-spinner" }, /* @__PURE__ */ import_react106.default.createElement(Spinner, { size: "md" }), changeType, " replica ..."));
        saveDisabled = true;
      }
      return /* @__PURE__ */ import_react106.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "Change Replica Role",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react106.default.createElement(
              Button,
              {
                key: "change",
                variant: "primary",
                onClick: () => {
                  saveHandler(changeType);
                },
                isDisabled: saveDisabled
              },
              "Change Role"
            ),
            /* @__PURE__ */ import_react106.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react106.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h3 }, "Please choose the new replication role you would like for this suffix")), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "New Role"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            value: newRole,
            id: "newRole",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          roleOptions.map((option, index) => /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: index, value: option, label: option }))
        ))), ridRow, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 12, className: "ds-center" }, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "modalChecked",
            isChecked: checked,
            onChange: (checked2, e) => {
              handleChange(e);
            },
            label: /* @__PURE__ */ import_react106.default.createElement(import_react106.default.Fragment, null, /* @__PURE__ */ import_react106.default.createElement("b", null, "Yes"), ", I am sure.")
          }
        ))), spinner)
      );
    }
  };
  var AddManagerModal = class extends import_react106.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        manager,
        manager_passwd,
        manager_passwd_confirm,
        error
      } = this.props;
      let saveBtnName = "Add Replication Manager";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Adding Replication Manager ...";
      }
      return /* @__PURE__ */ import_react106.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Add Replication Manager",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react106.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: error.manager || error.manager_passwd || error.manager_passwd_confirm || spinning
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react106.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react106.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h3 }, "Create a Replication Manager entry, and add it to the replication configuration for this suffix.  If the entry already exists it will be overwritten with the new credentials.")), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-lg", title: "The DN of the replication manager" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replication Manager DN"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: manager,
            type: "text",
            id: "manager",
            "aria-describedby": "horizontal-form-name-helper",
            name: "manager",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.manager ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top", title: "Replication Manager password" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: manager_passwd,
            type: "password",
            id: "manager_passwd",
            "aria-describedby": "horizontal-form-name-helper",
            name: "manager_passwd",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.manager_passwd ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top", title: "Replication Manager password" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Confirm Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: manager_passwd_confirm,
            type: "password",
            id: "manager_passwd_confirm",
            "aria-describedby": "horizontal-form-name-helper",
            name: "manager_passwd_confirm",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.manager_passwd_confirm ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))))
      );
    }
  };
  var EnableReplModal = class extends import_react106.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        enableRole,
        enableRID,
        enableBindDN,
        enableBindPW,
        enableBindPWConfirm,
        enableBindGroupDN,
        error,
        onMinus,
        onPlus,
        onNumberChange
      } = this.props;
      let saveBtnName = "Enable Replication";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Enabling Replication ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let replicaIDRow = "";
      if (enableRole === "Supplier") {
        replicaIDRow = /* @__PURE__ */ import_react106.default.createElement(Grid, null, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Replica ID"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react106.default.createElement(
          NumberInput,
          {
            value: enableRID,
            min: 1,
            max: 65534,
            onMinus,
            onChange: onNumberChange,
            onPlus,
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        )));
      }
      return /* @__PURE__ */ import_react106.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Enable Replication",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react106.default.createElement(
              Button,
              {
                key: "enable",
                variant: "primary",
                onClick: saveHandler,
                isDisabled: this.props.disabled || spinning,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react106.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react106.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h6 }, "Choose the replication role for this suffix.  If it is a Supplier replica then you must pick a unique ID to identify it among the other Supplier replicas in your environment.  The replication changelog will also automatically be created for you.")), /* @__PURE__ */ import_react106.default.createElement(Grid, null, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Replication Role"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react106.default.createElement(
          FormSelect,
          {
            id: "enableRole",
            value: enableRole,
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 0, value: "Supplier", label: "Supplier" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 1, value: "Hub", label: "Hub" }),
          /* @__PURE__ */ import_react106.default.createElement(FormSelectOption, { key: 2, value: "Consumer", label: "Consumer" })
        ))), replicaIDRow, /* @__PURE__ */ import_react106.default.createElement("hr", null), /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h6 }, 'You can optionally define the authentication information for this replicated suffix.  Either a Manager DN and Password, a Bind Group DN, or both, can be provided.  The Manager DN should be an entry under "cn=config" and if it does not exist it will be created, while the Bind Group DN is usually an existing group located in the database suffix.  Typically, just the Manager DN and Password are used when enabling replication for a suffix.')), /* @__PURE__ */ import_react106.default.createElement(Grid, { title: "The DN of the replication manager.  If you supply a password the entry will be created in the server (it will also overwrite the entry is it already exists)." }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replication Manager DN"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: enableBindDN,
            type: "text",
            id: "enableBindDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "enableBindDN",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.enableBindDN ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { title: "Replication Manager password" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: enableBindPW,
            type: "password",
            id: "enableBindPW",
            "aria-describedby": "horizontal-form-name-helper",
            name: "enableBindPW",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.enableBindPW ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { title: "Confirm the Replication Manager password" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Confirm Password"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: enableBindPWConfirm,
            type: "password",
            id: "enableBindPWConfirm",
            "aria-describedby": "horizontal-form-name-helper",
            name: "enableBindPWConfirm",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.enableBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { title: "The DN of a group that contains users that can perform replication updates" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind Group DN"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: enableBindGroupDN,
            type: "text",
            id: "enableBindGroupDN",
            "aria-describedby": "horizontal-form-name-helper",
            name: "enableBindGroupDN",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.enableBindGroupDN ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))))
      );
    }
  };
  var ExportCLModal = class extends import_react106.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        default: true,
        debug: false
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        handleLDIFChange,
        handleRadioChange,
        saveHandler,
        spinning,
        defaultCL,
        debugCL,
        decodeCL,
        exportCSN,
        ldifFile,
        saveOK
      } = this.props;
      let page = "";
      let saveBtnName = "Export Changelog";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Exporting ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      if (defaultCL) {
        page = /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h4 }, "This will export the changelog to the server's LDIF directory.  This is the only LDIF file that can be imported into the server for enabling changelog encryption.  Do not edit or rename the file."));
      } else {
        page = /* @__PURE__ */ import_react106.default.createElement("div", null, /* @__PURE__ */ import_react106.default.createElement(Grid, null, /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react106.default.createElement(TextContent, null, /* @__PURE__ */ import_react106.default.createElement(Text, { component: TextVariants.h4 }, "The LDIF file that is generated should ", /* @__PURE__ */ import_react106.default.createElement("b", null, "not"), " be used to initialize the Replication Changelog.  It is only meant for debugging/investigative purposes.")))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react106.default.createElement(GridItem, { className: "ds-label", span: 2 }, "LDIF File"), /* @__PURE__ */ import_react106.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react106.default.createElement(
          TextInput,
          {
            value: ldifFile,
            type: "text",
            id: "ldifFile",
            "aria-describedby": "horizontal-form-name-helper",
            name: "ldifFile",
            onChange: (str, e) => {
              handleLDIFChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top-xlg ds-margin-left" }, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "decodeCL",
            isChecked: decodeCL,
            isDisabled: exportCSN,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Decode base64 changes"
          }
        )), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-margin-top ds-margin-left" }, /* @__PURE__ */ import_react106.default.createElement(
          Checkbox,
          {
            id: "exportCSN",
            isChecked: exportCSN,
            isDisabled: decodeCL,
            onChange: (checked, e) => {
              handleChange(e);
            },
            label: "Only Export CSN's"
          }
        )));
      }
      return /* @__PURE__ */ import_react106.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          className: "ds-modal-changelog-export",
          title: "Create Replication Change Log LDIF File",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react106.default.createElement(
              Button,
              {
                key: "export",
                variant: "primary",
                onClick: saveHandler,
                isDisabled: !saveOK || spinning,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react106.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react106.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-indent ds-margin-top" }, /* @__PURE__ */ import_react106.default.createElement(
          Radio,
          {
            isChecked: defaultCL,
            name: "radioGroup",
            onChange: handleRadioChange,
            label: "Export to LDIF For Reinitializing The Changelog",
            id: "defaultCL"
          }
        )), /* @__PURE__ */ import_react106.default.createElement(Grid, { className: "ds-indent" }, /* @__PURE__ */ import_react106.default.createElement(
          Radio,
          {
            isChecked: debugCL,
            name: "radioGroup",
            onChange: handleRadioChange,
            label: "Export to LDIF For Debugging",
            id: "debugCL"
          }
        )), /* @__PURE__ */ import_react106.default.createElement("hr", null), page)
      );
    }
  };
  EnableReplModal.propTypes = {
    showModal: import_prop_types84.default.bool,
    closeHandler: import_prop_types84.default.func,
    handleChange: import_prop_types84.default.func,
    saveHandler: import_prop_types84.default.func,
    spinning: import_prop_types84.default.bool,
    disabled: import_prop_types84.default.bool,
    error: import_prop_types84.default.object
  };
  EnableReplModal.defaultProps = {
    showModal: false,
    spinning: false,
    disabled: false,
    error: {}
  };
  AddManagerModal.propTypes = {
    showModal: import_prop_types84.default.bool,
    closeHandler: import_prop_types84.default.func,
    handleChange: import_prop_types84.default.func,
    saveHandler: import_prop_types84.default.func,
    spinning: import_prop_types84.default.bool,
    error: import_prop_types84.default.object
  };
  AddManagerModal.defaultProps = {
    showModal: false,
    spinning: false,
    error: {}
  };
  ChangeReplRoleModal.propTypes = {
    showModal: import_prop_types84.default.bool,
    closeHandler: import_prop_types84.default.func,
    handleChange: import_prop_types84.default.func,
    saveHandler: import_prop_types84.default.func,
    spinning: import_prop_types84.default.bool,
    role: import_prop_types84.default.string,
    newRole: import_prop_types84.default.string
  };
  ChangeReplRoleModal.defaultProps = {
    showModal: false,
    spinning: false,
    role: "",
    newRole: ""
  };
  ReplAgmtModal.propTypes = {
    showModal: import_prop_types84.default.bool,
    closeHandler: import_prop_types84.default.func,
    handleChange: import_prop_types84.default.func,
    handleStripChange: import_prop_types84.default.func,
    handleFracChange: import_prop_types84.default.func,
    handleFracInitChange: import_prop_types84.default.func,
    saveHandler: import_prop_types84.default.func,
    spinning: import_prop_types84.default.bool,
    availAttrs: import_prop_types84.default.array,
    agmtName: import_prop_types84.default.string,
    agmtHost: import_prop_types84.default.string,
    agmtPort: import_prop_types84.default.string,
    agmtProtocol: import_prop_types84.default.string,
    agmtBindMethod: import_prop_types84.default.string,
    agmtBindDN: import_prop_types84.default.string,
    agmtBindPW: import_prop_types84.default.string,
    agmtBindPWConfirm: import_prop_types84.default.string,
    agmtBootstrap: import_prop_types84.default.bool,
    agmtBootstrapProtocol: import_prop_types84.default.string,
    agmtBootstrapBindMethod: import_prop_types84.default.string,
    agmtBootstrapBindDN: import_prop_types84.default.string,
    agmtBootstrapBindPW: import_prop_types84.default.string,
    agmtBootstrapBindPWConfirm: import_prop_types84.default.string,
    agmtStripAttrs: import_prop_types84.default.array,
    agmtFracAttrs: import_prop_types84.default.array,
    agmtFracInitAttrs: import_prop_types84.default.array,
    agmtSync: import_prop_types84.default.bool,
    agmtSyncMon: import_prop_types84.default.bool,
    agmtSyncTue: import_prop_types84.default.bool,
    agmtSyncWed: import_prop_types84.default.bool,
    agmtSyncThu: import_prop_types84.default.bool,
    agmtSyncFri: import_prop_types84.default.bool,
    agmtSyncSat: import_prop_types84.default.bool,
    agmtSyncSun: import_prop_types84.default.bool,
    agmtStartTime: import_prop_types84.default.string,
    agmtEndTime: import_prop_types84.default.string,
    saveOK: import_prop_types84.default.bool,
    error: import_prop_types84.default.object,
    edit: import_prop_types84.default.bool
  };
  ReplAgmtModal.defaultProps = {
    showModal: false,
    spinning: false,
    availAttrs: [],
    agmtName: "",
    agmtHost: "",
    agmtPort: "636",
    agmtProtocol: "LDAP",
    agmtBindMethod: "SIMPLE",
    agmtBindDN: "",
    agmtBindPW: "",
    agmtBindPWConfirm: "",
    agmtBootstrap: false,
    agmtBootstrapProtocol: "LDAP",
    agmtBootstrapBindMethod: "SIMPLE",
    agmtBootstrapBindDN: "",
    agmtBootstrapBindPW: "",
    agmtBootstrapBindPWConfirm: "",
    agmtStripAttrs: [],
    agmtFracAttrs: [],
    agmtFracInitAttrs: [],
    agmtSync: true,
    agmtSyncMon: false,
    agmtSyncTue: false,
    agmtSyncWed: false,
    agmtSyncThu: false,
    agmtSyncFri: false,
    agmtSyncSat: false,
    agmtSyncSun: false,
    agmtStartTime: "00:00",
    agmtEndTime: "23:59",
    saveOK: false,
    error: {},
    edit: false
  };
  WinsyncAgmtModal.propTypes = {
    showModal: import_prop_types84.default.bool,
    closeHandler: import_prop_types84.default.func,
    handleChange: import_prop_types84.default.func,
    handleFracChange: import_prop_types84.default.func,
    saveHandler: import_prop_types84.default.func,
    spinning: import_prop_types84.default.bool,
    availAttrs: import_prop_types84.default.array,
    agmtName: import_prop_types84.default.string,
    agmtHost: import_prop_types84.default.string,
    agmtPort: import_prop_types84.default.string,
    agmtProtocol: import_prop_types84.default.string,
    agmtBindDN: import_prop_types84.default.string,
    agmtBindPW: import_prop_types84.default.string,
    agmtBindPWConfirm: import_prop_types84.default.string,
    agmtFracAttrs: import_prop_types84.default.array,
    agmtSync: import_prop_types84.default.bool,
    agmtSyncMon: import_prop_types84.default.bool,
    agmtSyncTue: import_prop_types84.default.bool,
    agmtSyncWed: import_prop_types84.default.bool,
    agmtSyncThu: import_prop_types84.default.bool,
    agmtSyncFri: import_prop_types84.default.bool,
    agmtSyncSat: import_prop_types84.default.bool,
    agmtSyncSun: import_prop_types84.default.bool,
    agmtStartTime: import_prop_types84.default.string,
    agmtEndTime: import_prop_types84.default.string,
    agmtSyncGroups: import_prop_types84.default.bool,
    agmtSyncUsers: import_prop_types84.default.bool,
    agmtWinDomain: import_prop_types84.default.string,
    agmtWinSubtree: import_prop_types84.default.string,
    agmtDSSubtree: import_prop_types84.default.string,
    agmtOneWaySync: import_prop_types84.default.string,
    agmtSyncInterval: import_prop_types84.default.string,
    saveOK: import_prop_types84.default.bool,
    error: import_prop_types84.default.object,
    edit: import_prop_types84.default.bool
  };
  WinsyncAgmtModal.defaultProps = {
    showModal: false,
    spinning: false,
    availAttrs: [],
    agmtName: "",
    agmtHost: "",
    agmtPort: "636",
    agmtProtocol: "LDAPS",
    agmtBindDN: "",
    agmtBindPW: "",
    agmtBindPWConfirm: "",
    agmtFracAttrs: [],
    agmtSync: true,
    agmtSyncMon: false,
    agmtSyncTue: false,
    agmtSyncWed: false,
    agmtSyncThu: false,
    agmtSyncFri: false,
    agmtSyncSat: false,
    agmtSyncSun: false,
    agmtStartTime: "00:00",
    agmtEndTime: "23:59",
    agmtSyncGroups: false,
    agmtSyncUsers: false,
    agmtWinDomain: "",
    agmtWinSubtree: "",
    agmtDSSubtree: "",
    agmtOneWaySync: "both",
    // "both", "toWindows", "fromWindows"
    agmtSyncInterval: "",
    saveOK: false,
    error: {},
    edit: false
  };

  // src/lib/replication/replConfig.jsx
  var import_prop_types85 = __toESM(require_prop_types(), 1);
  var ReplConfig = class extends import_react107.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        saving: false,
        showConfirmManagerDelete: false,
        showAddManagerModal: false,
        showPromoteDemoteModal: false,
        addManagerSpinning: false,
        roleChangeSpinning: false,
        manager: "cn=replication manager,cn=config",
        manager_passwd: "",
        manager_passwd_confirm: "",
        newRole: this.props.role === "Supplier" ? "Hub" : "Supplier",
        newRID: 1,
        modalSpinning: false,
        modalChecked: false,
        errObj: {},
        saveBtnDisabled: true,
        isExpanded: false,
        // Config Settings
        nsds5replicabinddn: this.props.data.nsds5replicabinddn,
        nsds5replicabinddngroup: this.props.data.nsds5replicabinddngroup,
        nsds5replicabinddngroupcheckinterval: Number(this.props.data.nsds5replicabinddngroupcheckinterval) === 0 ? -1 : Number(this.props.data.nsds5replicabinddngroupcheckinterval),
        nsds5replicareleasetimeout: Number(this.props.data.nsds5replicareleasetimeout),
        nsds5replicapurgedelay: Number(this.props.data.nsds5replicapurgedelay) === 0 ? 604800 : Number(this.props.data.nsds5replicapurgedelay),
        nsds5replicatombstonepurgeinterval: Number(this.props.data.nsds5replicatombstonepurgeinterval) === 0 ? 86400 : Number(this.props.data.nsds5replicatombstonepurgeinterval),
        nsds5replicaprecisetombstonepurging: Number(this.props.data.nsds5replicaprecisetombstonepurging),
        nsds5replicaprotocoltimeout: Number(this.props.data.nsds5replicaprotocoltimeout) === 0 ? 120 : Number(this.props.data.nsds5replicaprotocoltimeout),
        nsds5replicabackoffmin: Number(this.props.data.nsds5replicabackoffmin) === 0 ? 3 : Number(this.props.data.nsds5replicabackoffmin),
        nsds5replicabackoffmax: Number(this.props.data.nsds5replicabackoffmax) === 0 ? 300 : Number(this.props.data.nsds5replicabackoffmax),
        nsds5replicakeepaliveupdateinterval: Number(this.props.data.nsds5replicakeepaliveupdateinterval) === 0 ? 3600 : Number(this.props.data.nsds5replicakeepaliveupdateinterval),
        // Original settings
        _nsds5replicabinddn: this.props.data.nsds5replicabinddn,
        _nsds5replicabinddngroup: this.props.data.nsds5replicabinddngroup,
        _nsds5replicabinddngroupcheckinterval: Number(this.props.data.nsds5replicabinddngroupcheckinterval) === 0 ? -1 : Number(this.props.data.nsds5replicabinddngroupcheckinterval),
        _nsds5replicareleasetimeout: this.props.data.nsds5replicareleasetimeout,
        _nsds5replicapurgedelay: Number(this.props.data.nsds5replicapurgedelay) === 0 ? 604800 : Number(this.props.data.nsds5replicapurgedelay),
        _nsds5replicatombstonepurgeinterval: Number(this.props.data.nsds5replicatombstonepurgeinterval) === 0 ? 86400 : Number(this.props.data.nsds5replicatombstonepurgeinterval),
        _nsds5replicaprecisetombstonepurging: this.props.data.nsds5replicaprecisetombstonepurging,
        _nsds5replicaprotocoltimeout: Number(this.props.data.nsds5replicaprotocoltimeout) === 0 ? 120 : Number(this.props.data.nsds5replicaprotocoltimeout),
        _nsds5replicabackoffmin: Number(this.props.data.nsds5replicabackoffmin) === 0 ? 3 : Number(this.props.data.nsds5replicabackoffmin),
        _nsds5replicabackoffmax: Number(this.props.data.nsds5replicabackoffmax) === 0 ? 300 : Number(this.props.data.nsds5replicabackoffmax),
        _nsds5replicakeepaliveupdateinterval: Number(this.props.data.nsds5replicakeepaliveupdateinterval) === 0 ? 3600 : Number(this.props.data.nsds5replicakeepaliveupdateinterval)
      };
      this.handleToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleMinusChange = () => {
        this.setState({
          newRID: Number(this.state.newRID) - 1
        });
      };
      this.handleNumberChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          newRID: newValue > 65534 ? 65534 : newValue < 1 ? 1 : newValue
        });
      };
      this.handlePlusChange = () => {
        this.setState({
          newRID: Number(this.state.newRID) + 1
        });
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.confirmManagerDelete = this.confirmManagerDelete.bind(this);
      this.closeConfirmManagerDelete = this.closeConfirmManagerDelete.bind(this);
      this.deleteManager = this.deleteManager.bind(this);
      this.handleShowAddManager = this.handleShowAddManager.bind(this);
      this.closeAddManagerModal = this.closeAddManagerModal.bind(this);
      this.addManager = this.addManager.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onManagerChange = this.onManagerChange.bind(this);
      this.handleShowPromoteDemoteModal = this.handleShowPromoteDemoteModal.bind(this);
      this.closePromoteDemoteModal = this.closePromoteDemoteModal.bind(this);
      this.doRoleChange = this.doRoleChange.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    doRoleChange(changeType) {
      let action = "demote";
      if (changeType === "Promoting") {
        action = "promote";
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        action,
        "--suffix=" + this.props.suffix,
        "--newrole=" + this.state.newRole
      ];
      if (this.state.newRole === "Supplier") {
        const ridNum = parseInt(this.state.newRID, 10);
        if (ridNum < 1 || ridNum >= 65535) {
          this.props.addNotification(
            "error",
            "A Supplier replica requires a unique numerical identifier.  Please enter an ID between 1 and 65534"
          );
          return;
        }
        cmd.push("--replica-id=" + this.state.newRID);
      }
      this.setState({
        roleChangeSpinning: true
      });
      log_cmd("doRoleChange", "change replica role", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.props.addNotification(
          "success",
          `Successfully ${action}d replica to a ${this.state.newRole}`
        );
        this.setState({
          roleChangeSpinning: false,
          showPromoteDemoteModal: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload();
        this.props.addNotification(
          "error",
          `Failed to ${action} replica - ${errMsg.desc}`
        );
        this.setState({
          roleChangeSpinning: false,
          showPromoteDemoteModal: false
        });
      });
    }
    closePromoteDemoteModal() {
      this.setState({
        showPromoteDemoteModal: false
      });
    }
    handleShowPromoteDemoteModal() {
      this.setState({
        showPromoteDemoteModal: true,
        modalChecked: false
      });
    }
    closeAddManagerModal() {
      this.setState({
        showAddManagerModal: false
      });
    }
    handleShowAddManager() {
      this.setState({
        showAddManagerModal: true,
        manager: "cn=replication manager,cn=config",
        manager_passwd: "",
        manager_passwd_confirm: "",
        errObj: {
          manager_passwd: true,
          manager_passwd_confirm: true
        }
      });
    }
    addManager() {
      if (!valid_dn(this.state.manager)) {
        this.props.addNotification(
          "error",
          `Invalid DN for the Replication Manager: ${this.state.manager}`
        );
        return;
      }
      if (this.state.manager_passwd === "" || this.state.manager_passwd_confirm === "") {
        this.props.addNotification(
          "error",
          "You must provide a password for the Replication Manager"
        );
        return;
      }
      if (this.state.manager_passwd !== this.state.manager_passwd_confirm) {
        this.props.addNotification(
          "error",
          "Passwords do not match"
        );
        return;
      }
      this.setState({
        addManagerSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "create-manager",
        "--suffix=" + this.props.suffix,
        "--name=" + this.state.manager
      ];
      const config2 = {
        cmd,
        promptArg: "",
        // repl manager auto prompts when passwd is missing
        passwd: this.state.manager_passwd,
        addNotification: this.props.addNotification,
        msg: "Replication Manager",
        success_msg: "Successfully added Replication Manager",
        error_msg: "Failure adding Replication Manager",
        state_callback: () => {
          this.setState({
            addManagerSpinning: false,
            showAddManagerModal: false
          });
        },
        reload_func: this.props.reloadConfig,
        reload_arg: this.props.suffix,
        funcName: "addManager",
        funcDesc: "Adding Replication Manager"
      };
      callCmdStreamPassword(config2);
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      });
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      const config_attrs = [
        "nsds5replicabinddngroup",
        "nsds5replicabinddngroupcheckinterval",
        "nsds5replicapurgedelay",
        "nsds5replicatombstonepurgeinterval",
        "nsds5replicareleasetimeout",
        "nsds5replicaprotocoltimeout",
        "nsds5replicabackoffmin",
        "nsds5replicabackoffmax",
        "nsds5replicaprecisetombstonepurging",
        "nsds5replicakeepaliveupdateinterval"
      ];
      for (const config_attr of config_attrs) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      this.setState({
        saveBtnDisabled
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      let valueErr = false;
      const errObj = this.state.errObj;
      const config_attrs = [
        "nsds5replicabinddngroup",
        "nsds5replicabinddngroupcheckinterval",
        "nsds5replicapurgedelay",
        "nsds5replicatombstonepurgeinterval",
        "nsds5replicareleasetimeout",
        "nsds5replicaprotocoltimeout",
        "nsds5replicabackoffmin",
        "nsds5replicabackoffmax",
        "nsds5replicaprecisetombstonepurging",
        "nsds5replicakeepaliveupdateinterval"
      ];
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr] !== value) {
          saveBtnDisabled = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr] !== this.state[config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      if (attr === "nsds5replicabinddngroup") {
        if (!valid_dn(value)) {
          valueErr = true;
          saveBtnDisabled = true;
        }
      } else if (this.state.nsds5replicabinddngroup !== "" && !valid_dn(this.state.nsds5replicabinddngroup)) {
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [attr]: value,
        saveBtnDisabled,
        errObj
      });
    }
    onManagerChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      if (attr === "manager_passwd") {
        if (value !== this.state.manager_passwd_confirm) {
          valueErr = true;
        } else {
          errObj[attr] = false;
          errObj.manager_passwd_confirm = false;
        }
      } else if (attr === "manager_passwd_confirm") {
        if (value !== this.state.manager_passwd) {
          valueErr = true;
        } else {
          errObj[attr] = false;
          errObj.manager_passwd = false;
        }
      }
      errObj[attr] = valueErr;
      this.setState({
        [attr]: value,
        errObj
      });
    }
    confirmManagerDelete(name2) {
      this.setState({
        showConfirmManagerDelete: true,
        modalChecked: false,
        modalSpinning: false,
        manager: name2
      });
    }
    closeConfirmManagerDelete() {
      this.setState({
        showConfirmManagerDelete: false,
        manager: ""
      });
    }
    deleteManager() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "delete-manager",
        "--suffix=" + this.props.suffix,
        "--name=" + this.state.manager
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteManager", "Deleting Replication Manager", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConfig(this.props.suffix);
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          `Successfully removed Replication Manager`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reloadConfig(this.props.suffix);
        this.props.addNotification(
          "error",
          `Failure removing Replication Manager - ${errMsg.desc}`
        );
        this.setState({
          modalSpinning: false
        });
      });
    }
    handleSaveConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "set",
        "--suffix=" + this.props.suffix
      ];
      if (this.state.nsds5replicabackoffmax !== this.state._nsds5replicabackoffmax) {
        cmd.push("--repl-backoff-max=" + this.state.nsds5replicabackoffmax);
      }
      if (this.state.nsds5replicabackoffmin !== this.state._nsds5replicabackoffmin) {
        cmd.push("--repl-backoff-min=" + this.state.nsds5replicabackoffmin);
      }
      if (this.state.nsds5replicaprotocoltimeout !== this.state._nsds5replicaprotocoltimeout) {
        cmd.push("--repl-protocol-timeout=" + this.state.nsds5replicaprotocoltimeout);
      }
      if (this.state.nsds5replicaprecisetombstonepurging !== this.state._nsds5replicaprecisetombstonepurging) {
        if (this.state.nsds5replicaprecisetombstonepurging) {
          cmd.push("--repl-fast-tombstone-purging=on");
        } else {
          cmd.push("--repl-fast-tombstone-purging=off");
        }
      }
      if (this.state.nsds5replicatombstonepurgeinterval !== this.state._nsds5replicatombstonepurgeinterval) {
        cmd.push("--repl-tombstone-purge-interval=" + this.state.nsds5replicatombstonepurgeinterval);
      }
      if (this.state.nsds5replicabinddngroup !== this.state._nsds5replicabinddngroup) {
        cmd.push("--repl-bind-group=" + this.state.nsds5replicabinddngroup);
      }
      if (this.state.nsds5replicabinddngroupcheckinterval !== this.state._nsds5replicabinddngroupcheckinterval) {
        cmd.push("--repl-bind-group-interval=" + this.state.nsds5replicabinddngroupcheckinterval);
      }
      if (this.state.nsds5replicakeepaliveupdateinterval !== this.state._nsds5replicakeepaliveupdateinterval) {
        cmd.push("--repl-keepalive-update-interval=" + this.state.nsds5replicakeepaliveupdateinterval);
      }
      if (this.state.nsds5replicareleasetimeout !== this.state._nsds5replicareleasetimeout) {
        cmd.push("--repl-release-timeout=" + this.state.nsds5replicareleasetimeout);
      }
      if (this.state.nsds5replicapurgedelay !== this.state._nsds5replicapurgedelay) {
        cmd.push("--repl-purge-delay=" + this.state.nsds5replicapurgedelay);
      }
      if (cmd.length > 6) {
        this.setState({
          // Start the spinner
          saving: true
        });
        log_cmd("handleSaveConfig", "Applying replication changes", cmd);
        const msg = "Successfully updated replication configuration.";
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reloadConfig(this.props.suffix);
          this.props.addNotification(
            "success",
            msg
          );
          this.setState({
            saving: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.reloadConfig(this.props.suffix);
          this.setState({
            saving: false
          });
          let msg2 = errMsg.desc;
          if ("info" in errMsg) {
            msg2 = errMsg.desc + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            `Error updating replication configuration - ${msg2}`
          );
        });
      }
    }
    render() {
      let roleButton = "";
      const manager_rows = [];
      let saveBtnName = "Save Configuration";
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = "Saving Config ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      for (const row of this.props.data.nsds5replicabinddn) {
        manager_rows.push(row);
      }
      if (this.props.role === "Supplier") {
        roleButton = /* @__PURE__ */ import_react107.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowPromoteDemoteModal,
            title: "Demote this Supplier replica to a Hub or Consumer",
            className: "ds-left-margin"
          },
          "Change Role"
        );
      } else if (this.props.role === "Hub") {
        roleButton = /* @__PURE__ */ import_react107.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowPromoteDemoteModal,
            title: "Promote or Demote this Hub replica to a Supplier or Consumer",
            className: "ds-left-margin"
          },
          "Change Role"
        );
      } else {
        roleButton = /* @__PURE__ */ import_react107.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowPromoteDemoteModal,
            title: "Promote this Consumer replica to a Supplier or Hub",
            className: "ds-left-margin"
          },
          "Change Role"
        );
      }
      return /* @__PURE__ */ import_react107.default.createElement("div", { className: this.state.saving ? "ds-disabled" : "" }, /* @__PURE__ */ import_react107.default.createElement("div", { className: "ds-margin-top-xxlg ds-left-margin" }, /* @__PURE__ */ import_react107.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react107.default.createElement(Grid, null, /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Replica Role"), /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react107.default.createElement(
        TextInput,
        {
          value: this.props.role,
          type: "text",
          "aria-describedby": "horizontal-form-name-helper",
          name: "replrole",
          id: "replrole",
          isDisabled: true
        }
      )), /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 1 }, roleButton)), /* @__PURE__ */ import_react107.default.createElement(Grid, null, /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Replica ID"), /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react107.default.createElement(
        TextInput,
        {
          value: this.props.data.nsds5replicaid,
          type: "text",
          "aria-describedby": "horizontal-form-name-helper",
          name: "replid",
          id: "replid",
          isDisabled: true
        }
      ))), /* @__PURE__ */ import_react107.default.createElement(Grid, null, /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 12 }, "Replication Managers"), /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-margin-top", span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
        ManagerTable,
        {
          rows: manager_rows,
          confirmDelete: this.confirmManagerDelete
        }
      ))), /* @__PURE__ */ import_react107.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react107.default.createElement(
        Button,
        {
          variant: "secondary",
          onClick: this.handleShowAddManager
        },
        "Add Replication Manager"
      ))), /* @__PURE__ */ import_react107.default.createElement(
        ExpandableSection,
        {
          toggleText: this.state.isExpanded ? "Hide Advanced Settings" : "Show Advanced Settings",
          onToggle: this.handleToggle,
          isExpanded: this.state.isExpanded
        },
        /* @__PURE__ */ import_react107.default.createElement("div", { className: "ds-margin-top ds-margin-left ds-margin-bottom-md" }, /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "The DN of the replication manager group",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN Group"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            TextInput,
            {
              value: this.state.nsds5replicabinddngroup,
              type: "text",
              id: "nsds5replicabinddngroup",
              "aria-describedby": "horizontal-form-name-helper",
              name: "nsds5replicabinddngroup",
              onChange: (str, e) => {
                this.handleChange(e);
              },
              validated: this.state.errObj.nsds5replicabinddngroup && this.state.nsds5replicabinddngroup !== "" ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "The interval to check for any changes in the group memebrship specified in the Bind DN Group and automatically rebuilds the list for the replication managers accordingly.  (nsds5replicabinddngroupcheckinterval).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Bind DN Group Check Interval"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicabinddngroupcheckinterval,
              min: -1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicabinddngroupcheckinterval");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicabinddngroupcheckinterval", -1);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicabinddngroupcheckinterval");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "This controls the maximum age of deleted entries (tombstone entries), and entry state information.  (nsds5replicapurgedelay).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Purge Delay"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicapurgedelay,
              min: -1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicapurgedelay");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicapurgedelay", -1);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicapurgedelay");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "This attribute specifies the time interval in seconds between purge operation cycles.  (nsds5replicatombstonepurgeinterval).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Tombstone Purge Interval"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicatombstonepurgeinterval,
              min: -1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicatombstonepurgeinterval");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicatombstonepurgeinterval", -1);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicatombstonepurgeinterval");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "A time limit (in seconds) that tells a replication session to yield if other replicas are trying to acquire this one (nsds5replicareleasetimeout).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replica Release Timeout"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicareleasetimeout,
              min: 0,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicareleasetimeout");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicareleasetimeout", 0);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicareleasetimeout");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "A timeout on how long to wait before stopping a replication session when the server is being stopped, replication is being disabled, or when removing a replication agreement. (nsds5replicaprotocoltimeout).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Replication Timeout"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicaprotocoltimeout,
              min: 1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicaprotocoltimeout");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicaprotocoltimeout", 1);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicaprotocoltimeout");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "This is the minimum amount of time in seconds that a replication session will go into a backoff state  (nsds5replicabackoffmin).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Back Off Minimum"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicabackoffmin,
              min: 1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicabackoffmin");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicabackoffmin", 1);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicabackoffmin");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "This is the maximum amount of time in seconds that a replication session will go into a backoff state  (nsds5replicabackoffmax).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Back Off Maximum"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicabackoffmax,
              min: 1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicabackoffmax");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicabackoffmax", 1);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicabackoffmax");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "The interval in seconds that the server will apply an internal update to get the RUV from getting stale. (nsds5replicakeepaliveupdateinterval).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Refresh RUV Interval"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            NumberInput,
            {
              value: this.state.nsds5replicakeepaliveupdateinterval,
              min: 60,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsds5replicakeepaliveupdateinterval");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsds5replicakeepaliveupdateinterval", 60);
              },
              onPlus: () => {
                this.onPlusConfig("nsds5replicakeepaliveupdateinterval");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(
          Grid,
          {
            title: "Enables faster tombstone purging (nsds5replicaprecisetombstonepurging).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Fast Tombstone Purging"),
          /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react107.default.createElement(
            Checkbox,
            {
              id: "nsds5replicaprecisetombstonepurging",
              isChecked: this.state.nsds5replicaprecisetombstonepurging,
              onChange: (str, e) => {
                this.handleChange(e);
              }
            }
          ))
        ), /* @__PURE__ */ import_react107.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react107.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react107.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleSaveConfig,
            isDisabled: this.state.saveBtnDisabled,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        ))))
      )), /* @__PURE__ */ import_react107.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmManagerDelete,
          closeHandler: this.closeConfirmManagerDelete,
          handleChange: this.onModalChange,
          actionHandler: this.deleteManager,
          spinning: this.state.modalSpinning,
          item: this.state.manager,
          checked: this.state.modalChecked,
          mTitle: "Remove Replication Manager",
          mMsg: "Are you sure you want to remove this Replication Manager?",
          mSpinningMsg: "Removing Manager ...",
          mBtnName: "Remove Manager"
        }
      ), /* @__PURE__ */ import_react107.default.createElement(
        AddManagerModal,
        {
          showModal: this.state.showAddManagerModal,
          closeHandler: this.closeAddManagerModal,
          handleChange: this.onManagerChange,
          saveHandler: this.addManager,
          spinning: this.state.addManagerSpinning,
          manager: this.state.manager,
          manager_passwd: this.state.manager_passwd,
          manager_passwd_confirm: this.state.manager_passwd_confirm,
          error: this.state.errObj
        }
      ), /* @__PURE__ */ import_react107.default.createElement(
        ChangeReplRoleModal,
        {
          showModal: this.state.showPromoteDemoteModal,
          closeHandler: this.closePromoteDemoteModal,
          handleChange: this.onModalChange,
          saveHandler: this.doRoleChange,
          spinning: this.state.roleChangeSpinning,
          role: this.props.role,
          newRole: this.state.newRole,
          checked: this.state.modalChecked,
          newRID: this.state.newRID,
          onMinus: this.handleMinusChange,
          onNumberChange: this.handleNumberChange,
          onPlus: this.handlePlusChange
        }
      )));
    }
  };
  ReplConfig.propTypes = {
    role: import_prop_types85.default.string,
    suffix: import_prop_types85.default.string,
    data: import_prop_types85.default.object,
    serverId: import_prop_types85.default.string
  };
  ReplConfig.defaultProps = {
    role: "",
    suffix: "",
    data: {},
    serverId: ""
  };

  // src/lib/replication/winsyncAgmts.jsx
  var import_react108 = __toESM(require_react(), 1);
  var import_prop_types86 = __toESM(require_prop_types(), 1);
  var WinsyncAgmts = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "_mounted", false);
      this.state = {
        showCreateAgmtModal: false,
        showEditAgmtModal: false,
        showConfirmDeleteAgmt: false,
        showConfirmInitAgmt: false,
        showConfirmEnableAgmt: false,
        showConfirmDisableAgmt: false,
        errObj: {},
        savingAgmt: false,
        mounted: false,
        rows: [],
        page: 1,
        value: "",
        sortBy: {},
        // Create agreement
        agmtName: "",
        agmtHost: "",
        agmtPort: "",
        agmtProtocol: "LDAPS",
        agmtBindDN: "",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtFracAttrs: [],
        agmtSync: true,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        modalChecked: false,
        modalSpinning: false,
        // Winsync specific settings
        agmtSyncGroups: false,
        agmtSyncUsers: true,
        agmtWinDomain: "",
        agmtWinSubtree: "",
        agmtDSSubtree: "",
        agmtOneWaySync: "both",
        // "both", "toWindows", "fromWindows"
        agmtSyncInterval: "",
        // Init agmt
        agmtInitCounter: 0,
        agmtInitIntervals: [],
        isExcludeAttrCreateOpen: false,
        isExcludeAttrEditOpen: false
      };
      this.handleExcludeAttrCreateToggle = (isExcludeAttrCreateOpen) => {
        this.setState({
          isExcludeAttrCreateOpen
        });
      };
      this.handleExcludeAttrCreateClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrCreateOpen: false
        });
      };
      this.handleExcludeAttrEditToggle = (isExcludeAttrEditOpen) => {
        this.setState({
          isExcludeAttrEditOpen
        });
      };
      this.handleExcludeAttrEditClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrEditOpen: false
        });
      };
      this.handleShowCreateAgmtModal = this.handleShowCreateAgmtModal.bind(this);
      this.closeCreateAgmtModal = this.closeCreateAgmtModal.bind(this);
      this.closeEditAgmtModal = this.closeEditAgmtModal.bind(this);
      this.handleTASelectChange = this.handleTASelectChange.bind(this);
      this.onTimeChange = this.onTimeChange.bind(this);
      this.onCreateChange = this.onCreateChange.bind(this);
      this.onEditChange = this.onEditChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onTAFracAttrChange = this.onTAFracAttrChange.bind(this);
      this.onTAFracAttrChangeEdit = this.onTAFracAttrChangeEdit.bind(this);
      this.createAgmt = this.createAgmt.bind(this);
      this.showEditAgmt = this.showEditAgmt.bind(this);
      this.saveAgmt = this.saveAgmt.bind(this);
      this.pokeAgmt = this.pokeAgmt.bind(this);
      this.initAgmt = this.initAgmt.bind(this);
      this.enableAgmt = this.enableAgmt.bind(this);
      this.disableAgmt = this.disableAgmt.bind(this);
      this.deleteAgmt = this.deleteAgmt.bind(this);
      this.showConfirmDeleteAgmt = this.showConfirmDeleteAgmt.bind(this);
      this.closeConfirmDeleteAgmt = this.closeConfirmDeleteAgmt.bind(this);
      this.showConfirmInitAgmt = this.showConfirmInitAgmt.bind(this);
      this.closeConfirmInitAgmt = this.closeConfirmInitAgmt.bind(this);
      this.confirmToggle = this.confirmToggle.bind(this);
      this.closeConfirmEnableAgmt = this.closeConfirmEnableAgmt.bind(this);
      this.closeConfirmDisableAgmt = this.closeConfirmDisableAgmt.bind(this);
      this.watchAgmtInit = this.watchAgmtInit.bind(this);
      this.onSort = this.onSort.bind(this);
      this.onSearchChange = this.onSearchChange.bind(this);
    }
    componentDidMount() {
      this._mounted = true;
      const rows = JSON.parse(JSON.stringify(this.props.rows));
      this.setState({ rows });
    }
    componentWillUnmount() {
      this._mounted = false;
    }
    onModalChange(e) {
      this.setState({
        [e.target.id]: e.target.checked
      });
    }
    validateConfig(attr, value, errObj) {
      let all_good = true;
      const configAttrs2 = [
        "agmtName",
        "agmtHost",
        "agmtWinDomain"
      ];
      const dnAttrs = [
        "agmtBindDN",
        "agmtWinSubtree",
        "agmtWinSubtree",
        "agmtDSSubtree"
      ];
      if (attr === "agmtSync" && value === true) {
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        errObj.agmtSyncSun = false;
        errObj.agmtStartTime = false;
        errObj.agmtEndTime = false;
      }
      for (const configAttr of configAttrs2) {
        if (attr === configAttr) {
          if (value === "") {
            errObj[attr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (this.state[configAttr] === "") {
          errObj[configAttr] = true;
          all_good = false;
        }
      }
      for (const dnAttr of dnAttrs) {
        if (attr === dnAttr) {
          if (!valid_dn(value)) {
            errObj[dnAttr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (!valid_dn(this.state[dnAttr])) {
          errObj[dnAttr] = true;
          all_good = false;
        }
      }
      if (attr === "agmtPort") {
        if (!valid_port(value)) {
          errObj.agmtPort = true;
          all_good = false;
        } else {
          errObj.agmtPort = false;
        }
      }
      if (attr === "agmtBindPW") {
        if (value !== this.state.agmtBindPWConfirm || value === "") {
          errObj.agmtBindPW = true;
          errObj.agmtBindPWConfirm = true;
          all_good = false;
        } else {
          errObj.agmtBindPW = false;
          errObj.agmtBindPWConfirm = false;
        }
      } else if (attr === "agmtBindPWConfirm") {
        if (value !== this.state.agmtBindPW || value === "") {
          errObj.agmtBindPW = true;
          errObj.agmtBindPWConfirm = true;
          all_good = false;
        } else {
          errObj.agmtBindPW = false;
          errObj.agmtBindPWConfirm = false;
        }
      } else if (this.state.agmtBindPW !== this.state.agmtBindPWConfirm || this.state.agmtBindPW === "" || this.state.agmtBindPWConfirm === "") {
        errObj.agmtBindPW = true;
        errObj.agmtBindPWConfirm = true;
        all_good = false;
      }
      if (attr === "agmtSync") {
        if (value) {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
          this.setState({
            agmtSyncMon: true,
            agmtSyncTue: true,
            agmtSyncWed: true,
            agmtSyncThu: true,
            agmtSyncFri: true,
            agmtSyncSat: true,
            agmtSyncSun: true,
            agmtStartTime: "0000",
            agmtEndTime: "2359"
          });
        }
      } else if (this.state.agmtSync) {
        let have_days = false;
        const days = [
          "agmtSyncSun",
          "agmtSyncMon",
          "agmtSyncTue",
          "agmtSyncWed",
          "agmtSyncThu",
          "agmtSyncFri",
          "agmtSyncSat"
        ];
        for (const day of days) {
          if (attr !== day && this.state[day] || attr === day && value) {
            have_days = true;
            break;
          }
        }
        errObj.agmtSyncSun = false;
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        if (!have_days) {
          errObj.agmtSyncSun = true;
          errObj.agmtSyncMon = true;
          errObj.agmtSyncTue = true;
          errObj.agmtSyncWed = true;
          errObj.agmtSyncThu = true;
          errObj.agmtSyncFri = true;
          errObj.agmtSyncSat = true;
          all_good = false;
        } else if (attr === "agmtStartTime") {
          if (value === "") {
            all_good = false;
            errObj.agmtStartTime = true;
          } else if (value >= this.state.agmtEndTime) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (attr === "agmtEndTime") {
          if (value === "") {
            errObj.agmtEndTime = true;
            all_good = false;
          } else if (this.state.agmtStartTime >= value) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (this.state.agmtStartTime >= this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
          all_good = false;
        }
      }
      return all_good;
    }
    onTimeChange(action, attr, val) {
      let value = val.replace(":", "");
      const errObj = this.state.errObj;
      const e = { target: { id: "dummy", value: "", type: "input" } };
      if (value === "") {
        value = "0000";
      }
      if (attr === "agmtStartTime") {
        if (value > this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
        } else {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
        }
      } else if (attr === "agmtEndTime") {
        if (this.state.agmtStartTime > value) {
          errObj.agmtEndTime = true;
        } else {
          errObj.agmtEndTime = false;
          errObj.agmtStartTime = false;
        }
      }
      this.setState({
        [attr]: value,
        errObj
      }, () => {
        action === "edit" ? this.onEditChange(e) : this.onCreateChange(e);
      });
    }
    onCreateChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = true;
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, errObj);
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        [e.target.toggle]: false
      });
    }
    onEditChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = true;
      errObj[attr] = false;
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, errObj);
      if (all_good) {
        all_good = false;
        if (attr !== "agmtHost" && this.state.agmtHost !== this.state._agmtHost || attr !== "agmtPort" && this.state.agmtPort !== this.state._agmtPort || attr !== "agmtBindDN" && this.state.agmtBindDN !== this.state._agmtBindDN || attr !== "agmtBindMethod" && this.state.agmtBindMethod !== this.state._agmtBindMethod || attr !== "agmtProtocol" && this.state.agmtProtocol !== this.state._agmtProtocol || attr !== "agmtSync" && this.state.agmtSync !== this.state._agmtSync || attr !== "agmtFracAttrs" && !listsEqual(this.state.agmtFracAttrs, this.state._agmtFracAttrs) || attr !== "agmtSyncGroups" && this.state.agmtSyncGroups !== this.state._agmtSyncGroups || attr !== "agmtSyncUsers" && this.state.agmtSyncUsers !== this.state._agmtSyncUsers || attr !== "agmtWinDomain" && this.state.agmtWinDomain !== this.state._agmtWinDomain || attr !== "agmtWinSubtree" && this.state.agmtWinSubtree !== this.state._agmtWinSubtree || attr !== "agmtDSSubtree" && this.state.agmtDSSubtree !== this.state._agmtDSSubtree || attr !== "agmtOneWaySync" && this.state.agmtOneWaySync !== this.state._agmtOneWaySync || attr !== "agmtSyncInterval" && this.state.agmtSyncInterval !== this.state._agmtSyncInterval) {
          all_good = true;
        }
        if (attr !== "agmtSync" && this.state.agmtSync || attr === "agmtSync" && value) {
          if (attr !== "agmtSyncMon" && this.state.agmtSyncMon !== this.state._agmtSyncMon || attr !== "agmtSyncTue" && this.state.agmtSyncTue !== this.state._agmtSyncTue || attr !== "agmtSyncWed" && this.state.agmtSyncWed !== this.state._agmtSyncWed || attr !== "agmtSyncThu" && this.state.agmtSyncThu !== this.state._agmtSyncThu || attr !== "agmtSyncFri" && this.state.agmtSyncFri !== this.state._agmtSyncFri || attr !== "agmtSyncSat" && this.state.agmtSyncSat !== this.state._agmtSyncSat || attr !== "agmtSyncSun" && this.state.agmtSyncSun !== this.state._agmtSyncSun || attr !== "agmtStartTime" && this.state.agmtStartTime !== this.state._agmtStartTime || attr !== "agmtEndTime" && this.state.agmtEndTime !== this.state._agmtEndTime) {
            all_good = true;
          }
        }
        if (attr === "agmtFracAttrs" && !this.listEqual(value, this.state._agmtFracAttrs)) {
          all_good = true;
        } else if (attr !== "dummy" && value !== this.state["_" + attr]) {
          all_good = true;
        }
      }
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        [e.target.toggle]: false
      });
    }
    handleTASelectChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[attr] = valueErr;
      if (attr.endsWith("Attrs")) {
        if (this.state[attr].includes(value)) {
          this.setState(
            (prevState) => ({
              [attr]: prevState[attr].filter((item) => item !== e.target.value),
              errObj,
              [e.target.toggle]: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              [attr]: [...prevState[attr], value],
              errObj,
              [e.target.toggle]: false
            })
          );
        }
      } else {
        this.setState({
          [attr]: value,
          errObj,
          [e.target.toggle]: false
        });
      }
    }
    onTAFracAttrChangeEdit(selection) {
      const { agmtFracAttrs } = this.state;
      const e = { target: { id: "dummy", value: "", type: "input" } };
      if (agmtFracAttrs.includes(selection)) {
        const new_values = this.state.agmtFracAttrs.filter((item) => item !== selection);
        this.setState({
          agmtFracAttrs: new_values,
          isExcludeAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      } else {
        const new_values = [...this.state.agmtFracAttrs, selection];
        this.setState({
          agmtFracAttrs: new_values,
          isExcludeAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      }
    }
    onTAFracAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtFracAttrs",
          value: values,
          type: "input",
          toggle: "isExcludeAttrCreateOpen"
        }
      };
      this.handleChange(e);
    }
    showConfirmDeleteAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmDeleteAgmt: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmDeleteAgmt() {
      this.setState({
        showConfirmDeleteAgmt: false,
        modalChecked: false
      });
    }
    showConfirmInitAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmInitAgmt: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmInitAgmt() {
      this.setState({
        showConfirmInitAgmt: false,
        modalChecked: false
      });
    }
    handleShowCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: true,
        agmtName: "",
        agmtHost: "",
        agmtPort: "636",
        agmtProtocol: "LDAP",
        agmtBindDN: "",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtFracAttrs: [],
        agmtSync: false,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        agmtSyncGroups: false,
        agmtSyncUsers: true,
        agmtWinDomain: "",
        agmtWinSubtree: "",
        agmtDSSubtree: "",
        agmtOneWaySync: "both",
        // "both", "toWindows", "fromWindows"
        agmtSyncInterval: "",
        errObj: {
          // Marks all these fields as required
          agmtName: true,
          agmtHost: true,
          agmtBindDN: true,
          agmtBindPW: true,
          agmtBindPWConfirm: true,
          agmtWinDomain: true,
          agmtWinSubtree: true,
          agmtDSSubtree: true
        }
      });
    }
    closeCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: false
      });
    }
    closeEditAgmtModal() {
      this.setState({
        showEditAgmtModal: false
      });
    }
    showEditAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "get",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("showEditAgmt", "Edit winsync agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let agmtName2 = "";
        let agmtHost = "";
        let agmtPort = "";
        let agmtProtocol = "";
        let agmtBindDN = "";
        let agmtBindPW = "";
        let agmtBindPWConfirm = "";
        let agmtFracAttrs = [];
        let agmtSync = false;
        let agmtSyncMon = false;
        let agmtSyncTue = false;
        let agmtSyncWed = false;
        let agmtSyncThu = false;
        let agmtSyncFri = false;
        let agmtSyncSat = false;
        let agmtSyncSun = false;
        let agmtStartTime = "0000";
        let agmtEndTime = "2359";
        let agmtSyncGroups = false;
        let agmtSyncUsers = false;
        let agmtWinDomain = "";
        let agmtWinSubtree = "";
        let agmtDSSubtree = "";
        let agmtOneWaySync = "both";
        let agmtSyncInterval = "";
        for (const attr in config2.attrs) {
          const val = config2.attrs[attr][0];
          if (attr === "winsyncinterval") {
            agmtSyncInterval = val;
          }
          if (attr === "onewaysync") {
            agmtOneWaySync = val;
          }
          if (attr === "nsds7directoryreplicasubtree") {
            agmtDSSubtree = val;
          }
          if (attr === "nsds7windowsreplicasubtree") {
            agmtWinSubtree = val;
          }
          if (attr === "nsds7windowsdomain") {
            agmtWinDomain = val;
          }
          if (attr === "nsds7newwinusersyncenabled") {
            if (val.toLowerCase() === "on") {
              agmtSyncUsers = true;
            }
          }
          if (attr === "nsds7newwingroupsyncenabled") {
            if (val.toLowerCase() === "on") {
              agmtSyncGroups = true;
            }
          }
          if (attr === "cn") {
            agmtName2 = val;
          }
          if (attr === "nsds5replicahost") {
            agmtHost = val;
          }
          if (attr === "nsds5replicaport") {
            agmtPort = val;
          }
          if (attr === "nsds5replicatransportinfo") {
            agmtProtocol = val;
          }
          if (attr === "nsds5replicabinddn") {
            agmtBindDN = val;
          }
          if (attr === "nsds5replicacredentials") {
            agmtBindPW = val;
            agmtBindPWConfirm = val;
          }
          if (attr === "nsds5replicatedattributelist") {
            const attrs = val.replace("(objectclass=*) $ EXCLUDE", "").trim();
            agmtFracAttrs = attrs.split(" ");
          }
          if (attr === "nsds5replicaupdateschedule") {
            agmtSync = true;
            const parts = val.split(" ");
            const times = parts[0].split("-");
            const days = parts[1];
            agmtStartTime = times[0];
            agmtEndTime = times[1];
            if (days.includes("0")) {
              agmtSyncSun = true;
            }
            if (days.includes("1")) {
              agmtSyncMon = true;
            }
            if (days.includes("2")) {
              agmtSyncTue = true;
            }
            if (days.includes("3")) {
              agmtSyncWed = true;
            }
            if (days.includes("4")) {
              agmtSyncThu = true;
            }
            if (days.includes("5")) {
              agmtSyncFri = true;
            }
            if (days.includes("6")) {
              agmtSyncSat = true;
            }
          }
        }
        if (this._mounted) {
          this.setState({
            showEditAgmtModal: true,
            errObj: {},
            agmtName: agmtName2,
            agmtHost,
            agmtPort,
            agmtProtocol,
            agmtBindDN,
            agmtBindPW,
            agmtBindPWConfirm,
            agmtFracAttrs,
            agmtSync,
            agmtSyncMon,
            agmtSyncTue,
            agmtSyncWed,
            agmtSyncThu,
            agmtSyncFri,
            agmtSyncSat,
            agmtSyncSun,
            agmtStartTime,
            agmtEndTime,
            agmtSyncGroups,
            agmtSyncUsers,
            agmtWinDomain,
            agmtWinSubtree,
            agmtDSSubtree,
            agmtOneWaySync,
            agmtSyncInterval,
            agmtSaveOK: false,
            // Record original values before editing
            _agmtName: agmtName2,
            _agmtHost: agmtHost,
            _agmtPort: agmtPort,
            _agmtProtocol: agmtProtocol,
            _agmtBindDN: agmtBindDN,
            _agmtBindPW: agmtBindPW,
            _agmtBindPWConfirm: agmtBindPWConfirm,
            _agmtFracAttrs: agmtFracAttrs,
            _agmtSync: agmtSync,
            _agmtSyncMon: agmtSyncMon,
            _agmtSyncTue: agmtSyncTue,
            _agmtSyncWed: agmtSyncWed,
            _agmtSyncThu: agmtSyncThu,
            _agmtSyncFri: agmtSyncFri,
            _agmtSyncSat: agmtSyncSat,
            _agmtSyncSun: agmtSyncSun,
            _agmtStartTime: agmtStartTime,
            _agmtEndTime: agmtEndTime,
            _agmtSyncGroups: agmtSyncGroups,
            _agmtSyncUsers: agmtSyncUsers,
            _agmtWinDomain: agmtWinDomain,
            _agmtWinSubtree: agmtWinSubtree,
            _agmtDSSubtree: agmtDSSubtree,
            _agmtOneWaySync: agmtOneWaySync,
            _agmtSyncInterval: agmtSyncInterval
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to get agreement information for: "${agmtName}" - ${errMsg.desc}`
        );
      });
    }
    saveAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "set",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      const passwd = "";
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      } else if (this.state.agmtSync !== this.state._agmtSync && !this.state.agmtSync) {
        cmd.push("--schedule=");
      }
      if (this.state.agmtSyncGroups !== this.state._agmtSyncGroups) {
        let val = "off";
        if (this.state.agmtSyncGroups) {
          val = "on";
        }
        cmd.push("--sync-groups=" + val);
      }
      if (this.state.agmtSyncUsers !== this.state._agmtSyncUsers) {
        let val = "off";
        if (this.state.agmtSyncUsers) {
          val = "on";
        }
        cmd.push("--sync-users=" + val);
      }
      if (this.state.agmtWinDomain !== this.state._agmtWinDomain) {
        cmd.push("--win-domain=" + this.state.agmtWinDomain);
      }
      if (this.state.agmtWinSubtree !== this.state._agmtWinSubtree) {
        cmd.push("--win-subtree=" + this.state.agmtWinSubtree);
      }
      if (this.state.agmtDSSubtree !== this.state._agmtDSSubtree) {
        cmd.push("--ds-subtree=" + this.state.agmtDSSubtree);
      }
      if (this.state.agmtOneWaySync !== this.state._agmtOneWaySync) {
        let value = this.state.agmtOneWaySync;
        if (value === "both") {
          value = "";
        }
        cmd.push("--one-way-sync=" + value);
      }
      if (this.state.agmtSyncInterval !== this.state._agmtSyncInterval) {
        cmd.push("--sync-interval=" + this.state.agmtSyncInterval);
      }
      if (this.state.agmtProtocol !== this.state._agmtProtocol) {
        cmd.push("--conn-protocol=" + this.state.agmtProtocol);
      }
      if (this.state.agmtBindPW !== this.state._agmtBindPW) {
        cmd.push("--bind-passwd=" + this.state.agmtBindPW);
      }
      if (this.state.agmtBindDN !== this.state._agmtBindDN) {
        cmd.push("--bind-passwd=" + this.state.agmtBindDN);
      }
      if (this.state.agmtFracAttrs !== this.state._agmtFracAttrs) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtHost !== this.state._agmtHost) {
        cmd.push("--host=" + this.state.agmtHost);
      }
      if (this.state.agmtPort !== this.state._agmtPort) {
        cmd.push("--port=" + this.state.agmtPort);
      }
      this.setState({
        savingAgmt: true
      });
      const config2 = {
        cmd,
        promptArg: "--bind-passwd-prompt",
        passwd,
        addNotification: this.props.addNotification,
        success_msg: "Successfully updated winsync agreement",
        error_msg: "Failed to update winsync agreement",
        state_callback: () => {
          this.setState({
            savingAgmt: false,
            showEditAgmtModal: false
          });
        },
        reload_func: this.props.reload,
        reload_arg: this.props.suffix,
        funcName: "saveAgmt",
        funcDesc: "update winsync agreement"
      };
      callCmdStreamPassword(config2);
    }
    pokeAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "poke",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("pokeAgmt", "send updates now", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully poked winsync agreement"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to poke winsync agreement - ${errMsg.desc}`
        );
      });
    }
    initAgmt() {
      this.setState({
        modalSpinning: true
      });
      const init_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "init",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("initAgmt", "Initialize winsync agreement", init_cmd);
      cockpit_default.spawn(init_cmd, { superuser: true, err: "message" }).done((content) => {
        const agmtIntervalCount = this.state.agmtInitCounter + 1;
        const intervals = this.state.agmtInitIntervals;
        this.props.reload(this.props.suffix);
        intervals[agmtIntervalCount] = setInterval(this.watchAgmtInit, 2e3, this.state.agmtName, agmtIntervalCount);
        if (this._mounted) {
          this.setState({
            agmtInitCounter: agmtIntervalCount,
            agmtInitIntervals: intervals,
            showConfirmInitAgmt: false
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to initialize winsync agreement - ${errMsg.desc}`
        );
        this.setState({
          showConfirmInitAgmt: false
        });
      });
    }
    confirmToggle(agmtName, state) {
      if (state === "Enabled") {
        this.setState({
          agmtName,
          showConfirmDisableAgmt: true,
          modalSpinning: false,
          modalChecked: false
        });
      } else {
        this.setState({
          agmtName,
          showConfirmEnableAgmt: true,
          modalSpinning: false,
          modalChecked: false
        });
      }
    }
    closeConfirmEnableAgmt() {
      this.setState({
        showConfirmEnableAgmt: false
      });
    }
    closeConfirmDisableAgmt() {
      this.setState({
        showConfirmDisableAgmt: false
      });
    }
    enableAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "enable",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("enableAgmt", "enable agmt", cmd);
      this.setState({
        modalSpinning: true
      });
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully enabled winsync agreement"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to enabled winsync agreement - ${errMsg.desc}`
        );
      });
    }
    disableAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "disable",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("disableAgmt", "Disable agmt", cmd);
      this.setState({
        modalSpinning: true
      });
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully disabled winsync agreement"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to disable winsync agreement - ${errMsg.desc}`
        );
      });
    }
    deleteAgmt() {
      this.setState({
        deleteSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "delete",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("deleteAgmt", "Delete agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully deleted winsync agreement"
        );
        this.setState({
          showConfirmDeleteAgmt: false,
          deleteSpinning: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to delete winsync agreement - ${errMsg.desc}`
        );
        this.setState({
          showConfirmDeleteAgmt: false,
          deleteSpinning: false
        });
      });
    }
    createAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "create",
        this.state.agmtName,
        "--suffix=" + this.props.suffix,
        "--host=" + this.state.agmtHost,
        "--port=" + this.state.agmtPort,
        "--conn-protocol=" + this.state.agmtProtocol,
        "--bind-dn=" + this.state.agmtBindDN,
        "--ds-subtree=" + this.state.agmtDSSubtree,
        "--win-subtree=" + this.state.agmtWinSubtree,
        "--win-domain=" + this.state.agmtWinDomain,
        "--one-way-sync=" + this.state.agmtOneWaySync
      ];
      const passwd = this.state.agmtBindPW;
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      }
      if (this.state.agmtFracAttrs.length > 0) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtSyncGroups) {
        cmd.push("--sync-groups=on");
      }
      if (this.state.agmtSyncUsers) {
        cmd.push("--sync-users=on");
      }
      if (this.state.agmtSyncInterval !== "") {
        cmd.push("--sync-interval=" + this.state.agmtSyncInterval);
      }
      this.setState({
        savingAgmt: true
      });
      let ext_func = "";
      if (this.state.agmtInit === "online-init") {
        ext_func = this.initAgmt;
      }
      log_cmd("createAgmt", "Create winsync agmt", cmd);
      const config2 = {
        cmd,
        promptArg: "--bind-passwd-prompt",
        passwd,
        addNotification: this.props.addNotification,
        success_msg: "Successfully created winsync agreement",
        error_msg: "Failed to create winsync agreement",
        state_callback: () => {
          this.setState({
            savingAgmt: false,
            showCreateAgmtModal: false
          });
        },
        reload_func: this.props.reload,
        reload_arg: this.props.suffix,
        ext_func,
        ext_arg: this.state.agmtName,
        funcName: "createAgmt",
        funcDesc: "Create winsync agreement"
      };
      callCmdStreamPassword(config2);
    }
    watchAgmtInit(agmtName, idx) {
      const status_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "init-status",
        "--suffix=" + this.props.suffix,
        agmtName
      ];
      log_cmd("watchAgmtInit", "Get initialization status for agmt", status_cmd);
      cockpit_default.spawn(status_cmd, { superuser: true, err: "message" }).done((data) => {
        const init_status = JSON.parse(data);
        if (init_status.startsWith("Agreement successfully initialized") || init_status.startsWith("Agreement initialization failed")) {
          clearInterval(this.state.agmtInitIntervals[idx]);
          this.props.reload(this.props.suffix);
        }
      });
    }
    onSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    onSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3], row[4], row[5]]);
      }
      if (val === "") {
        rows = JSON.parse(JSON.stringify(this.props.rows));
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      return /* @__PURE__ */ import_react108.default.createElement("div", { className: "ds-margin-right" }, /* @__PURE__ */ import_react108.default.createElement(
        ReplAgmtTable,
        {
          key: this.state.rows,
          rows: this.state.rows,
          edit: this.showEditAgmt,
          poke: this.pokeAgmt,
          init: this.showConfirmInitAgmt,
          enable: this.confirmToggle,
          delete: this.showConfirmDeleteAgmt,
          page: this.state.page,
          sort: this.onSort,
          sortBy: this.state.sortBy,
          search: this.onSearchChange,
          value: this.state.value
        }
      ), /* @__PURE__ */ import_react108.default.createElement("div", { className: "ds-margin-top ds-container ds-inline ds-margin-bottom-md" }, /* @__PURE__ */ import_react108.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: this.handleShowCreateAgmtModal
        },
        "Create Agreement"
      ), /* @__PURE__ */ import_react108.default.createElement(
        Button,
        {
          className: "ds-left-margin",
          variant: "secondary",
          onClick: () => {
            this.props.reload(this.props.suffix);
          }
        },
        "Refresh Agreements"
      )), /* @__PURE__ */ import_react108.default.createElement(
        WinsyncAgmtModal,
        {
          showModal: this.state.showCreateAgmtModal,
          closeHandler: this.closeCreateAgmtModal,
          handleChange: this.onCreateChange,
          handleTimeChange: this.onTimeChange,
          handleFracChange: this.onTAFracAttrChange,
          onSelectToggle: this.handleExcludeAttrCreateToggle,
          onSelectClear: this.handleExcludeAttrCreateClear,
          isExcludeAttrOpen: this.state.isExcludeAttrCreateOpen,
          saveHandler: this.createAgmt,
          getToggleId: this.getToggleId,
          spinning: this.state.savingAgmt,
          agmtName: this.state.agmtName,
          agmtHost: this.state.agmtHost,
          agmtPort: this.state.agmtPort,
          agmtBindDN: this.state.agmtBindDN,
          agmtBindPW: this.state.agmtBindPW,
          agmtBindPWConfirm: this.state.agmtBindPWConfirm,
          agmtProtocol: this.state.agmtProtocol,
          agmtFracAttrs: this.state.agmtFracAttrs,
          agmtSync: this.state.agmtSync,
          agmtSyncMon: this.state.agmtSyncMon,
          agmtSyncTue: this.state.agmtSyncTue,
          agmtSyncWed: this.state.agmtSyncWed,
          agmtSyncThu: this.state.agmtSyncThu,
          agmtSyncFri: this.state.agmtSyncFri,
          agmtSyncSat: this.state.agmtSyncSat,
          agmtSyncSun: this.state.agmtSyncSun,
          agmtStartTime: this.state.agmtStartTime,
          agmtEndTime: this.state.agmtEndTime,
          agmtSyncGroups: this.state.agmtSyncGroups,
          agmtSyncUsers: this.state.agmtSyncUsers,
          agmtWinDomain: this.state.agmtWinDomain,
          agmtWinSubtree: this.state.agmtWinSubtree,
          agmtDSSubtree: this.state.agmtDSSubtree,
          agmtOneWaySync: this.state.agmtOneWaySync,
          agmtSyncInterval: this.state.agmtSyncInterval,
          agmtInit: this.state.agmtInit,
          availAttrs: this.props.attrs,
          error: this.state.errObj,
          saveOK: this.state.agmtSaveOK
        }
      ), /* @__PURE__ */ import_react108.default.createElement(
        WinsyncAgmtModal,
        {
          key: this.state.showEditAgmtModal ? "edit1" : "edit0",
          showModal: this.state.showEditAgmtModal,
          closeHandler: this.closeEditAgmtModal,
          handleChange: this.onEditChange,
          handleTimeChange: this.onTimeChange,
          handleFracChange: this.onTAFracAttrChangeEdit,
          onSelectToggle: this.handleExcludeAttrEditToggle,
          onSelectClear: this.handleExcludeAttrEditClear,
          isExcludeAttrOpen: this.state.isExcludeAttrEditOpen,
          getToggleId: this.getToggleId,
          saveHandler: this.saveAgmt,
          spinning: this.state.savingAgmt,
          agmtName: this.state.agmtName,
          agmtHost: this.state.agmtHost,
          agmtPort: this.state.agmtPort,
          agmtBindDN: this.state.agmtBindDN,
          agmtBindPW: this.state.agmtBindPW,
          agmtBindPWConfirm: this.state.agmtBindPWConfirm,
          agmtProtocol: this.state.agmtProtocol,
          agmtStripAttrs: this.state.agmtStripAttrs,
          agmtFracAttrs: this.state.agmtFracAttrs,
          agmtFracInitAttrs: this.state.agmtFracInitAttrs,
          agmtSync: this.state.agmtSync,
          agmtSyncMon: this.state.agmtSyncMon,
          agmtSyncTue: this.state.agmtSyncTue,
          agmtSyncWed: this.state.agmtSyncWed,
          agmtSyncThu: this.state.agmtSyncThu,
          agmtSyncFri: this.state.agmtSyncFri,
          agmtSyncSat: this.state.agmtSyncSat,
          agmtSyncSun: this.state.agmtSyncSun,
          agmtStartTime: this.state.agmtStartTime,
          agmtEndTime: this.state.agmtEndTime,
          agmtSyncGroups: this.state.agmtSyncGroups,
          agmtSyncUsers: this.state.agmtSyncUsers,
          agmtWinDomain: this.state.agmtWinDomain,
          agmtWinSubtree: this.state.agmtWinSubtree,
          agmtDSSubtree: this.state.agmtDSSubtree,
          agmtOneWaySync: this.state.agmtOneWaySync,
          agmtSyncInterval: this.state.agmtSyncInterval,
          agmtInit: this.state.agmtInit,
          availAttrs: this.props.attrs,
          error: this.state.errObj,
          saveOK: this.state.agmtSaveOK,
          edit: true
        }
      ), /* @__PURE__ */ import_react108.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteAgmt,
          closeHandler: this.closeConfirmDeleteAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.deleteAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Delete Winsync Agreement",
          mMsg: "Are you sure you want to delete this winsync agreement",
          mSpinningMsg: "Deleting Winsync Agreement ...",
          mBtnName: "Delete Agreement"
        }
      ), /* @__PURE__ */ import_react108.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmInitAgmt,
          closeHandler: this.closeConfirmInitAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.initAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Initialize Winsync Agreement",
          mMsg: "Are you sure you want to initialize this winsync agreement?",
          mSpinningMsg: "Initializing Winsync Agreement ...",
          mBtnName: "Initialize Agreement"
        }
      ), /* @__PURE__ */ import_react108.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmEnableAgmt,
          closeHandler: this.closeConfirmEnableAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.enableAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Enable Winsync Agreement",
          mMsg: "Are you sure you want to enable this winsync agreement?",
          mSpinningMsg: "Enabling Winsync Agreement ...",
          mBtnName: "Enable Agreement"
        }
      ), /* @__PURE__ */ import_react108.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDisableAgmt,
          closeHandler: this.closeConfirmDisableAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.disableAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Disable Winsync Agreement",
          mMsg: "Are you sure you want to disable this winsync agreement?",
          mSpinningMsg: "Disabling Winsync Agreement ...",
          mBtnName: "Disable Agreement"
        }
      ));
    }
  };
  WinsyncAgmts.propTypes = {
    suffix: import_prop_types86.default.string,
    serverId: import_prop_types86.default.string,
    rows: import_prop_types86.default.array,
    addNotification: import_prop_types86.default.func
  };
  WinsyncAgmts.defaultProps = {
    serverId: "",
    suffix: "",
    rows: []
  };

  // src/lib/replication/replAgmts.jsx
  var import_react109 = __toESM(require_react(), 1);
  var import_prop_types87 = __toESM(require_prop_types(), 1);
  var ldapOptions = ["SIMPLE", "SASL/DIGEST-MD5", "SASL/GSSAPI"];
  var ldapsOptions = ["SIMPLE", "SSLCLIENTAUTH"];
  var ldapBootstrapOptions = ["SIMPLE"];
  var ldapsBootstrapOptions = ["SIMPLE", "SSLCLIENTAUTH"];
  var ReplAgmts = class extends import_react109.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "_mounted", false);
      __publicField(this, "onSelectToggle", (isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "onSelectClear", (toggleId, collection) => {
        this.setState({
          [toggleId]: false,
          [collection]: []
        });
      });
      this.state = {
        showCreateAgmtModal: false,
        showEditAgmtModal: false,
        showConfirmDeleteAgmt: false,
        showConfirmInitAgmt: false,
        showConfirmEnableAgmt: false,
        showConfirmDisableAgmt: false,
        errObj: {},
        savingAgmt: false,
        mounted: false,
        rows: [],
        page: 1,
        value: "",
        sortBy: {},
        // Create agreement
        agmtName: "",
        agmtHost: "",
        agmtPort: "636",
        agmtProtocol: "LDAPS",
        agmtBindMethod: "SIMPLE",
        agmtBindMethodOptions: ldapsOptions,
        agmtBindDN: "cn=replication manager,cn=config",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtBootstrap: false,
        agmtBootstrapProtocol: "LDAPS",
        agmtBootstrapBindMethod: "SIMPLE",
        agmtBootstrapBindMethodOptions: ldapsBootstrapOptions,
        agmtBootstrapBindDN: "cn=replication manager,cn=config",
        agmtBootstrapBindPW: "",
        agmtBootstrapBindPWConfirm: "",
        agmtStripAttrs: [],
        agmtFracAttrs: [],
        agmtFracInitAttrs: [],
        agmtSync: true,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        modalChecked: false,
        modalSpinning: false,
        // Init agmt
        agmtInitCounter: 0,
        agmtInitIntervals: [],
        isExcludeAttrsCreateOpen: false,
        isExcludeInitAttrsCreateOpen: false,
        isStripAttrsCreateOpen: false,
        isExcludeAttrsEditOpen: false,
        isExcludeInitAttrsEditOpen: false,
        isStripAttrsEditOpen: false
      };
      this.handleExcludeAttrsCreateToggle = (isExcludeAttrsCreateOpen) => {
        this.setState({
          isExcludeAttrsCreateOpen
        });
      };
      this.handleExcludeAttrsCreateClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrsCreateOpen: false
        });
      };
      this.handleExcludeAttrsInitCreateToggle = (isExcludeInitAttrsCreateOpen) => {
        this.setState({
          isExcludeInitAttrsCreateOpen
        });
      };
      this.handleExcludeAttrsInitCreateClear = () => {
        this.setState({
          agmtFracInitAttrs: [],
          isExcludeInitAttrsCreateOpen: false
        });
      };
      this.onStripAttrsCreateToggle = (isStripAttrsCreateOpen) => {
        this.setState({
          isStripAttrsCreateOpen
        });
      };
      this.handleStripAttrsCreateClear = () => {
        this.setState({
          agmtStripAttrs: [],
          isStripAttrsCreateOpen: false
        });
      };
      this.handleExcludeAttrsEditToggle = (isExcludeAttrsEditOpen) => {
        this.setState({
          isExcludeAttrsEditOpen
        });
      };
      this.handleExcludeAttrsEditClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrsEditOpen: false
        });
      };
      this.handleExcludeAttrsInitEditToggle = (isExcludeInitAttrsEditOpen) => {
        this.setState({
          isExcludeInitAttrsEditOpen
        });
      };
      this.handleExcludeAttrsInitEditClear = () => {
        this.setState({
          agmtFracInitAttrs: [],
          isExcludeInitAttrsEditOpen: false
        });
      };
      this.onStripAttrsEditToggle = (isStripAttrsEditOpen) => {
        this.setState({
          isStripAttrsEditOpen
        });
      };
      this.handleStripAttrsEditClear = () => {
        this.setState({
          agmtStripAttrs: [],
          isStripAttrsEditOpen: false
        });
      };
      this.handleShowCreateAgmtModal = this.handleShowCreateAgmtModal.bind(this);
      this.closeCreateAgmtModal = this.closeCreateAgmtModal.bind(this);
      this.closeEditAgmtModal = this.closeEditAgmtModal.bind(this);
      this.handleTASelectChange = this.handleTASelectChange.bind(this);
      this.onTimeChange = this.onTimeChange.bind(this);
      this.onCreateChange = this.onCreateChange.bind(this);
      this.onEditChange = this.onEditChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onTAFracInitAttrChange = this.onTAFracInitAttrChange.bind(this);
      this.onTAFracAttrChange = this.onTAFracAttrChange.bind(this);
      this.onTAStripAttrChange = this.onTAStripAttrChange.bind(this);
      this.onTAFracInitAttrChangeEdit = this.onTAFracInitAttrChangeEdit.bind(this);
      this.onTAFracAttrChangeEdit = this.onTAFracAttrChangeEdit.bind(this);
      this.onTAStripAttrChangeEdit = this.onTAStripAttrChangeEdit.bind(this);
      this.createAgmt = this.createAgmt.bind(this);
      this.showEditAgmt = this.showEditAgmt.bind(this);
      this.saveAgmt = this.saveAgmt.bind(this);
      this.pokeAgmt = this.pokeAgmt.bind(this);
      this.initAgmt = this.initAgmt.bind(this);
      this.enableAgmt = this.enableAgmt.bind(this);
      this.disableAgmt = this.disableAgmt.bind(this);
      this.deleteAgmt = this.deleteAgmt.bind(this);
      this.showConfirmDeleteAgmt = this.showConfirmDeleteAgmt.bind(this);
      this.closeConfirmDeleteAgmt = this.closeConfirmDeleteAgmt.bind(this);
      this.showConfirmInitAgmt = this.showConfirmInitAgmt.bind(this);
      this.closeConfirmInitAgmt = this.closeConfirmInitAgmt.bind(this);
      this.confirmToggle = this.confirmToggle.bind(this);
      this.closeConfirmEnableAgmt = this.closeConfirmEnableAgmt.bind(this);
      this.closeConfirmDisableAgmt = this.closeConfirmDisableAgmt.bind(this);
      this.watchAgmtInit = this.watchAgmtInit.bind(this);
      this.onSort = this.onSort.bind(this);
      this.onSearchChange = this.onSearchChange.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
    }
    componentDidMount() {
      this._mounted = true;
      const rows = JSON.parse(JSON.stringify(this.props.rows));
      this.setState({ rows });
    }
    componentWillUnmount() {
      this._mounted = false;
    }
    onModalChange(e) {
      this.setState({
        [e.target.id]: e.target.checked
      });
    }
    validateConfig(attr, value, modalData, errObj) {
      let all_good = true;
      const configAttrs2 = [
        "agmtName",
        "agmtHost"
      ];
      const dnAttrs = [
        "agmtBindDN"
      ];
      if (attr === "agmtBootstrap" && value === false) {
        errObj.agmtBootstrapBindDN = false;
        errObj.agmtBootstrapBindPW = false;
        errObj.agmtBootstrapBindPWConfirm = false;
      }
      if (attr === "agmtSync" && value === true) {
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        errObj.agmtSyncSun = false;
        errObj.agmtStartTime = false;
        errObj.agmtEndTime = false;
      }
      for (const configAttr of configAttrs2) {
        if (attr === configAttr) {
          if (value === "") {
            errObj[attr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (this.state[configAttr] === "") {
          errObj[configAttr] = true;
          all_good = false;
        }
      }
      for (const dnAttr of dnAttrs) {
        if (attr === dnAttr) {
          if (!valid_dn(value)) {
            errObj[dnAttr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (!valid_dn(this.state[dnAttr])) {
          errObj[dnAttr] = true;
          all_good = false;
        }
      }
      if (attr === "agmtPort") {
        if (!valid_port(value)) {
          errObj.agmtPort = true;
          all_good = false;
        } else {
          errObj.agmtPort = false;
        }
      } else if (attr === "agmtProtocol") {
        if (value === "LDAP") {
          modalData.agmtBindMethodOptions = ldapOptions;
        } else {
          modalData.agmtBindMethodOptions = ldapsOptions;
        }
        if (modalData.agmtBindMethodOptions.indexOf(this.state.agmtBindMethod) === -1) {
          modalData.agmtBindMethod = modalData.agmtBindMethodOptions[0];
        }
      } else if (attr === "agmtBindMethod") {
        modalData.agmtBindMethod = value;
      } else if (attr === "agmtBootstrapBindMethod") {
        modalData.agmtBootstrapBindMethod = value;
      } else if (attr === "agmtBootstrapProtocol") {
        if (value === "LDAP") {
          modalData.agmtBootstrapBindMethodOptions = ldapBootstrapOptions;
        } else {
          modalData.agmtBootstrapBindMethodOptions = ldapsBootstrapOptions;
        }
        if (modalData.agmtBootstrapBindMethodOptions.indexOf(this.state.agmtBootstrapBindMethod) === -1) {
          modalData.agmtBootstrapBindMethod = modalData.agmtBootstrapBindMethodOptions[0];
        }
      }
      if (attr === "agmtBindMethod" && (value !== "SIMPLE" && value !== "SASL/DIGEST-MD5")) {
        errObj.agmtBindPW = false;
        errObj.agmtBindPWConfirm = false;
      } else if (this.state.agmtBindMethod === "SIMPLE" || this.state.agmtBindMethod === "SASL/DIGEST-MD5" || attr === "agmtBindMethod" && (value === "SIMPLE" || value === "SASL/DIGEST-MD5")) {
        if (attr === "agmtBindPW") {
          if (value !== this.state.agmtBindPWConfirm || value === "") {
            errObj.agmtBindPW = true;
            errObj.agmtBindPWConfirm = true;
            all_good = false;
          } else {
            errObj.agmtBindPW = false;
            errObj.agmtBindPWConfirm = false;
          }
        } else if (attr === "agmtBindPWConfirm") {
          if (value !== this.state.agmtBindPW || value === "") {
            errObj.agmtBindPW = true;
            errObj.agmtBindPWConfirm = true;
            all_good = false;
          } else {
            errObj.agmtBindPW = false;
            errObj.agmtBindPWConfirm = false;
          }
        } else if (this.state.agmtBindPW !== this.state.agmtBindPWConfirm || this.state.agmtBindPW === "" || this.state.agmtBindPWConfirm === "") {
          errObj.agmtBindPW = true;
          errObj.agmtBindPWConfirm = true;
          all_good = false;
        }
      } else {
        errObj.agmtBindPW = false;
        errObj.agmtBindPWConfirm = false;
      }
      if (attr === "agmtBootstrap") {
        if (value) {
          if (this.state.agmtBootstrapBindMethod === "SIMPLE") {
            if (this.state.agmtBootstrapBindPW === "" || this.state.agmtBootstrapBindPWConfirm === "") {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else if (this.state.agmtBootstrapBindPW !== this.state.agmtBootstrapBindPWConfirm) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapProtocol = false;
              errObj.agmtBootstrapBindMethod = false;
            }
          } else {
            errObj.agmtBootstrapProtocol = false;
            errObj.agmtBootstrapBindMethod = false;
          }
          if (this.state.agmtBootstrapBindDN === "" || !valid_dn(this.state.agmtBootstrapBindDN)) {
            errObj.agmtBootstrapBindDN = true;
            all_good = false;
          }
        }
      } else if (this.state.agmtBootstrap) {
        if (attr === "agmtBootstrapBindDN") {
          if (value === "" || !valid_dn(value)) {
            errObj.agmtBootstrapBindDN = true;
            all_good = false;
          } else {
            errObj.agmtBootstrapBindDN = false;
          }
        } else if (this.state.agmtBootstrapBindDN === "" || !valid_dn(this.state.agmtBootstrapBindDN)) {
          errObj.agmtBootstrapBindDN = true;
          all_good = false;
        } else {
          errObj.agmtBootstrapBindDN = false;
        }
        if (attr === "agmtBootstrapBindMethod") {
          if (value === "SIMPLE") {
            if (this.state.agmtBootstrapBindPW === "" || this.state.agmtBootstrapBindPWConfirm === "") {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else if (this.state.agmtBootstrapBindPW !== this.state.agmtBootstrapBindPWConfirm) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            }
          } else {
            errObj.agmtBootstrapBindPW = false;
            errObj.agmtBootstrapBindPWConfirm = false;
            if (this.state.agmtBootstrapProtocol === "LDAP") {
              errObj.agmtBootstrapBindMethod = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapProtocol = false;
              errObj.agmtBootstrapBindMethod = false;
            }
          }
        } else if (this.state.agmtBootstrapBindMethod === "SIMPLE") {
          if (attr === "agmtBootstrapBindPW") {
            if (value === "") {
              all_good = false;
              errObj.agmtBootstrapBindPW = true;
            } else if (value !== this.state.agmtBootstrapBindPWConfirm) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapBindPW = false;
              errObj.agmtBootstrapBindPWConfirm = false;
            }
          } else if (this.state.agmtBootstrapBindPW === "") {
            all_good = false;
          }
          if (attr === "agmtBootstrapBindPWConfirm") {
            if (value === "") {
              all_good = false;
              errObj.agmtBootstrapBindPWConfirm = true;
            } else if (value !== this.state.agmtBootstrapBindPW) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapBindPW = false;
              errObj.agmtBootstrapBindPWConfirm = false;
            }
          } else if (this.state.agmtBootstrapBindPWConfirm === "") {
            all_good = false;
          }
        } else {
          if (this.state.agmtBootstrapProtocol === "LDAP") {
            errObj.agmtBootstrapProtocol = true;
            all_good = false;
          } else {
            errObj.agmtBootstrapProtocol = false;
            errObj.agmtBootstrapBindMethod = false;
          }
        }
      }
      if (attr === "agmtSync") {
        if (value) {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
          this.setState({
            agmtSyncMon: true,
            agmtSyncTue: true,
            agmtSyncWed: true,
            agmtSyncThu: true,
            agmtSyncFri: true,
            agmtSyncSat: true,
            agmtSyncSun: true,
            agmtStartTime: "0000",
            agmtEndTime: "2359"
          });
        }
      } else if (this.state.agmtSync) {
        let have_days = false;
        const days = [
          "agmtSyncSun",
          "agmtSyncMon",
          "agmtSyncTue",
          "agmtSyncWed",
          "agmtSyncThu",
          "agmtSyncFri",
          "agmtSyncSat"
        ];
        for (const day of days) {
          if (attr !== day && this.state[day] || attr === day && value) {
            have_days = true;
            break;
          }
        }
        errObj.agmtSyncSun = false;
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        if (!have_days) {
          errObj.agmtSyncSun = true;
          errObj.agmtSyncMon = true;
          errObj.agmtSyncTue = true;
          errObj.agmtSyncWed = true;
          errObj.agmtSyncThu = true;
          errObj.agmtSyncFri = true;
          errObj.agmtSyncSat = true;
          all_good = false;
        } else if (attr === "agmtStartTime") {
          if (value === "") {
            all_good = false;
            errObj.agmtStartTime = true;
          } else if (value >= this.state.agmtEndTime) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (attr === "agmtEndTime") {
          if (value === "") {
            errObj.agmtEndTime = true;
            all_good = false;
          } else if (this.state.agmtStartTime >= value) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (this.state.agmtStartTime >= this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
          all_good = false;
        }
      }
      return all_good;
    }
    onTimeChange(action, attr, val) {
      let value = val.replace(":", "");
      const errObj = this.state.errObj;
      const e = { target: { id: "dummy", value: "", type: "input" } };
      if (value === "") {
        value = "0000";
      }
      if (attr === "agmtStartTime") {
        if (value > this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
        } else {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
        }
      } else if (attr === "agmtEndTime") {
        if (this.state.agmtStartTime > value) {
          errObj.agmtEndTime = true;
        } else {
          errObj.agmtEndTime = false;
          errObj.agmtStartTime = false;
        }
      }
      this.setState({
        [attr]: value,
        errObj
      }, () => {
        action === "edit" ? this.onEditChange(e) : this.onCreateChange(e);
      });
    }
    onCreateChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = true;
      const modalData = {
        agmtBindMethod: this.state.agmtBindMethod,
        agmtBindMethodOptions: this.state.agmtBindMethodOptions,
        agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions
      };
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, modalData, errObj);
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        agmtBindMethod: modalData.agmtBindMethod,
        agmtBindMethodOptions: modalData.agmtBindMethodOptions,
        agmtBootstrapBindMethod: modalData.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: modalData.agmtBootstrapBindMethodOptions,
        [e.target.toggle]: false
      });
    }
    onEditChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = false;
      const modalData = {
        agmtBindMethod: this.state.agmtBindMethod,
        agmtBindMethodOptions: this.state.agmtBindMethodOptions,
        agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions
      };
      errObj[attr] = false;
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, modalData, errObj);
      if (all_good) {
        all_good = false;
        if (attr !== "agmtHost" && this.state.agmtHost !== this.state._agmtHost || attr !== "agmtPort" && this.state.agmtPort !== this.state._agmtPort || attr !== "agmtBindDN" && this.state.agmtBindDN !== this.state._agmtBindDN || attr !== "agmtBindMethod" && this.state.agmtBindMethod !== this.state._agmtBindMethod || attr !== "agmtProtocol" && this.state.agmtProtocol !== this.state._agmtProtocol || attr !== "agmtSync" && this.state.agmtSync !== this.state._agmtSync || attr !== "agmtBootstrap" && this.state.agmtBootstrap !== this.state._agmtBootstrap || attr !== "agmtStripAttrs" && !listsEqual(this.state.agmtStripAttrs, this.state._agmtStripAttrs) || attr !== "agmtFracAttrs" && !listsEqual(this.state.agmtFracAttrs, this.state._agmtFracAttrs) || attr !== "agmtFracInitAttrs" && !listsEqual(this.state.agmtFracInitAttrs, this.state._agmtFracInitAttrs)) {
          all_good = true;
        }
        if (attr !== "agmtSync" && this.state.agmtSync || attr === "agmtSync" && value) {
          if (attr !== "agmtSyncMon" && this.state.agmtSyncMon !== this.state._agmtSyncMon || attr !== "agmtSyncTue" && this.state.agmtSyncTue !== this.state._agmtSyncTue || attr !== "agmtSyncWed" && this.state.agmtSyncWed !== this.state._agmtSyncWed || attr !== "agmtSyncThu" && this.state.agmtSyncThu !== this.state._agmtSyncThu || attr !== "agmtSyncFri" && this.state.agmtSyncFri !== this.state._agmtSyncFri || attr !== "agmtSyncSat" && this.state.agmtSyncSat !== this.state._agmtSyncSat || attr !== "agmtSyncSun" && this.state.agmtSyncSun !== this.state._agmtSyncSun || attr !== "agmtStartTime" && this.state.agmtStartTime !== this.state._agmtStartTime || attr !== "agmtEndTime" && this.state.agmtEndTime !== this.state._agmtEndTime) {
            all_good = true;
          }
        }
        if (attr !== "agmtBootstrap" && this.state.agmtBootstrap || attr === "agmtBootstrap" && value) {
          if (attr !== "agmtBootstrapBindDN" && this.state.agmtBootstrapBindDN !== this.state._agmtBootstrapBindDN || attr !== "agmtBootstrapBindPW" && this.state.agmtBootstrapBindPW !== this.state._agmtBootstrapBindPW || attr !== "agmtBootstrapBindPWConfirm" && this.state.agmtBootstrapBindPWConfirm !== this.state._agmtBootstrapBindPWConfirm || attr !== "agmtBootstrapBindMethod" && this.state.agmtBootstrapBindMethod !== this.state._agmtBootstrapBindMethod || attr !== "agmtBootstrapProtocol" && this.state.agmtBootstrapProtocol !== this.state._agmtBootstrapProtocol) {
            all_good = true;
          }
        }
        if (attr === "agmtStripAttrs" && !listsEqual(value, this.state._agmtStripAttrs) || attr === "agmtFracAttrs" && !listsEqual(value, this.state._agmtFracAttrs) || attr === "agmtFracInitAttrs" && !listsEqual(value, this.state._agmtFracInitAttrs)) {
          all_good = true;
        } else if (attr !== "dummy" && value !== this.state["_" + attr]) {
          all_good = true;
        }
      }
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        agmtBindMethod: modalData.agmtBindMethod,
        agmtBindMethodOptions: modalData.agmtBindMethodOptions,
        agmtBootstrapBindMethod: modalData.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: modalData.agmtBootstrapBindMethodOptions,
        [e.target.toggle]: false
      });
    }
    handleTASelectChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[attr] = valueErr;
      if (attr.endsWith("Attrs")) {
        if (this.state[attr].includes(value)) {
          this.setState(
            (prevState) => ({
              [attr]: prevState[attr].filter((item) => item !== e.target.value),
              errObj,
              [e.target.toggle]: false
            })
          );
        } else {
          this.setState(
            (prevState) => ({
              [attr]: [...prevState[attr], value],
              errObj,
              [e.target.toggle]: false
            })
          );
        }
      } else {
        this.setState({
          [attr]: value,
          errObj,
          [e.target.toggle]: false
        });
      }
    }
    onTAStripAttrChangeEdit(selection) {
      const { agmtStripAttrs } = this.state;
      const e = { target: { id: "dummy", value: "", type: "input" } };
      if (agmtStripAttrs.includes(selection)) {
        const new_values = this.state.agmtStripAttrs.filter((item) => item !== selection);
        this.setState({
          agmtStripAttrs: new_values,
          isStripAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      } else {
        const new_values = [...this.state.agmtStripAttrs, selection];
        this.setState({
          agmtStripAttrs: new_values,
          isStripAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      }
    }
    onTAFracAttrChangeEdit(selection) {
      const { agmtFracAttrs } = this.state;
      const e = { target: { id: "dummy", value: "", type: "input" } };
      if (agmtFracAttrs.includes(selection)) {
        const new_values = this.state.agmtFracAttrs.filter((item) => item !== selection);
        this.setState({
          agmtFracAttrs: new_values,
          isExcludeAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      } else {
        const new_values = [...this.state.agmtFracAttrs, selection];
        this.setState({
          agmtFracAttrs: new_values,
          isExcludeAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      }
    }
    onTAFracInitAttrChangeEdit(selection) {
      const e = { target: { id: "dummy", value: "", type: "input" } };
      const { agmtFracInitAttrs } = this.state;
      if (agmtFracInitAttrs.includes(selection)) {
        const new_values = this.state.agmtFracInitAttrs.filter((item) => item !== selection);
        this.setState({
          agmtFracInitAttrs: new_values,
          isExcludeInitAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      } else {
        const new_values = [...this.state.agmtFracInitAttrs, selection];
        this.setState({
          agmtFracInitAttrs: new_values,
          isExcludeInitAttrsEditOpen: false
        }, () => {
          this.onEditChange(e);
        });
      }
    }
    onTAStripAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtStripAttrs",
          value: values,
          type: "input",
          toggle: "isStripAttrsCreateOpen"
        }
      };
      this.handleTASelectChange(e);
    }
    onTAFracAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtFracAttrs",
          value: values,
          type: "input",
          toggle: "isExcludeAttrsCreateOpen"
        }
      };
      this.handleTASelectChange(e);
    }
    onTAFracInitAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtFracInitAttrs",
          value: values,
          type: "input",
          toggle: "isExcludeInitAttrsCreateOpen"
        }
      };
      this.handleTASelectChange(e);
    }
    showConfirmDeleteAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmDeleteAgmt: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteAgmt() {
      this.setState({
        showConfirmDeleteAgmt: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmInitAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmInitAgmt: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmInitAgmt() {
      this.setState({
        showConfirmInitAgmt: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    handleShowCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: true,
        agmtName: "",
        agmtHost: "",
        agmtPort: "636",
        agmtProtocol: "LDAPS",
        agmtBindMethod: "SIMPLE",
        agmtBindDN: "cn=replication manager,cn=config",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtBootstrap: false,
        agmtBootstrapProtocol: "LDAPS",
        agmtBootstrapBindMethod: "SIMPLE",
        agmtBootstrapBindDN: "cn=replication manager,cn=config",
        agmtBootstrapBindPW: "",
        agmtBootstrapBindPWConfirm: "",
        agmtStripAttrs: [],
        agmtFracAttrs: [],
        agmtFracInitAttrs: [],
        agmtSync: false,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        errObj: {}
      });
    }
    closeCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: false
      });
    }
    closeEditAgmtModal() {
      this.setState({
        showEditAgmtModal: false
      });
    }
    showEditAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "get",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("showEditAgmt", "Edit replication agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let agmtName2 = "";
        let agmtHost = "";
        let agmtPort = "";
        let agmtProtocol = "";
        let agmtBindMethod = "";
        let agmtBindDN = "";
        let agmtBindPW = "";
        let agmtBindPWConfirm = "";
        let agmtBootstrap = false;
        let agmtBootstrapProtocol = "";
        let agmtBootstrapBindMethod = "SIMPLE";
        let agmtBootstrapBindDN = "";
        let agmtBootstrapBindPW = "";
        let agmtBootstrapBindPWConfirm = "";
        let agmtStripAttrs = [];
        let agmtFracAttrs = [];
        let agmtFracInitAttrs = [];
        let agmtSync = false;
        let agmtSyncMon = false;
        let agmtSyncTue = false;
        let agmtSyncWed = false;
        let agmtSyncThu = false;
        let agmtSyncFri = false;
        let agmtSyncSat = false;
        let agmtSyncSun = false;
        let agmtStartTime = "0000";
        let agmtEndTime = "2359";
        for (const attr in config2.attrs) {
          const val = config2.attrs[attr][0];
          if (attr === "cn") {
            agmtName2 = val;
          }
          if (attr === "nsds5replicahost") {
            agmtHost = val;
          }
          if (attr === "nsds5replicaport") {
            agmtPort = val;
          }
          if (attr === "nsds5replicatransportinfo") {
            agmtProtocol = val;
          }
          if (attr === "nsds5replicabindmethod") {
            agmtBindMethod = val.toUpperCase();
          }
          if (attr === "nsds5replicabinddn") {
            agmtBindDN = val;
          }
          if (attr === "nsds5replicacredentials") {
            agmtBindPW = val;
            agmtBindPWConfirm = val;
          }
          if (attr === "nsds5replicabootstraptransportinfo") {
            agmtBootstrapProtocol = val;
          }
          if (attr === "nsds5replicabootstrapbindmethod") {
            agmtBootstrapBindMethod = val.toUpperCase();
          }
          if (attr === "nsds5replicabootstrapbinddn") {
            agmtBootstrapBindDN = val;
            agmtBootstrap = true;
          }
          if (attr === "nsds5replicabootstrapcredentials") {
            agmtBootstrapBindPW = val;
            agmtBootstrapBindPWConfirm = val;
          }
          if (attr === "nsds5replicatedattributelist") {
            const attrs = val.replace("(objectclass=*) $ EXCLUDE", "").trim();
            agmtFracAttrs = attrs.split(" ");
          }
          if (attr === "nsds5replicatedattributelisttotal") {
            const attrs = val.replace("(objectclass=*) $ EXCLUDE", "").trim();
            agmtFracInitAttrs = attrs.split(" ");
          }
          if (attr === "nsds5replicastripattrs") {
            agmtStripAttrs = val.split(" ");
          }
          if (attr === "nsds5replicaupdateschedule") {
            agmtSync = true;
            const parts = val.split(" ");
            const times = parts[0].split("-");
            const days = parts[1];
            agmtStartTime = times[0];
            agmtEndTime = times[1];
            if (days.includes("0")) {
              agmtSyncSun = true;
            }
            if (days.includes("1")) {
              agmtSyncMon = true;
            }
            if (days.includes("2")) {
              agmtSyncTue = true;
            }
            if (days.includes("3")) {
              agmtSyncWed = true;
            }
            if (days.includes("4")) {
              agmtSyncThu = true;
            }
            if (days.includes("5")) {
              agmtSyncFri = true;
            }
            if (days.includes("6")) {
              agmtSyncSat = true;
            }
          }
        }
        if (this._mounted) {
          this.setState({
            showEditAgmtModal: true,
            agmtName: agmtName2,
            agmtHost,
            agmtPort,
            agmtProtocol,
            agmtBindMethod,
            agmtBindDN,
            agmtBindPW,
            agmtBindPWConfirm,
            agmtBootstrap,
            agmtBootstrapProtocol,
            agmtBootstrapBindMethod,
            agmtBootstrapBindDN,
            agmtBootstrapBindPW,
            agmtBootstrapBindPWConfirm,
            agmtStripAttrs,
            agmtFracAttrs,
            agmtFracInitAttrs,
            agmtSync,
            agmtSyncMon,
            agmtSyncTue,
            agmtSyncWed,
            agmtSyncThu,
            agmtSyncFri,
            agmtSyncSat,
            agmtSyncSun,
            agmtStartTime,
            agmtEndTime,
            agmtSaveOK: false,
            modalMsg: "",
            errObj: {},
            // Record original values before editing
            _agmtName: agmtName2,
            _agmtHost: agmtHost,
            _agmtPort: agmtPort,
            _agmtProtocol: agmtProtocol,
            _agmtBindMethod: agmtBindMethod,
            _agmtBindDN: agmtBindDN,
            _agmtBindPW: agmtBindPW,
            _agmtBindPWConfirm: agmtBindPWConfirm,
            _agmtBootstrap: agmtBootstrap,
            _agmtBootstrapProtocol: agmtBootstrapProtocol,
            _agmtBootstrapBindMethod: agmtBootstrapBindMethod,
            _agmtBootstrapBindDN: agmtBootstrapBindDN,
            _agmtBootstrapBindPW: agmtBootstrapBindPW,
            _agmtBootstrapBindPWConfirm: agmtBootstrapBindPWConfirm,
            _agmtStripAttrs: agmtStripAttrs,
            _agmtFracAttrs: agmtFracAttrs,
            _agmtFracInitAttrs: agmtFracInitAttrs,
            _agmtSync: agmtSync,
            _agmtSyncMon: agmtSyncMon,
            _agmtSyncTue: agmtSyncTue,
            _agmtSyncWed: agmtSyncWed,
            _agmtSyncThu: agmtSyncThu,
            _agmtSyncFri: agmtSyncFri,
            _agmtSyncSat: agmtSyncSat,
            _agmtSyncSun: agmtSyncSun,
            _agmtStartTime: agmtStartTime,
            _agmtEndTime: agmtEndTime
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to get agreement information for: "${agmtName}" - ${errMsg.desc}`
        );
      });
    }
    saveAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "set",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      let passwd = "";
      let bootstrap_passwd = "";
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      } else if (this.state.agmtSync !== this.state._agmtSync && !this.state.agmtSync) {
        cmd.push("--schedule=");
      }
      if (this.state.agmtBindMethod !== this.state._agmtBindMethod) {
        cmd.push("--bind-method=" + this.state.agmtBindMethod);
      }
      if (this.state.agmtProtocol !== this.state._agmtProtocol) {
        cmd.push("--conn-protocol=" + this.state.agmtProtocol);
      }
      if (this.state.agmtBindPW !== this.state._agmtBindPW) {
        passwd = this.state.agmtBindPW;
      }
      if (this.state.agmtBindDN !== this.state._agmtBindDN) {
        cmd.push("--bind-dn=" + this.state.agmtBindDN);
      }
      if (this.state.agmtFracAttrs !== this.state._agmtFracAttrs) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtFracInitAttrs !== this.state._agmtFracInitAttrs) {
        cmd.push("--frac-list-total=" + this.state.agmtFracInitAttrs.join(" "));
      }
      if (this.state.agmtStripAttrs !== this.state._agmtStripAttrs) {
        cmd.push("--strip-list=" + this.state.agmtStripAttrs.join(" "));
      }
      if (this.state.agmtHost !== this.state._agmtHost) {
        cmd.push("--host=" + this.state.agmtHost);
      }
      if (this.state.agmtPort !== this.state._agmtPort) {
        cmd.push("--port=" + this.state.agmtPort);
      }
      if (this.state.agmtBootstrap) {
        if (this.state.agmtBootstrapBindMethod !== this.state._agmtBootstrapBindMethod) {
          cmd.push("--bootstrap-bind-method=" + this.state.agmtBootstrapBindMethod);
        }
        if (this.state.agmtBootstrapProtocol !== this.state._agmtBootstrapProtocol) {
          cmd.push("--bootstrap-conn-protocol=" + this.state.agmtBootstrapProtocol);
        }
        if (this.state.agmtBootstrapBindPW !== this.state._agmtBootstrapBindPW) {
          bootstrap_passwd = this.state.agmtBootstrapBindPW;
        }
        if (this.state.agmtBootstrapBindDN !== this.state._agmtBootstrapBindDN) {
          cmd.push("--bootstrap-bind-dn=" + this.state.agmtBootstrapBindDN);
        }
      }
      this.setState({
        savingAgmt: true
      });
      if (passwd !== "") {
        cmd.push("--bind-passwd-prompt");
      }
      if (bootstrap_passwd !== "") {
        cmd.push("--bootstrap-bind-passwd-prompt");
      }
      log_cmd("saveAgmt", "edit agmt", cmd);
      let buffer = "";
      const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
      proc.done((data) => {
        this.props.reload(this.props.suffix);
        if (this._mounted) {
          this.setState({
            savingAgmt: false,
            showEditAgmtModal: false
          });
        }
        this.props.addNotification(
          "success",
          "Successfully updated replication agreement"
        );
      }).fail((_) => {
        this.props.addNotification(
          "error",
          `Failed to update replication agreement - ${buffer}`
        );
        this.setState({
          savingAgmt: false
        });
      }).stream((data) => {
        buffer += data;
        const lines = buffer.split("\n");
        const last_line = lines[lines.length - 1].toLowerCase();
        if (last_line.includes("bootstrap")) {
          proc.input(bootstrap_passwd + "\n", true);
        } else {
          proc.input(passwd + "\n", true);
        }
      });
    }
    pokeAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "poke",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("pokeAgmt", "send updates now", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully poked replication agreement"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to poke replication agreement - ${errMsg.desc}`
        );
      });
    }
    initAgmt(agmtName) {
      this.setState({
        modalSpinning: true
      });
      const init_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "init",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("initAgmt", "Initialize agreement", init_cmd);
      cockpit_default.spawn(init_cmd, { superuser: true, err: "message" }).done((content) => {
        const agmtIntervalCount = this.state.agmtInitCounter + 1;
        const intervals = this.state.agmtInitIntervals;
        this.props.reload(this.props.suffix);
        intervals[agmtIntervalCount] = setInterval(this.watchAgmtInit, 2e3, this.state.agmtName, agmtIntervalCount);
        if (this._mounted) {
          this.setState({
            agmtInitCounter: agmtIntervalCount,
            agmtInitIntervals: intervals,
            showConfirmInitAgmt: false
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to initialize replication agreement - ${errMsg.desc}`
        );
        this.setState({
          showConfirmInitAgmt: false
        });
      });
    }
    confirmToggle(agmtName, state) {
      if (state === "Enabled") {
        this.setState({
          agmtName,
          showConfirmDisableAgmt: true,
          modalChecked: false,
          modalSpinning: false
        });
      } else {
        this.setState({
          agmtName,
          showConfirmEnableAgmt: true,
          modalChecked: false,
          modalSpinning: false
        });
      }
    }
    closeConfirmEnableAgmt() {
      this.setState({
        showConfirmEnableAgmt: false
      });
    }
    closeConfirmDisableAgmt() {
      this.setState({
        showConfirmDisableAgmt: false
      });
    }
    enableAgmt() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "enable",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("enableAgmt", "enable agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully enabled replication agreement"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to enabled replication agreement - ${errMsg.desc}`
        );
      });
    }
    disableAgmt() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "disable",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("disableAgmt", "Disable agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully disabled replication agreement"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to disable replication agreement - ${errMsg.desc}`
        );
      });
    }
    deleteAgmt() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "delete",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("deleteAgmt", "Delete agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully deleted replication agreement"
        );
        this.setState({
          showConfirmDeleteAgmt: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to delete replication agreement - ${errMsg.desc}`
        );
        this.setState({
          showConfirmDeleteAgmt: false
        });
      });
    }
    createAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "create",
        this.state.agmtName,
        "--suffix=" + this.props.suffix,
        "--host=" + this.state.agmtHost,
        "--port=" + this.state.agmtPort,
        "--bind-method=" + this.state.agmtBindMethod,
        "--conn-protocol=" + this.state.agmtProtocol,
        "--bind-dn=" + this.state.agmtBindDN
      ];
      let passwd = "";
      let bootstrap_passwd = "";
      if (this.state.agmtBindPW !== "") {
        passwd = this.state.agmtBindPW;
      }
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      }
      if (this.state.agmtFracAttrs.length > 0) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtFracInitAttrs.length > 0) {
        cmd.push("--frac-list-total=" + this.state.agmtFracInitAttrs.join(" "));
      }
      if (this.state.agmtStripAttrs.length > 0) {
        cmd.push("--strip-list=" + this.state.agmtStripAttrs.join(" "));
      }
      if (this.state.agmtBootstrap) {
        if (this.state.agmtBootstrapBindDN !== "") {
          cmd.push("--bootstrap-bind-dn=" + this.state.agmtBootstrapBindDN);
        }
        if (this.state.agmtBootstrapBindDNPW !== "") {
          bootstrap_passwd = this.state.agmtBootstrapBindDNPW;
        }
        if (this.state.agmtBootstrapBindMethod !== "") {
          cmd.push("--bootstrap-bind-method=" + this.state.agmtBootstrapBindMethod);
        }
        if (this.state.agmtBootstrapProtocol !== "") {
          cmd.push("--bootstrap-conn-protocol=" + this.state.agmtBootstrapProtocol);
        }
      }
      this.setState({
        savingAgmt: true
      });
      if (passwd !== "") {
        cmd.push("--bind-passwd-prompt");
      }
      if (bootstrap_passwd !== "") {
        cmd.push("--bootstrap-bind-passwd-prompt");
      }
      log_cmd("createAgmt", "Create agmt", cmd);
      let buffer = "";
      const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
      proc.done((data) => {
        this.props.reload(this.props.suffix);
        if (this._mounted) {
          this.setState({
            savingAgmt: false,
            showCreateAgmtModal: false
          });
        }
        this.props.addNotification(
          "success",
          "Successfully created replication agreement"
        );
        if (this.state.agmtInit === "online-init") {
          this.initAgmt(this.state.agmtName);
        }
      }).fail((_) => {
        this.props.addNotification(
          "error",
          `Failed to create replication agreement - ${buffer}`
        );
        this.setState({
          savingAgmt: false
        });
      }).stream((data) => {
        buffer += data;
        const lines = buffer.split("\n");
        const last_line = lines[lines.length - 1].toLowerCase();
        if (last_line.includes("bootstrap")) {
          proc.input(bootstrap_passwd + "\n", true);
        } else {
          proc.input(passwd + "\n", true);
        }
      });
    }
    watchAgmtInit(agmtName, idx) {
      const status_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "init-status",
        "--suffix=" + this.props.suffix,
        agmtName
      ];
      log_cmd("watchAgmtInit", "Get initialization status for agmt", status_cmd);
      cockpit_default.spawn(status_cmd, { superuser: true, err: "message" }).done((data) => {
        const init_status = JSON.parse(data);
        if (init_status.startsWith("Agreement successfully initialized") || init_status.startsWith("Agreement initialization failed")) {
          clearInterval(this.state.agmtInitIntervals[idx]);
          this.props.reload(this.props.suffix);
        }
      });
    }
    onSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    onSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      for (const row of this.state.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3], row[4], row[5]]);
      }
      if (val === "") {
        rows = JSON.parse(JSON.stringify(this.props.rows));
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      return /* @__PURE__ */ import_react109.default.createElement("div", { className: "ds-margin-right ds-margin-bottom-md" }, /* @__PURE__ */ import_react109.default.createElement(
        ReplAgmtTable,
        {
          key: this.state.rows,
          rows: this.state.rows,
          edit: this.showEditAgmt,
          poke: this.pokeAgmt,
          init: this.showConfirmInitAgmt,
          enable: this.confirmToggle,
          delete: this.showConfirmDeleteAgmt,
          page: this.state.page,
          handleSort: this.onSort,
          sortBy: this.state.sortBy,
          handleSearch: this.onSearchChange,
          value: this.state.value
        }
      ), /* @__PURE__ */ import_react109.default.createElement("div", { className: "ds-margin-top ds-container ds-inline" }, /* @__PURE__ */ import_react109.default.createElement(
        Button,
        {
          variant: "primary",
          onClick: this.handleShowCreateAgmtModal
        },
        "Create Agreement"
      ), /* @__PURE__ */ import_react109.default.createElement(
        Button,
        {
          className: "ds-left-margin",
          variant: "secondary",
          onClick: () => {
            this.props.reload(this.props.suffix);
          }
        },
        "Refresh Agreements"
      )), /* @__PURE__ */ import_react109.default.createElement(
        ReplAgmtModal,
        {
          key: this.state.showCreateAgmtModal ? "create1" : "create0",
          showModal: this.state.showCreateAgmtModal,
          closeHandler: this.closeCreateAgmtModal,
          handleChange: this.onCreateChange,
          handleTimeChange: this.onTimeChange,
          handleStripChange: this.onTAStripAttrChange,
          handleFracChange: this.onTAFracInitAttrChange,
          handleFracInitChange: this.onTAFracInitAttrChange,
          onExcludeAttrsToggle: this.handleExcludeAttrsCreateToggle,
          onExcludeAttrsClear: this.handleExcludeAttrsCreateClear,
          onExcludeAttrsInitToggle: this.handleExcludeAttrsInitCreateToggle,
          onExcludeAttrsInitClear: this.handleExcludeAttrsInitCreateClear,
          handleStripAttrsToggle: this.onStripAttrsCreateToggle,
          onStripAttrsClear: this.handleStripAttrsCreateClear,
          isExcludeAttrsOpen: this.state.isExcludeAttrsCreateOpen,
          isExcludeInitAttrsOpen: this.state.isExcludeInitAttrsCreateOpen,
          isStripAttrsOpen: this.state.isStripAttrsCreateOpen,
          saveHandler: this.createAgmt,
          spinning: this.state.savingAgmt,
          agmtName: this.state.agmtName,
          agmtHost: this.state.agmtHost,
          agmtPort: this.state.agmtPort,
          agmtBindDN: this.state.agmtBindDN,
          agmtBindPW: this.state.agmtBindPW,
          agmtBindPWConfirm: this.state.agmtBindPWConfirm,
          agmtProtocol: this.state.agmtProtocol,
          agmtBindMethod: this.state.agmtBindMethod,
          agmtBindMethodOptions: this.state.agmtBindMethodOptions,
          agmtBootstrap: this.state.agmtBootstrap,
          agmtBootstrapBindDN: this.state.agmtBootstrapBindDN,
          agmtBootstrapBindPW: this.state.agmtBootstrapBindPW,
          agmtBootstrapBindPWConfirm: this.state.agmtBootstrapBindPWConfirm,
          agmtBootstrapProtocol: this.state.agmtBootstrapProtocol,
          agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
          agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions,
          agmtStripAttrs: this.state.agmtStripAttrs,
          agmtFracAttrs: this.state.agmtFracAttrs,
          agmtFracInitAttrs: this.state.agmtFracInitAttrs,
          agmtSync: this.state.agmtSync,
          agmtSyncMon: this.state.agmtSyncMon,
          agmtSyncTue: this.state.agmtSyncTue,
          agmtSyncWed: this.state.agmtSyncWed,
          agmtSyncThu: this.state.agmtSyncThu,
          agmtSyncFri: this.state.agmtSyncFri,
          agmtSyncSat: this.state.agmtSyncSat,
          agmtSyncSun: this.state.agmtSyncSun,
          agmtStartTime: this.state.agmtStartTime,
          agmtEndTime: this.state.agmtEndTime,
          agmtInit: this.state.agmtInit,
          availAttrs: this.props.attrs,
          error: this.state.errObj,
          saveOK: this.state.agmtSaveOK
        }
      ), /* @__PURE__ */ import_react109.default.createElement(
        ReplAgmtModal,
        {
          key: this.state.showEditAgmtModal ? "edit1" : "edit0",
          showModal: this.state.showEditAgmtModal,
          closeHandler: this.closeEditAgmtModal,
          handleChange: this.onEditChange,
          handleTimeChange: this.onTimeChange,
          handleStripChange: this.onTAStripAttrChangeEdit,
          handleFracChange: this.onTAFracAttrChangeEdit,
          handleFracInitChange: this.onTAFracInitAttrChangeEdit,
          onExcludeAttrsToggle: this.handleExcludeAttrsEditToggle,
          onExcludeAttrsClear: this.handleExcludeAttrsEditClear,
          onExcludeAttrsInitToggle: this.handleExcludeAttrsInitEditToggle,
          onExcludeAttrsInitClear: this.handleExcludeAttrsInitEditClear,
          handleStripAttrsToggle: this.onStripAttrsEditToggle,
          onStripAttrsClear: this.handleStripAttrsEditClear,
          isExcludeAttrsOpen: this.state.isExcludeAttrsEditOpen,
          isExcludeInitAttrsOpen: this.state.isExcludeInitAttrsEditOpen,
          isStripAttrsOpen: this.state.isStripAttrsEditOpen,
          saveHandler: this.saveAgmt,
          spinning: this.state.savingAgmt,
          agmtName: this.state.agmtName,
          agmtHost: this.state.agmtHost,
          agmtPort: this.state.agmtPort,
          agmtBindDN: this.state.agmtBindDN,
          agmtBindPW: this.state.agmtBindPW,
          agmtBindPWConfirm: this.state.agmtBindPWConfirm,
          agmtProtocol: this.state.agmtProtocol,
          agmtBindMethod: this.state.agmtBindMethod,
          agmtBindMethodOptions: this.state.agmtBindMethodOptions,
          agmtBootstrap: this.state.agmtBootstrap,
          agmtBootstrapBindDN: this.state.agmtBootstrapBindDN,
          agmtBootstrapBindPW: this.state.agmtBootstrapBindPW,
          agmtBootstrapBindPWConfirm: this.state.agmtBootstrapBindPWConfirm,
          agmtBootstrapProtocol: this.state.agmtBootstrapProtocol,
          agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
          agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions,
          agmtStripAttrs: this.state.agmtStripAttrs,
          agmtFracAttrs: this.state.agmtFracAttrs,
          agmtFracInitAttrs: this.state.agmtFracInitAttrs,
          agmtSync: this.state.agmtSync,
          agmtSyncMon: this.state.agmtSyncMon,
          agmtSyncTue: this.state.agmtSyncTue,
          agmtSyncWed: this.state.agmtSyncWed,
          agmtSyncThu: this.state.agmtSyncThu,
          agmtSyncFri: this.state.agmtSyncFri,
          agmtSyncSat: this.state.agmtSyncSat,
          agmtSyncSun: this.state.agmtSyncSun,
          agmtStartTime: this.state.agmtStartTime,
          agmtEndTime: this.state.agmtEndTime,
          agmtInit: this.state.agmtInit,
          availAttrs: this.props.attrs,
          error: this.state.errObj,
          saveOK: this.state.agmtSaveOK,
          edit: true
        }
      ), /* @__PURE__ */ import_react109.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDeleteAgmt,
          closeHandler: this.closeConfirmDeleteAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.deleteAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Delete Replication Agreement",
          mMsg: "Are you sure you want to delete this replication agreement?",
          mSpinningMsg: "Deleting Replication Agreement ...",
          mBtnName: "Delete Agreement"
        }
      ), /* @__PURE__ */ import_react109.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmInitAgmt,
          closeHandler: this.closeConfirmInitAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.initAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Initialize Replication Agreement",
          mMsg: "Are you sure you want to initialize this replication agreement?",
          mSpinningMsg: "Initializing Replication Agreement ...",
          mBtnName: "Initialize Agreement"
        }
      ), /* @__PURE__ */ import_react109.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmEnableAgmt,
          closeHandler: this.closeConfirmEnableAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.enableAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Enable Replication Agreement",
          mMsg: "Are you sure you want to enable this replication agreement?",
          mSpinningMsg: "Enabling ...",
          mBtnName: "Enable Agreement"
        }
      ), /* @__PURE__ */ import_react109.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDisableAgmt,
          closeHandler: this.closeConfirmDisableAgmt,
          handleChange: this.onModalChange,
          actionHandler: this.disableAgmt,
          spinning: this.state.modalSpinning,
          item: this.state.agmtName,
          checked: this.state.modalChecked,
          mTitle: "Disable Replication Agreement",
          mMsg: "Are you sure you want to disable this replication agreement?",
          mSpinningMsg: "Disabling ...",
          mBtnName: "Disable Agreement"
        }
      ));
    }
  };
  ReplAgmts.propTypes = {
    suffix: import_prop_types87.default.string,
    serverId: import_prop_types87.default.string,
    rows: import_prop_types87.default.array,
    addNotification: import_prop_types87.default.func,
    attrs: import_prop_types87.default.array
  };
  ReplAgmts.defaultProps = {
    serverId: "",
    suffix: "",
    rows: [],
    attrs: []
  };

  // src/lib/replication/replTasks.jsx
  var import_react110 = __toESM(require_react(), 1);
  var import_prop_types88 = __toESM(require_prop_types(), 1);
  var ReplRUV = class extends import_react110.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        errObj: {},
        rid: "",
        localRID: "",
        ldifLocation: "",
        saveOK: false,
        showConfirmCleanRUV: false,
        modalChecked: false,
        modalSpinning: false,
        showConfirmCLImport: false,
        showCLExport: false,
        defaultCL: true,
        debugCL: false,
        decodeCL: false,
        exportCSN: false,
        ldifFile: "/tmp/changelog.ldif"
      };
      this.showConfirmCleanRUV = this.showConfirmCleanRUV.bind(this);
      this.closeConfirmCleanRUV = this.closeConfirmCleanRUV.bind(this);
      this.handleShowConfirmCLImport = this.handleShowConfirmCLImport.bind(this);
      this.closeConfirmCLImport = this.closeConfirmCLImport.bind(this);
      this.handleShowCLExport = this.handleShowCLExport.bind(this);
      this.closeCLExport = this.closeCLExport.bind(this);
      this.showConfirmExport = this.showConfirmExport.bind(this);
      this.closeConfirmExport = this.closeConfirmExport.bind(this);
      this.handleLDIFChange = this.handleLDIFChange.bind(this);
      this.onCLLDIFChange = this.onCLLDIFChange.bind(this);
      this.onRadioChange = this.onRadioChange.bind(this);
      this.onChange = this.onChange.bind(this);
      this.cleanRUV = this.cleanRUV.bind(this);
      this.exportChangelog = this.exportChangelog.bind(this);
      this.importChangelog = this.importChangelog.bind(this);
    }
    showConfirmCleanRUV(rid) {
      this.setState({
        rid,
        showConfirmCleanRUV: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmCleanRUV() {
      this.setState({
        showConfirmCleanRUV: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    handleShowConfirmCLImport() {
      this.setState({
        showConfirmCLImport: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmCLImport() {
      this.setState({
        showConfirmCLImport: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    handleShowCLExport() {
      this.setState({
        saveOK: true,
        showCLExport: true,
        decodeCL: false,
        defaultCL: true,
        debugCL: false,
        exportChangelog: false,
        ldifFile: "/tmp/changelog.ldif"
      });
    }
    closeCLExport() {
      this.setState({
        showCLExport: false
      });
    }
    showConfirmExport() {
      this.setState({
        saveOK: false,
        showConfirmExport: true,
        ldifLocation: ""
      });
    }
    closeConfirmExport() {
      this.setState({
        showConfirmExport: false
      });
    }
    onRadioChange(_, e) {
      let defaultCL = false;
      let debugCL = false;
      if (e.target.id === "defaultCL") {
        defaultCL = true;
      } else if (e.target.id === "debugCL") {
        debugCL = true;
      }
      this.setState({
        defaultCL,
        debugCL
      });
    }
    cleanRUV() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-tasks",
        "cleanallruv",
        "--replica-id=" + this.state.rid,
        "--force-cleaning",
        "--suffix=" + this.props.suffix
      ];
      log_cmd("cleanRUV", "Clean the rid", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          "Successfully started CleanAllRUV task"
        );
        this.closeConfirmCleanRUV();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to start CleanAllRUV task - ${errMsg.desc}`
        );
        this.closeConfirmCleanRUV();
      });
    }
    handleLDIFChange(e) {
      const value = e.target.value;
      let saveOK = true;
      if (value === "" || bad_file_name(value)) {
        saveOK = false;
      }
      this.setState({
        [e.target.id]: value,
        saveOK
      });
    }
    onCLLDIFChange(e) {
      const value = e.target.value;
      let saveOK = true;
      if (value === "" || value.indexOf(" ") >= 0) {
        saveOK = false;
      }
      this.setState({
        [e.target.id]: value,
        saveOK
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    importChangelog() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "import-changelog",
        "default",
        "--replica-root",
        this.props.suffix
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("importChangelog", "Import relication changelog via LDIF", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Changelog was successfully initialized`
        );
        this.setState({
          showConfirmCLImport: false,
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error importing changelog LDIF - ${errMsg.desc}`
        );
        this.setState({
          showConfirmCLImport: false,
          modalSpinning: false
        });
      });
    }
    exportChangelog() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "export-changelog"
      ];
      if (this.state.defaultCL) {
        cmd.push("default");
      } else {
        cmd.push("to-ldif");
        if (this.state.exportCSN) {
          cmd.push("--csn-only");
        }
        if (this.state.decodeCL) {
          cmd.push("--decode");
        }
        if (this.state.ldifFile) {
          cmd.push("--output-file=" + this.state.ldifFile);
        }
      }
      cmd.push("--replica-root=" + this.props.suffix);
      this.setState({
        exportSpinner: true
      });
      log_cmd("exportChangelog", "Import relication changelog via LDIF", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          `Changelog was successfully exported`
        );
        this.setState({
          showCLExport: false,
          exportSpinner: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error importing changelog LDIF - ${errMsg.desc}`
        );
        this.setState({
          showCLExport: false,
          exportSpinner: false
        });
      });
    }
    render() {
      const remote_rows = [];
      let localRID = "";
      let localURL = "";
      let localCSN = "";
      let localRawCSN = "";
      let localMinCSN = "";
      let localRawMinCSN = "";
      for (const row of this.props.rows) {
        if (row.rid === this.props.localRID) {
          localRID = row.rid;
          localURL = row.url;
          localCSN = row.maxcsn;
          localRawCSN = row.raw_maxcsn;
          localMinCSN = row.csn;
          localRawMinCSN = row.raw_csn;
        } else {
          remote_rows.push(row);
        }
      }
      let localRUV = /* @__PURE__ */ import_react110.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react110.default.createElement(Grid, { className: "ds-margin-top-med" }, /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 2 }, "Replica ID"), /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react110.default.createElement("b", null, localRID))), /* @__PURE__ */ import_react110.default.createElement(Grid, null, /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 2 }, "LDAP URL"), /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react110.default.createElement("b", null, localURL))), /* @__PURE__ */ import_react110.default.createElement(Grid, null, /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 2 }, "Min CSN"), /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react110.default.createElement("b", null, localMinCSN), " (", localRawMinCSN, ")")), /* @__PURE__ */ import_react110.default.createElement(Grid, null, /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 2 }, "Max CSN"), /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react110.default.createElement("b", null, localCSN), " (", localRawCSN, ")")));
      if (localRID === "") {
        localRUV = /* @__PURE__ */ import_react110.default.createElement("div", { className: "ds-indent ds-margin-top" }, /* @__PURE__ */ import_react110.default.createElement("i", null, "There is no local RUV, the database might not have been initialized yet."));
      }
      return /* @__PURE__ */ import_react110.default.createElement("div", { className: "ds-margin-top-xlg ds-indent" }, /* @__PURE__ */ import_react110.default.createElement(TextContent, null, /* @__PURE__ */ import_react110.default.createElement(Text, { component: TextVariants.h3 }, "Local RUV", /* @__PURE__ */ import_react110.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "RRefresh the RUV for this suffixs",
          onClick: () => {
            this.props.reload(this.props.suffix);
          }
        }
      ))), localRUV, /* @__PURE__ */ import_react110.default.createElement(TextContent, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react110.default.createElement(Text, { component: TextVariants.h3 }, "Remote RUV's", /* @__PURE__ */ import_react110.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh the remote RUVs for this suffixs",
          onClick: () => {
            this.props.reload(this.props.suffix);
          }
        }
      ))), /* @__PURE__ */ import_react110.default.createElement("div", { className: "ds-left-indent-md" }, /* @__PURE__ */ import_react110.default.createElement(
        RUVTable,
        {
          rows: remote_rows,
          confirmDelete: this.showConfirmCleanRUV
        }
      )), /* @__PURE__ */ import_react110.default.createElement(TextContent, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react110.default.createElement(Text, { component: TextVariants.h3 }, "Replication Change Log Tasks")), /* @__PURE__ */ import_react110.default.createElement(Form, { className: "ds-margin-top-lg ds-left-indent-md", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react110.default.createElement(Grid, null, /* @__PURE__ */ import_react110.default.createElement(
        GridItem,
        {
          span: 3,
          title: "Export the changelog to an LDIF file.  Typically used for changelog encryption purposes, or debugging."
        },
        /* @__PURE__ */ import_react110.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowCLExport
          },
          "Export Changelog"
        )
      ), /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react110.default.createElement("p", { className: "ds-margin-top" }, "Export the replication changelog to a LDIF file.  Used for preparing to encrypt the changelog, or simply for debugging."))), /* @__PURE__ */ import_react110.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react110.default.createElement(
        GridItem,
        {
          span: 3,
          title: "Initialize the changelog with an LDIF file for changelog encryption purposes."
        },
        /* @__PURE__ */ import_react110.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowConfirmCLImport
          },
          "Import Changelog"
        )
      ), /* @__PURE__ */ import_react110.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react110.default.createElement("p", { className: "ds-margin-top" }, "Initialize the replication changelog from an LDIF file.  Used to initialize the change log after encryption has been enabled.")))), /* @__PURE__ */ import_react110.default.createElement("hr", null), /* @__PURE__ */ import_react110.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmCleanRUV,
          closeHandler: this.closeConfirmCleanRUV,
          handleChange: this.onChange,
          actionHandler: this.cleanRUV,
          spinning: this.state.modalSpinning,
          item: "Replica ID " + this.state.rid,
          checked: this.state.modalChecked,
          mTitle: "Remove RUV Element (CleanAllRUV)",
          mMsg: "Are you sure you want to attempt to clean this Replica ID from the suffix?",
          mSpinningMsg: "Starting cleaning task (CleanAllRUV) ...",
          mBtnName: "Remove RUV Element"
        }
      ), /* @__PURE__ */ import_react110.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmCLImport,
          closeHandler: this.closeConfirmCLImport,
          handleChange: this.onChange,
          actionHandler: this.importChangelog,
          spinning: this.state.modalSpinning,
          item: "Replicated Suffix " + this.props.suffix,
          checked: this.state.modalChecked,
          mTitle: "Initialize Replication Changelog From LDIF",
          mMsg: "Are you sure you want to attempt to initialize the changelog from LDIF?  This will reject all operations during during the initialization.",
          mSpinningMsg: "Initialzing Replication Change Log ...",
          mBtnName: "Import Changelog LDIF"
        }
      ), /* @__PURE__ */ import_react110.default.createElement(
        ExportCLModal,
        {
          showModal: this.state.showCLExport,
          closeHandler: this.closeCLExport,
          handleChange: this.onChange,
          handleLDIFChange: this.onCLLDIFChange,
          handleRadioChange: this.onRadioChange,
          saveHandler: this.exportChangelog,
          defaultCL: this.state.defaultCL,
          debugCL: this.state.debugCL,
          decodeCL: this.state.decodeCL,
          exportCSN: this.state.exportCSN,
          ldifFile: this.state.ldifFile,
          spinning: this.state.exportSpinner,
          saveOK: this.state.saveOK
        }
      ));
    }
  };
  ReplRUV.propTypes = {
    suffix: import_prop_types88.default.string,
    serverId: import_prop_types88.default.string,
    rows: import_prop_types88.default.array,
    addNotification: import_prop_types88.default.func,
    localRID: import_prop_types88.default.string,
    reload: import_prop_types88.default.func
  };
  ReplRUV.defaultProps = {
    serverId: "",
    suffix: "",
    rows: [],
    localRID: ""
  };

  // src/lib/replication/replSuffix.jsx
  var import_prop_types89 = __toESM(require_prop_types(), 1);
  var ReplSuffix = class extends import_react111.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        activeTabKey: 0,
        showDisableConfirm: false,
        replicationEnabled: false,
        errObj: {},
        replEnabled: this.props.replicated,
        // Enable replication settings
        showEnableReplModal: false,
        enableRole: "Supplier",
        enableRID: 1,
        enableBindDN: "cn=replication manager,cn=config",
        enableBindPW: "",
        enableBindPWConfirm: "",
        enableBindGroupDN: "",
        enableSpinning: false,
        disabled: true,
        // Disable repl enable button
        // Disable replication
        showDisableReplModal: false,
        disableChecked: false,
        disableSpinning: false,
        modalChecked: false,
        modalSpinning: false
      };
      this.handleMinusChange = () => {
        this.setState({
          enableRID: Number(this.state.enableRID) - 1
        });
      };
      this.handleNumberChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          enableRID: newValue > 65534 ? 65534 : newValue < 1 ? 1 : newValue
        });
      };
      this.handlePlusChange = () => {
        this.setState({
          enableRID: Number(this.state.enableRID) + 1
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleReplChange = this.handleReplChange.bind(this);
      this.onEnableChange = this.onEnableChange.bind(this);
      this.validateEnable = this.validateEnable.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.disableReplication = this.disableReplication.bind(this);
      this.enableReplication = this.enableReplication.bind(this);
      this.closeEnableReplModal = this.closeEnableReplModal.bind(this);
      this.closeDisableReplModal = this.closeDisableReplModal.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    handleReplChange() {
      if (this.props.replicated) {
        this.setState({
          showDisableReplModal: true,
          modalChecked: false,
          modalSpinning: false
        });
      } else {
        this.setState({
          showEnableReplModal: true,
          enableSpinning: false
        });
      }
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    validateEnable() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = ["enableBindDN", "enableBindGroupDN"];
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && (!valid_dn(this.state[attr]) || !this.state[attr].includes(","))) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      if (this.state.enableBindDN) {
        if (this.state.enableBindPW === "" || this.state.enableBindPW !== this.state.enableBindPWConfirm) {
          errObj.enableBindPW = true;
          errObj.enableBindPWConfirm = true;
          all_good = false;
        }
      }
      this.setState({
        errObj,
        disabled: !all_good
      });
    }
    onEnableChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateEnable();
      });
    }
    closeEnableReplModal() {
      this.setState({
        showEnableReplModal: false
      });
    }
    enableReplication() {
      if (this.state.enableBindDN !== "" && !valid_dn(this.state.enableBindDN)) {
        this.props.addNotification(
          "error",
          `The Bind DN is not a valid DN (Distinguished Name) ${this.state.enableBindDN}`
        );
        return;
      }
      if (this.state.enableBindGroupDN !== "" && !valid_dn(this.state.enableBindGroupDN)) {
        this.props.addNotification(
          "error",
          `The Group DN is not a valid DN (Distinguished Name)`
        );
        return;
      }
      if (this.state.enableBindPW !== this.state.enableBindPWConfirm) {
        this.props.addNotification(
          "error",
          `The Bind DN passwords do not match`
        );
        return;
      }
      if (this.state.enableRID !== "" && (this.state.enableRID < 1 || this.state.enableRID > 65534)) {
        this.props.addNotification(
          "error",
          `The Replica ID is not in the valid range of 1 - 65534`
        );
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "enable",
        "--suffix=" + this.props.suffix,
        "--role=" + this.state.enableRole
      ];
      let passwd = "";
      if (this.state.enableBindDN !== "") {
        cmd.push("--bind-dn=" + this.state.enableBindDN);
      }
      if (this.state.enableBindPW !== "") {
        passwd = this.state.enableBindPW;
      }
      if (this.state.enableBindGroupDN !== "") {
        cmd.push("--bind-group-dn=" + this.state.enableBindGroupDN);
      }
      if (this.state.enableRole === "Supplier") {
        cmd.push("--replica-id=" + this.state.enableRID);
      }
      this.setState({
        enableSpinning: true
      });
      this.props.disableTree();
      const config2 = {
        cmd,
        promptArg: "--bind-passwd-prompt",
        passwd,
        addNotification: this.props.addNotification,
        success_msg: `Successfully enabled replication for "${this.props.suffix}"`,
        error_msg: `Failed to enable replication for "${this.props.suffix}"`,
        state_callback: () => {
        },
        reload_func: this.props.reload,
        reload_arg: "1",
        funcName: "enableReplication",
        funcDesc: "Enable replication"
      };
      callCmdStreamPassword(config2);
    }
    closeDisableReplModal() {
      this.setState({
        showDisableReplModal: false
      });
    }
    disableReplication() {
      this.props.disableTree();
      this.setState({
        modalSpinning: true
      });
      const cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", "replication", "disable", "--suffix=" + this.props.suffix];
      log_cmd("disableReplication", "Disable replication", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(1);
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          `Successfully disabled replication for "${this.props.suffix}"`
        );
      }).fail((err) => {
        this.props.reload(1);
        this.setState({
          modalSpinning: false
        });
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Failed to disable replication for "${this.props.suffix}" - ${errMsg.desc}`
        );
      });
    }
    //
    // Render the component
    //
    render() {
      let spinning = "";
      let spintext = "";
      let suffixIcon = faTree;
      if (this.props.replicated) {
        suffixIcon = faClone;
      } else {
        if (this.props.repl === "subsuffix") {
          suffixIcon = faLeaf;
        }
      }
      if (this.props.spinning) {
        spinning = /* @__PURE__ */ import_react111.default.createElement(Spinner, { className: "ds-margin-top ds-margin-left ds-inline-spinner", size: "sm" });
        spintext = /* @__PURE__ */ import_react111.default.createElement("font", { size: "2" }, /* @__PURE__ */ import_react111.default.createElement("i", null, "Refreshing"));
      }
      let suffixClass = "ds-margin-top-lg";
      if (this.props.disabled) {
        suffixClass = "ds-margin-top-lg ds-disabled";
      }
      let enabledContent = /* @__PURE__ */ import_react111.default.createElement("div", { className: suffixClass }, /* @__PURE__ */ import_react111.default.createElement(Tabs, { isFilled: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react111.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react111.default.createElement(TabTitleText, null, "Configuration") }, /* @__PURE__ */ import_react111.default.createElement(
        ReplConfig,
        {
          suffix: this.props.suffix,
          role: this.props.role,
          data: this.props.data,
          serverId: this.props.serverId,
          addNotification: this.props.addNotification,
          reload: this.props.reload,
          reloadConfig: this.props.reloadConfig
        }
      )), /* @__PURE__ */ import_react111.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react111.default.createElement(TabTitleText, null, "Agreements ", /* @__PURE__ */ import_react111.default.createElement("font", { size: "2" }, "(", this.props.agmtRows.length, ")")) }, /* @__PURE__ */ import_react111.default.createElement(
        ReplAgmts,
        {
          suffix: this.props.suffix,
          serverId: this.props.serverId,
          rows: this.props.agmtRows,
          addNotification: this.props.addNotification,
          reload: this.props.reloadAgmts,
          attrs: this.props.attrs,
          disableTable: this.props.disableAgmtTable,
          key: this.props.agmtRows
        }
      )), /* @__PURE__ */ import_react111.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react111.default.createElement(TabTitleText, null, "Winsync Agreements ", /* @__PURE__ */ import_react111.default.createElement("font", { size: "2" }, "(", this.props.winsyncRows.length, ")")) }, /* @__PURE__ */ import_react111.default.createElement(
        WinsyncAgmts,
        {
          suffix: this.props.suffix,
          serverId: this.props.serverId,
          rows: this.props.winsyncRows,
          addNotification: this.props.addNotification,
          reload: this.props.reloadWinsyncAgmts,
          attrs: this.props.attrs,
          disableTable: this.props.disableWSAgmtTable,
          key: this.props.winsyncRows
        }
      )), /* @__PURE__ */ import_react111.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react111.default.createElement(TabTitleText, null, "Change Log") }, /* @__PURE__ */ import_react111.default.createElement(
        Changelog,
        {
          suffix: this.props.suffix,
          serverId: this.props.serverId,
          addNotification: this.props.addNotification,
          clMaxEntries: this.props.data.clMaxEntries,
          clMaxAge: this.props.data.clMaxAge,
          clTrimInt: this.props.data.clTrimInt,
          clEncrypt: this.props.data.clEncrypt,
          key: this.props.data
        }
      )), /* @__PURE__ */ import_react111.default.createElement(Tab, { eventKey: 4, title: /* @__PURE__ */ import_react111.default.createElement(TabTitleText, null, "RUV's & Tasks") }, /* @__PURE__ */ import_react111.default.createElement(
        ReplRUV,
        {
          suffix: this.props.suffix,
          serverId: this.props.serverId,
          rows: this.props.ruvRows,
          addNotification: this.props.addNotification,
          reload: this.props.reloadRUV,
          localRID: this.props.data.nsds5replicaid,
          ldifRows: this.props.ldifRows,
          key: this.props.ruvRows
        }
      ))));
      let replActionButton = "";
      if (this.props.replicated) {
        replActionButton = /* @__PURE__ */ import_react111.default.createElement(
          Button,
          {
            className: "ds-float-right",
            variant: "danger",
            onClick: this.handleReplChange,
            title: "Disable replication, and remove all replication agreements."
          },
          "Disable"
        );
      } else {
        enabledContent = /* @__PURE__ */ import_react111.default.createElement("div", { className: "ds-center ds-margin-top-xlg" }, /* @__PURE__ */ import_react111.default.createElement(TextContent, null, /* @__PURE__ */ import_react111.default.createElement(Text, { component: TextVariants.h3 }, "Replication is not enabled for this suffix")), /* @__PURE__ */ import_react111.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleReplChange,
            className: "ds-margin-top-lg"
          },
          "Enable Replication"
        ));
      }
      return /* @__PURE__ */ import_react111.default.createElement("div", { id: "suffix-page" }, /* @__PURE__ */ import_react111.default.createElement(Grid, null, /* @__PURE__ */ import_react111.default.createElement(GridItem, { className: "ds-suffix-header", span: 8 }, /* @__PURE__ */ import_react111.default.createElement(FontAwesomeIcon, { size: "sm", icon: suffixIcon }), "\xA0\xA0", this.props.suffix, /* @__PURE__ */ import_react111.default.createElement(
        FontAwesomeIcon,
        {
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh replication settings for this suffix",
          onClick: () => this.props.reload(false)
        }
      ), spinning, " ", spintext), /* @__PURE__ */ import_react111.default.createElement(GridItem, { span: 4 }, replActionButton)), enabledContent, /* @__PURE__ */ import_react111.default.createElement(
        EnableReplModal,
        {
          showModal: this.state.showEnableReplModal,
          closeHandler: this.closeEnableReplModal,
          handleChange: this.onEnableChange,
          saveHandler: this.enableReplication,
          spinning: this.state.enableSpinning,
          enableRole: this.state.enableRole,
          enableRID: this.state.enableRID,
          enableBindDN: this.state.enableBindDN,
          disabled: this.state.disabled,
          onMinus: this.handleMinusChange,
          onNumberChange: this.handleNumberChange,
          onPlus: this.handlePlusChange,
          error: this.state.errObj
        }
      ), /* @__PURE__ */ import_react111.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDisableReplModal,
          closeHandler: this.closeDisableReplModal,
          onChange: this.handleChange,
          actionHandler: this.disableReplication,
          spinning: this.state.modalSpinning,
          item: this.props.suffix,
          checked: this.state.modalChecked,
          mTitle: "Disable Replication",
          mMsg: "Are you sure you want to disable replication for this suffix?",
          mSpinningMsg: "Disabling Replication ...",
          mBtnName: "Disable Replication"
        }
      ));
    }
  };
  ReplSuffix.propTypes = {
    serverId: import_prop_types89.default.string,
    suffix: import_prop_types89.default.string,
    role: import_prop_types89.default.string,
    addNotification: import_prop_types89.default.func,
    agmtRows: import_prop_types89.default.array,
    ldifRows: import_prop_types89.default.array,
    winsyncRows: import_prop_types89.default.array,
    ruvRows: import_prop_types89.default.array,
    reloadAgmts: import_prop_types89.default.func,
    reloadRUV: import_prop_types89.default.func,
    reloadConfig: import_prop_types89.default.func,
    reload: import_prop_types89.default.func,
    replicated: import_prop_types89.default.bool,
    attrs: import_prop_types89.default.array,
    enableTree: import_prop_types89.default.func,
    disableTree: import_prop_types89.default.func,
    spinning: import_prop_types89.default.bool,
    disabled: import_prop_types89.default.bool
  };
  ReplSuffix.defaultProps = {
    serverId: "",
    suffix: "",
    role: "",
    agmtRows: [],
    winsyncRows: [],
    ruvRows: [],
    ldifRows: [],
    replicated: false,
    attrs: [],
    spinning: false,
    disabled: false
  };

  // src/replication.jsx
  var import_prop_types90 = __toESM(require_prop_types(), 1);
  var Replication = class extends import_react112.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        errObj: {},
        nodes: [],
        node_name: "",
        node_type: "",
        node_replicated: false,
        disableTree: true,
        activeItems: [],
        // Suffix
        suffixLoading: false,
        attributes: [],
        role: "",
        rid: "0",
        bindDNs: [],
        bindDNGroup: "",
        agmtRows: [],
        winsyncRows: [],
        ruvRows: [],
        suffixSpinning: false,
        disabled: false,
        clLoading: false,
        clMaxEntries: "",
        clMaxAge: "",
        clTrimInt: "",
        clEncrypt: false,
        suffixKey: 0,
        ldifRows: [],
        showDisableConfirm: false,
        loaded: false
      };
      this.handleTreeClick = this.handleTreeClick.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.disableTree = this.disableTree.bind(this);
      this.enableTree = this.enableTree.bind(this);
      this.update_tree_nodes = this.update_tree_nodes.bind(this);
      this.reloadConfig = this.reloadConfig.bind(this);
      this.reloadAgmts = this.reloadAgmts.bind(this);
      this.reloadWinsyncAgmts = this.reloadWinsyncAgmts.bind(this);
      this.reloadRUV = this.reloadRUV.bind(this);
      this.loadAttrs = this.loadAttrs.bind(this);
      this.loadReplSuffix = this.loadReplSuffix.bind(this);
      this.reloadChangelog = this.reloadChangelog.bind(this);
      this.loadSuffixTree = this.loadSuffixTree.bind(this);
      this.loadLDIFs = this.loadLDIFs.bind(this);
    }
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(3)) {
        if (this.state.firstLoad) {
          this.loadSuffixTree(true);
          if (!this.state.loaded) {
            this.loadAttrs();
          }
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.loadSuffixTree(true);
          }
        }
      }
    }
    reloadChangelog() {
      this.setState({
        clLoading: true
      });
      const cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", "replication", "get-changelog"];
      log_cmd("reloadChangelog", "Reload the changelog", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let clDir = "";
        let clMaxEntries = "";
        let clMaxAge = "";
        let clTrimInt = "";
        let clEncrypt = false;
        for (const attr in config2.attrs) {
          const val = config2.attrs[attr][0];
          if (attr === "nsslapd-changelogdir") {
            clDir = val;
          }
          if (attr === "nsslapd-changelogmaxentries") {
            clMaxEntries = val;
          }
          if (attr === "nsslapd-changelogmaxage") {
            clMaxAge = val;
          }
          if (attr === "nsslapd-changelogtrim-interval") {
            clTrimInt = val;
          }
          if (attr === "nsslapd-encryptionalgorithm") {
            clEncrypt = true;
          }
        }
        this.setState({
          clDir,
          clMaxEntries,
          clMaxAge,
          clTrimInt,
          clEncrypt,
          clLoading: false
        });
      }).fail(() => {
        this.setState({
          clDir: "",
          clMaxEntries: "",
          clMaxAge: "",
          clTrimInt: "",
          clEncrypt: false,
          clLoading: false
        });
      });
    }
    processBranch(treeBranch) {
      if (treeBranch === void 0 || treeBranch.length === 0) {
        return;
      }
      for (const sub in treeBranch) {
        if (!treeBranch[sub].type.endsWith("suffix")) {
          treeBranch.splice(sub, 1);
          continue;
        } else if (treeBranch[sub].replicated) {
          treeBranch[sub].icon = /* @__PURE__ */ import_react112.default.createElement(FontAwesomeIcon, { size: "sm", icon: faClone });
          treeBranch[sub].replicated = true;
        }
        if (treeBranch[sub].children.length === 0) {
          delete treeBranch[sub].children;
        }
        this.processBranch(treeBranch[sub].children);
      }
    }
    loadSuffixTree(fullReset) {
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      this.setState({
        loaded: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "get-tree"
      ];
      log_cmd("loadSuffixTree", "Start building the suffix tree", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        let treeData = [];
        if (content !== "") {
          treeData = JSON.parse(content);
          for (const suffix of treeData) {
            if (suffix.type === "suffix") {
              suffix.icon = /* @__PURE__ */ import_react112.default.createElement(FontAwesomeIcon, { size: "sm", icon: faTree });
            } else if (suffix.type === "subsuffix") {
              suffix.icon = /* @__PURE__ */ import_react112.default.createElement(FontAwesomeIcon, { size: "sm", icon: faLeaf });
            }
            if (suffix.children.length === 0) {
              delete suffix.children;
            }
          }
        }
        const basicData = [
          {
            name: "Suffixes",
            icon: /* @__PURE__ */ import_react112.default.createElement(TopologyIcon, null),
            id: "repl-suffixes",
            children: [],
            defaultExpanded: true
          }
        ];
        let current_node = this.state.node_name;
        let current_type = this.state.node_type;
        let replicated = this.state.node_replicated;
        if (fullReset && treeData.length > 0) {
          let found = false;
          for (let i = 0; i < treeData.length; i++) {
            if (treeData[i].replicated) {
              treeData[i].icon = /* @__PURE__ */ import_react112.default.createElement(FontAwesomeIcon, { size: "sm", icon: faClone });
              replicated = true;
              if (!found) {
                current_node = treeData[i].id;
                current_type = treeData[i].type;
                this.setState({
                  activeItems: [treeData[i], basicData[0]]
                });
                this.loadReplSuffix(treeData[i].id);
                found = true;
              }
            }
            this.processBranch(treeData[i].children);
            if (treeData[i].children && treeData[i].children.length === 0) {
              delete treeData[i].children;
            }
          }
          if (!found) {
            current_node = treeData[0].id;
            current_type = treeData[0].type;
            this.setState({
              activeItems: [treeData[0], basicData[0]]
            });
            this.loadReplSuffix(treeData[0].id);
          }
        } else if (treeData.length > 0) {
          for (const suffix of treeData) {
            this.processBranch(suffix.children);
            if (suffix.id === current_node) {
              replicated = suffix.replicated;
            }
            if (suffix.replicated) {
              suffix.icon = /* @__PURE__ */ import_react112.default.createElement(FontAwesomeIcon, { size: "sm", icon: faClone });
            }
          }
          this.loadReplSuffix(current_node);
        }
        basicData[0].children = treeData;
        this.setState({
          nodes: basicData,
          node_name: current_node,
          node_type: current_type,
          node_replicated: replicated
        }, () => {
          this.update_tree_nodes();
        });
      });
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (treeViewItem.id === "repl-suffixes") {
        return;
      }
      this.setState({
        activeItems: [treeViewItem],
        node_name: treeViewItem.id,
        node_type: treeViewItem.type,
        node_replicated: treeViewItem.replicated,
        disableTree: true
        // Disable the tree to allow node to be fully loaded
      });
      if (treeViewItem.id in this.state) {
        this.setState({
          disableTree: false,
          suffixKey: /* @__PURE__ */ new Date()
        });
      } else {
        this.loadReplSuffix(treeViewItem.id);
        this.setState((prevState) => {
          return {
            suffixKey: /* @__PURE__ */ new Date()
          };
        });
      }
    }
    update_tree_nodes() {
      this.setState({
        loaded: true,
        disableTree: false
      }, () => {
        const className = "pf-c-tree-view__list-item";
        const element = document.getElementById("repl-tree");
        if (element) {
          const elements = element.getElementsByClassName(className);
          for (const el of elements) {
            if (el.id === "repl-suffixes") {
              continue;
            }
            el.setAttribute("title", el.innerText);
          }
        }
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    closeSuffixModal() {
      this.setState({
        showSuffixModal: false
      });
    }
    reloadAgmts(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "list",
        "--suffix",
        suffix
      ];
      log_cmd("reloadAgmts", "get repl agreements", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const obj = JSON.parse(content);
        const rows = [];
        for (const idx in obj.items) {
          const agmt_attrs = obj.items[idx].attrs;
          let state = "Enabled";
          let update_status = "";
          let agmt_init_status = "";
          if ("nsds5replicaenabled" in agmt_attrs) {
            if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
              state = "Disabled";
            }
          }
          if ("nsds5replicalastupdatestatus" in agmt_attrs) {
            update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
          }
          if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
            agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
            if (agmt_init_status === "Error (0) Total update in progress" || agmt_init_status === "Error (0)") {
              agmt_init_status = "Initializing";
            } else if (agmt_init_status === "Error (0) Total update succeeded") {
              agmt_init_status = "Initialized";
            }
          } else if (agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
            agmt_init_status = "Not Initialized";
          } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
            agmt_init_status = "Initializing";
          }
          rows.push([
            agmt_attrs.cn[0],
            agmt_attrs.nsds5replicahost[0],
            agmt_attrs.nsds5replicaport[0],
            state,
            update_status,
            agmt_init_status
          ]);
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            agmtRows: rows
          },
          suffixSpinning: false,
          disabled: false
        });
      }).fail(() => {
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    reloadWinsyncAgmts(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "list",
        "--suffix",
        suffix
      ];
      log_cmd("reloadWinsyncAgmts", "Get Winsync Agreements", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const obj = JSON.parse(content);
        const ws_rows = [];
        for (const idx in obj.items) {
          let state = "Enabled";
          let update_status = "";
          let ws_agmt_init_status = "Initialized";
          const agmt_attrs = obj.items[idx].attrs;
          if ("nsds5replicaenabled" in agmt_attrs) {
            if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
              state = "Disabled";
            }
          }
          if ("nsds5replicalastupdatestatus" in agmt_attrs) {
            update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
          }
          if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
            ws_agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
            if (ws_agmt_init_status === "Error (0) Total update in progress" || ws_agmt_init_status === "Error (0)") {
              ws_agmt_init_status = "Initializing";
            } else if (ws_agmt_init_status === "Error (0) Total update succeeded") {
              ws_agmt_init_status = "Initialized";
            }
          } else if ("nsds5replicalastinitstart" in agmt_attrs && agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
            ws_agmt_init_status = "Not Initialized";
          } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
            ws_agmt_init_status = "Initializing";
          }
          ws_rows.push([
            agmt_attrs.cn[0],
            agmt_attrs.nsds5replicahost[0],
            agmt_attrs.nsds5replicaport[0],
            state,
            update_status,
            ws_agmt_init_status
          ]);
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            winsyncRows: ws_rows
          },
          suffixSpinning: false,
          disabled: false
        });
      }).fail(() => {
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    reloadConfig(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get",
        "--suffix",
        suffix
      ];
      log_cmd("reloadConfig", "Reload suffix repl config", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let current_role = "";
        let nsds5replicaprecisetombstonepurging = false;
        if ("nsds5replicaprecisetombstonepurging" in config2.attrs) {
          if (config2.attrs.nsds5replicaprecisetombstonepurging[0].toLowerCase() === "on") {
            nsds5replicaprecisetombstonepurging = true;
          }
        }
        if (config2.attrs.nsds5replicatype[0] === "3") {
          current_role = "Supplier";
        } else {
          if (config2.attrs.nsds5flags[0] === "1") {
            current_role = "Hub";
          } else {
            current_role = "Consumer";
          }
        }
        this.setState({
          [suffix]: {
            role: current_role,
            nsds5flags: config2.attrs.nsds5flags[0],
            nsds5replicatype: config2.attrs.nsds5replicatype[0],
            nsds5replicaid: "nsds5replicaid" in config2.attrs ? config2.attrs.nsds5replicaid[0] : "",
            nsds5replicabinddn: "nsds5replicabinddn" in config2.attrs ? config2.attrs.nsds5replicabinddn : "",
            nsds5replicabinddngroup: "nsds5replicabinddngroup" in config2.attrs ? config2.attrs.nsds5replicabinddngroup[0] : "",
            nsds5replicabinddngroupcheckinterval: "nsds5replicabinddngroupcheckinterval" in config2.attrs ? config2.attrs.nsds5replicabinddngroupcheckinterval[0] : "",
            nsds5replicareleasetimeout: "nsds5replicareleasetimeout" in config2.attrs ? config2.attrs.nsds5replicareleasetimeout[0] : "",
            nsds5replicapurgedelay: "nsds5replicapurgedelay" in config2.attrs ? config2.attrs.nsds5replicapurgedelay[0] : "",
            nsds5replicatombstonepurgeinterval: "nsds5replicatombstonepurgeinterval" in config2.attrs ? config2.attrs.nsds5replicatombstonepurgeinterval[0] : "",
            nsds5replicaprecisetombstonepurging,
            nsds5replicaprotocoltimeout: "nsds5replicaprotocoltimeout" in config2.attrs ? config2.attrs.nsds5replicaprotocoltimeout[0] : "",
            nsds5replicabackoffmin: "nsds5replicabackoffmin" in config2.attrs ? config2.attrs.nsds5replicabackoffmin[0] : "",
            nsds5replicabackoffmax: "nsds5replicabackoffmax" in config2.attrs ? config2.attrs.nsds5replicabackoffmax[0] : "",
            nsds5replicakeepaliveupdateinterval: "nsds5replicakeepaliveupdateinterval" in config2.attrs ? config2.attrs.nsds5replicakeepaliveupdateinterval[0] : "3600"
          },
          suffixSpinning: false,
          disabled: false,
          suffixKey: /* @__PURE__ */ new Date()
        }, this.loadLDIFs);
      }).fail(() => {
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    reloadRUV(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get-ruv",
        "--suffix=" + suffix
      ];
      log_cmd("reloadRUV", "Get the suffix RUV", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const ruvs = JSON.parse(content);
        const ruv_rows = [];
        for (const idx in ruvs.items) {
          const ruv = ruvs.items[idx];
          ruv_rows.push({
            rid: ruv.rid,
            url: ruv.url,
            csn: ruv.csn,
            raw_csn: ruv.raw_csn,
            maxcsn: ruv.maxcsn,
            raw_maxcsn: ruv.raw_maxcsn
          });
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            ruvRows: ruv_rows
          },
          suffixSpinning: false,
          disabled: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (errMsg.desc !== "No such object") {
          this.props.addNotification(
            "error",
            `Error loading suffix RUV - ${errMsg.desc}`
          );
        }
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    loadLDIFs() {
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "ldifs"
      ];
      log_cmd("loadLDIFs", "Load replication LDIF Files", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const rows = [];
        for (const row of config2.items) {
          if (row[3].toLowerCase() === this.state.node_name.toLowerCase()) {
            rows.push([row[0], row[1], row[2]]);
          }
        }
        this.setState({
          ldifRows: rows
        }, () => {
          this.update_tree_nodes();
        });
      });
    }
    loadReplSuffix(suffix) {
      this.setState({
        activeKey: 1,
        suffixLoading: true,
        [suffix]: {}
      });
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get",
        "--suffix",
        suffix
      ];
      log_cmd("loadReplSuffix", "Load suffix repl config", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        let current_role = "";
        let nsds5replicaprecisetombstonepurging = false;
        if ("nsds5replicaprecisetombstonepurging" in config2.attrs) {
          if (config2.attrs.nsds5replicaprecisetombstonepurging[0].toLowerCase() === "on") {
            nsds5replicaprecisetombstonepurging = true;
          }
        }
        if (config2.attrs.nsds5replicatype[0] === "3") {
          current_role = "Supplier";
        } else {
          if (config2.attrs.nsds5flags[0] === "1") {
            current_role = "Hub";
          } else {
            current_role = "Consumer";
          }
        }
        this.setState({
          [suffix]: {
            role: current_role,
            nsds5flags: config2.attrs.nsds5flags[0],
            nsds5replicatype: config2.attrs.nsds5replicatype[0],
            nsds5replicaid: "nsds5replicaid" in config2.attrs ? config2.attrs.nsds5replicaid[0] : "",
            nsds5replicabinddn: "nsds5replicabinddn" in config2.attrs ? config2.attrs.nsds5replicabinddn : "",
            nsds5replicabinddngroup: "nsds5replicabinddngroup" in config2.attrs ? config2.attrs.nsds5replicabinddngroup[0] : "",
            nsds5replicabinddngroupcheckinterval: "nsds5replicabinddngroupcheckinterval" in config2.attrs ? config2.attrs.nsds5replicabinddngroupcheckinterval[0] : "",
            nsds5replicareleasetimeout: "nsds5replicareleasetimeout" in config2.attrs ? config2.attrs.nsds5replicareleasetimeout[0] : "",
            nsds5replicapurgedelay: "nsds5replicapurgedelay" in config2.attrs ? config2.attrs.nsds5replicapurgedelay[0] : "",
            nsds5replicatombstonepurgeinterval: "nsds5replicatombstonepurgeinterval" in config2.attrs ? config2.attrs.nsds5replicatombstonepurgeinterval[0] : "",
            nsds5replicaprecisetombstonepurging,
            nsds5replicaprotocoltimeout: "nsds5replicaprotocoltimeout" in config2.attrs ? config2.attrs.nsds5replicaprotocoltimeout[0] : "",
            nsds5replicabackoffmin: "nsds5replicabackoffmin" in config2.attrs ? config2.attrs.nsds5replicabackoffmin[0] : "",
            nsds5replicabackoffmax: "nsds5replicabackoffmax" in config2.attrs ? config2.attrs.nsds5replicabackoffmax[0] : "",
            nsds5replicakeepaliveupdateinterval: "nsds5replicakeepaliveupdateinterval" in config2.attrs ? config2.attrs.nsds5replicakeepaliveupdateinterval[0] : "3600",
            clMaxEntries: "",
            clMaxAge: "",
            clTrimInt: "",
            clEncrypt: false
          }
        }, this.loadLDIFs);
        cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "replication",
          "get-changelog",
          "--suffix",
          suffix
        ];
        log_cmd("loadReplSuffix", "Load the replication info", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const config3 = JSON.parse(content2);
          let clMaxEntries = "";
          let clMaxAge = "";
          let clTrimInt = "";
          let clEncrypt = false;
          for (const attr in config3.attrs) {
            const val = config3.attrs[attr][0];
            if (attr === "nsslapd-changelogmaxentries") {
              clMaxEntries = val;
            }
            if (attr === "nsslapd-changelogmaxage") {
              clMaxAge = val;
            }
            if (attr === "nsslapd-changelogtrim-interval") {
              clTrimInt = val;
            }
            if (attr === "nsslapd-encryptionalgorithm") {
              clEncrypt = true;
            }
          }
          this.setState({
            [suffix]: {
              ...this.state[suffix],
              clMaxEntries,
              clMaxAge,
              clTrimInt,
              clEncrypt
            }
          });
          cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "repl-agmt",
            "list",
            "--suffix",
            suffix
          ];
          log_cmd("loadReplSuffix", "get repl agreements", cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content3) => {
            const obj = JSON.parse(content3);
            const rows = [];
            for (const idx in obj.items) {
              const agmt_attrs = obj.items[idx].attrs;
              let state = "Enabled";
              let update_status = "";
              let agmt_init_status = "";
              if ("nsds5replicaenabled" in agmt_attrs) {
                if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
                  state = "Disabled";
                }
              }
              if ("nsds5replicalastupdatestatus" in agmt_attrs) {
                update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
              }
              if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
                agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
                if (agmt_init_status === "Error (0) Total update in progress" || agmt_init_status === "Error (0)") {
                  agmt_init_status = "Initializing";
                } else if (agmt_init_status === "Error (0) Total update succeeded") {
                  agmt_init_status = "Initialized";
                }
              } else if ("nsds5replicalastinitstart" in agmt_attrs && agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
                agmt_init_status = "Not Initialized";
              } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
                agmt_init_status = "Initializing";
              }
              rows.push([
                agmt_attrs.cn[0],
                agmt_attrs.nsds5replicahost[0],
                agmt_attrs.nsds5replicaport[0],
                state,
                update_status,
                agmt_init_status
              ]);
            }
            this.setState({
              [suffix]: {
                ...this.state[suffix],
                agmtRows: rows
              }
            });
            cmd = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
              "repl-winsync-agmt",
              "list",
              "--suffix",
              suffix
            ];
            log_cmd("loadReplSuffix", "Get Winsync Agreements", cmd);
            cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content4) => {
              const obj2 = JSON.parse(content4);
              const ws_rows = [];
              for (const idx in obj2.items) {
                let state = "Enabled";
                let update_status = "";
                let ws_agmt_init_status = "Initialized";
                const agmt_attrs = obj2.items[idx].attrs;
                if ("nsds5replicaenabled" in agmt_attrs) {
                  if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
                    state = "Disabled";
                  }
                }
                if ("nsds5replicalastupdatestatus" in agmt_attrs) {
                  update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
                }
                if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
                  ws_agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
                  if (ws_agmt_init_status === "Error (0) Total update in progress" || ws_agmt_init_status === "Error (0)") {
                    ws_agmt_init_status = "Initializing";
                  } else if (ws_agmt_init_status === "Error (0) Total update succeeded") {
                    ws_agmt_init_status = "Initialized";
                  }
                } else if ("nsds5replicalastinitstart" in agmt_attrs && agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
                  ws_agmt_init_status = "Not Initialized";
                } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
                  ws_agmt_init_status = "Initializing";
                }
                ws_rows.push([
                  agmt_attrs.cn[0],
                  agmt_attrs.nsds5replicahost[0],
                  agmt_attrs.nsds5replicaport[0],
                  state,
                  update_status,
                  ws_agmt_init_status
                ]);
              }
              this.setState({
                [suffix]: {
                  ...this.state[suffix],
                  winsyncRows: ws_rows
                }
              });
              cmd = [
                "dsconf",
                "-j",
                "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
                "replication",
                "get-ruv",
                "--suffix=" + suffix
              ];
              log_cmd("loadReplSuffix", "Get the suffix RUV", cmd);
              cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content5) => {
                const ruvs = JSON.parse(content5);
                const ruv_rows = [];
                for (const idx in ruvs.items) {
                  const ruv = ruvs.items[idx];
                  ruv_rows.push({
                    rid: ruv.rid,
                    url: ruv.url,
                    csn: ruv.csn,
                    raw_csn: ruv.raw_csn,
                    maxcsn: ruv.maxcsn,
                    raw_maxcsn: ruv.raw_maxcsn
                  });
                }
                this.setState({
                  [suffix]: {
                    ...this.state[suffix],
                    ruvRows: ruv_rows
                  },
                  suffixLoading: false,
                  disableTree: false
                });
              }).fail((err) => {
                const errMsg = JSON.parse(err);
                if (errMsg.desc !== "No such object" && !errMsg.desc.includes("There is no RUV for suffix")) {
                  this.props.addNotification(
                    "error",
                    `Error loading suffix RUV - ${errMsg.desc}`
                  );
                }
                this.setState({
                  suffixLoading: false,
                  disableTree: false
                });
              });
            }).fail((err) => {
              const errMsg = JSON.parse(err);
              this.props.addNotification(
                "error",
                `Error loading winsync agreements - ${errMsg.desc}`
              );
              this.setState({
                suffixLoading: false,
                disableTree: false
              });
            });
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.props.addNotification(
              "error",
              `Error loading replication agreements configuration - ${errMsg.desc}`
            );
            this.setState({
              suffixLoading: false,
              disableTree: false
            });
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.props.addNotification(
            "error",
            `Error loading replication changelog configuration - ${errMsg.desc}`
          );
          this.setState({
            suffixLoading: false,
            disableTree: false
          });
        });
      }).fail(() => {
        this.setState({
          suffixLoading: false,
          disableTree: false,
          node_replicated: false
        });
      });
    }
    loadAttrs() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("Suffixes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        });
      });
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    disableTree() {
      this.setState({
        disableTree: true
      });
    }
    render() {
      const { nodes } = this.state;
      let repl_page = "";
      let repl_element = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (!this.state.loaded) {
        repl_page = /* @__PURE__ */ import_react112.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react112.default.createElement(TextContent, null, /* @__PURE__ */ import_react112.default.createElement(Text, { component: TextVariants.h3 }, "Loading Replication Information ...")), /* @__PURE__ */ import_react112.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      } else {
        if (this.state.suffixLoading) {
          repl_element = /* @__PURE__ */ import_react112.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react112.default.createElement(TextContent, null, /* @__PURE__ */ import_react112.default.createElement(Text, { component: TextVariants.h3 }, "Loading Replication Configuration For ", /* @__PURE__ */ import_react112.default.createElement("b", null, this.state.node_name, " ..."))), /* @__PURE__ */ import_react112.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
        } else {
          if (this.state.node_name in this.state) {
            repl_element = /* @__PURE__ */ import_react112.default.createElement("div", null, /* @__PURE__ */ import_react112.default.createElement(
              ReplSuffix,
              {
                serverId: this.props.serverId,
                suffix: this.state.node_name,
                role: this.state[this.state.node_name].role,
                data: this.state[this.state.node_name],
                addNotification: this.props.addNotification,
                agmtRows: this.state[this.state.node_name].agmtRows,
                winsyncRows: this.state[this.state.node_name].winsyncRows,
                ruvRows: this.state[this.state.node_name].ruvRows,
                ldifRows: this.state.ldifRows,
                reloadAgmts: this.reloadAgmts,
                reloadWinsyncAgmts: this.reloadWinsyncAgmts,
                reloadRUV: this.reloadRUV,
                reloadConfig: this.reloadConfig,
                reloadLDIF: this.loadLDIFs,
                reload: this.loadSuffixTree,
                attrs: this.state.attributes,
                replicated: this.state.node_replicated,
                enableTree: this.enableTree,
                disableTree: this.disableTree,
                key: this.state.suffixKey,
                disabled: this.state.disabled,
                spinning: this.state.suffixSpinning
              }
            ));
          } else {
            repl_element = /* @__PURE__ */ import_react112.default.createElement(
              ReplSuffix,
              {
                serverId: this.props.serverId,
                suffix: this.state.node_name,
                role: "",
                data: "",
                addNotification: this.props.addNotification,
                disableWSAgmtTable: this.state.disableWSAgmtTable,
                disableAgmtTable: this.state.disableAgmtTable,
                reloadAgmts: this.reloadAgmts,
                reloadWinsyncAgmts: this.reloadWinsyncAgmts,
                reloadRUV: this.reloadRUV,
                reloadLDIF: this.loadLDIFs,
                reloadConfig: this.reloadConfig,
                reload: this.loadSuffixTree,
                attrs: this.state.attributes,
                replicated: this.state.node_replicated,
                enableTree: this.enableTree,
                disableTree: this.disableTree,
                spinning: this.state.suffixSpinning,
                disabled: this.state.disabled,
                ldifRows: this.state.ldifRows,
                key: this.state.node_name
              }
            );
          }
        }
        repl_page = /* @__PURE__ */ import_react112.default.createElement("div", { className: "container-fluid" }, /* @__PURE__ */ import_react112.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react112.default.createElement("div", null, /* @__PURE__ */ import_react112.default.createElement("div", { className: "ds-tree" }, /* @__PURE__ */ import_react112.default.createElement("div", { className: disabled, id: "repl-tree" }, /* @__PURE__ */ import_react112.default.createElement(
          TreeView,
          {
            data: nodes,
            activeItems: this.state.activeItems,
            onSelect: this.handleTreeClick
          }
        )))), /* @__PURE__ */ import_react112.default.createElement("div", { className: "ds-tree-content" }, repl_element)));
      }
      return /* @__PURE__ */ import_react112.default.createElement("div", null, repl_page);
    }
  };
  Replication.propTypes = {
    addNotification: import_prop_types90.default.func,
    serverId: import_prop_types90.default.string
  };
  Replication.defaultProps = {
    serverId: ""
  };

  // src/server.jsx
  var import_react129 = __toESM(require_react(), 1);
  var import_prop_types106 = __toESM(require_prop_types(), 1);

  // src/lib/server/settings.jsx
  var import_react113 = __toESM(require_react(), 1);
  var import_prop_types91 = __toESM(require_prop_types(), 1);
  var general_attrs3 = [
    "nsslapd-port",
    "nsslapd-secureport",
    "nsslapd-localhost",
    "nsslapd-listenhost",
    "nsslapd-bakdir",
    "nsslapd-ldifdir",
    "nsslapd-schemadir",
    "nsslapd-certdir"
  ];
  var path_attrs = [
    "nsslapd-bakdir",
    "nsslapd-ldifdir",
    "nsslapd-schemadir",
    "nsslapd-certdir"
  ];
  var rootdn_attrs = [
    "nsslapd-rootpwstoragescheme",
    "nsslapd-rootpw",
    "confirmRootpw"
  ];
  var disk_attrs = [
    "nsslapd-disk-monitoring",
    "nsslapd-disk-monitoring-logging-critical",
    "nsslapd-disk-monitoring-threshold",
    "nsslapd-disk-monitoring-grace-period"
  ];
  var adv_attrs = [
    "nsslapd-allow-anonymous-access",
    "nsslapd-entryusn-global",
    "nsslapd-ignore-time-skew",
    "nsslapd-readonly",
    "nsslapd-anonlimitsdn",
    "nsslapd-schemacheck",
    "nsslapd-syntaxcheck",
    "nsslapd-plugin-logging",
    "nsslapd-syntaxlogging",
    "nsslapd-plugin-binddn-tracking",
    "nsslapd-attribute-name-exceptions",
    "nsslapd-dn-validate-strict"
  ];
  var ServerSettings = class extends import_react113.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        activeTabKey: 0,
        attrs: this.props.attrs,
        // Setting lists
        configSaveDisabled: true,
        configReloading: false,
        errObjConfig: {},
        rootDNReloading: false,
        rootDNSaveDisabled: true,
        errObjRootDN: {},
        diskMonReloading: false,
        diskMonSaveDisabled: true,
        errObjDiskMon: {},
        advSaveDisabled: true,
        advReloading: false,
        errObjAdv: {}
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.options = [
        { value: "PBKDF2_SHA256", label: "PBKDF2_SHA256", disabled: false },
        { value: "SSHA512", label: "SSHA512", disabled: false },
        { value: "SSHA384", label: "SSHA384", disabled: false },
        { value: "SSHA256", label: "SSHA256", disabled: false },
        { value: "SSHA", label: "SSHA", disabled: false },
        { value: "MD5", label: "MD5", disabled: false },
        { value: "SMD5", label: "SMD5", disabled: false },
        { value: "CRYPT-MD5", label: "CRYPT-MD5", disabled: false },
        { value: "CRYPT-SHA512", label: "CRYPT-SHA512", disabled: false },
        { value: "CRYPT-SHA256", label: "CRYPT-SHA256", disabled: false },
        { value: "CRYPT", label: "CRYPT", disabled: false },
        { value: "GOST_YESCRYPT", label: "GOST_YESCRYPT", disabled: false },
        { value: "CLEAR", label: "CLEAR", disabled: false }
      ];
      this.validatePaths = this.validatePaths.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleReloadConfig = this.handleReloadConfig.bind(this);
      this.handleSaveRootDN = this.handleSaveRootDN.bind(this);
      this.reloadRootDN = this.reloadRootDN.bind(this);
      this.handleSaveDiskMonitoring = this.handleSaveDiskMonitoring.bind(this);
      this.reloadDiskMonitoring = this.reloadDiskMonitoring.bind(this);
      this.handleSaveAdvanced = this.handleSaveAdvanced.bind(this);
      this.reloadAdvanced = this.reloadAdvanced.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    validatePaths(disableSaveBtn) {
      let disableBtn = disableSaveBtn;
      const errObj = this.state.errObjConfig;
      for (const attr of path_attrs) {
        const cmd = `[ -d "${this.state[attr]}" ]`;
        cockpit_default.script(cmd, [], { superuser: true, err: "message" }).done((output) => {
          errObj[attr] = false;
          this.setState({
            errObjConfig: errObj,
            configSaveDisabled: disableBtn
          });
        }).fail(() => {
          errObj[attr] = true;
          disableBtn = true;
          this.setState({
            configSaveDisabled: disableBtn,
            errObjConfig: errObj
          });
        });
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      let valueErr = false;
      let errObj;
      if (nav_tab === "config") {
        config_attrs = general_attrs3;
        disableBtnName = "configSaveDisabled";
        errObj = this.state.errObjConfig;
      } else if (nav_tab === "rootdn") {
        disableBtnName = "rootDNSaveDisabled";
        config_attrs = rootdn_attrs;
        errObj = this.state.errObjRootDN;
      } else if (nav_tab === "diskmon") {
        disableBtnName = "diskMonSaveDisabled";
        config_attrs = disk_attrs;
        errObj = this.state.errObjDiskMon;
      } else if (nav_tab === "adv") {
        disableBtnName = "advSaveDisabled";
        config_attrs = adv_attrs;
        errObj = this.state.errObjAdv;
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (nav_tab === "config") {
        if (attr !== "nsslapd-listenhost" && value === "") {
          valueErr = true;
          disableSaveBtn = true;
        }
      } else if (nav_tab === "rootdn") {
        if (attr === "nsslapd-rootpw") {
          if (value !== this.state.confirmRootpw) {
            disableSaveBtn = true;
            valueErr = true;
            errObj["nsslapd-rootpw"] = true;
          } else {
            errObj.confirmRootpw = false;
            errObj["nsslapd-rootpw"] = false;
          }
        }
        if (attr === "confirmRootpw") {
          if (value !== this.state["nsslapd-rootpw"]) {
            disableSaveBtn = true;
            valueErr = true;
            errObj.confirmRootpw = true;
          } else {
            errObj.confirmRootpw = false;
            errObj["nsslapd-rootpw"] = false;
          }
        }
        if (value === "") {
          disableSaveBtn = true;
          valueErr = true;
        }
      } else if (nav_tab === "diskmon") {
        if (value === "" && typeof value !== "boolean") {
          valueErr = true;
          disableSaveBtn = true;
        }
        if (attr === "nsslapd-disk-monitoring-threshold") {
          const numVal = Number(value);
          if (numVal < 4096) {
            valueErr = true;
            disableSaveBtn = true;
          }
        }
      } else if (nav_tab === "adv") {
        if (attr === "nsslapd-anonlimitsdn" && !valid_dn(value)) {
          valueErr = true;
          errObj[attr] = true;
        }
        if (value === "" && attr !== "nsslapd-anonlimitsdn" && typeof value !== "boolean") {
          valueErr = true;
          disableSaveBtn = true;
        }
      }
      errObj[attr] = valueErr;
      this.setState({
        [attr]: value,
        errObjConfig: errObj,
        [disableBtnName]: disableSaveBtn
      }, () => {
        this.validatePaths(disableSaveBtn);
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let diskMonitoring = false;
      let diskLogCritical = false;
      let schemaCheck = false;
      let syntaxCheck = false;
      let pluginLogging = false;
      let syntaxLogging = false;
      let bindDNTracking = false;
      let nameExceptions = false;
      let dnValidate = false;
      let usnGlobal = false;
      let ignoreSkew = false;
      let readOnly = false;
      let listenhost = "";
      if (attrs["nsslapd-entryusn-global"][0] === "on") {
        usnGlobal = true;
      }
      if (attrs["nsslapd-ignore-time-skew"][0] === "on") {
        ignoreSkew = true;
      }
      if (attrs["nsslapd-readonly"][0] === "on") {
        readOnly = true;
      }
      if (attrs["nsslapd-disk-monitoring"][0] === "on") {
        diskMonitoring = true;
      }
      if (attrs["nsslapd-disk-monitoring-logging-critical"][0] === "on") {
        diskLogCritical = true;
      }
      if (attrs["nsslapd-schemacheck"][0] === "on") {
        schemaCheck = true;
      }
      if (attrs["nsslapd-syntaxcheck"][0] === "on") {
        syntaxCheck = true;
      }
      if (attrs["nsslapd-plugin-logging"][0] === "on") {
        pluginLogging = true;
      }
      if (attrs["nsslapd-syntaxlogging"][0] === "on") {
        syntaxLogging = true;
      }
      if (attrs["nsslapd-plugin-binddn-tracking"][0] === "on") {
        bindDNTracking = true;
      }
      if (attrs["nsslapd-attribute-name-exceptions"][0] === "on") {
        nameExceptions = true;
      }
      if (attrs["nsslapd-dn-validate-strict"][0] === "on") {
        dnValidate = true;
      }
      if ("nsslapd-listenhost" in attrs) {
        listenhost = attrs["nsslapd-listenhost"][0];
      }
      this.setState({
        loaded: true,
        loading: false,
        errObjConfig: {},
        errObjRootDN: {},
        errObjDiskMon: {},
        errObjAdv: {},
        // Settings
        "nsslapd-port": attrs["nsslapd-port"][0],
        "nsslapd-secureport": attrs["nsslapd-secureport"][0],
        "nsslapd-localhost": attrs["nsslapd-localhost"][0],
        "nsslapd-listenhost": listenhost,
        "nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
        "nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
        "nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
        "nsslapd-certdir": attrs["nsslapd-certdir"][0],
        "nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
        "nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
        confirmRootpw: attrs["nsslapd-rootpw"][0],
        "nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
        "nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
        "nsslapd-disk-monitoring-threshold": attrs["nsslapd-disk-monitoring-threshold"][0],
        "nsslapd-disk-monitoring-grace-period": attrs["nsslapd-disk-monitoring-grace-period"][0],
        "nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
        "nsslapd-disk-monitoring": diskMonitoring,
        "nsslapd-disk-monitoring-logging-critical": diskLogCritical,
        "nsslapd-schemacheck": schemaCheck,
        "nsslapd-syntaxcheck": syntaxCheck,
        "nsslapd-plugin-logging": pluginLogging,
        "nsslapd-syntaxlogging": syntaxLogging,
        "nsslapd-plugin-binddn-tracking": bindDNTracking,
        "nsslapd-attribute-name-exceptions": nameExceptions,
        "nsslapd-dn-validate-strict": dnValidate,
        "nsslapd-entryusn-global": usnGlobal,
        "nsslapd-ignore-time-skew": ignoreSkew,
        "nsslapd-readonly": readOnly,
        // Record original values
        "_nsslapd-port": attrs["nsslapd-port"][0],
        "_nsslapd-secureport": attrs["nsslapd-secureport"][0],
        "_nsslapd-localhost": attrs["nsslapd-localhost"][0],
        "_nsslapd-listenhost": listenhost,
        "_nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
        "_nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
        "_nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
        "_nsslapd-certdir": attrs["nsslapd-certdir"][0],
        "_nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
        "_nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
        _confirmRootpw: attrs["nsslapd-rootpw"][0],
        "_nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
        "_nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
        "_nsslapd-disk-monitoring-threshold": attrs["nsslapd-disk-monitoring-threshold"][0],
        "_nsslapd-disk-monitoring-grace-period": attrs["nsslapd-disk-monitoring-grace-period"][0],
        "_nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
        "_nsslapd-disk-monitoring": diskMonitoring,
        "_nsslapd-disk-monitoring-logging-critical": diskLogCritical,
        "_nsslapd-schemacheck": schemaCheck,
        "_nsslapd-syntaxcheck": syntaxCheck,
        "_nsslapd-plugin-logging": pluginLogging,
        "_nsslapd-syntaxlogging": syntaxLogging,
        "_nsslapd-plugin-binddn-tracking": bindDNTracking,
        "_nsslapd-attribute-name-exceptions": nameExceptions,
        "_nsslapd-dn-validate-strict": dnValidate,
        "_nsslapd-entryusn-global": usnGlobal,
        "_nsslapd-ignore-time-skew": ignoreSkew,
        "_nsslapd-readonly": readOnly
      }, this.props.enableTree);
    }
    handleSaveRootDN() {
      this.setState({
        rootDNReloading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of rootdn_attrs) {
        if (attr !== "confirmRootpw" && this.state["_" + attr] !== this.state[attr]) {
          cmd.push(attr + "=" + this.state[attr]);
        }
      }
      log_cmd("handleSaveRootDN", "Saving changes to root DN", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.reloadRootDN();
        this.props.addNotification(
          "success",
          "Successfully updated Directory Manager configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.reloadRootDN();
        this.props.addNotification(
          "error",
          `Error updating Directory Manager configuration - ${errMsg.desc}`
        );
      });
    }
    reloadRootDN() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleReloadConfig", "Reload Directory Manager configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        this.setState(
          () => ({
            rootDNReloading: false,
            "nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
            "nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
            confirmRootpw: attrs["nsslapd-rootpw"][0],
            "nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
            // Record original values
            "_nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
            "_nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
            _confirmRootpw: attrs["nsslapd-rootpw"][0],
            "_nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
            rootDNSaveDisabled: true
          })
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          rootDNReloading: false
        });
        this.props.addNotification(
          "error",
          `Error reloading Directory Manager configuration - ${errMsg.desc}`
        );
      });
    }
    handleSaveDiskMonitoring() {
      this.setState({
        diskMonReloading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of disk_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveDiskMonitoring", "Saving changes to Disk Monitoring", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.reloadDiskMonitoring();
        this.props.addNotification(
          "success",
          "Successfully updated Disk Monitoring configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.reloadDiskMonitoring();
        this.props.addNotification(
          "error",
          `Error updating Disk Monitoring configuration - ${errMsg.desc}`
        );
      });
    }
    reloadDiskMonitoring() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadDiskMonitoring", "Reload Disk Monitoring configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let diskMonitoring = false;
        let diskLogCritical = false;
        if (attrs["nsslapd-disk-monitoring"][0] === "on") {
          diskMonitoring = true;
        }
        if (attrs["nsslapd-disk-monitoring-logging-critical"][0] === "on") {
          diskLogCritical = true;
        }
        this.setState(
          () => ({
            diskMonReloading: false,
            "nsslapd-disk-monitoring-threshold": attrs["nsslapd-disk-monitoring-threshold"][0],
            "nsslapd-disk-monitoring-grace-period": attrs["nsslapd-disk-monitoring-grace-period"][0],
            "nsslapd-disk-monitoring": diskMonitoring,
            "nsslapd-disk-monitoring-logging-critical": diskLogCritical,
            // Record original values
            "_nsslapd-disk-monitoring-threshold": attrs["nsslapd-disk-monitoring-threshold"][0],
            "_nsslapd-disk-monitoring-grace-period": attrs["nsslapd-disk-monitoring-grace-period"][0],
            "_nsslapd-disk-monitoring": diskMonitoring,
            "_nsslapd-disk-monitoring-logging-critical": diskLogCritical,
            diskMonSaveDisabled: true
          })
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          diskMonReloading: false
        });
        this.props.addNotification(
          "error",
          `Error reloading Disk Monitoring configuration - ${errMsg.desc}`
        );
      });
    }
    handleSaveAdvanced() {
      this.setState({
        advReloading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of adv_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveAdvanced", "Saving Advanced configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.reloadAdvanced();
        this.props.addNotification(
          "success",
          "Successfully updated Advanced configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.reloadAdvanced();
        this.props.addNotification(
          "error",
          `Error updating Advanced configuration - ${errMsg.desc}`
        );
      });
    }
    reloadAdvanced() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadAdvanced", "Reload Advanced configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let schemaCheck = false;
        let syntaxCheck = false;
        let pluginLogging = false;
        let syntaxLogging = false;
        let bindDNTracking = false;
        let nameExceptions = false;
        let dnValidate = false;
        let usnGlobal = false;
        let ignoreSkew = false;
        let readOnly = false;
        if (attrs["nsslapd-entryusn-global"][0] === "on") {
          usnGlobal = true;
        }
        if (attrs["nsslapd-ignore-time-skew"][0] === "on") {
          ignoreSkew = true;
        }
        if (attrs["nsslapd-readonly"][0] === "on") {
          readOnly = true;
        }
        if (attrs["nsslapd-schemacheck"][0] === "on") {
          schemaCheck = true;
        }
        if (attrs["nsslapd-syntaxcheck"][0] === "on") {
          syntaxCheck = true;
        }
        if (attrs["nsslapd-plugin-logging"][0] === "on") {
          pluginLogging = true;
        }
        if (attrs["nsslapd-syntaxlogging"][0] === "on") {
          syntaxLogging = true;
        }
        if (attrs["nsslapd-plugin-binddn-tracking"][0] === "on") {
          bindDNTracking = true;
        }
        if (attrs["nsslapd-attribute-name-exceptions"][0] === "on") {
          nameExceptions = true;
        }
        if (attrs["nsslapd-dn-validate-strict"][0] === "on") {
          dnValidate = true;
        }
        this.setState(
          () => ({
            "nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
            "nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
            "nsslapd-schemacheck": schemaCheck,
            "nsslapd-syntaxcheck": syntaxCheck,
            "nsslapd-plugin-logging": pluginLogging,
            "nsslapd-syntaxLogging": syntaxLogging,
            "nsslapd-plugin-binddn-tracking": bindDNTracking,
            "nsslapd-attribute-name-exceptions": nameExceptions,
            "nsslapd-dn-validate-strict": dnValidate,
            "nsslapd-entryusn-global": usnGlobal,
            "nsslapd-ignore-time-skew": ignoreSkew,
            "nsslapd-readonly": readOnly,
            // Record original values
            "_nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
            "_nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
            "_nsslapd-schemacheck": schemaCheck,
            "_nsslapd-syntaxcheck": syntaxCheck,
            "_nsslapd-plugin-logging": pluginLogging,
            "_nsslapd-syntaxLogging": syntaxLogging,
            "_nsslapd-plugin-binddn-tracking": bindDNTracking,
            "_nsslapd-attribute-name-exceptions": nameExceptions,
            "_nsslapd-dn-validate-strict": dnValidate,
            "_nsslapd-entryusn-global": usnGlobal,
            "_nsslapd-ignore-time-skew": ignoreSkew,
            "_nsslapd-readonly": readOnly,
            advReloading: false,
            advSaveDisabled: true
          })
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading Advanced configuration - ${errMsg.desc}`
        );
        this.setState({
          advReloading: false
        });
      });
    }
    handleSaveConfig() {
      this.setState({
        configReloading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of general_attrs3) {
        if (this.state["_" + attr] !== this.state[attr]) {
          cmd.push(attr + "=" + this.state[attr]);
        }
      }
      log_cmd("handleSaveConfig", "Applying server config change", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleReloadConfig();
        this.props.addNotification(
          "warning",
          "Successfully updated server configuration.  These changes require the server to be restarted to take effect."
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleReloadConfig();
        this.props.addNotification(
          "error",
          `Error updating server configuration - ${errMsg.desc}`
        );
      });
    }
    handleReloadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleReloadConfig", "Reload server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let listenhost = "";
        if ("nsslapd-listenhost" in attrs) {
          listenhost = attrs["nsslapd-listenhost"][0];
        }
        this.setState(
          () => ({
            configReloading: false,
            configSaveDisabled: true,
            errObjConfig: {},
            errObjRootDN: {},
            errObjDiskMon: {},
            errObjAdv: {},
            "nsslapd-port": attrs["nsslapd-port"][0],
            "nsslapd-secureport": attrs["nsslapd-secureport"][0],
            "nsslapd-localhost": attrs["nsslapd-localhost"][0],
            "nsslapd-listenhost": listenhost,
            "nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
            "nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
            "nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
            "nsslapd-certdir": attrs["nsslapd-certdir"][0],
            // Record original values
            "_nsslapd-port": attrs["nsslapd-port"][0],
            "_nsslapd-secureport": attrs["nsslapd-secureport"][0],
            "_nsslapd-localhost": attrs["nsslapd-localhost"][0],
            "_nsslapd-listenhost": listenhost,
            "_nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
            "_nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
            "_nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
            "_nsslapd-certdir": attrs["nsslapd-certdir"][0]
          })
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error reloading server configuration - ${errMsg.desc}`
        );
        this.setState({
          configReloading: false
        });
      });
    }
    render() {
      let body = "";
      let diskMonitor = "";
      let saveBtnName = "Save Settings";
      const extraPrimaryProps = {};
      if (this.state.configReloading || this.state.rootDNReloading || this.state.diskMonReloading || this.state.advReloading) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      if (this.state["nsslapd-disk-monitoring"]) {
        diskMonitor = /* @__PURE__ */ import_react113.default.createElement(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-top-lg ds-left-indent-lg ds-margin-bottom" }, /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The available disk space, in bytes, that will trigger the shutdown process. Default is 2mb. Once below half of the threshold then we enter the shutdown mode. Value range: 4096 - 9223372036854775807. (nsslapd-disk-monitoring-threshold)"
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Disk Monitoring Threshold"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-disk-monitoring-threshold"],
              min: 4096,
              max: 922337203685477,
              onMinus: () => {
                this.onMinusConfig("nsslapd-disk-monitoring-threshold", "diskmon");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-disk-monitoring-threshold", 1, 922337203685477, "diskmon");
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-disk-monitoring-threshold", "diskmon");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ), /* @__PURE__ */ import_react113.default.createElement(FormHelperText, { isError: true, isHidden: !this.state.errObjDiskMon["nsslapd-disk-monitoring-threshold"] }, "Value must be greater than or equal to 4096"))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "How many minutes to wait to allow an admin to clean up disk space before shutting slapd down. The default is 60 minutes. (nsslapd-disk-monitoring-grace-period)"
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Disk Monitoring Grace Period"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-disk-monitoring-grace-period"],
              min: 1,
              max: 2147483647,
              onMinus: () => {
                this.onMinusConfig("nsslapd-disk-monitoring-grace-period", "diskmon");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-disk-monitoring-grace-period", 1, 2147483647, "diskmon");
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-disk-monitoring-grace-period", "diskmon");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            className: "ds-margin-top",
            title: "When disk space gets critically low do not remove logs to free up disk space. (nsslapd-disk-monitoring-logging-critical)"
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            Checkbox,
            {
              id: "nsslapd-disk-monitoring-logging-critical",
              isChecked: this.state["nsslapd-disk-monitoring-logging-critical"],
              onChange: (str, e) => {
                this.handleChange(e, "diskmon");
              },
              label: "Preserve Logs Even If Disk Space Gets Low"
            }
          ))
        ));
      }
      if (this.state.loading) {
        body = /* @__PURE__ */ import_react113.default.createElement("div", { className: "ds-loading-spinner ds-margin-top ds-center" }, /* @__PURE__ */ import_react113.default.createElement(TextContent, null, /* @__PURE__ */ import_react113.default.createElement(Text, { component: TextVariants.h3 }, "Loading Server Settings ...")), /* @__PURE__ */ import_react113.default.createElement(Spinner, { className: "ds-margin-top", size: "md" }));
      } else {
        body = /* @__PURE__ */ import_react113.default.createElement("div", { className: "ds-margin-bottom-md" }, /* @__PURE__ */ import_react113.default.createElement(Grid, null, /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react113.default.createElement(TextContent, null, /* @__PURE__ */ import_react113.default.createElement(Text, { component: TextVariants.h3 }, "Server Settings", /* @__PURE__ */ import_react113.default.createElement(
          FontAwesomeIcon,
          {
            size: "lg",
            className: "ds-left-margin ds-refresh",
            icon: faSyncAlt,
            title: "Refresh configuration settings",
            onClick: this.handleReloadConfig
          }
        ))))), /* @__PURE__ */ import_react113.default.createElement("div", { className: this.state.loading ? "ds-fadeout" : "ds-fadein ds-left-margin" }, /* @__PURE__ */ import_react113.default.createElement(Tabs, { isFilled: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react113.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react113.default.createElement(TabTitleText, null, "General Settings") }, /* @__PURE__ */ import_react113.default.createElement(Form, { autoComplete: "off", className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The version of the Directory Server package"
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Server Version"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.props.version,
              type: "text",
              id: "server-version",
              "aria-describedby": "horizontal-form-name-helper",
              name: "server-version",
              isDisabled: true
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The server's local hostname (nsslapd-localhost)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Server Hostname"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-localhost"],
              type: "text",
              id: "nsslapd-localhost",
              "aria-describedby": "horizontal-form-name-helper",
              name: "server-hostname",
              onChange: (str, e) => {
                this.handleChange(e, "config");
              },
              validated: this.state.errObjConfig["nsslapd-localhost"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The server's port number (nsslapd-port)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "LDAP Port"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-port"],
              min: 1,
              max: 65534,
              onMinus: () => {
                this.onMinusConfig("nsslapd-port", "config");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-port", 1, 65534, "config");
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-port", "config");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8,
              validated: this.state.errObjConfig["nsslapd-port"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The server's secure port number (nsslapd-secureport)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "LDAPS Port"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-secureport"],
              min: 1,
              max: 65534,
              onMinus: () => {
                this.onMinusConfig("nsslapd-secureport", "config");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-secureport", 1, 65534, "config");
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-secureport", "config");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8,
              validated: this.state.errObjConfig["nsslapd-secureport"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "This parameter can be used to restrict the Directory Server instance to a single IP interface (hostname, or IP address).  Requires restart. (nsslapd-listenhost)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Listen Host Address"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-listenhost"],
              type: "text",
              id: "nsslapd-listenhost",
              "aria-describedby": "horizontal-form-name-helper",
              name: "server-listenhost",
              onChange: (str, e) => {
                this.handleChange(e, "config");
              },
              validated: this.state.errObjConfig["nsslapd-listenhost"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: this.state.errObjConfig["nsslapd-bakdir"] ? "Invalid backup directory path!" : "The location where database backups are stored (nsslapd-bakdir)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Backup Directory"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-bakdir"],
              type: "text",
              id: "nsslapd-bakdir",
              "aria-describedby": "horizontal-form-name-helper",
              name: "server-bakdir",
              onChange: (str, e) => {
                this.handleChange(e, "config");
              },
              validated: this.state.errObjConfig["nsslapd-bakdir"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: this.state.errObjConfig["nsslapd-ldifdir"] ? "Invalid LDIF directory path!" : "The location where the server's LDIF files are located (nsslapd-ldifdir)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "LDIF File Directory"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-ldifdir"],
              type: "text",
              id: "nsslapd-ldifdir",
              "aria-describedby": "horizontal-form-name-helper",
              name: "server-ldifdir",
              onChange: (str, e) => {
                this.handleChange(e, "config");
              },
              validated: this.state.errObjConfig["nsslapd-ldifdir"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: this.state.errObjConfig["nsslapd-schemadir"] ? "Invalid schema directory path!" : "The location for the servers custom schema files. (nsslapd-schemadir)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Schema Directory"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-schemadir"],
              type: "text",
              id: "nsslapd-schemadir",
              "aria-describedby": "horizontal-form-name-helper",
              name: "server-schemadir",
              onChange: (str, e) => {
                this.handleChange(e, "config");
              },
              validated: this.state.errObjConfig["nsslapd-schemadir"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: this.state.errObjConfig["nsslapd-certdir"] ? "Invalid certificate directory path!" : "The location of the server's certificates (nsslapd-certdir)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Certificate Directory"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-certdir"],
              type: "text",
              id: "nsslapd-certdir",
              "aria-describedby": "horizontal-form-name-helper",
              name: "server-certdir",
              onChange: (str, e) => {
                this.handleChange(e, "config");
              },
              validated: this.state.errObjConfig["nsslapd-certdir"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        )), /* @__PURE__ */ import_react113.default.createElement(
          Button,
          {
            isDisabled: this.state.configSaveDisabled || this.state.configReloading,
            variant: "primary",
            className: "ds-margin-top-xlg",
            onClick: this.handleSaveConfig,
            isLoading: this.state.configReloading,
            spinnerAriaValueText: this.state.configReloading ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react113.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react113.default.createElement(TabTitleText, null, "Directory Manager") }, /* @__PURE__ */ import_react113.default.createElement(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The DN of the unrestricted directory manager (nsslapd-rootdn)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Directory Manager DN"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-rootdn"],
              type: "text",
              id: "nsslapd-rootdn",
              "aria-describedby": "horizontal-form-name-helper",
              name: "nsslapd-rootdn",
              isDisabled: true
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The password for the Root DN/Directory Manager (nsslapd-rootpw)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Directory Manager Password"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-rootpw"],
              type: "password",
              id: "nsslapd-rootpw",
              "aria-describedby": "horizontal-form-name-helper",
              name: "nsslapd-rootpw",
              onChange: (str, e) => {
                this.handleChange(e, "rootdn");
              },
              validated: this.state.errObjRootDN["nsslapd-rootpw"] ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "Confirm the Directory Manager password"
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Confirm Password"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state.confirmRootpw,
              type: "password",
              id: "confirmRootpw",
              "aria-describedby": "horizontal-form-name-helper",
              name: "confirmRootpw",
              onChange: (str, e) => {
                this.handleChange(e, "rootdn");
              },
              validated: this.state.errObjRootDN.confirmRootpw ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "Set the Directory Manager password storage scheme (nsslapd-rootpwstoragescheme)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Password Storage Scheme"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            FormSelect,
            {
              id: "nsslapd-rootpwstoragescheme",
              value: this.state["nsslapd-rootpwstoragescheme"],
              onChange: (str, e) => {
                this.handleChange(e, "rootdn");
              },
              "aria-label": "FormSelect Input"
            },
            this.options.map((option, index) => /* @__PURE__ */ import_react113.default.createElement(FormSelectOption, { key: index, value: option.value, label: option.label }))
          ))
        )), /* @__PURE__ */ import_react113.default.createElement(
          Button,
          {
            variant: "primary",
            className: "ds-margin-top-xlg",
            isDisabled: this.state.rootDNSaveDisabled || this.state.rootDNReloading,
            onClick: this.handleSaveRootDN,
            isLoading: this.state.rootDNReloading,
            spinnerAriaValueText: this.state.rootDNReloading ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react113.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react113.default.createElement(TabTitleText, null, "Disk Monitoring") }, /* @__PURE__ */ import_react113.default.createElement(Form, { className: "ds-margin-left ds-margin-top-xlg", autoComplete: "off" }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-disk-monitoring",
            isChecked: this.state["nsslapd-disk-monitoring"],
            onChange: (str, e) => {
              this.handleChange(e, "diskmon");
            },
            label: "Enable Disk Space Monitoring"
          }
        )), diskMonitor, /* @__PURE__ */ import_react113.default.createElement(
          Button,
          {
            isDisabled: this.state.diskMonSaveDisabled || this.state.diskMonReloading,
            variant: "primary",
            className: "ds-margin-top-xlg",
            onClick: this.handleSaveDiskMonitoring,
            isLoading: this.state.diskMonReloading,
            spinnerAriaValueText: this.state.diskMonReloading ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react113.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react113.default.createElement(TabTitleText, null, "Advanced Settings") }, /* @__PURE__ */ import_react113.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react113.default.createElement(Grid, null, /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-schemacheck",
            isChecked: this.state["nsslapd-schemacheck"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "Enable schema checking (nsslapd-schemacheck).",
            "aria-label": "uncontrolled checkbox example",
            label: "Enable Schema Checking"
          }
        )), /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-syntaxcheck",
            isChecked: this.state["nsslapd-syntaxcheck"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "Enable attribute syntax checking (nsslapd-syntaxcheck).",
            label: "Enable Attribute Syntax Checking"
          }
        ))), /* @__PURE__ */ import_react113.default.createElement(Grid, null, /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-plugin-logging",
            isChecked: this.state["nsslapd-plugin-logging"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "Enable plugins to log access and audit events.  (nsslapd-plugin-logging).",
            label: "Enable Plugin Logging"
          }
        )), /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-syntaxlogging",
            isChecked: this.state["nsslapd-syntaxlogging"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "Enable syntax logging (nsslapd-syntaxlogging).",
            label: "Enable Attribute Syntax Logging"
          }
        ))), /* @__PURE__ */ import_react113.default.createElement(Grid, null, /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-plugin-binddn-tracking",
            isChecked: this.state["nsslapd-plugin-binddn-tracking"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            label: "Enable Plugin Bind DN Tracking",
            title: "Enabling this feature will write new operational attributes to the modified entry: internalModifiersname & internalCreatorsname. These new attributes contain the plugin DN, while modifiersname will be the original binding entry that triggered the update. (nsslapd-plugin-binddn-tracking)."
          }
        )), /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-attribute-name-exceptions",
            isChecked: this.state["nsslapd-attribute-name-exceptions"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "Allows non-standard characters in attribute names to be used for backwards compatibility with older servers (nsslapd-attribute-name-exceptions).",
            label: "Allow Attribute Naming Exceptions"
          }
        ))), /* @__PURE__ */ import_react113.default.createElement(Grid, null, /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-dn-validate-strict",
            isChecked: this.state["nsslapd-dn-validate-strict"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            label: "Strict DN Syntax Validation",
            title: "Enables strict syntax validation for DNs, according to section 3 in RFC 4514 (nsslapd-dn-validate-strict)."
          }
        )), /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-entryusn-global",
            isChecked: this.state["nsslapd-entryusn-global"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "For USN plugin - maintain unique USNs across all back end databases (nsslapd-entryusn-global).",
            label: "Maintain Unique USNs Across All Backends"
          }
        ))), /* @__PURE__ */ import_react113.default.createElement(Grid, null, /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-ignore-time-skew",
            isChecked: this.state["nsslapd-ignore-time-skew"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "Ignore replication time skew when acquiring a replica to start a replciation session (nsslapd-ignore-time-skew).",
            label: "Ignore CSN Time Skew"
          }
        )), /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react113.default.createElement(
          Checkbox,
          {
            id: "nsslapd-readonly",
            isChecked: this.state["nsslapd-readonly"],
            onChange: (str, e) => {
              this.handleChange(e, "adv");
            },
            title: "Make entire server read-only (nsslapd-readonly)",
            label: "Server Read-Only"
          }
        ))), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            className: "ds-margin-top",
            title: "Allow anonymous binds to the server (nsslapd-allow-anonymous-access)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Allow Anonymous Access"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            FormSelect,
            {
              id: "nsslapd-allow-anonymous-access",
              value: this.state["nsslapd-allow-anonymous-access"],
              onChange: (str, e) => {
                this.handleChange(e, "adv");
              },
              "aria-label": "FormSelect Input"
            },
            /* @__PURE__ */ import_react113.default.createElement(FormSelectOption, { key: "0", value: "on", label: "on" }),
            /* @__PURE__ */ import_react113.default.createElement(FormSelectOption, { key: "1", value: "off", label: "off" }),
            /* @__PURE__ */ import_react113.default.createElement(
              FormSelectOption,
              {
                key: "2",
                value: "rootdse",
                label: "rootdse",
                title: "Allows anonymous search and read access to search the root DSE itself, but restricts access to all other directory entries. "
              }
            )
          ))
        ), /* @__PURE__ */ import_react113.default.createElement(
          Grid,
          {
            title: "The DN of a template entry containing the resource limits to apply to anonymous connections (nsslapd-anonlimitsdn)."
          },
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Anonymous Resource Limits DN"),
          /* @__PURE__ */ import_react113.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react113.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-anonlimitsdn"],
              type: "text",
              id: "nsslapd-anonlimitsdn",
              "aria-describedby": "horizontal-form-name-helper",
              name: "nsslapd-anonlimitsdn",
              onChange: (str, e) => {
                this.handleChange(e, "adv");
              },
              validated: this.state.errObjAdv.anonLimitsDN ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        )), /* @__PURE__ */ import_react113.default.createElement(
          Button,
          {
            isDisabled: this.state.advSaveDisabled || this.state.advReloading,
            variant: "primary",
            className: "ds-margin-top-xlg",
            onClick: this.handleSaveAdvanced,
            isLoading: this.state.advReloading,
            spinnerAriaValueText: this.state.advReloading ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )))));
      }
      return /* @__PURE__ */ import_react113.default.createElement(
        "div",
        {
          id: "server-settings-page",
          className: this.state.configReloading || this.state.rootDNReloading || this.state.diskMonReloading || this.state.advReloading ? "ds-disabled" : ""
        },
        body
      );
    }
  };
  ServerSettings.propTypes = {
    addNotification: import_prop_types91.default.func,
    serverId: import_prop_types91.default.string,
    version: import_prop_types91.default.string,
    attrs: import_prop_types91.default.object
  };
  ServerSettings.defaultProps = {
    serverId: "",
    version: "",
    attrs: {}
  };

  // src/lib/server/tuning.jsx
  var import_react114 = __toESM(require_react(), 1);
  var import_prop_types92 = __toESM(require_prop_types(), 1);
  var tuning_attrs = [
    "nsslapd-ndn-cache-enabled",
    "nsslapd-ignore-virtual-attrs",
    "nsslapd-connection-nocanon",
    "nsslapd-enable-turbo-mode",
    "nsslapd-threadnumber",
    "nsslapd-maxdescriptors",
    "nsslapd-timelimit",
    "nsslapd-sizelimit",
    "nsslapd-pagedsizelimit",
    "nsslapd-idletimeout",
    "nsslapd-ioblocktimeout",
    "nsslapd-outbound-ldap-io-timeout",
    "nsslapd-maxbersize",
    "nsslapd-maxsasliosize",
    "nsslapd-listen-backlog-size",
    "nsslapd-max-filter-nest-level",
    "nsslapd-ndn-cache-max-size"
  ];
  var ServerTuning = class extends import_react114.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        loaded: false,
        activeKey: 1,
        saveDisabled: true,
        errObj: {},
        attrs: this.props.attrs,
        isExpanded: false
      };
      this.handleOnToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.maxValue = 2e9;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onConfigChange = (event, id, min3, max3) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      for (const config_attr of tuning_attrs) {
        if (this.state[config_attr].toString() !== this.state["_" + config_attr].toString()) {
          saveBtnDisabled = false;
          break;
        }
      }
      this.setState({
        saveDisabled: saveBtnDisabled
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    loadConfig(reloading) {
      if (reloading) {
        this.setState({
          loaded: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("loadConfig", "Load server tuning configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let ndnEnabled = false;
        let ignoreVirtAttrs = false;
        let connNoCannon = false;
        let turboMode = false;
        if (attrs["nsslapd-ndn-cache-enabled"][0] === "on") {
          ndnEnabled = true;
        }
        if (attrs["nsslapd-ignore-virtual-attrs"][0] === "on") {
          ignoreVirtAttrs = true;
        }
        if (attrs["nsslapd-connection-nocanon"][0] === "on") {
          connNoCannon = true;
        }
        if (attrs["nsslapd-enable-turbo-mode"][0] === "on") {
          turboMode = true;
        }
        this.setState({
          loaded: true,
          loading: false,
          saveDisabled: true,
          // Settings
          "nsslapd-ndn-cache-enabled": ndnEnabled,
          "nsslapd-ignore-virtual-attrs": ignoreVirtAttrs,
          "nsslapd-connection-nocanon": connNoCannon,
          "nsslapd-enable-turbo-mode": turboMode,
          "nsslapd-threadnumber": attrs["nsslapd-threadnumber"][0],
          "nsslapd-maxdescriptors": attrs["nsslapd-maxdescriptors"][0],
          "nsslapd-timelimit": attrs["nsslapd-timelimit"][0],
          "nsslapd-sizelimit": attrs["nsslapd-sizelimit"][0],
          "nsslapd-pagedsizelimit": attrs["nsslapd-pagedsizelimit"][0],
          "nsslapd-idletimeout": attrs["nsslapd-idletimeout"][0],
          "nsslapd-ioblocktimeout": attrs["nsslapd-ioblocktimeout"][0],
          "nsslapd-outbound-ldap-io-timeout": attrs["nsslapd-outbound-ldap-io-timeout"][0],
          "nsslapd-maxbersize": attrs["nsslapd-maxbersize"][0],
          "nsslapd-maxsasliosize": attrs["nsslapd-maxsasliosize"][0],
          "nsslapd-listen-backlog-size": attrs["nsslapd-listen-backlog-size"][0],
          "nsslapd-max-filter-nest-level": attrs["nsslapd-max-filter-nest-level"][0],
          "nsslapd-ndn-cache-max-size": attrs["nsslapd-ndn-cache-max-size"][0],
          // Record original values
          "_nsslapd-ndn-cache-enabled": ndnEnabled,
          "_nsslapd-ignore-virtual-attrs": ignoreVirtAttrs,
          "_nsslapd-connection-nocanon": connNoCannon,
          "_nsslapd-enable-turbo-mode": turboMode,
          "_nsslapd-threadnumber": attrs["nsslapd-threadnumber"][0],
          "_nsslapd-maxdescriptors": attrs["nsslapd-maxdescriptors"][0],
          "_nsslapd-timelimit": attrs["nsslapd-timelimit"][0],
          "_nsslapd-sizelimit": attrs["nsslapd-sizelimit"][0],
          "_nsslapd-pagedsizelimit": attrs["nsslapd-pagedsizelimit"][0],
          "_nsslapd-idletimeout": attrs["nsslapd-idletimeout"][0],
          "_nsslapd-ioblocktimeout": attrs["nsslapd-ioblocktimeout"][0],
          "_nsslapd-outbound-ldap-io-timeout": attrs["nsslapd-outbound-ldap-io-timeout"][0],
          "_nsslapd-maxbersize": attrs["nsslapd-maxbersize"][0],
          "_nsslapd-maxsasliosize": attrs["nsslapd-maxsasliosize"][0],
          "_nsslapd-listen-backlog-size": attrs["nsslapd-listen-backlog-size"][0],
          "_nsslapd-max-filter-nest-level": attrs["nsslapd-max-filter-nest-level"][0],
          "_nsslapd-ndn-cache-max-size": attrs["nsslapd-ndn-cache-max-size"][0]
        }, this.props.enableTree());
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loaded: true
        });
        this.props.addNotification(
          "error",
          `Error loading server configuration - ${errMsg.desc}`
        );
      });
    }
    handleSaveConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      this.setState({
        loading: true
      });
      for (const attr of tuning_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveConfig", "Saving Tuning configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadConfig();
        this.props.addNotification(
          "success",
          "Successfully updated tuning configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.loadConfig();
        this.props.addNotification(
          "error",
          `Error updating tuning configuration - ${errMsg.desc}`
        );
      });
    }
    render() {
      let body = "";
      let saveBtnName = "Save Settings";
      const extraPrimaryProps = {};
      if (this.state.loading) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react114.default.createElement("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react114.default.createElement(TextContent, null, /* @__PURE__ */ import_react114.default.createElement(Text, { component: TextVariants.h3 }, "Loading Tuning Configuration ...")), /* @__PURE__ */ import_react114.default.createElement(Spinner, { className: "ds-margin-top", size: "lg" }));
      } else {
        body = /* @__PURE__ */ import_react114.default.createElement("div", { className: this.state.loading ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md" }, /* @__PURE__ */ import_react114.default.createElement(Grid, null, /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react114.default.createElement(TextContent, null, /* @__PURE__ */ import_react114.default.createElement(Text, { component: TextVariants.h3 }, "Tuning & Limits", /* @__PURE__ */ import_react114.default.createElement(
          FontAwesomeIcon,
          {
            size: "lg",
            className: "ds-left-margin ds-refresh",
            icon: faSyncAlt,
            title: "Refresh settings",
            onClick: () => {
              this.loadConfig(1);
            }
          }
        ))))), /* @__PURE__ */ import_react114.default.createElement(Form, { className: "ds-left-margin", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react114.default.createElement(
          Grid,
          {
            className: "ds-margin-top-xlg",
            title: "The number of worker threads that handle database operations.  Set to '-1' for enable auto tuning. (nsslapd-threadnumber)."
          },
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Number Of Worker Threads"),
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-threadnumber"],
              min: -1,
              max: 512,
              onMinus: () => {
                this.onMinusConfig("nsslapd-threadnumber");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-threadnumber", -1, 512);
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-threadnumber");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react114.default.createElement(
          Grid,
          {
            title: "The maximum number of seconds allocated for a search request.  Set to '-1' to disable the time limit (nsslapd-timelimit)."
          },
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Search Time Limit"),
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-timelimit"],
              min: -1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsslapd-timelimit");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-timelimit", -1, 0);
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-timelimit");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react114.default.createElement(
          Grid,
          {
            title: "The maximum number of entries to return from a search operation.  Set to '-1' to disable the size limit (nsslapd-sizelimit)."
          },
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Search Size Limit"),
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-sizelimit"],
              min: -1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsslapd-sizelimit");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-sizelimit", -1, 0);
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-sizelimit");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react114.default.createElement(
          Grid,
          {
            title: "The maximum number of entries to return from a paged search operation. Set to '-1' to disable the size limit (nsslapd-pagedsizelimit)."
          },
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Paged Search Size Limit"),
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-pagedsizelimit"],
              min: -1,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsslapd-pagedsizelimit");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-pagedsizelimit", -1, 0);
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-pagedsizelimit");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react114.default.createElement(
          Grid,
          {
            title: "Sets the amount of time in seconds after which an idle LDAP client connection is closed by the server (nsslapd-idletimeout)."
          },
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Idle Connection Timeout"),
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-idletimeout"],
              min: 0,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsslapd-idletimeout");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-idletimeout", 0, 0);
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-idletimeout");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        ), /* @__PURE__ */ import_react114.default.createElement(
          Grid,
          {
            title: "Sets the amount of time in milliseconds after which the connection to a stalled LDAP client is closed (nsslapd-ioblocktimeout)."
          },
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "I/O Block Timeout"),
          /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
            NumberInput,
            {
              value: this.state["nsslapd-ioblocktimeout"],
              min: 0,
              max: this.maxValue,
              onMinus: () => {
                this.onMinusConfig("nsslapd-ioblocktimeout");
              },
              onChange: (e) => {
                this.onConfigChange(e, "nsslapd-ioblocktimeout", 0, 0);
              },
              onPlus: () => {
                this.onPlusConfig("nsslapd-ioblocktimeout");
              },
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ))
        )), /* @__PURE__ */ import_react114.default.createElement(
          ExpandableSection,
          {
            className: "ds-margin-top-xlg",
            toggleText: this.state.isExpanded ? "Hide Advanced Settings" : "Show Advanced Settings",
            onToggle: this.handleOnToggle,
            isExpanded: this.state.isExpanded
          },
          /* @__PURE__ */ import_react114.default.createElement("div", { className: "ds-margin-top ds-indent" }, /* @__PURE__ */ import_react114.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              className: "ds-margin-top",
              title: "Sets the I/O wait time for all outbound LDAP connections (nsslapd-outbound-ldap-io-timeout)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Outbound IO Timeout"),
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
              NumberInput,
              {
                value: this.state["nsslapd-outbound-ldap-io-timeout"],
                min: 0,
                max: this.maxValue,
                onMinus: () => {
                  this.onMinusConfig("nsslapd-outbound-ldap-io-timeout");
                },
                onChange: (e) => {
                  this.onConfigChange(e, "nsslapd-outbound-ldap-io-timeout", 0, 0);
                },
                onPlus: () => {
                  this.onPlusConfig("nsslapd-outbound-ldap-io-timeout");
                },
                inputName: "input",
                inputAriaLabel: "number input",
                minusBtnAriaLabel: "minus",
                plusBtnAriaLabel: "plus",
                widthChars: 8
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "The maximum size in bytes allowed for an incoming message (nsslapd-maxbersize)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum BER Size"),
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
              NumberInput,
              {
                value: this.state["nsslapd-maxbersize"],
                min: 0,
                max: this.maxValue,
                onMinus: () => {
                  this.onMinusConfig("nsslapd-maxbersize");
                },
                onChange: (e) => {
                  this.onConfigChange(e, "nsslapd-maxbersize", 0, 0);
                },
                onPlus: () => {
                  this.onPlusConfig("nsslapd-maxbersize");
                },
                inputName: "input",
                inputAriaLabel: "number input",
                minusBtnAriaLabel: "minus",
                plusBtnAriaLabel: "plus",
                widthChars: 8
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "The maximum allowed SASL IO packet size that the server will accept (nsslapd-maxsasliosize)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum SASL IO Size"),
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
              NumberInput,
              {
                value: this.state["nsslapd-maxsasliosize"],
                min: -1,
                max: this.maxValue,
                onMinus: () => {
                  this.onMinusConfig("nsslapd-maxsasliosize");
                },
                onChange: (e) => {
                  this.onConfigChange(e, "nsslapd-maxsasliosize", -1, 0);
                },
                onPlus: () => {
                  this.onPlusConfig("nsslapd-maxsasliosize");
                },
                inputName: "input",
                inputAriaLabel: "number input",
                minusBtnAriaLabel: "minus",
                plusBtnAriaLabel: "plus",
                widthChars: 8
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "The maximum length for how long the connection queue for the socket can grow before refusing connections (nsslapd-listen-backlog-size)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Listen Backlog Size"),
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
              NumberInput,
              {
                value: this.state["nsslapd-listen-backlog-size"],
                min: 1,
                max: this.maxValue,
                onMinus: () => {
                  this.onMinusConfig("nsslapd-listen-backlog-size");
                },
                onChange: (e) => {
                  this.onConfigChange(e, "nsslapd-listen-backlog-size", 1, 0);
                },
                onPlus: () => {
                  this.onPlusConfig("nsslapd-listen-backlog-size");
                },
                inputName: "input",
                inputAriaLabel: "number input",
                minusBtnAriaLabel: "minus",
                plusBtnAriaLabel: "plus",
                widthChars: 8
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "Sets how deep a nested search filter is analysed (nsslapd-max-filter-nest-level)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Nested Filter Level"),
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react114.default.createElement(
              NumberInput,
              {
                value: this.state["nsslapd-max-filter-nest-level"],
                min: -1,
                max: this.maxValue,
                onMinus: () => {
                  this.onMinusConfig("nsslapd-max-filter-nest-level");
                },
                onChange: (e) => {
                  this.onConfigChange(e, "nsslapd-max-filter-nest-level", -1, 0);
                },
                onPlus: () => {
                  this.onPlusConfig("nsslapd-max-filter-nest-level");
                },
                inputName: "input",
                inputAriaLabel: "number input",
                minusBtnAriaLabel: "minus",
                plusBtnAriaLabel: "plus",
                widthChars: 8
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "Disable DNS reverse entries for outgoing connections (nsslapd-connection-nocanon)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react114.default.createElement(
              Checkbox,
              {
                id: "nsslapd-connection-nocanon",
                isChecked: this.state["nsslapd-connection-nocanon"],
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                label: "Disable Reverse DNS Lookups"
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "Sets the worker threads to continuously read a connection without passing it back to the polling mechanism. (nsslapd-enable-turbo-mode)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react114.default.createElement(
              Checkbox,
              {
                id: "nsslapd-enable-turbo-mode",
                isChecked: this.state["nsslapd-enable-turbo-mode"],
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                label: "Enable Connection Turbo Mode"
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "Disable the virtual attribute lookup in a search entry (nsslapd-ignore-virtual-attrs)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react114.default.createElement(
              Checkbox,
              {
                id: "nsslapd-ignore-virtual-attrs",
                isChecked: this.state["nsslapd-ignore-virtual-attrs"],
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                label: "Disable Virtual Attribute Lookups"
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "Enable the normalized DN cache.  Each thread has its own cache (nsslapd-ndn-cache-enabled)."
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react114.default.createElement(
              Checkbox,
              {
                isChecked: this.state["nsslapd-ndn-cache-enabled"],
                id: "nsslapd-ndn-cache-enabled",
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                label: "Enable Normalized DN Cache"
              }
            ))
          ), /* @__PURE__ */ import_react114.default.createElement(
            Grid,
            {
              title: "The max NDN cache size in bytes (nsslapd-ndn-cache-max-size).",
              className: "ds-left-indent-lg"
            },
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { className: "ds-label", span: 2 }, "NDN Max Cache Size"),
            /* @__PURE__ */ import_react114.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react114.default.createElement(
              NumberInput,
              {
                isDisabled: !this.state["nsslapd-ndn-cache-enabled"],
                value: this.state["nsslapd-ndn-cache-max-size"],
                min: -1,
                max: this.maxValue,
                onMinus: () => {
                  this.onMinusConfig("nsslapd-ndn-cache-max-size");
                },
                onChange: (e) => {
                  this.onConfigChange(e, "nsslapd-ndn-cache-max-size", -1, 0);
                },
                onPlus: () => {
                  this.onPlusConfig("nsslapd-ndn-cache-max-size");
                },
                inputName: "input",
                inputAriaLabel: "number input",
                minusBtnAriaLabel: "minus",
                plusBtnAriaLabel: "plus",
                widthChars: 8
              }
            ))
          )))
        ), /* @__PURE__ */ import_react114.default.createElement(
          Button,
          {
            isDisabled: this.state.saveDisabled || this.state.loading,
            variant: "primary",
            className: "ds-margin-top-xlg",
            onClick: this.handleSaveConfig,
            isLoading: this.state.loading,
            spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        ));
      }
      return /* @__PURE__ */ import_react114.default.createElement("div", { id: "tuning-content" }, body);
    }
  };
  ServerTuning.propTypes = {
    addNotification: import_prop_types92.default.func,
    serverId: import_prop_types92.default.string,
    attrs: import_prop_types92.default.object
  };
  ServerTuning.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/sasl.jsx
  var import_react117 = __toESM(require_react(), 1);

  // src/lib/server/serverTables.jsx
  var import_react115 = __toESM(require_react(), 1);
  var import_prop_types93 = __toESM(require_prop_types(), 1);
  var SASLTable = class extends import_react115.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        dropdownIsOpen: false,
        columns: [
          {
            title: "Mapping Name",
            transforms: [sortable],
            cellFormatters: [expandable]
          },
          { title: "Search Base", transforms: [sortable] },
          { title: "Priority", transforms: [sortable] }
        ]
      };
      this.handleOnSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handleOnPerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleOnCollapse = this.handleOnCollapse.bind(this);
      this.handleOnSearchChange = this.handleOnSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          3: this.state.rows[idx].cells[2],
          regex: this.state.rows[idx].regex,
          filter: this.state.rows[idx].filter
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2],
            srow[3]
          ],
          regex: srow.regex,
          filter: srow.filter
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(regex, filter) {
      return /* @__PURE__ */ import_react115.default.createElement(Grid, { className: "ds-left-indent-lg" }, /* @__PURE__ */ import_react115.default.createElement(GridItem, { span: 3 }, "Regular Expression:"), /* @__PURE__ */ import_react115.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react115.default.createElement("b", null, regex)), /* @__PURE__ */ import_react115.default.createElement(GridItem, { span: 3 }, "Search Filter:"), /* @__PURE__ */ import_react115.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react115.default.createElement("b", null, filter)));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let count = 0;
      for (const row of this.props.rows) {
        rows.push(
          {
            isOpen: false,
            cells: [row.cn[0], row.nssaslmapbasedntemplate[0], row.nssaslmappriority[0]],
            regex: row.nssaslmapregexstring[0],
            filter: row.nssaslmapfiltertemplate[0]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row.nssaslmapregexstring[0], row.nssaslmapfiltertemplate[0]) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No SASL Mappings"] }];
        columns = [{ title: "SASL Mappings" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleOnCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleOnSearchChange(value, event) {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        const val = value.toLowerCase();
        if (val !== "" && row.cn[0].toLowerCase().indexOf(val) === -1 && row.nssaslmapbasedntemplate[0].toLowerCase().indexOf(val) === -1 && row.nssaslmappriority[0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [row.cn[0], row.nssaslmapbasedntemplate[0], row.nssaslmappriority[0]],
            regex: row.nssaslmapregexstring[0],
            filter: row.nssaslmapfiltertemplate[0]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(row.nssaslmapregexstring[0], row.nssaslmapfiltertemplate[0]) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Mapping",
          onClick: (event, rowId, rowData, extra) => this.props.editMapping(
            rowData.cells[0],
            rowData.regex,
            rowData.cells[1],
            rowData.filter,
            rowData.cells[2]
          )
        },
        {
          title: "Delete Mapping",
          onClick: (event, rowId, rowData, extra) => this.props.deleteMapping(rowData.cells[0])
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react115.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react115.default.createElement(
        SearchInput,
        {
          placeholder: "Search Mappings",
          value: this.state.value,
          onChange: this.handleOnSearchChange,
          onClear: (evt) => this.handleOnSearchChange("", evt)
        }
      ), /* @__PURE__ */ import_react115.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "sasl table",
          cells: columns,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          onCollapse: this.handleOnCollapse,
          actions: tableRows.length > 0 ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react115.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react115.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react115.default.createElement(
        Pagination,
        {
          itemCount: this.state.rows.length / 2,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleOnSetPage,
          onPerPageSelect: this.handleOnPerPageSelect
        }
      ));
    }
  };
  SASLTable.propTypes = {
    rows: import_prop_types93.default.array,
    editMapping: import_prop_types93.default.func,
    deleteMapping: import_prop_types93.default.func
  };
  SASLTable.defaultProps = {
    rows: []
  };

  // src/lib/server/serverModals.jsx
  var import_react116 = __toESM(require_react(), 1);
  var import_prop_types94 = __toESM(require_prop_types(), 1);
  var SASLMappingModal = class extends import_react116.default.Component {
    render() {
      let title = this.props.type;
      let btnText = "Create Mapping";
      const extraPrimaryProps = {};
      if (title !== "Create") {
        btnText = "Save Mapping";
      }
      title = title + " SASL Mapping";
      if (this.props.spinning) {
        btnText = "Saving...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      return /* @__PURE__ */ import_react116.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title,
          isOpen: this.props.showModal,
          onClose: this.props.handleClose,
          actions: [
            /* @__PURE__ */ import_react116.default.createElement(
              Button,
              {
                key: "confirm",
                isDisabled: this.props.saveDisabled || this.props.spinning,
                variant: "primary",
                isLoading: this.props.spinning,
                spinnerAriaValueText: this.props.spinning ? "Loading" : void 0,
                onClick: () => {
                  this.props.saveHandler(this.props.name);
                },
                ...extraPrimaryProps
              },
              btnText
            ),
            /* @__PURE__ */ import_react116.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.props.handleClose }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react116.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react116.default.createElement(
          Grid,
          {
            title: "SASL Mapping entry name",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { className: "ds-label", span: 3 }, "SASL Mapping Name"),
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react116.default.createElement(
            TextInput,
            {
              value: this.props.name,
              type: "text",
              id: "saslMapName",
              "aria-describedby": "horizontal-form-name-helper",
              name: "saslMapName",
              onChange: (str, e) => {
                this.props.handleChange(e);
              },
              validated: this.props.error.saslMapName ? ValidatedOptions.error : ValidatedOptions.default,
              isRequired: true,
              isDisabled: this.props.type === "Edit"
            }
          ), /* @__PURE__ */ import_react116.default.createElement(FormHelperText, { isError: true, isHidden: !this.props.error.saslMapName }, "You must provide a name for this mapping"))
        ), /* @__PURE__ */ import_react116.default.createElement(
          Grid,
          {
            title: "SASL Mapping Regular Expression"
          },
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Regular Expression"),
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react116.default.createElement(
            TextInput,
            {
              value: this.props.regex,
              type: "text",
              id: "saslMapRegex",
              "aria-describedby": "horizontal-form-name-helper",
              name: "saslMapRegex",
              onChange: (str, e) => {
                this.props.handleChange(e);
              },
              isRequired: true,
              validated: this.props.error.saslMapRegex ? ValidatedOptions.error : ValidatedOptions.default
            }
          ), /* @__PURE__ */ import_react116.default.createElement(FormHelperText, { isError: true, isHidden: !this.props.error.saslMapRegex }, "You must provide a valid regular expression"))
        ), /* @__PURE__ */ import_react116.default.createElement(
          Grid,
          {
            title: "Test Regular Expression"
          },
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { className: "ds-label", span: 3 }, /* @__PURE__ */ import_react116.default.createElement("font", { size: "2" }, "* Test Regex")),
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react116.default.createElement(
            TextInput,
            {
              value: this.props.testText,
              type: "text",
              id: "saslTestText",
              "aria-describedby": "horizontal-form-name-helper",
              name: "saslTestText",
              onChange: (str, e) => {
                this.props.handleChange(e);
              },
              placeholder: "Enter text to test regex"
            }
          )),
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react116.default.createElement(
            Button,
            {
              className: "ds-left-margin",
              isDisabled: this.props.testBtnDisabled || this.props.error.saslMapRegex,
              variant: "primary",
              onClick: this.props.handleTestRegex
            },
            "Test It"
          ))
        ), /* @__PURE__ */ import_react116.default.createElement(
          Grid,
          {
            title: "The search base or a specific entry DN to match against the constructed DN"
          },
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { className: "ds-label", span: 3 }, "SASL Mapping Base"),
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react116.default.createElement(
            TextInput,
            {
              value: this.props.base,
              type: "text",
              id: "saslBase",
              "aria-describedby": "horizontal-form-name-helper",
              name: "saslBase",
              onChange: (str, e) => {
                this.props.handleChange(e);
              },
              isRequired: true,
              validated: this.props.error.saslBase ? ValidatedOptions.error : ValidatedOptions.default
            }
          ), /* @__PURE__ */ import_react116.default.createElement(FormHelperText, { isError: true, isHidden: !this.props.error.saslBase }, "You must provide a search base"))
        ), /* @__PURE__ */ import_react116.default.createElement(
          Grid,
          {
            title: "SASL mapping search filter"
          },
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { className: "ds-label", span: 3 }, "SASL Mapping Filter"),
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react116.default.createElement(
            TextInput,
            {
              value: this.props.filter,
              type: "text",
              id: "saslFilter",
              "aria-describedby": "horizontal-form-name-helper",
              name: "saslFilter",
              onChange: (str, e) => {
                this.props.handleChange(e);
              },
              isRequired: true,
              validated: this.props.error.saslFilter ? ValidatedOptions.error : ValidatedOptions.default
            }
          ), /* @__PURE__ */ import_react116.default.createElement(FormHelperText, { isError: true, isHidden: !this.props.error.saslFilter }, "You must provide an LDAP search filter"))
        ), /* @__PURE__ */ import_react116.default.createElement(
          Grid,
          {
            title: "Set the mapping priority for which mappings should be tried first"
          },
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { className: "ds-label", span: 3 }, "SASL Mapping Priority"),
          /* @__PURE__ */ import_react116.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react116.default.createElement(
            TextInput,
            {
              value: this.props.priority,
              type: "number",
              id: "saslPriority",
              "aria-describedby": "horizontal-form-name-helper",
              name: "saslPriority",
              onChange: (str, e) => {
                this.props.handleChange(e);
              },
              validated: this.props.error.saslPriority ? ValidatedOptions.error : ValidatedOptions.default
            }
          ), /* @__PURE__ */ import_react116.default.createElement(FormHelperText, { isError: true, isHidden: !this.props.error.saslPriority }, "Priority must be between 1 and 100"))
        ))
      );
    }
  };
  SASLMappingModal.propTypes = {
    showModal: import_prop_types94.default.bool,
    testBtnDisabled: import_prop_types94.default.bool,
    saveDisabled: import_prop_types94.default.bool,
    closeHandler: import_prop_types94.default.func,
    handleChange: import_prop_types94.default.func,
    handleTestRegex: import_prop_types94.default.func,
    saveHandler: import_prop_types94.default.func,
    error: import_prop_types94.default.object,
    name: import_prop_types94.default.string,
    regex: import_prop_types94.default.string,
    testText: import_prop_types94.default.string,
    base: import_prop_types94.default.string,
    filter: import_prop_types94.default.string,
    priority: import_prop_types94.default.string,
    spinning: import_prop_types94.default.bool
  };
  SASLMappingModal.defaultProps = {
    showModal: false,
    testBtnDisabled: true,
    saveDisabled: true,
    error: {},
    name: "",
    regex: "",
    testText: "",
    base: "",
    filter: "",
    priority: "",
    spinning: import_prop_types94.default.bool
  };

  // src/lib/server/sasl.jsx
  var ServerSASL = class extends import_react117.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        configLoading: false,
        tableLoading: false,
        loaded: false,
        activeKey: 1,
        errObj: {},
        saveDisabled: true,
        supportedMechs: [],
        mappingKey: 0,
        // Main settings
        allowedMechs: [],
        mappingFallback: false,
        maxBufSize: "",
        // Mapping modal
        showMapping: false,
        saveMappingDisabled: true,
        testRegexDisabled: true,
        testBtnDisabled: true,
        saslMapName: "",
        saslMapRegex: "",
        saslTestText: "",
        saslBase: "",
        saslFilter: "",
        saslPriority: "100",
        saslModalType: "Create",
        saslErrObj: {},
        showConfirmDelete: false,
        modalChecked: false,
        isAllowedMechOpen: false
      };
      this.handleOnAllowedMechToggle = (isAllowedMechOpen) => {
        this.setState({
          isAllowedMechOpen
        });
      };
      this.handleOnSelect = (event, selection) => {
        const { allowedMechs } = this.state;
        if (allowedMechs.includes(selection)) {
          this.setState(
            (prevState) => ({
              allowedMechs: prevState.allowedMechs.filter((item) => item !== selection),
              isAllowedMechOpen: false
            }),
            () => {
              this.validateSaveBtn();
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              allowedMechs: [...prevState.allowedMechs, selection],
              isAllowedMechOpen: false
            }),
            () => {
              this.validateSaveBtn();
            }
          );
        }
      };
      this.handleOnAllowedMechClear = () => {
        this.setState({
          allowedMechs: [],
          isAllowedMechOpen: false
        });
      };
      this.validateRegex = this.validateRegex.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onTestRegex = this.onTestRegex.bind(this);
      this.handleLoadConfig = this.handleLoadConfig.bind(this);
      this.loadMechs = this.loadMechs.bind(this);
      this.loadSASLMappings = this.loadSASLMappings.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleShowCreateMapping = this.handleShowCreateMapping.bind(this);
      this.showEditMapping = this.showEditMapping.bind(this);
      this.closeMapping = this.closeMapping.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.createMapping = this.createMapping.bind(this);
      this.editMapping = this.editMapping.bind(this);
      this.deleteMapping = this.deleteMapping.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadConfig();
      } else {
        this.props.enableTree();
      }
    }
    normalizeRegex(regex_str) {
      return regex_str.replace(/\\\(/g, "(").replace(/\\\)/g, ")");
    }
    validateRegex(regex) {
      const errObj = this.state.saslErrObj;
      let saveMappingDisabled = this.state.saveMappingDisabled;
      if (this.state.saslMapRegex === "") {
        errObj.saslMapRegex = true;
      } else {
        try {
          RegExp(this.state.saslMapRegex);
          const cleaned_regex = this.normalizeRegex(this.state.saslMapRegex);
          RegExp(cleaned_regex);
          errObj.saslMapRegex = false;
        } catch (e) {
          errObj.saslMapRegex = true;
          saveMappingDisabled = true;
        }
      }
      this.setState({
        saslErrObj: errObj,
        saveMappingDisabled
      });
      return !errObj.saslMapRegex;
    }
    onTestRegex() {
      const test_string = this.state.saslTestText;
      if (this.validateRegex()) {
        const cleaned_regex = this.normalizeRegex(this.state.saslMapRegex);
        const sasl_regex = RegExp(cleaned_regex);
        if (sasl_regex.test(test_string)) {
          this.props.addNotification(
            "success",
            "The test string matches the Regular Expression"
          );
        } else {
          this.props.addNotification(
            "warning",
            "The test string does not match the Regular Expression"
          );
        }
      } else {
        this.props.addNotification(
          "error",
          "Invalid regular expression"
        );
      }
    }
    validateSaveBtn() {
      const attrs = ["mappingFallback", "maxBufSize"];
      let disableSaveBtn = true;
      for (const attr of attrs) {
        if (this.state[attr] !== this.state["_" + attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      const orig_mechs = [...this.state._allowedMechs];
      const new_mechs = [...this.state.allowedMechs];
      if (!listsEqual(orig_mechs, new_mechs)) {
        disableSaveBtn = false;
      }
      this.setState({
        saveDisabled: disableSaveBtn
      });
    }
    handleChange(e) {
      let attr = "";
      let value = "";
      value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      attr = e.target.id;
      this.setState({
        [attr]: value,
        isAllowedMechOpen: false
      }, () => {
        this.validateSaveBtn();
      });
    }
    validateModal() {
      let disableSaveBtn = true;
      let disableRegexTestBtn = true;
      const errObj = this.state.saslErrObj;
      let error = false;
      const attrs = ["saslMapName", "saslMapRegex", "saslBase", "saslPriority", "saslFilter"];
      for (const attr of attrs) {
        if (this.state[attr] === "" || attr === "saslPriority" && this.state[attr] === "0") {
          errObj[attr] = true;
          error = true;
        } else {
          errObj[attr] = false;
        }
      }
      if (!error) {
        for (const attr of attrs) {
          if (this.state[attr] !== this.state["_" + attr]) {
            disableSaveBtn = false;
            break;
          }
        }
      }
      if (this.state.saslMapRegex !== "" && this.state.saslTestText !== "") {
        disableRegexTestBtn = false;
      }
      this.setState({
        saveMappingDisabled: disableSaveBtn,
        testBtnDisabled: disableRegexTestBtn,
        saslErrObj: errObj
      }, () => {
        this.validateRegex();
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateModal();
      });
    }
    handleLoadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleLoadConfig", "Get SASL settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let allowedMechsVal = attrs["nsslapd-allowed-sasl-mechanisms"][0];
        let allowedMechs = [];
        let fallback = false;
        if (attrs["nsslapd-sasl-mapping-fallback"][0] === "on") {
          fallback = true;
        }
        if (allowedMechsVal !== "") {
          if (allowedMechsVal.indexOf(",") > -1) {
            allowedMechsVal = allowedMechsVal.trim();
            allowedMechs = allowedMechsVal.split(",");
          } else {
            allowedMechs = allowedMechsVal.split(" ");
          }
        }
        this.setState({
          maxBufSize: attrs["nsslapd-sasl-max-buffer-size"][0],
          allowedMechs,
          mappingFallback: fallback,
          saveDisabled: true,
          // Store original values
          _maxBufSize: attrs["nsslapd-sasl-max-buffer-size"][0],
          _allowedMechs: allowedMechs,
          _mappingFallback: fallback
        }, this.loadMechs());
      });
    }
    loadMechs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "get-available-mechs"
      ];
      log_cmd("loadMechs", "Get supported SASL mechanisms", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          supportedMechs: config2.items
        }, this.loadSASLMappings());
      });
    }
    loadSASLMappings() {
      const cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", "sasl", "list", "--details"];
      log_cmd("get_and_set_sasl", "Get SASL mappings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const saslMapObj = JSON.parse(content);
        const mappings = [];
        for (const mapping of saslMapObj.items) {
          if (!("nssaslmappriority" in mapping.attrs)) {
            mapping.attrs.nssaslmappriority = ["100"];
          }
          mappings.push(mapping.attrs);
        }
        const key = this.state.mappingKey + 1;
        this.setState({
          mappings,
          mappingKey: key,
          loaded: true,
          tableLoading: false,
          configLoading: false,
          showMappingModal: false,
          showConfirmDelete: false
        }, this.props.enableTree);
      });
    }
    handleShowCreateMapping() {
      this.setState({
        showMappingModal: true,
        saveMappingDisabled: true,
        testRegexDisabled: true,
        saslModalType: "Create",
        saslMapName: "",
        saslMapRegex: "",
        saslTestText: "",
        saslBase: "",
        saslFilter: "",
        saslPriority: "100",
        saslErrObj: {}
      });
    }
    closeMapping() {
      this.setState({
        showMappingModal: false
      });
    }
    showEditMapping(name2, regex, base, filter, priority) {
      this.setState({
        showMappingModal: true,
        saveMappingDisabled: true,
        testRegexDisabled: true,
        saslModalType: "Edit",
        saslMapName: name2,
        saslMapRegex: regex,
        saslTestText: "",
        saslBase: base,
        saslFilter: filter,
        saslPriority: priority,
        // Note original values
        _saslMapName: name2,
        _saslMapRegex: regex,
        _saslTestText: "",
        _saslBase: base,
        _saslFilter: filter,
        _saslPriority: priority,
        saslErrObj: {}
      });
    }
    showConfirmDelete(name2) {
      this.setState({
        saslMapName: name2,
        modalChecked: false,
        showConfirmDelete: true
      });
    }
    closeConfirmDelete() {
      this.setState({
        modalChecked: false,
        showConfirmDelete: false
      });
    }
    createMapping() {
      this.setState({
        tableLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "create",
        "--cn=" + this.state.saslMapName,
        "--nsSaslMapFilterTemplate=" + this.state.saslFilter,
        "--nsSaslMapRegexString=" + this.state.saslMapRegex,
        "--nsSaslMapBaseDNTemplate=" + this.state.saslBase,
        "--nsSaslMapPriority=" + this.state.saslPriority
      ];
      log_cmd("createMapping", "Create sasl mapping", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadConfig();
        this.props.addNotification(
          "success",
          "Successfully create new SASL Mapping"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadConfig();
        this.props.addNotification(
          "error",
          `Error creating new SASL Mapping - ${errMsg.desc}`
        );
      });
    }
    editMapping(name2) {
      const new_mappings = this.state.mappings;
      for (const saslMap of new_mappings) {
        if (saslMap.cn[0] === name2) {
          saslMap.nssaslmapregexstring = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmapregexstring[0], loading: true, size: "sm" })];
          saslMap.nssaslmapbasedntemplate = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmapbasedntemplate[0], loading: true, size: "sm" })];
          saslMap.nssaslmapfiltertemplate = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmapfiltertemplate[0], loading: true, size: "sm" })];
          saslMap.nssaslmappriority = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmappriority[0], loading: true, size: "sm" })];
        }
      }
      this.setState({
        mappings: new_mappings,
        tableLoading: true
      });
      const delete_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "delete",
        this.state._saslMapName
      ];
      const create_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "create",
        "--cn=" + this.state.saslMapName,
        "--nsSaslMapFilterTemplate=" + this.state.saslFilter,
        "--nsSaslMapRegexString=" + this.state.saslMapRegex,
        "--nsSaslMapBaseDNTemplate=" + this.state.saslBase,
        "--nsSaslMapPriority=" + this.state.saslPriority
      ];
      log_cmd("editMapping", "deleting sasl mapping", delete_cmd);
      cockpit_default.spawn(delete_cmd, { superuser: true, err: "message" }).done((content) => {
        log_cmd("editMapping", "Create new sasl mapping", create_cmd);
        cockpit_default.spawn(create_cmd, { superuser: true, err: "message" }).done((content2) => {
          this.handleLoadConfig();
          this.props.addNotification(
            "success",
            "Successfully updated SASL Mapping"
          );
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.closeMapping();
          this.handleLoadConfig();
          this.props.addNotification(
            "error",
            `Error updating SASL Mapping - ${errMsg.desc}`
          );
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadConfig();
        this.closeMapping();
        this.props.addNotification(
          "error",
          `Error replacing SASL Mapping - ${errMsg.desc}`
        );
      });
    }
    deleteMapping() {
      const new_mappings = this.state.mappings;
      for (const saslMap of new_mappings) {
        if (saslMap.cn[0] === this.state.saslMapName) {
          saslMap.nssaslmapregexstring = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmapregexstring[0], loading: true, size: "sm" })];
          saslMap.nssaslmapbasedntemplate = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmapbasedntemplate[0], loading: true, size: "sm" })];
          saslMap.nssaslmapfiltertemplate = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmapfiltertemplate[0], loading: true, size: "sm" })];
          saslMap.nssaslmappriority = [/* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-lower-field", key: new_mappings[0].nssaslmappriority[0], loading: true, size: "sm" })];
        }
      }
      this.setState({
        mappings: new_mappings,
        tableLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "delete",
        this.state.saslMapName
      ];
      log_cmd("deleteMapping", "Delete sasl mapping", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadConfig();
        this.props.addNotification(
          "success",
          "Successfully deleted SASL Mapping"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadConfig();
        this.closeConfirmDelete();
        this.props.addNotification(
          "error",
          `Error deleting SASL Mapping - ${errMsg.desc}`
        );
      });
    }
    handleSaveConfig() {
      this.setState({
        configLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config"
      ];
      const mech_str_new = this.state.allowedMechs.join(" ");
      const mech_str_orig = this.state._allowedMechs.join(" ");
      if (mech_str_orig !== mech_str_new) {
        if (mech_str_new.length === 0) {
          cmd.push("delete");
          cmd.push("nsslapd-allowed-sasl-mechanisms");
        } else {
          cmd.push("replace");
          cmd.push("nsslapd-allowed-sasl-mechanisms=" + mech_str_new);
        }
      } else {
        cmd.push("replace");
      }
      if (this.state._mappingFallback !== this.state.mappingFallback) {
        let value = "off";
        if (this.state.mappingFallback) {
          value = "on";
        }
        cmd.push("nsslapd-sasl-mapping-fallback=" + value);
      }
      if (this.state._maxBufSize !== this.state.maxBufSize) {
        cmd.push("nsslapd-sasl-max-buffer-size=" + this.state.maxBufSize);
      }
      log_cmd("handleSaveConfig", "Applying SASL config change", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadConfig();
        this.props.addNotification(
          "warning",
          "Successfully updated SASL configuration.  These changes require the server to be restarted to take effect."
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleLoadConfig();
        this.props.addNotification(
          "error",
          `Error updating SASL configuration - ${errMsg.desc}`
        );
      });
    }
    render() {
      let body = "";
      let saveBtnName = "Save Settings";
      const extraPrimaryProps = {};
      if (this.state.configLoading) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react117.default.createElement("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react117.default.createElement(TextContent, null, /* @__PURE__ */ import_react117.default.createElement(Text, { component: TextVariants.h3 }, "Loading SASL Configuration ...")), /* @__PURE__ */ import_react117.default.createElement(Spinner, { className: "ds-margin-top", size: "lg" }));
      } else {
        body = /* @__PURE__ */ import_react117.default.createElement("div", { className: this.state.configLoading ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md" }, /* @__PURE__ */ import_react117.default.createElement(Grid, null, /* @__PURE__ */ import_react117.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react117.default.createElement(TextContent, null, /* @__PURE__ */ import_react117.default.createElement(Text, { component: TextVariants.h3 }, "SASL Settings", /* @__PURE__ */ import_react117.default.createElement(
          FontAwesomeIcon,
          {
            size: "lg",
            className: "ds-left-margin ds-refresh",
            icon: faSyncAlt,
            title: "Refresh SASL settings",
            onClick: this.handleLoadConfig
          }
        ))))), /* @__PURE__ */ import_react117.default.createElement(Form, { isHorizontal: true, autoComplete: "off", className: "ds-left-margin" }, /* @__PURE__ */ import_react117.default.createElement(Grid, { title: "The maximum SASL buffer size in bytes (nsslapd-sasl-max-buffer-size).", className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react117.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Max SASL Buffer Size"), /* @__PURE__ */ import_react117.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react117.default.createElement(
          TextInput,
          {
            value: this.state.maxBufSize,
            type: "number",
            id: "maxBufSize",
            "aria-describedby": "horizontal-form-name-helper",
            name: "maxBufSize",
            onChange: (str, e) => {
              this.handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react117.default.createElement(
          Grid,
          {
            title: "A list of SASL mechanisms the server will only accept (nsslapd-allowed-sasl-mechanisms).  The default is all mechanisms are allowed."
          },
          /* @__PURE__ */ import_react117.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Allowed SASL Mechanisms"),
          /* @__PURE__ */ import_react117.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react117.default.createElement(
            Select,
            {
              variant: SelectVariant.typeaheadMulti,
              typeAheadAriaLabel: "Type SASL mechanism to allow",
              onToggle: this.handleOnAllowedMechToggle,
              onSelect: this.handleOnSelect,
              onClear: this.handleOnAllowedMechClear,
              selections: this.state.allowedMechs,
              isOpen: this.state.isAllowedMechOpen,
              "aria-labelledby": "typeAhead-sasl-mechs",
              placeholderText: "Type SASL mechanism to allow...",
              noResultsFoundText: "There are no matching entries"
            },
            this.state.supportedMechs.map((attr, index) => /* @__PURE__ */ import_react117.default.createElement(
              SelectOption,
              {
                key: index,
                value: attr
              }
            ))
          ))
        ), /* @__PURE__ */ import_react117.default.createElement(
          Grid,
          {
            title: "Check all sasl mappings until one succeeds or they all fail (nsslapd-sasl-mapping-fallback)."
          },
          /* @__PURE__ */ import_react117.default.createElement(
            Checkbox,
            {
              isChecked: this.state.mappingFallback,
              id: "mappingFallback",
              onChange: (checked, e) => {
                this.handleChange(e);
              },
              label: "Allow SASL Mapping Fallback"
            }
          )
        )), /* @__PURE__ */ import_react117.default.createElement(
          Button,
          {
            isDisabled: this.state.saveDisabled || this.state.configLoading,
            variant: "primary",
            className: "ds-margin-top-xlg",
            onClick: this.handleSaveConfig,
            isLoading: this.state.configLoading,
            spinnerAriaValueText: this.state.configLoading ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        ), /* @__PURE__ */ import_react117.default.createElement("hr", null), /* @__PURE__ */ import_react117.default.createElement(
          Grid,
          {
            title: "A list of SASL mechanisms the server will only accept (nsslapd-allowed-sasl-mechanisms).  The default is all mechanisms are allowed.",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react117.default.createElement(TextContent, null, /* @__PURE__ */ import_react117.default.createElement(Text, { className: "ds-center ds-margin-top", component: TextVariants.h3 }, "SASL Mappings"))
        ), /* @__PURE__ */ import_react117.default.createElement(
          SASLTable,
          {
            key: this.state.mappingKey,
            rows: this.state.mappings,
            editMapping: this.showEditMapping,
            deleteMapping: this.showConfirmDelete,
            className: "ds-margin-top"
          }
        ), /* @__PURE__ */ import_react117.default.createElement(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowCreateMapping
          },
          "Create New Mapping"
        ));
      }
      return /* @__PURE__ */ import_react117.default.createElement("div", { id: "server-sasl-page" }, body, /* @__PURE__ */ import_react117.default.createElement(
        SASLMappingModal,
        {
          showModal: this.state.showMappingModal,
          testBtnDisabled: this.state.testBtnDisabled,
          saveDisabled: this.state.saveMappingDisabled,
          handleClose: this.closeMapping,
          handleChange: this.onModalChange,
          handleTestRegex: this.onTestRegex,
          saveHandler: this.state.saslModalType === "Create" ? this.createMapping : this.editMapping,
          error: this.state.saslErrObj,
          type: this.state.saslModalType,
          name: this.state.saslMapName,
          regex: this.state.saslMapRegex,
          testText: this.state.saslTestText,
          base: this.state.saslBase,
          filter: this.state.saslFilter,
          priority: this.state.saslPriority,
          spinning: this.state.tableLoading
        }
      ), /* @__PURE__ */ import_react117.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onModalChange,
          actionHandler: this.deleteMapping,
          item: this.state.saslMapName,
          checked: this.state.modalChecked,
          spinning: this.state.tableLoading,
          mTitle: "Delete SASL Mapping",
          mMsg: "Are you sure you want to delete this SASL mapping?",
          mSpinningMsg: "Deleting SASL Mapping ...",
          mBtnName: "Delete Mapping"
        }
      ));
    }
  };

  // src/lib/server/ldapi.jsx
  var import_react118 = __toESM(require_react(), 1);
  var import_prop_types95 = __toESM(require_prop_types(), 1);
  var ldapi_attrs = [
    "nsslapd-ldapifilepath",
    "nsslapd-ldapimaprootdn",
    "nsslapd-ldapientrysearchbase",
    "nsslapd-ldapigidnumbertype",
    "nsslapd-ldapiuidnumbertype"
  ];
  var ServerLDAPI = class extends import_react118.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        loaded: false,
        saveDisabled: true,
        attrs: this.props.attrs,
        attributes: [],
        isUIDOpen: false,
        isGIDOpen: false
      };
      this.handleUIDToggle = (isUIDOpen) => {
        this.setState({
          isUIDOpen
        });
      };
      this.handleUIDSelect = (event, selection, isPlaceholder) => {
        this.setState({
          "nsslapd-ldapiuidnumbertype": selection,
          isUIDOpen: false
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.handleGIDToggle = (isGIDOpen) => {
        this.setState({
          isGIDOpen
        });
      };
      this.handleGIDSelect = (event, selection, isPlaceholder) => {
        this.setState({
          "nsslapd-ldapigidnumbertype": selection,
          isGIDOpen: false
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.handleLoadConfig = this.handleLoadConfig.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.getAttributes = this.getAttributes.bind(this);
      this.reloadConfig = this.reloadConfig.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadConfig();
      } else {
        this.props.enableTree();
      }
    }
    getAttributes() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        }, this.props.enableTree);
      });
    }
    validateSaveBtn() {
      let disableSaveBtn = true;
      for (const ldapi_attr of ldapi_attrs) {
        if (this.state["_" + ldapi_attr].toLowerCase() !== this.state[ldapi_attr].toLowerCase()) {
          disableSaveBtn = false;
          break;
        }
      }
      if (this.state["nsslapd-ldapimaptoentries"] !== this.state["_nsslapd-ldapimaptoentries"]) {
        disableSaveBtn = false;
      }
      this.setState({
        saveDisabled: disableSaveBtn
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    handleLoadConfig() {
      const attrs = this.state.attrs;
      let mapToEntries = false;
      if ("nsslapd-ldapimaptoentries" in attrs) {
        if (attrs["nsslapd-ldapimaptoentries"][0] === "on") {
          mapToEntries = true;
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveDisabled: true,
        "nsslapd-ldapimaptoentries": mapToEntries,
        "nsslapd-ldapifilepath": attrs["nsslapd-ldapifilepath"][0],
        "nsslapd-ldapimaprootdn": attrs["nsslapd-ldapimaprootdn"][0],
        "nsslapd-ldapientrysearchbase": attrs["nsslapd-ldapientrysearchbase"][0],
        "nsslapd-ldapigidnumbertype": attrs["nsslapd-ldapigidnumbertype"][0],
        "nsslapd-ldapiuidnumbertype": attrs["nsslapd-ldapiuidnumbertype"][0],
        // Record original values
        "_nsslapd-ldapimaptoentries": mapToEntries,
        "_nsslapd-ldapimaprootdn": attrs["nsslapd-ldapimaprootdn"][0],
        "_nsslapd-ldapifilepath": attrs["nsslapd-ldapifilepath"][0],
        "_nsslapd-ldapientrysearchbase": attrs["nsslapd-ldapientrysearchbase"][0],
        "_nsslapd-ldapigidnumbertype": attrs["nsslapd-ldapigidnumbertype"][0],
        "_nsslapd-ldapiuidnumbertype": attrs["nsslapd-ldapiuidnumbertype"][0]
      }, this.getAttributes);
    }
    reloadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadConfig", "Reload server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        this.setState({
          attrs
        }, this.handleLoadConfig);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error loading server configuration - ${errMsg.desc}`
        );
      });
    }
    handleSaveConfig() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of [...ldapi_attrs, "nsslapd-ldapimaptoentries"]) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveConfig", "Saving LDAPI settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState({
          loading: false
        }, this.reloadConfig);
        this.props.addNotification(
          "success",
          "Successfully updated LDAPI configuration"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loading: false
        }, this.reloadConfig);
        this.props.addNotification(
          "error",
          `Error updating LDAPI configuration - ${errMsg.desc}`
        );
      });
    }
    render() {
      let mapUserAttrs = "";
      const extraPrimaryProps = {};
      let saveBtnName = "Save Settings";
      if (this.state.loading) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      if (this.state["nsslapd-ldapimaptoentries"]) {
        const attributes = this.state.attributes.map((option, index) => /* @__PURE__ */ import_react118.default.createElement(SelectOption, { key: index, value: option }));
        mapUserAttrs = /* @__PURE__ */ import_react118.default.createElement("div", { className: "ds-margin-left" }, /* @__PURE__ */ import_react118.default.createElement(
          Grid,
          {
            className: "ds-margin-top",
            title: "The Directory Server attribute to map system UIDs to user entries (nsslapd-ldapiuidnumbertype)."
          },
          /* @__PURE__ */ import_react118.default.createElement(GridItem, { className: "ds-label", span: 3 }, "LDAPI UID Number Attribute"),
          /* @__PURE__ */ import_react118.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react118.default.createElement(
            Select,
            {
              variant: SelectVariant.single,
              "aria-label": "Select UID Input",
              onToggle: this.handleUIDToggle,
              onSelect: this.handleUIDSelect,
              selections: this.state["nsslapd-ldapiuidnumbertype"],
              isOpen: this.state.isUIDOpen,
              "aria-labelledby": "UID"
            },
            attributes
          ))
        ), /* @__PURE__ */ import_react118.default.createElement(
          Grid,
          {
            className: "ds-margin-top",
            title: "The Directory Server attribute to map system GUIDs to user entries (nsslapd-ldapigidnumbertype)."
          },
          /* @__PURE__ */ import_react118.default.createElement(GridItem, { className: "ds-label", span: 3 }, "LDAPI GID Number Attribute"),
          /* @__PURE__ */ import_react118.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react118.default.createElement(
            Select,
            {
              variant: SelectVariant.single,
              "aria-label": "Select GID Input",
              onToggle: this.handleGIDToggle,
              onSelect: this.handleGIDSelect,
              selections: this.state["nsslapd-ldapigidnumbertype"],
              isOpen: this.state.isGIDOpen,
              "aria-labelledby": "GID"
            },
            attributes
          ))
        ), /* @__PURE__ */ import_react118.default.createElement(
          Grid,
          {
            title: "The subtree to search for user entries to use for autobind. (nsslapd-ldapientrysearchbase).",
            className: "ds-margin-top"
          },
          /* @__PURE__ */ import_react118.default.createElement(GridItem, { className: "ds-label", span: 3 }, "LDAPI Entry Search Base"),
          /* @__PURE__ */ import_react118.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react118.default.createElement(
            TextInput,
            {
              value: this.state["nsslapd-ldapientrysearchbase"],
              type: "text",
              id: "nsslapd-ldapientrysearchbase",
              "aria-describedby": "horizontal-form-name-helper",
              onChange: (str, e) => {
                this.handleChange(e);
              }
            }
          ))
        ));
      }
      let body = /* @__PURE__ */ import_react118.default.createElement("div", null, /* @__PURE__ */ import_react118.default.createElement(Form, { className: "ds-margin-top-xlg ds-left-margin", autoComplete: "off", isHorizontal: true }, /* @__PURE__ */ import_react118.default.createElement(Grid, { title: "The Unix socket file (nsslapd-ldapifilepath).  The UI requires this exact path so it is a read-only setting." }, /* @__PURE__ */ import_react118.default.createElement(GridItem, { className: "ds-label", span: 3 }, "LDAPI Socket File Path"), /* @__PURE__ */ import_react118.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react118.default.createElement(
        TextInput,
        {
          value: this.state["nsslapd-ldapifilepath"],
          type: "text",
          id: "nsslapd-ldapifilepath",
          "aria-describedby": "horizontal-form-name-helper",
          isDisabled: true
        }
      ))), /* @__PURE__ */ import_react118.default.createElement(Grid, { title: "Map the Unix root entry to this Directory Manager DN (nsslapd-ldapimaprootdn).  The UI requires this to be set to the current root DN so it is a read-only setting. The attribute is obsolete. Current root DN is used." }, /* @__PURE__ */ import_react118.default.createElement(GridItem, { className: "ds-label", span: 3 }, "LDAPI Map To Root DN"), /* @__PURE__ */ import_react118.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react118.default.createElement(
        TextInput,
        {
          value: this.state["nsslapd-ldapimaprootdn"],
          type: "text",
          id: "nsslapd-ldapimaprootdn",
          "aria-describedby": "horizontal-form-name-helper",
          isDisabled: true
        }
      ))), /* @__PURE__ */ import_react118.default.createElement(
        Grid,
        {
          title: "Map regular system users to Directory Server entries (nsslapd-ldapimaptoentries).",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react118.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react118.default.createElement(
          Checkbox,
          {
            id: "nsslapd-ldapimaptoentries",
            isChecked: this.state["nsslapd-ldapimaptoentries"],
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "uncontrolled checkbox example",
            label: "Map System Users to Database Entries"
          }
        ))
      ), mapUserAttrs), /* @__PURE__ */ import_react118.default.createElement(
        Button,
        {
          isDisabled: this.state.saveDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: this.handleSaveConfig,
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveBtnName
      ));
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react118.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react118.default.createElement(TextContent, null, /* @__PURE__ */ import_react118.default.createElement(Text, { component: TextVariants.h3 }, "Loading LDAPI configuration ...")), /* @__PURE__ */ import_react118.default.createElement(Spinner, { className: "ds-margin-top", size: "lg" }));
      }
      return /* @__PURE__ */ import_react118.default.createElement("div", { id: "server-ldapi-page", className: this.state.loading ? "ds-disabled" : "" }, /* @__PURE__ */ import_react118.default.createElement(Grid, null, /* @__PURE__ */ import_react118.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react118.default.createElement(TextContent, null, /* @__PURE__ */ import_react118.default.createElement(Text, { component: TextVariants.h3 }, "LDAPI & AutoBind Settings", /* @__PURE__ */ import_react118.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh LDAPI settings",
          onClick: this.handleLoadConfig
        }
      ))))), body);
    }
  };
  ServerLDAPI.propTypes = {
    addNotification: import_prop_types95.default.func,
    serverId: import_prop_types95.default.string,
    attrs: import_prop_types95.default.object
  };
  ServerLDAPI.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/accessLog.jsx
  var import_react119 = __toESM(require_react(), 1);
  var import_prop_types96 = __toESM(require_prop_types(), 1);
  var settings_attrs = [
    "nsslapd-accesslog",
    "nsslapd-accesslog-level",
    "nsslapd-accesslog-logbuffering",
    "nsslapd-accesslog-logging-enabled"
  ];
  var rotation_attrs = [
    "nsslapd-accesslog-logrotationsync-enabled",
    "nsslapd-accesslog-logrotationsynchour",
    "nsslapd-accesslog-logrotationsyncmin",
    "nsslapd-accesslog-logrotationtime",
    "nsslapd-accesslog-logrotationtimeunit",
    "nsslapd-accesslog-maxlogsize",
    "nsslapd-accesslog-maxlogsperdir",
    "nsslapd-accesslog-compress"
  ];
  var rotation_attrs_no_time = [
    "nsslapd-accesslog-logrotationsync-enabled",
    "nsslapd-accesslog-logrotationtime",
    "nsslapd-accesslog-logrotationtimeunit",
    "nsslapd-accesslog-maxlogsize",
    "nsslapd-accesslog-maxlogsperdir",
    "nsslapd-accesslog-compress"
  ];
  var exp_attrs3 = [
    "nsslapd-accesslog-logexpirationtime",
    "nsslapd-accesslog-logexpirationtimeunit",
    "nsslapd-accesslog-logmaxdiskspace",
    "nsslapd-accesslog-logminfreediskspace"
  ];
  var ServerAccessLog = class extends import_react119.default.Component {
    constructor(props) {
      super(props);
      this.defaultLevel = /* @__PURE__ */ import_react119.default.createElement(import_react119.default.Fragment, null, "Default Logging ", /* @__PURE__ */ import_react119.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 256)"));
      this.internalOpLevel = /* @__PURE__ */ import_react119.default.createElement(import_react119.default.Fragment, null, "Internal Operations ", /* @__PURE__ */ import_react119.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 4)"));
      this.refLevel = /* @__PURE__ */ import_react119.default.createElement(import_react119.default.Fragment, null, "Entry Access and Referrals ", /* @__PURE__ */ import_react119.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 512)"));
      this.state = {
        loading: true,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs,
        canSelectAll: false,
        isExpanded: false,
        rows: [
          { cells: [{ title: this.defaultLevel }], level: 256, selected: true },
          { cells: [{ title: this.internalOpLevel }], level: 4, selected: false },
          { cells: [{ title: this.refLevel }], level: 512, selected: false }
        ],
        columns: [
          { title: "Logging Level" }
        ]
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleOnToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.handleOnSelect = this.handleOnSelect.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs;
        disableBtnName = "saveSettingsDisabled";
        for (const row of this.state.rows) {
          for (const orig_row of this.state._rows) {
            if (orig_row.level === row.level) {
              if (orig_row.selected !== row.selected) {
                disableSaveBtn = false;
                break;
              }
            }
          }
        }
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs;
      } else {
        config_attrs = exp_attrs3;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-accesslog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-accesslog-compress", value);
      });
    }
    handleTimeChange(time_str) {
      let disableSaveBtn = true;
      const time_parts = time_str.split(":");
      let hour = time_parts[0];
      let min3 = time_parts[1];
      if (hour.length === 2 && hour[0] === "0") {
        hour = hour[1];
      }
      if (min3.length === 2 && min3[0] === "0") {
        min3 = min3[1];
      }
      for (const config_attr of rotation_attrs_no_time) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (hour !== this.state["_nsslapd-accesslog-logrotationsynchour"] || min3 !== this.state["_nsslapd-accesslog-logrotationsyncmin"]) {
        disableSaveBtn = false;
      }
      this.setState({
        "nsslapd-accesslog-logrotationsynchour": hour,
        "nsslapd-accesslog-logrotationsyncmin": min3,
        saveRotationDisabled: disableSaveBtn
      });
    }
    saveConfig(nav_tab) {
      let new_level = 0;
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs;
      } else {
        config_attrs = exp_attrs3;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      for (const row of this.state.rows) {
        if (row.selected) {
          new_level += row.level;
        }
      }
      if (new_level.toString() !== this.state["_nsslapd-accesslog-level"]) {
        if (new_level === 0) {
          new_level = 256;
        }
        cmd.push("nsslapd-accesslog-level=" + new_level.toString());
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving access log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.refreshConfig();
        this.props.addNotification(
          "success",
          "Successfully updated Access Log settings"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.refreshConfig();
        this.props.addNotification(
          "error",
          `Error saving Access Log settings - ${errMsg.desc}`
        );
      });
    }
    refreshConfig(refesh) {
      this.setState({
        loading: true,
        loaded: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Access Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let enabled = false;
        let buffering = false;
        let compress = false;
        const level_val = parseInt(attrs["nsslapd-accesslog-level"][0]);
        const rows = [...this.state.rows];
        if (attrs["nsslapd-accesslog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-accesslog-logbuffering"][0] === "on") {
          buffering = true;
        }
        if (attrs["nsslapd-accesslog-compress"][0] === "on") {
          compress = true;
        }
        for (const row in rows) {
          if (rows[row].level & level_val) {
            rows[row].selected = true;
          } else {
            rows[row].selected = false;
          }
        }
        this.setState({
          loading: false,
          loaded: true,
          saveSettingsDisabled: true,
          saveRotationDisabled: true,
          saveExpDisabled: true,
          "nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
          "nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
          "nsslapd-accesslog-logbuffering": buffering,
          "nsslapd-accesslog-logexpirationtime": attrs["nsslapd-accesslog-logexpirationtime"][0],
          "nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
          "nsslapd-accesslog-logging-enabled": enabled,
          "nsslapd-accesslog-logmaxdiskspace": attrs["nsslapd-accesslog-logmaxdiskspace"][0],
          "nsslapd-accesslog-logminfreediskspace": attrs["nsslapd-accesslog-logminfreediskspace"][0],
          "nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
          "nsslapd-accesslog-logrotationsynchour": attrs["nsslapd-accesslog-logrotationsynchour"][0],
          "nsslapd-accesslog-logrotationsyncmin": attrs["nsslapd-accesslog-logrotationsyncmin"][0],
          "nsslapd-accesslog-logrotationtime": attrs["nsslapd-accesslog-logrotationtime"][0],
          "nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
          "nsslapd-accesslog-maxlogsize": attrs["nsslapd-accesslog-maxlogsize"][0],
          "nsslapd-accesslog-maxlogsperdir": attrs["nsslapd-accesslog-maxlogsperdir"][0],
          "nsslapd-accesslog-compress": compress,
          rows,
          // Record original values
          _rows: JSON.parse(JSON.stringify(rows)),
          "_nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
          "_nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
          "_nsslapd-accesslog-logbuffering": buffering,
          "_nsslapd-accesslog-logexpirationtime": attrs["nsslapd-accesslog-logexpirationtime"][0],
          "_nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
          "_nsslapd-accesslog-logging-enabled": enabled,
          "_nsslapd-accesslog-logmaxdiskspace": attrs["nsslapd-accesslog-logmaxdiskspace"][0],
          "_nsslapd-accesslog-logminfreediskspace": attrs["nsslapd-accesslog-logminfreediskspace"][0],
          "_nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
          "_nsslapd-accesslog-logrotationsynchour": attrs["nsslapd-accesslog-logrotationsynchour"][0],
          "_nsslapd-accesslog-logrotationsyncmin": attrs["nsslapd-accesslog-logrotationsyncmin"][0],
          "_nsslapd-accesslog-logrotationtime": attrs["nsslapd-accesslog-logrotationtime"][0],
          "_nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
          "_nsslapd-accesslog-maxlogsize": attrs["nsslapd-accesslog-maxlogsize"][0],
          "_nsslapd-accesslog-maxlogsperdir": attrs["nsslapd-accesslog-maxlogsperdir"][0],
          "_nsslapd-accesslog-compress": compress
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading Access Log configuration - ${errMsg.desc}`
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let buffering = false;
      let compress = false;
      const level_val = parseInt(attrs["nsslapd-accesslog-level"][0]);
      const rows = [...this.state.rows];
      if (attrs["nsslapd-accesslog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-accesslog-logbuffering"][0] === "on") {
        buffering = true;
      }
      if (attrs["nsslapd-accesslog-compress"][0] === "on") {
        compress = true;
      }
      for (const row in rows) {
        if (rows[row].level & level_val) {
          rows[row].selected = true;
        } else {
          rows[row].selected = false;
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
        "nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
        "nsslapd-accesslog-logbuffering": buffering,
        "nsslapd-accesslog-logexpirationtime": attrs["nsslapd-accesslog-logexpirationtime"][0],
        "nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
        "nsslapd-accesslog-logging-enabled": enabled,
        "nsslapd-accesslog-logmaxdiskspace": attrs["nsslapd-accesslog-logmaxdiskspace"][0],
        "nsslapd-accesslog-logminfreediskspace": attrs["nsslapd-accesslog-logminfreediskspace"][0],
        "nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
        "nsslapd-accesslog-logrotationsynchour": attrs["nsslapd-accesslog-logrotationsynchour"][0],
        "nsslapd-accesslog-logrotationsyncmin": attrs["nsslapd-accesslog-logrotationsyncmin"][0],
        "nsslapd-accesslog-logrotationtime": attrs["nsslapd-accesslog-logrotationtime"][0],
        "nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
        "nsslapd-accesslog-maxlogsize": attrs["nsslapd-accesslog-maxlogsize"][0],
        "nsslapd-accesslog-maxlogsperdir": attrs["nsslapd-accesslog-maxlogsperdir"][0],
        "nsslapd-accesslog-compress": compress,
        rows,
        // Record original values
        _rows: JSON.parse(JSON.stringify(rows)),
        "_nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
        "_nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
        "_nsslapd-accesslog-logbuffering": buffering,
        "_nsslapd-accesslog-logexpirationtime": attrs["nsslapd-accesslog-logexpirationtime"][0],
        "_nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
        "_nsslapd-accesslog-logging-enabled": enabled,
        "_nsslapd-accesslog-logmaxdiskspace": attrs["nsslapd-accesslog-logmaxdiskspace"][0],
        "_nsslapd-accesslog-logminfreediskspace": attrs["nsslapd-accesslog-logminfreediskspace"][0],
        "_nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
        "_nsslapd-accesslog-logrotationsynchour": attrs["nsslapd-accesslog-logrotationsynchour"][0],
        "_nsslapd-accesslog-logrotationsyncmin": attrs["nsslapd-accesslog-logrotationsyncmin"][0],
        "_nsslapd-accesslog-logrotationtime": attrs["nsslapd-accesslog-logrotationtime"][0],
        "_nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
        "_nsslapd-accesslog-maxlogsize": attrs["nsslapd-accesslog-maxlogsize"][0],
        "_nsslapd-accesslog-maxlogsperdir": attrs["nsslapd-accesslog-maxlogsperdir"][0],
        "_nsslapd-accesslog-compress": compress
      }, this.props.enableTree);
    }
    handleOnSelect(event, isSelected, rowId) {
      let disableSaveBtn = true;
      const rows = [...this.state.rows];
      rows[rowId].selected = isSelected;
      for (const config_attr of settings_attrs) {
        if (this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const row of rows) {
        for (const orig_row of this.state._rows) {
          if (orig_row.level === row.level) {
            if (orig_row.selected !== row.selected) {
              disableSaveBtn = false;
              break;
            }
          }
        }
      }
      this.setState({
        rows,
        saveSettingsDisabled: disableSaveBtn
      });
    }
    render() {
      let saveSettingsName = "Save Log Settings";
      let saveRotationName = "Save Rotation Settings";
      let saveDeletionName = "Save Deletion Settings";
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-accesslog-logrotationsynchour"] ? this.state["nsslapd-accesslog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-accesslog-logrotationsyncmin"] ? this.state["nsslapd-accesslog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = "Saving settings ...";
        saveRotationName = "Saving settings ...";
        saveDeletionName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      let body = /* @__PURE__ */ import_react119.default.createElement("div", { className: "ds-margin-top-lg ds-left-margin" }, /* @__PURE__ */ import_react119.default.createElement(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react119.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react119.default.createElement(TabTitleText, null, "Settings") }, /* @__PURE__ */ import_react119.default.createElement(
        Checkbox,
        {
          className: "ds-margin-top-xlg",
          id: "nsslapd-accesslog-logging-enabled",
          isChecked: this.state["nsslapd-accesslog-logging-enabled"],
          onChange: (checked, e) => {
            this.handleChange(e, "settings");
          },
          title: "Enable access logging (nsslapd-accesslog-logging-enabled).",
          label: "Enable Access Logging"
        }
      ), /* @__PURE__ */ import_react119.default.createElement(Form, { className: "ds-margin-top-lg ds-left-margin-md", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react119.default.createElement(
        FormGroup,
        {
          label: "Access Log Location",
          fieldId: "nsslapd-accesslog",
          title: "Enable access logging (nsslapd-accesslog)."
        },
        /* @__PURE__ */ import_react119.default.createElement(
          TextInput,
          {
            value: this.state["nsslapd-accesslog"],
            type: "text",
            id: "nsslapd-accesslog",
            "aria-describedby": "horizontal-form-name-helper",
            name: "nsslapd-accesslog",
            onChange: (str, e) => {
              this.handleChange(e, "settings");
            }
          }
        )
      )), /* @__PURE__ */ import_react119.default.createElement(
        Checkbox,
        {
          className: "ds-left-margin-md ds-margin-top-lg",
          id: "nsslapd-accesslog-logbuffering",
          isChecked: this.state["nsslapd-accesslog-logbuffering"],
          onChange: (checked, e) => {
            this.handleChange(e, "settings");
          },
          title: "Disable access log buffering for faster troubleshooting, but this will impact server performance (nsslapd-accesslog-logbuffering).",
          label: "Access Log Buffering Enabled"
        }
      ), /* @__PURE__ */ import_react119.default.createElement(
        ExpandableSection,
        {
          className: "ds-left-margin-md ds-margin-top-lg ds-font-size-md",
          toggleText: this.state.isExpanded ? "Hide Logging Levels" : "Show Logging Levels",
          onToggle: this.handleOnToggle,
          isExpanded: this.state.isExpanded
        },
        /* @__PURE__ */ import_react119.default.createElement(
          Table,
          {
            className: "ds-left-margin",
            onSelect: this.handleOnSelect,
            canSelectAll: this.state.canSelectAll,
            variant: TableVariant.compact,
            "aria-label": "Selectable Table",
            cells: this.state.columns,
            rows: this.state.rows
          },
          /* @__PURE__ */ import_react119.default.createElement(TableHeader, null),
          /* @__PURE__ */ import_react119.default.createElement(TableBody, null)
        )
      ), /* @__PURE__ */ import_react119.default.createElement(
        Button,
        {
          key: "save settings",
          isDisabled: this.state.saveSettingsDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("settings");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveSettingsName
      )), /* @__PURE__ */ import_react119.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react119.default.createElement(TabTitleText, null, "Rotation Policy") }, /* @__PURE__ */ import_react119.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react119.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The maximum number of logs that are archived (nsslapd-accesslog-maxlogsperdir)."
        },
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Number Of Logs"),
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react119.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-accesslog-maxlogsperdir"],
            min: 1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-accesslog-maxlogsperdir", "rotation");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-accesslog-maxlogsperdir", 1, 2147483647, "rotation");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-accesslog-maxlogsperdir", "rotation");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react119.default.createElement(Grid, { title: "The maximum size of each log file in megabytes (nsslapd-accesslog-maxlogsize)." }, /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Log Size (in MB)"), /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react119.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-accesslog-maxlogsize"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-accesslog-maxlogsize", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-accesslog-maxlogsize", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-accesslog-maxlogsize", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 6
        }
      ))), /* @__PURE__ */ import_react119.default.createElement("hr", null), /* @__PURE__ */ import_react119.default.createElement(Grid, { title: "Rotate the log based this number of time units (nsslapd-accesslog-logrotationtime)." }, /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Create New Log Every ..."), /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react119.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react119.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-accesslog-logrotationtime"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-accesslog-logrotationtime", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-accesslog-logrotationtime", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-accesslog-logrotationtime", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 3
        }
      ), /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react119.default.createElement(
        FormSelect,
        {
          id: "nsslapd-accesslog-logrotationtimeunit",
          value: this.state["nsslapd-accesslog-logrotationtimeunit"],
          onChange: (str, e) => {
            this.handleChange(e, "rotation");
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "0", value: "minute", label: "minute" }),
        /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "1", value: "hour", label: "hour" }),
        /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
        /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
        /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
      ))))), /* @__PURE__ */ import_react119.default.createElement(Grid, { title: "The time when the log should be rotated (nsslapd-accesslog-logrotationsynchour, nsslapd-accesslog-logrotationsyncmin)." }, /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Time Of Day"), /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react119.default.createElement(
        TimePicker,
        {
          time: rotationTime,
          onChange: this.handleTimeChange,
          is24Hour: true
        }
      ))), /* @__PURE__ */ import_react119.default.createElement(Grid, { title: "Compress (gzip) the log after it's rotated." }, /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Compress Rotated Logs"), /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 8 }, /* @__PURE__ */ import_react119.default.createElement(
        Switch,
        {
          id: "nsslapd-accesslog-compress",
          isChecked: this.state["nsslapd-accesslog-compress"],
          onChange: this.handleSwitchChange,
          "aria-label": "nsslapd-accesslog-compress"
        }
      )))), /* @__PURE__ */ import_react119.default.createElement(
        Button,
        {
          key: "save rot settings",
          isDisabled: this.state.saveRotationDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("rotation");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveRotationName
      )), /* @__PURE__ */ import_react119.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react119.default.createElement(TabTitleText, null, "Deletion Policy") }, /* @__PURE__ */ import_react119.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react119.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-accesslog-logmaxdiskspace)."
        },
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log Archive Exceeds (in MB)"),
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react119.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-accesslog-logmaxdiskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-accesslog-logmaxdiskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-accesslog-logmaxdiskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-accesslog-logmaxdiskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react119.default.createElement(
        Grid,
        {
          title: "The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-accesslog-logminfreediskspace)."
        },
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Free Disk Space (in MB)"),
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react119.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-accesslog-logminfreediskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-accesslog-logminfreediskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-accesslog-logminfreediskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-accesslog-logminfreediskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react119.default.createElement(
        Grid,
        {
          title: "Server deletes an old archived log file when it is older than the specified age. (nsslapd-accesslog-logexpirationtime)."
        },
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log File is Older Than ..."),
        /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react119.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react119.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-accesslog-logexpirationtime"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-accesslog-logexpirationtime", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-accesslog-logexpirationtime", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-accesslog-logexpirationtime", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 3
          }
        ), /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react119.default.createElement(
          FormSelect,
          {
            id: "nsslapd-accesslog-logexpirationtimeunit",
            value: this.state["nsslapd-accesslog-logexpirationtimeunit"],
            onChange: (str, e) => {
              this.handleChange(e, "exp");
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
          /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
          /* @__PURE__ */ import_react119.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
        ))))
      )), /* @__PURE__ */ import_react119.default.createElement(
        Button,
        {
          key: "save del settings",
          isDisabled: this.state.saveExpDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("exp");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveDeletionName
      ))));
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react119.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react119.default.createElement(TextContent, null, /* @__PURE__ */ import_react119.default.createElement(Text, { component: TextVariants.h3 }, "Loading Access Log Settings ...")), /* @__PURE__ */ import_react119.default.createElement(Spinner, { size: "xl" }));
      }
      return /* @__PURE__ */ import_react119.default.createElement("div", { id: "server-accesslog-page", className: this.state.loading ? "ds-disabled" : "" }, /* @__PURE__ */ import_react119.default.createElement(Grid, null, /* @__PURE__ */ import_react119.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react119.default.createElement(TextContent, null, /* @__PURE__ */ import_react119.default.createElement(Text, { component: TextVariants.h3 }, "Access Log Settings", /* @__PURE__ */ import_react119.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh log settings",
          onClick: () => {
            this.refreshConfig();
          }
        }
      ))))), body);
    }
  };
  ServerAccessLog.propTypes = {
    addNotification: import_prop_types96.default.func,
    serverId: import_prop_types96.default.string,
    attrs: import_prop_types96.default.object
  };
  ServerAccessLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/auditLog.jsx
  var import_react120 = __toESM(require_react(), 1);
  var import_prop_types97 = __toESM(require_prop_types(), 1);
  var settings_attrs2 = [
    "nsslapd-auditlog",
    "nsslapd-auditlog-logging-enabled"
  ];
  var rotation_attrs2 = [
    "nsslapd-auditlog-logrotationsync-enabled",
    "nsslapd-auditlog-logrotationsynchour",
    "nsslapd-auditlog-logrotationsyncmin",
    "nsslapd-auditlog-logrotationtime",
    "nsslapd-auditlog-logrotationtimeunit",
    "nsslapd-auditlog-maxlogsize",
    "nsslapd-auditlog-maxlogsperdir",
    "nsslapd-auditlog-compress"
  ];
  var rotation_attrs_no_time2 = [
    "nsslapd-auditlog-logrotationsync-enabled",
    "nsslapd-auditlog-logrotationtime",
    "nsslapd-auditlog-logrotationtimeunit",
    "nsslapd-auditlog-maxlogsize",
    "nsslapd-auditlog-maxlogsperdir",
    "nsslapd-auditlog-compress"
  ];
  var exp_attrs4 = [
    "nsslapd-auditlog-logexpirationtime",
    "nsslapd-auditlog-logexpirationtimeunit",
    "nsslapd-auditlog-logmaxdiskspace",
    "nsslapd-auditlog-logminfreediskspace"
  ];
  var ServerAuditLog = class extends import_react120.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs,
        displayAttrs: [],
        isDisplayAttrOpen: false,
        attributes: [],
        displayAllAttrs: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleOnDisplayAttrSelect = (event, selection) => {
        if (this.state.displayAttrs.includes(selection)) {
          this.setState(
            (prevState) => ({
              displayAttrs: prevState.displayAttrs.filter((item) => item !== selection),
              isDisplayAttrOpen: false
            }),
            () => {
              this.validateSaveBtn("settings", "none", "none");
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              displayAttrs: [...prevState.displayAttrs, selection],
              isDisplayAttrOpen: false
            }),
            () => {
              this.validateSaveBtn("settings", "none", "none");
            }
          );
        }
      };
      this.handleOnDisplayAttrToggle = (isDisplayAttrOpen) => {
        this.setState({
          isDisplayAttrOpen
        });
      };
      this.handleOnDisplayAttrClear = () => {
        this.setState({
          displayAttrs: [],
          isDisplayAttrOpen: false
        }, () => {
          this.validateSaveBtn("settings", "none", "none");
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.getAttributes();
      } else {
        this.props.enableTree();
      }
    }
    getAttributes() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attributes for audit log display attributes", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        }, () => {
          this.loadConfig();
        });
      });
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs2;
        disableBtnName = "saveSettingsDisabled";
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs2;
      } else {
        config_attrs = exp_attrs4;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      if (this.state.displayAllAttrs !== this.state._displayAllAttrs) {
        disableSaveBtn = false;
      }
      if (!this.state.displayAllAttrs && !listsEqual(this.state.displayAttrs, this.state._displayAttrs)) {
        disableSaveBtn = false;
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-auditlog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-auditlog-compress", value);
      });
    }
    handleTimeChange(time_str) {
      let disableSaveBtn = true;
      const time_parts = time_str.split(":");
      let hour = time_parts[0];
      let min3 = time_parts[1];
      if (hour.length === 2 && hour[0] === "0") {
        hour = hour[1];
      }
      if (min3.length === 2 && min3[0] === "0") {
        min3 = min3[1];
      }
      for (const config_attr of rotation_attrs_no_time2) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (hour !== this.state["_nsslapd-auditlog-logrotationsynchour"] || min3 !== this.state["_nsslapd-auditlog-logrotationsyncmin"]) {
        disableSaveBtn = false;
      }
      this.setState({
        "nsslapd-auditlog-logrotationsynchour": hour,
        "nsslapd-auditlog-logrotationsyncmin": min3,
        saveRotationDisabled: disableSaveBtn
      });
    }
    saveConfig(nav_tab) {
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs2;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs2;
      } else {
        config_attrs = exp_attrs4;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      if (!this.state.displayAllAttrs && !listsEqual(this.state.displayAttrs, this.state._displayAttrs)) {
        if (this.state.displayAttrs.length > 0) {
          const val = this.state.displayAttrs.join(" ");
          cmd.push("nsslapd-auditlog-display-attrs=" + val);
        } else {
          cmd.push("nsslapd-auditlog-display-attrs=");
        }
      }
      if (this.state.displayAllAttrs !== this.state._displayAllAttrs) {
        if (this.state.displayAllAttrs) {
          cmd.push("nsslapd-auditlog-display-attrs=*");
        } else if (this.state.displayAttrs.length === 0) {
          cmd.push("nsslapd-auditlog-display-attrs=");
        }
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving audit log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.refreshConfig();
        this.props.addNotification(
          "success",
          "Successfully updated Audit Log settings"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.refreshConfig();
        this.props.addNotification(
          "error",
          `Error saving Audit Log settings - ${errMsg.desc}`
        );
      });
    }
    refreshConfig() {
      this.setState({
        loading: true,
        loaded: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Audit Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let enabled = false;
        let compressed = false;
        let display_attrs = [];
        let displayAllAttrs = this.state.displayAllAttrs;
        if (attrs["nsslapd-auditlog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-auditlog-compress"][0] === "on") {
          compressed = true;
        }
        if ("nsslapd-auditlog-display-attrs" in attrs) {
          if (attrs["nsslapd-auditlog-display-attrs"][0] === "*") {
            displayAllAttrs = true;
          } else if (attrs["nsslapd-auditlog-display-attrs"][0] !== "") {
            displayAllAttrs = false;
            display_attrs = attrs["nsslapd-auditlog-display-attrs"][0].split(/[, ]+/);
          }
        }
        this.setState({
          loading: false,
          loaded: true,
          saveSettingsDisabled: true,
          saveRotationDisabled: true,
          saveExpDisabled: true,
          "nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
          "nsslapd-auditlog-logexpirationtime": attrs["nsslapd-auditlog-logexpirationtime"][0],
          "nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
          "nsslapd-auditlog-logging-enabled": enabled,
          "nsslapd-auditlog-logmaxdiskspace": attrs["nsslapd-auditlog-logmaxdiskspace"][0],
          "nsslapd-auditlog-logminfreediskspace": attrs["nsslapd-auditlog-logminfreediskspace"][0],
          "nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
          "nsslapd-auditlog-logrotationsynchour": attrs["nsslapd-auditlog-logrotationsynchour"][0],
          "nsslapd-auditlog-logrotationsyncmin": attrs["nsslapd-auditlog-logrotationsyncmin"][0],
          "nsslapd-auditlog-logrotationtime": attrs["nsslapd-auditlog-logrotationtime"][0],
          "nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
          "nsslapd-auditlog-maxlogsize": attrs["nsslapd-auditlog-maxlogsize"][0],
          "nsslapd-auditlog-maxlogsperdir": attrs["nsslapd-auditlog-maxlogsperdir"][0],
          "nsslapd-auditlog-compress": compressed,
          displayAttrs: display_attrs,
          displayAllAttrs,
          // Record original values
          "_nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
          "_nsslapd-auditlog-logexpirationtime": attrs["nsslapd-auditlog-logexpirationtime"][0],
          "_nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
          "_nsslapd-auditlog-logging-enabled": enabled,
          "_nsslapd-auditlog-logmaxdiskspace": attrs["nsslapd-auditlog-logmaxdiskspace"][0],
          "_nsslapd-auditlog-logminfreediskspace": attrs["nsslapd-auditlog-logminfreediskspace"][0],
          "_nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
          "_nsslapd-auditlog-logrotationsynchour": attrs["nsslapd-auditlog-logrotationsynchour"][0],
          "_nsslapd-auditlog-logrotationsyncmin": attrs["nsslapd-auditlog-logrotationsyncmin"][0],
          "_nsslapd-auditlog-logrotationtime": attrs["nsslapd-auditlog-logrotationtime"][0],
          "_nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
          "_nsslapd-auditlog-maxlogsize": attrs["nsslapd-auditlog-maxlogsize"][0],
          "_nsslapd-auditlog-maxlogsperdir": attrs["nsslapd-auditlog-maxlogsperdir"][0],
          "_nsslapd-auditlog-compress": compressed,
          _displayAttrs: display_attrs,
          _displayAllAttrs: displayAllAttrs
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading Audit Log configuration - ${errMsg.desc}`
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let compressed = false;
      let display_attrs = [];
      let displayAllAttrs = this.state.displayAllAttrs;
      if (attrs["nsslapd-auditlog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-auditlog-compress"][0] === "on") {
        compressed = true;
      }
      if ("nsslapd-auditlog-display-attrs" in attrs) {
        if (attrs["nsslapd-auditlog-display-attrs"][0] === "*") {
          displayAllAttrs = true;
        } else if (attrs["nsslapd-auditlog-display-attrs"][0] !== "") {
          display_attrs = attrs["nsslapd-auditlog-display-attrs"][0].split(/[, ]+/);
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
        "nsslapd-auditlog-logexpirationtime": attrs["nsslapd-auditlog-logexpirationtime"][0],
        "nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
        "nsslapd-auditlog-logging-enabled": enabled,
        "nsslapd-auditlog-logmaxdiskspace": attrs["nsslapd-auditlog-logmaxdiskspace"][0],
        "nsslapd-auditlog-logminfreediskspace": attrs["nsslapd-auditlog-logminfreediskspace"][0],
        "nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
        "nsslapd-auditlog-logrotationsynchour": attrs["nsslapd-auditlog-logrotationsynchour"][0],
        "nsslapd-auditlog-logrotationsyncmin": attrs["nsslapd-auditlog-logrotationsyncmin"][0],
        "nsslapd-auditlog-logrotationtime": attrs["nsslapd-auditlog-logrotationtime"][0],
        "nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
        "nsslapd-auditlog-maxlogsize": attrs["nsslapd-auditlog-maxlogsize"][0],
        "nsslapd-auditlog-maxlogsperdir": attrs["nsslapd-auditlog-maxlogsperdir"][0],
        "nsslapd-auditlog-compress": compressed,
        displayAttrs: display_attrs,
        displayAllAttrs,
        // Record original values,
        "_nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
        "_nsslapd-auditlog-logexpirationtime": attrs["nsslapd-auditlog-logexpirationtime"][0],
        "_nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
        "_nsslapd-auditlog-logging-enabled": enabled,
        "_nsslapd-auditlog-logmaxdiskspace": attrs["nsslapd-auditlog-logmaxdiskspace"][0],
        "_nsslapd-auditlog-logminfreediskspace": attrs["nsslapd-auditlog-logminfreediskspace"][0],
        "_nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
        "_nsslapd-auditlog-logrotationsynchour": attrs["nsslapd-auditlog-logrotationsynchour"][0],
        "_nsslapd-auditlog-logrotationsyncmin": attrs["nsslapd-auditlog-logrotationsyncmin"][0],
        "_nsslapd-auditlog-logrotationtime": attrs["nsslapd-auditlog-logrotationtime"][0],
        "_nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
        "_nsslapd-auditlog-maxlogsize": attrs["nsslapd-auditlog-maxlogsize"][0],
        "_nsslapd-auditlog-maxlogsperdir": attrs["nsslapd-auditlog-maxlogsperdir"][0],
        "_nsslapd-auditlog-compress": compressed,
        _displayAttrs: display_attrs,
        _displayAllAttrs: displayAllAttrs
      }, this.props.enableTree);
    }
    render() {
      let saveSettingsName = "Save Log Settings";
      let saveRotationName = "Save Rotation Settings";
      let saveDeletionName = "Save Deletion Settings";
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-auditlog-logrotationsynchour"] ? this.state["nsslapd-auditlog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-auditlog-logrotationsyncmin"] ? this.state["nsslapd-auditlog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = "Saving settings ...";
        saveRotationName = "Saving settings ...";
        saveDeletionName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      let body = /* @__PURE__ */ import_react120.default.createElement("div", { className: "ds-margin-top-lg ds-left-margin" }, /* @__PURE__ */ import_react120.default.createElement(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react120.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react120.default.createElement(TabTitleText, null, "Settings") }, /* @__PURE__ */ import_react120.default.createElement(
        Checkbox,
        {
          className: "ds-margin-top-xlg",
          id: "nsslapd-auditlog-logging-enabled",
          isChecked: this.state["nsslapd-auditlog-logging-enabled"],
          onChange: (checked, e) => {
            this.handleChange(e, "settings");
          },
          title: "Enable audit logging (nsslapd-auditlog-logging-enabled).",
          label: "Enable Audit Logging"
        }
      ), /* @__PURE__ */ import_react120.default.createElement(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react120.default.createElement(
        FormGroup,
        {
          label: "Audit Log Location",
          fieldId: "nsslapd-auditlog",
          title: "Enable audit logging (nsslapd-auditlog)."
        },
        /* @__PURE__ */ import_react120.default.createElement(
          TextInput,
          {
            value: this.state["nsslapd-auditlog"],
            type: "text",
            id: "nsslapd-auditlog",
            "aria-describedby": "horizontal-form-name-helper",
            name: "nsslapd-auditlog",
            onChange: (str, e) => {
              this.handleChange(e, "settings");
            }
          }
        )
      )), /* @__PURE__ */ import_react120.default.createElement(Form, { className: "ds-margin-top-lg ds-margin-left", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react120.default.createElement(
        FormGroup,
        {
          label: "Display Attributes",
          fieldId: "nsslapd-auditlog-display-attrs",
          title: "Display attributes from the entry in the audit log (nsslapd-auditlog-display-attrs)."
        },
        /* @__PURE__ */ import_react120.default.createElement("div", { className: this.state.displayAllAttrs ? "ds-hidden" : "ds-margin-bottom" }, /* @__PURE__ */ import_react120.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type an attribute",
            onToggle: this.handleOnDisplayAttrToggle,
            onSelect: this.handleOnDisplayAttrSelect,
            onClear: this.handleOnDisplayAttrClear,
            selections: this.state.displayAttrs,
            isOpen: this.state.isDisplayAttrOpen,
            "aria-labelledby": "typeAhead-audit-display-attr",
            placeholderText: "Type an attribute...",
            noResultsFoundText: "There are no matching attributes"
          },
          this.state.attributes.map((attr, index) => /* @__PURE__ */ import_react120.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        )),
        /* @__PURE__ */ import_react120.default.createElement(
          Checkbox,
          {
            className: "ds-lower-field-md",
            id: "displayAllAttrs",
            isChecked: this.state.displayAllAttrs,
            onChange: (checked, e) => {
              this.handleChange(e, "settings");
            },
            title: "Display all attributes from the entry in the audit log (nsslapd-auditlog-display-attrs).",
            label: "All Attributes"
          }
        )
      )), /* @__PURE__ */ import_react120.default.createElement(
        Button,
        {
          key: "save settings",
          isDisabled: this.state.saveSettingsDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("settings");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveSettingsName
      )), /* @__PURE__ */ import_react120.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react120.default.createElement(TabTitleText, null, "Rotation Policy") }, /* @__PURE__ */ import_react120.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react120.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The maximum number of logs that are archived (nsslapd-auditlog-maxlogsperdir)."
        },
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Number Of Logs"),
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react120.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditlog-maxlogsperdir"],
            min: 1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditlog-maxlogsperdir", "rotation");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditlog-maxlogsperdir", 1, 2147483647, "rotation");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditlog-maxlogsperdir", "rotation");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react120.default.createElement(Grid, { title: "The maximum size of each log file in megabytes (nsslapd-auditlog-maxlogsize)." }, /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Log Size (in MB)"), /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react120.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-auditlog-maxlogsize"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-auditlog-maxlogsize", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-auditlog-maxlogsize", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-auditlog-maxlogsize", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 6
        }
      ))), /* @__PURE__ */ import_react120.default.createElement("hr", null), /* @__PURE__ */ import_react120.default.createElement(Grid, { title: "Rotate the log based this number of time units (nsslapd-auditlog-logrotationtime)." }, /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Create New Log Every ..."), /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react120.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react120.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-auditlog-logrotationtime"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-auditlog-logrotationtime", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-auditlog-logrotationtime", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-auditlog-logrotationtime", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 3
        }
      ), /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react120.default.createElement(
        FormSelect,
        {
          id: "nsslapd-auditlog-logrotationtimeunit",
          value: this.state["nsslapd-auditlog-logrotationtimeunit"],
          onChange: (str, e) => {
            this.handleChange(e, "rotation");
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "0", value: "minute", label: "minute" }),
        /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "1", value: "hour", label: "hour" }),
        /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
        /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
        /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
      ))))), /* @__PURE__ */ import_react120.default.createElement(Grid, { title: "The time when the log should be rotated (nsslapd-auditlog-logrotationsynchour, nsslapd-auditlog-logrotationsyncmin)." }, /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Time Of Day"), /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react120.default.createElement(
        TimePicker,
        {
          time: rotationTime,
          onChange: this.handleTimeChange,
          is24Hour: true
        }
      ))), /* @__PURE__ */ import_react120.default.createElement(Grid, { title: "Compress (gzip) the log after it's rotated." }, /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Compress Rotated Logs"), /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react120.default.createElement(
        Switch,
        {
          id: "nsslapd-auditlog-compress",
          isChecked: this.state["nsslapd-auditlog-compress"],
          onChange: this.handleSwitchChange,
          "aria-label": "nsslapd-auditlog-compress"
        }
      ), "`"))), /* @__PURE__ */ import_react120.default.createElement(
        Button,
        {
          key: "save rot settings",
          isDisabled: this.state.saveRotationDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("rotation");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveRotationName
      )), /* @__PURE__ */ import_react120.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react120.default.createElement(TabTitleText, null, "Deletion Policy") }, /* @__PURE__ */ import_react120.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react120.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-auditlog-logmaxdiskspace)."
        },
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log Archive Exceeds (in MB)"),
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react120.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditlog-logmaxdiskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditlog-logmaxdiskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditlog-logmaxdiskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditlog-logmaxdiskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react120.default.createElement(
        Grid,
        {
          title: "The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-auditlog-logminfreediskspace)."
        },
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Free Disk Space (in MB)"),
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react120.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditlog-logminfreediskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditlog-logminfreediskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditlog-logminfreediskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditlog-logminfreediskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react120.default.createElement(
        Grid,
        {
          title: "Server deletes an old archived log file when it is older than the specified age. (nsslapd-auditlog-logexpirationtime)."
        },
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log File is Older Than ..."),
        /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react120.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react120.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditlog-logexpirationtime"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditlog-logexpirationtime", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditlog-logexpirationtime", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditlog-logexpirationtime", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 3
          }
        ), /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react120.default.createElement(
          FormSelect,
          {
            id: "nsslapd-auditlog-logexpirationtimeunit",
            value: this.state["nsslapd-auditlog-logexpirationtimeunit"],
            onChange: (str, e) => {
              this.handleChange(e, "exp");
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
          /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
          /* @__PURE__ */ import_react120.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
        ))))
      )), /* @__PURE__ */ import_react120.default.createElement(
        Button,
        {
          key: "save del settings",
          isDisabled: this.state.saveExpDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("exp");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveDeletionName
      ))));
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react120.default.createElement("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react120.default.createElement(TextContent, null, /* @__PURE__ */ import_react120.default.createElement(Text, { component: TextVariants.h3 }, "Loading Audit Log settings ...")), /* @__PURE__ */ import_react120.default.createElement(Spinner, { className: "ds-margin-top", size: "lg" }));
      }
      return /* @__PURE__ */ import_react120.default.createElement("div", { id: "server-auditlog-page", className: this.state.loading ? "ds-disabled" : "" }, /* @__PURE__ */ import_react120.default.createElement(Grid, null, /* @__PURE__ */ import_react120.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react120.default.createElement(TextContent, null, /* @__PURE__ */ import_react120.default.createElement(Text, { component: TextVariants.h3 }, "Audit Log Settings", /* @__PURE__ */ import_react120.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh log settings",
          onClick: () => {
            this.refreshConfig();
          }
        }
      ))))), body);
    }
  };
  ServerAuditLog.propTypes = {
    addNotification: import_prop_types97.default.func,
    serverId: import_prop_types97.default.string,
    attrs: import_prop_types97.default.object
  };
  ServerAuditLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/auditfailLog.jsx
  var import_react121 = __toESM(require_react(), 1);
  var import_prop_types98 = __toESM(require_prop_types(), 1);
  var settings_attrs3 = [
    "nsslapd-auditfaillog",
    "nsslapd-auditfaillog-level",
    "nsslapd-auditfaillog-logbuffering",
    "nsslapd-auditfaillog-logging-enabled"
  ];
  var rotation_attrs3 = [
    "nsslapd-auditfaillog-logrotationsync-enabled",
    "nsslapd-auditfaillog-logrotationsynchour",
    "nsslapd-auditfaillog-logrotationsyncmin",
    "nsslapd-auditfaillog-logrotationtime",
    "nsslapd-auditfaillog-logrotationtimeunit",
    "nsslapd-auditfaillog-maxlogsize",
    "nsslapd-auditfaillog-maxlogsperdir",
    "nsslapd-auditfaillog-compress"
  ];
  var rotation_attrs_no_time3 = [
    "nsslapd-auditfaillog-logrotationsync-enabled",
    "nsslapd-auditfaillog-logrotationtime",
    "nsslapd-auditfaillog-logrotationtimeunit",
    "nsslapd-auditfaillog-maxlogsize",
    "nsslapd-auditfaillog-maxlogsperdir",
    "nsslapd-auditfaillog-compress"
  ];
  var exp_attrs5 = [
    "nsslapd-auditfaillog-logexpirationtime",
    "nsslapd-auditfaillog-logexpirationtimeunit",
    "nsslapd-auditfaillog-logmaxdiskspace",
    "nsslapd-auditfaillog-logminfreediskspace"
  ];
  var ServerAuditFailLog = class extends import_react121.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs3;
        disableBtnName = "saveSettingsDisabled";
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs3;
      } else {
        config_attrs = exp_attrs5;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-auditfaillog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-auditfaillog-compress", value);
      });
    }
    handleTimeChange(time_str) {
      let disableSaveBtn = true;
      const time_parts = time_str.split(":");
      let hour = time_parts[0];
      let min3 = time_parts[1];
      if (hour.length === 2 && hour[0] === "0") {
        hour = hour[1];
      }
      if (min3.length === 2 && min3[0] === "0") {
        min3 = min3[1];
      }
      for (const config_attr of rotation_attrs_no_time3) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (hour !== this.state["_nsslapd-auditfaillog-logrotationsynchour"] || min3 !== this.state["_nsslapd-auditfaillog-logrotationsyncmin"]) {
        disableSaveBtn = false;
      }
      this.setState({
        "nsslapd-auditfaillog-logrotationsynchour": hour,
        "nsslapd-auditfaillog-logrotationsyncmin": min3,
        saveRotationDisabled: disableSaveBtn
      });
    }
    saveConfig(nav_tab) {
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs3;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs3;
      } else {
        config_attrs = exp_attrs5;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving audit fail log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.refreshConfig();
        this.props.addNotification(
          "success",
          "Successfully updated Audit Fail Log settings"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.refreshConfig();
        this.props.addNotification(
          "error",
          `Error saving Audit Fail Log settings - ${errMsg.desc}`
        );
      });
    }
    refreshConfig() {
      this.setState({
        loading: true,
        loaded: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Audit Fail Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let enabled = false;
        let compressed = false;
        if (attrs["nsslapd-auditfaillog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-auditfaillog-compress"][0] === "on") {
          compressed = true;
        }
        this.setState(
          () => ({
            loading: false,
            loaded: true,
            saveSettingsDisabled: true,
            saveRotationDisabled: true,
            saveExpDisabled: true,
            "nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
            "nsslapd-auditfaillog-logexpirationtime": attrs["nsslapd-auditfaillog-logexpirationtime"][0],
            "nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
            "nsslapd-auditfaillog-logging-enabled": enabled,
            "nsslapd-auditfaillog-logmaxdiskspace": attrs["nsslapd-auditfaillog-logmaxdiskspace"][0],
            "nsslapd-auditfaillog-logminfreediskspace": attrs["nsslapd-auditfaillog-logminfreediskspace"][0],
            "nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
            "nsslapd-auditfaillog-logrotationsynchour": attrs["nsslapd-auditfaillog-logrotationsynchour"][0],
            "nsslapd-auditfaillog-logrotationsyncmin": attrs["nsslapd-auditfaillog-logrotationsyncmin"][0],
            "nsslapd-auditfaillog-logrotationtime": attrs["nsslapd-auditfaillog-logrotationtime"][0],
            "nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
            "nsslapd-auditfaillog-maxlogsize": attrs["nsslapd-auditfaillog-maxlogsize"][0],
            "nsslapd-auditfaillog-maxlogsperdir": attrs["nsslapd-auditfaillog-maxlogsperdir"][0],
            "nsslapd-auditfaillog-compress": compressed,
            // Record original values
            "_nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
            "_nsslapd-auditfaillog-logexpirationtime": attrs["nsslapd-auditfaillog-logexpirationtime"][0],
            "_nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
            "_nsslapd-auditfaillog-logging-enabled": enabled,
            "_nsslapd-auditfaillog-logmaxdiskspace": attrs["nsslapd-auditfaillog-logmaxdiskspace"][0],
            "_nsslapd-auditfaillog-logminfreediskspace": attrs["nsslapd-auditfaillog-logminfreediskspace"][0],
            "_nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
            "_nsslapd-auditfaillog-logrotationsynchour": attrs["nsslapd-auditfaillog-logrotationsynchour"][0],
            "_nsslapd-auditfaillog-logrotationsyncmin": attrs["nsslapd-auditfaillog-logrotationsyncmin"][0],
            "_nsslapd-auditfaillog-logrotationtime": attrs["nsslapd-auditfaillog-logrotationtime"][0],
            "_nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
            "_nsslapd-auditfaillog-maxlogsize": attrs["nsslapd-auditfaillog-maxlogsize"][0],
            "_nsslapd-auditfaillog-maxlogsperdir": attrs["nsslapd-auditfaillog-maxlogsperdir"][0],
            "_nsslapd-auditfaillog-compress": compressed
          })
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading Audit Fail Log configuration - ${errMsg.desc}`
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let compressed = false;
      if (attrs["nsslapd-auditfaillog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-auditfaillog-compress"][0] === "on") {
        compressed = true;
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
        "nsslapd-auditfaillog-logexpirationtime": attrs["nsslapd-auditfaillog-logexpirationtime"][0],
        "nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
        "nsslapd-auditfaillog-logging-enabled": enabled,
        "nsslapd-auditfaillog-logmaxdiskspace": attrs["nsslapd-auditfaillog-logmaxdiskspace"][0],
        "nsslapd-auditfaillog-logminfreediskspace": attrs["nsslapd-auditfaillog-logminfreediskspace"][0],
        "nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
        "nsslapd-auditfaillog-logrotationsynchour": attrs["nsslapd-auditfaillog-logrotationsynchour"][0],
        "nsslapd-auditfaillog-logrotationsyncmin": attrs["nsslapd-auditfaillog-logrotationsyncmin"][0],
        "nsslapd-auditfaillog-logrotationtime": attrs["nsslapd-auditfaillog-logrotationtime"][0],
        "nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
        "nsslapd-auditfaillog-maxlogsize": attrs["nsslapd-auditfaillog-maxlogsize"][0],
        "nsslapd-auditfaillog-maxlogsperdir": attrs["nsslapd-auditfaillog-maxlogsperdir"][0],
        "nsslapd-auditfaillog-compress": compressed,
        // Record original values,
        "_nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
        "_nsslapd-auditfaillog-logexpirationtime": attrs["nsslapd-auditfaillog-logexpirationtime"][0],
        "_nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
        "_nsslapd-auditfaillog-logging-enabled": enabled,
        "_nsslapd-auditfaillog-logmaxdiskspace": attrs["nsslapd-auditfaillog-logmaxdiskspace"][0],
        "_nsslapd-auditfaillog-logminfreediskspace": attrs["nsslapd-auditfaillog-logminfreediskspace"][0],
        "_nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
        "_nsslapd-auditfaillog-logrotationsynchour": attrs["nsslapd-auditfaillog-logrotationsynchour"][0],
        "_nsslapd-auditfaillog-logrotationsyncmin": attrs["nsslapd-auditfaillog-logrotationsyncmin"][0],
        "_nsslapd-auditfaillog-logrotationtime": attrs["nsslapd-auditfaillog-logrotationtime"][0],
        "_nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
        "_nsslapd-auditfaillog-maxlogsize": attrs["nsslapd-auditfaillog-maxlogsize"][0],
        "_nsslapd-auditfaillog-maxlogsperdir": attrs["nsslapd-auditfaillog-maxlogsperdir"][0],
        "_nsslapd-auditfaillog-compress": compressed
      }, this.props.enableTree);
    }
    render() {
      let saveSettingsName = "Save Log Settings";
      let saveRotationName = "Save Rotation Settings";
      let saveDeletionName = "Save Deletion Settings";
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-auditfaillog-logrotationsynchour"] ? this.state["nsslapd-auditfaillog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-auditfaillog-logrotationsyncmin"] ? this.state["nsslapd-auditfaillog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = "Saving settings ...";
        saveRotationName = "Saving settings ...";
        saveDeletionName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      let body = /* @__PURE__ */ import_react121.default.createElement("div", { className: "ds-margin-top-lg ds-left-margin" }, /* @__PURE__ */ import_react121.default.createElement(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react121.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react121.default.createElement(TabTitleText, null, "Settings") }, /* @__PURE__ */ import_react121.default.createElement(
        Checkbox,
        {
          className: "ds-margin-top-xlg",
          id: "nsslapd-auditfaillog-logging-enabled",
          isChecked: this.state["nsslapd-auditfaillog-logging-enabled"],
          onChange: (checked, e) => {
            this.handleChange(e, "settings");
          },
          title: "Enable audit fail logging (nsslapd-auditfaillog-logging-enabled).",
          label: "Enable Audit Fail Logging"
        }
      ), /* @__PURE__ */ import_react121.default.createElement(Grid, { className: "ds-margin-top-xlg ds-margin-left", title: "Enable audit fail logging (nsslapd-auditfaillog)." }, /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Audit Fail Log Location"), /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react121.default.createElement(
        TextInput,
        {
          value: this.state["nsslapd-auditfaillog"],
          type: "text",
          id: "nsslapd-auditfaillog",
          "aria-describedby": "horizontal-form-name-helper",
          name: "nsslapd-auditfaillog",
          onChange: (str, e) => {
            this.handleChange(e, "settings");
          }
        }
      ))), /* @__PURE__ */ import_react121.default.createElement(
        Button,
        {
          key: "save settings",
          isDisabled: this.state.saveSettingsDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("settings");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveSettingsName
      )), /* @__PURE__ */ import_react121.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react121.default.createElement(TabTitleText, null, "Rotation Policy") }, /* @__PURE__ */ import_react121.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react121.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The maximum number of logs that are archived (nsslapd-auditfaillog-maxlogsperdir)."
        },
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Number Of Logs"),
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react121.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditfaillog-maxlogsperdir"],
            min: 1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditfaillog-maxlogsperdir", "rotation");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditfaillog-maxlogsperdir", 1, 2147483647, "rotation");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditfaillog-maxlogsperdir", "rotation");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react121.default.createElement(Grid, { title: "The maximum size of each log file in megabytes (nsslapd-auditfaillog-maxlogsize)." }, /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Log Size (in MB)"), /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react121.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-auditfaillog-maxlogsize"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-auditfaillog-maxlogsize", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-auditfaillog-maxlogsize", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-auditfaillog-maxlogsize", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 6
        }
      ))), /* @__PURE__ */ import_react121.default.createElement("hr", null), /* @__PURE__ */ import_react121.default.createElement(Grid, { title: "Rotate the log based this number of time units (nsslapd-auditfaillog-logrotationtime)." }, /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Create New Log Every ..."), /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react121.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react121.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-auditfaillog-logrotationtime"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-auditfaillog-logrotationtime", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-auditfaillog-logrotationtime", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-auditfaillog-logrotationtime", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 3
        }
      ), /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react121.default.createElement(
        FormSelect,
        {
          id: "nsslapd-auditfaillog-logrotationtimeunit",
          value: this.state["nsslapd-auditfaillog-logrotationtimeunit"],
          onChange: (str, e) => {
            this.handleChange(e, "rotation");
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "0", value: "minute", label: "minute" }),
        /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "1", value: "hour", label: "hour" }),
        /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
        /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
        /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
      ))))), /* @__PURE__ */ import_react121.default.createElement(Grid, { title: "The time when the log should be rotated (nsslapd-auditfaillog-logrotationsynchour, nsslapd-auditfaillog-logrotationsyncmin)." }, /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Time Of Day"), /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react121.default.createElement(
        TimePicker,
        {
          time: rotationTime,
          onChange: this.handleTimeChange,
          is24Hour: true
        }
      ))), /* @__PURE__ */ import_react121.default.createElement(Grid, { title: "Compress (gzip) the log after it's rotated." }, /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Compress Rotated Logs"), /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react121.default.createElement(
        Switch,
        {
          id: "nsslapd-auditfaillog-compress",
          isChecked: this.state["nsslapd-auditfaillog-compress"],
          onChange: this.handleSwitchChange,
          "aria-label": "nsslapd-auditfaillog-compress"
        }
      )))), /* @__PURE__ */ import_react121.default.createElement(
        Button,
        {
          key: "save rot settings",
          isDisabled: this.state.saveRotationDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("rotation");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveRotationName
      )), /* @__PURE__ */ import_react121.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react121.default.createElement(TabTitleText, null, "Deletion Policy") }, /* @__PURE__ */ import_react121.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react121.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-auditfaillog-logmaxdiskspace)."
        },
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log Archive Exceeds (in MB)"),
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react121.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditfaillog-logmaxdiskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditfaillog-logmaxdiskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditfaillog-logmaxdiskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditfaillog-logmaxdiskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react121.default.createElement(
        Grid,
        {
          title: "The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-auditfaillog-logminfreediskspace)."
        },
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Free Disk Space (in MB)"),
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react121.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditfaillog-logminfreediskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditfaillog-logminfreediskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditfaillog-logminfreediskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditfaillog-logminfreediskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react121.default.createElement(
        Grid,
        {
          title: "Server deletes an old archived log file when it is older than the specified age. (nsslapd-auditfaillog-logexpirationtime)."
        },
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log File is Older Than ..."),
        /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react121.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react121.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-auditfaillog-logexpirationtime"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-auditfaillog-logexpirationtime", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-auditfaillog-logexpirationtime", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-auditfaillog-logexpirationtime", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 3
          }
        ), /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react121.default.createElement(
          FormSelect,
          {
            id: "nsslapd-auditfaillog-logexpirationtimeunit",
            value: this.state["nsslapd-auditfaillog-logexpirationtimeunit"],
            onChange: (str, e) => {
              this.handleChange(e, "exp");
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
          /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
          /* @__PURE__ */ import_react121.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
        ))))
      )), /* @__PURE__ */ import_react121.default.createElement(
        Button,
        {
          key: "save del settings",
          isDisabled: this.state.saveExpDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("exp");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveDeletionName
      ))));
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react121.default.createElement("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react121.default.createElement(TextContent, null, /* @__PURE__ */ import_react121.default.createElement(Text, { component: TextVariants.h3 }, "Loading Audit Fail Log Settings ...")), /* @__PURE__ */ import_react121.default.createElement(Spinner, { className: "ds-margin-top", size: "lg" }));
      }
      return /* @__PURE__ */ import_react121.default.createElement("div", { id: "server-auditfaillog-page", className: this.state.loading ? "ds-disabled" : "" }, /* @__PURE__ */ import_react121.default.createElement(Grid, null, /* @__PURE__ */ import_react121.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react121.default.createElement(TextContent, null, /* @__PURE__ */ import_react121.default.createElement(Text, { component: TextVariants.h3 }, "Audit Fail Log Settings", /* @__PURE__ */ import_react121.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh log settings",
          onClick: () => {
            this.refreshConfig();
          }
        }
      ))))), body);
    }
  };
  ServerAuditFailLog.propTypes = {
    addNotification: import_prop_types98.default.func,
    serverId: import_prop_types98.default.string,
    attrs: import_prop_types98.default.object
  };
  ServerAuditFailLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/errorLog.jsx
  var import_react122 = __toESM(require_react(), 1);
  var import_prop_types99 = __toESM(require_prop_types(), 1);
  var settings_attrs4 = [
    "nsslapd-errorlog",
    "nsslapd-errorlog-level",
    "nsslapd-errorlog-logging-enabled"
  ];
  var rotation_attrs4 = [
    "nsslapd-errorlog-logrotationsync-enabled",
    "nsslapd-errorlog-logrotationsynchour",
    "nsslapd-errorlog-logrotationsyncmin",
    "nsslapd-errorlog-logrotationtime",
    "nsslapd-errorlog-logrotationtimeunit",
    "nsslapd-errorlog-maxlogsize",
    "nsslapd-errorlog-maxlogsperdir",
    "nsslapd-errorlog-compress"
  ];
  var rotation_attrs_no_time4 = [
    "nsslapd-errorlog-logrotationsync-enabled",
    "nsslapd-errorlog-logrotationtime",
    "nsslapd-errorlog-logrotationtimeunit",
    "nsslapd-errorlog-maxlogsize",
    "nsslapd-errorlog-maxlogsperdir",
    "nsslapd-errorlog-compress"
  ];
  var exp_attrs6 = [
    "nsslapd-errorlog-logexpirationtime",
    "nsslapd-errorlog-logexpirationtimeunit",
    "nsslapd-errorlog-logmaxdiskspace",
    "nsslapd-errorlog-logminfreediskspace"
  ];
  var ServerErrorLog = class extends import_react122.default.Component {
    constructor(props) {
      super(props);
      this.traceLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Trace Function Calls ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 1)"));
      this.packetLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Packet Handling ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 2)"));
      this.heavyLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Heavy Trace Output ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 4)"));
      this.connLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Connection Management ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 8)"));
      this.packetSentLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Packets Sent & Received ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 16)"));
      this.filterLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Search Filter Processing ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 32)"));
      this.configLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Config File Processing ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 64)"));
      this.aclLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Access Control List Processing ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 128)"));
      this.entryLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Log Entry Parsing ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 2048)"));
      this.houseLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Housekeeping ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 4096)"));
      this.replLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Replication ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 8192)"));
      this.cacheLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Entry Cache ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 32768)"));
      this.pluginLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Plugin ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 65536)"));
      this.aclSummaryevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Access Control Summary ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 262144)"));
      this.dbLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Backend Database ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 524288)"));
      this.pwdpolicyLevel = /* @__PURE__ */ import_react122.default.createElement(import_react122.default.Fragment, null, "Password Policy ", /* @__PURE__ */ import_react122.default.createElement("font", { size: "1", className: "ds-info-color" }, "(level 1048576)"));
      this.state = {
        loading: true,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs,
        canSelectAll: false,
        isExpanded: false,
        rows: [
          { cells: [{ title: this.traceLevel }], level: 1, selected: false },
          { cells: [{ title: this.packetLevel }], level: 2, selected: false },
          { cells: [{ title: this.heavyLevel }], level: 4, selected: false },
          { cells: [{ title: this.connLevel }], level: 8, selected: false },
          { cells: [{ title: this.packetSentLevel }], level: 16, selected: false },
          { cells: [{ title: this.filterLevel }], level: 32, selected: false },
          { cells: [{ title: this.configLevel }], level: 64, selected: false },
          { cells: [{ title: this.aclLevel }], level: 128, selected: false },
          { cells: [{ title: this.entryLevel }], level: 2048, selected: false },
          { cells: [{ title: this.houseLevel }], level: 4096, selected: false },
          { cells: [{ title: this.replLevel }], level: 8192, selected: false },
          { cells: [{ title: this.cacheLevel }], level: 32768, selected: false },
          { cells: [{ title: this.pluginLevel }], level: 65536, selected: false },
          { cells: [{ title: this.aclSummaryevel }], level: 262144, selected: false },
          { cells: [{ title: this.dbLevel }], level: 524288, selected: false },
          { cells: [{ title: this.pwdpolicyLevel }], level: 1048576, selected: false }
        ],
        columns: [
          { title: "Logging Level" }
        ]
      };
      this.handleOnToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.handleRefreshConfig = this.handleRefreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.handleOnSelect = this.handleOnSelect.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs4;
        disableBtnName = "saveSettingsDisabled";
        for (const row of this.state.rows) {
          for (const orig_row of this.state._rows) {
            if (orig_row.level === row.level) {
              if (orig_row.selected !== row.selected) {
                disableSaveBtn = false;
                break;
              }
            }
          }
        }
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs4;
      } else {
        config_attrs = exp_attrs6;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-errorlog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-errorlog-compress", value);
      });
    }
    handleTimeChange(time_str) {
      let disableSaveBtn = true;
      const time_parts = time_str.split(":");
      let hour = time_parts[0];
      let min3 = time_parts[1];
      if (hour.length === 2 && hour[0] === "0") {
        hour = hour[1];
      }
      if (min3.length === 2 && min3[0] === "0") {
        min3 = min3[1];
      }
      for (const config_attr of rotation_attrs_no_time4) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (hour !== this.state["_nsslapd-errorlog-logrotationsynchour"] || min3 !== this.state["_nsslapd-errorlog-logrotationsyncmin"]) {
        disableSaveBtn = false;
      }
      this.setState({
        "nsslapd-errorlog-logrotationsynchour": hour,
        "nsslapd-errorlog-logrotationsyncmin": min3,
        saveRotationDisabled: disableSaveBtn
      });
    }
    saveConfig(nav_tab) {
      let new_level = 0;
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs4;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs4;
      } else {
        config_attrs = exp_attrs6;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      for (const row of this.state.rows) {
        if (row.selected) {
          new_level += row.level;
        }
      }
      if (new_level.toString() !== this.state["_nsslapd-errorlog-level"]) {
        if (new_level === 0) {
          new_level = 16384;
        }
        cmd.push("nsslapd-errorlog-level=" + new_level.toString());
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving Error log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleRefreshConfig();
        this.props.addNotification(
          "success",
          "Successfully updated Error Log settings"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.handleRefreshConfig();
        this.props.addNotification(
          "error",
          `Error saving Error Log settings - ${errMsg.desc}`
        );
      });
    }
    handleRefreshConfig() {
      this.setState({
        loading: true,
        loaded: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleRefreshConfig", "load Error Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let enabled = false;
        let compressed = false;
        const level_val = parseInt(attrs["nsslapd-errorlog-level"][0]);
        const rows = [...this.state.rows];
        if (attrs["nsslapd-errorlog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-errorlog-compress"][0] === "on") {
          compressed = true;
        }
        for (const row in rows) {
          if (rows[row].level & level_val) {
            rows[row].selected = true;
          } else {
            rows[row].selected = false;
          }
        }
        this.setState(
          () => ({
            loading: false,
            loaded: true,
            saveSettingsDisabled: true,
            saveRotationDisabled: true,
            saveExpDisabled: true,
            "nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
            "nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
            "nsslapd-errorlog-logexpirationtime": attrs["nsslapd-errorlog-logexpirationtime"][0],
            "nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
            "nsslapd-errorlog-logging-enabled": enabled,
            "nsslapd-errorlog-logmaxdiskspace": attrs["nsslapd-errorlog-logmaxdiskspace"][0],
            "nsslapd-errorlog-logminfreediskspace": attrs["nsslapd-errorlog-logminfreediskspace"][0],
            "nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
            "nsslapd-errorlog-logrotationsynchour": attrs["nsslapd-errorlog-logrotationsynchour"][0],
            "nsslapd-errorlog-logrotationsyncmin": attrs["nsslapd-errorlog-logrotationsyncmin"][0],
            "nsslapd-errorlog-logrotationtime": attrs["nsslapd-errorlog-logrotationtime"][0],
            "nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
            "nsslapd-errorlog-maxlogsize": attrs["nsslapd-errorlog-maxlogsize"][0],
            "nsslapd-errorlog-maxlogsperdir": attrs["nsslapd-errorlog-maxlogsperdir"][0],
            "nsslapd-errorlog-compress": compressed,
            rows,
            // Record original values
            _rows: JSON.parse(JSON.stringify(rows)),
            "_nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
            "_nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
            "_nsslapd-errorlog-logexpirationtime": attrs["nsslapd-errorlog-logexpirationtime"][0],
            "_nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
            "_nsslapd-errorlog-logging-enabled": enabled,
            "_nsslapd-errorlog-logmaxdiskspace": attrs["nsslapd-errorlog-logmaxdiskspace"][0],
            "_nsslapd-errorlog-logminfreediskspace": attrs["nsslapd-errorlog-logminfreediskspace"][0],
            "_nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
            "_nsslapd-errorlog-logrotationsynchour": attrs["nsslapd-errorlog-logrotationsynchour"][0],
            "_nsslapd-errorlog-logrotationsyncmin": attrs["nsslapd-errorlog-logrotationsyncmin"][0],
            "_nsslapd-errorlog-logrotationtime": attrs["nsslapd-errorlog-logrotationtime"][0],
            "_nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
            "_nsslapd-errorlog-maxlogsize": attrs["nsslapd-errorlog-maxlogsize"][0],
            "_nsslapd-errorlog-maxlogsperdir": attrs["nsslapd-errorlog-maxlogsperdir"][0],
            "_nsslapd-errorlog-compress": compressed
          })
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading Error Log configuration - ${errMsg.desc}`
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let compressed = false;
      const level_val = parseInt(attrs["nsslapd-errorlog-level"][0]);
      const rows = [...this.state.rows];
      if (attrs["nsslapd-errorlog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-errorlog-compress"][0] === "on") {
        compressed = true;
      }
      for (const row in rows) {
        if (rows[row].level & level_val) {
          rows[row].selected = true;
        } else {
          rows[row].selected = false;
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
        "nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
        "nsslapd-errorlog-logexpirationtime": attrs["nsslapd-errorlog-logexpirationtime"][0],
        "nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
        "nsslapd-errorlog-logging-enabled": enabled,
        "nsslapd-errorlog-logmaxdiskspace": attrs["nsslapd-errorlog-logmaxdiskspace"][0],
        "nsslapd-errorlog-logminfreediskspace": attrs["nsslapd-errorlog-logminfreediskspace"][0],
        "nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
        "nsslapd-errorlog-logrotationsynchour": attrs["nsslapd-errorlog-logrotationsynchour"][0],
        "nsslapd-errorlog-logrotationsyncmin": attrs["nsslapd-errorlog-logrotationsyncmin"][0],
        "nsslapd-errorlog-logrotationtime": attrs["nsslapd-errorlog-logrotationtime"][0],
        "nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
        "nsslapd-errorlog-maxlogsize": attrs["nsslapd-errorlog-maxlogsize"][0],
        "nsslapd-errorlog-maxlogsperdir": attrs["nsslapd-errorlog-maxlogsperdir"][0],
        "nsslapd-errorlog-compress": compressed,
        rows,
        // Record original values
        _rows: JSON.parse(JSON.stringify(rows)),
        "_nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
        "_nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
        "_nsslapd-errorlog-logexpirationtime": attrs["nsslapd-errorlog-logexpirationtime"][0],
        "_nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
        "_nsslapd-errorlog-logging-enabled": enabled,
        "_nsslapd-errorlog-logmaxdiskspace": attrs["nsslapd-errorlog-logmaxdiskspace"][0],
        "_nsslapd-errorlog-logminfreediskspace": attrs["nsslapd-errorlog-logminfreediskspace"][0],
        "_nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
        "_nsslapd-errorlog-logrotationsynchour": attrs["nsslapd-errorlog-logrotationsynchour"][0],
        "_nsslapd-errorlog-logrotationsyncmin": attrs["nsslapd-errorlog-logrotationsyncmin"][0],
        "_nsslapd-errorlog-logrotationtime": attrs["nsslapd-errorlog-logrotationtime"][0],
        "_nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
        "_nsslapd-errorlog-maxlogsize": attrs["nsslapd-errorlog-maxlogsize"][0],
        "_nsslapd-errorlog-maxlogsperdir": attrs["nsslapd-errorlog-maxlogsperdir"][0],
        "_nsslapd-errorlog-compress": compressed
      }, this.props.enableTree);
    }
    handleOnSelect(event, isSelected, rowId) {
      let disableSaveBtn = true;
      const rows = [...this.state.rows];
      rows[rowId].selected = isSelected;
      for (const config_attr of settings_attrs4) {
        if (this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const row of rows) {
        for (const orig_row of this.state._rows) {
          if (orig_row.level === row.level) {
            if (orig_row.selected !== row.selected) {
              disableSaveBtn = false;
              break;
            }
          }
        }
      }
      this.setState({
        rows,
        saveSettingsDisabled: disableSaveBtn
      });
    }
    render() {
      let saveSettingsName = "Save Log Settings";
      let saveRotationName = "Save Rotation Settings";
      let saveDeletionName = "Save Deletion Settings";
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-errorlog-logrotationsynchour"] ? this.state["nsslapd-errorlog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-errorlog-logrotationsyncmin"] ? this.state["nsslapd-errorlog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = "Saving settings ...";
        saveRotationName = "Saving settings ...";
        saveDeletionName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      let body = /* @__PURE__ */ import_react122.default.createElement("div", { className: "ds-margin-top-lg ds-left-margin" }, /* @__PURE__ */ import_react122.default.createElement(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react122.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react122.default.createElement(TabTitleText, null, "Settings") }, /* @__PURE__ */ import_react122.default.createElement(
        Checkbox,
        {
          className: "ds-margin-top-xlg",
          id: "nsslapd-errorlog-logging-enabled",
          isChecked: this.state["nsslapd-errorlog-logging-enabled"],
          onChange: (checked, e) => {
            this.handleChange(e, "settings");
          },
          title: "Enable Error logging (nsslapd-errorlog-logging-enabled).",
          label: "Enable Error Logging"
        }
      ), /* @__PURE__ */ import_react122.default.createElement(Form, { className: "ds-margin-top-lg ds-left-margin-md", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react122.default.createElement(
        FormGroup,
        {
          label: "Error Log Location",
          fieldId: "nsslapd-errorlog",
          title: "Enable Error logging (nsslapd-errorlog)."
        },
        /* @__PURE__ */ import_react122.default.createElement(
          TextInput,
          {
            value: this.state["nsslapd-errorlog"],
            type: "text",
            id: "nsslapd-errorlog",
            "aria-describedby": "horizontal-form-name-helper",
            name: "nsslapd-errorlog",
            onChange: (str, e) => {
              this.handleChange(e, "settings");
            }
          }
        )
      )), /* @__PURE__ */ import_react122.default.createElement(
        ExpandableSection,
        {
          className: "ds-left-margin-md ds-margin-top-lg ds-font-size-md",
          toggleText: this.state.isExpanded ? "Hide Verbose Logging Levels" : "Show Verbose Logging Levels",
          onToggle: this.handleOnToggle,
          isExpanded: this.state.isExpanded
        },
        /* @__PURE__ */ import_react122.default.createElement(
          Table,
          {
            className: "ds-left-margin",
            onSelect: this.handleOnSelect,
            canSelectAll: this.state.canSelectAll,
            variant: TableVariant.compact,
            "aria-label": "Selectable Table",
            cells: this.state.columns,
            rows: this.state.rows
          },
          /* @__PURE__ */ import_react122.default.createElement(TableHeader, null),
          /* @__PURE__ */ import_react122.default.createElement(TableBody, null)
        )
      ), /* @__PURE__ */ import_react122.default.createElement(
        Button,
        {
          key: "save settings",
          isDisabled: this.state.saveSettingsDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("settings");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveSettingsName
      )), /* @__PURE__ */ import_react122.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react122.default.createElement(TabTitleText, null, "Rotation Policy") }, /* @__PURE__ */ import_react122.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react122.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The maximum number of logs that are archived (nsslapd-errorlog-maxlogsperdir)."
        },
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Number Of Logs"),
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react122.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-errorlog-maxlogsperdir"],
            min: 1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-errorlog-maxlogsperdir", "rotation");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-errorlog-maxlogsperdir", 1, 2147483647, "rotation");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-errorlog-maxlogsperdir", "rotation");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react122.default.createElement(Grid, { title: "The maximum size of each log file in megabytes (nsslapd-errorlog-maxlogsize)." }, /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Log Size (in MB)"), /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react122.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-errorlog-maxlogsize"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-errorlog-maxlogsize", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-errorlog-maxlogsize", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-errorlog-maxlogsize", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 6
        }
      ))), /* @__PURE__ */ import_react122.default.createElement("hr", null), /* @__PURE__ */ import_react122.default.createElement(Grid, { title: "Rotate the log based this number of time units (nsslapd-errorlog-logrotationtime)." }, /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Create New Log Every ..."), /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react122.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react122.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-errorlog-logrotationtime"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-errorlog-logrotationtime", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-errorlog-logrotationtime", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-errorlog-logrotationtime", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 3
        }
      ), /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react122.default.createElement(
        FormSelect,
        {
          id: "nsslapd-errorlog-logrotationtimeunit",
          value: this.state["nsslapd-errorlog-logrotationtimeunit"],
          onChange: (str, e) => {
            this.handleChange(e, "rotation");
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "0", value: "minute", label: "minute" }),
        /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "1", value: "hour", label: "hour" }),
        /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
        /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
        /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
      ))))), /* @__PURE__ */ import_react122.default.createElement(Grid, { title: "The time when the log should be rotated (nsslapd-errorlog-logrotationsynchour, nsslapd-errorlog-logrotationsyncmin)." }, /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Time Of Day"), /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react122.default.createElement(
        TimePicker,
        {
          time: rotationTime,
          onChange: this.handleTimeChange,
          is24Hour: true
        }
      ))), /* @__PURE__ */ import_react122.default.createElement(Grid, { title: "Compress (gzip) the log after it's rotated." }, /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Compress Rotated Logs"), /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react122.default.createElement(
        Switch,
        {
          id: "nsslapd-errorlog-compress",
          isChecked: this.state["nsslapd-errorlog-compress"],
          onChange: this.handleSwitchChange,
          "aria-label": "nsslapd-errorlog-compress"
        }
      )))), /* @__PURE__ */ import_react122.default.createElement(
        Button,
        {
          key: "save rot settings",
          isDisabled: this.state.saveRotationDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("rotation");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveRotationName
      )), /* @__PURE__ */ import_react122.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react122.default.createElement(TabTitleText, null, "Deletion Policy") }, /* @__PURE__ */ import_react122.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react122.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-errorlog-logmaxdiskspace)."
        },
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log Archive Exceeds (in MB)"),
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react122.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-errorlog-logmaxdiskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-errorlog-logmaxdiskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-errorlog-logmaxdiskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-errorlog-logmaxdiskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react122.default.createElement(
        Grid,
        {
          title: "The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-errorlog-logminfreediskspace)."
        },
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Free Disk Space (in MB)"),
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react122.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-errorlog-logminfreediskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-errorlog-logminfreediskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-errorlog-logminfreediskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-errorlog-logminfreediskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react122.default.createElement(
        Grid,
        {
          title: "Server deletes an old archived log file when it is older than the specified age. (nsslapd-errorlog-logexpirationtime)."
        },
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log File is Older Than ..."),
        /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react122.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react122.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-errorlog-logexpirationtime"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-errorlog-logexpirationtime", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-errorlog-logexpirationtime", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-errorlog-logexpirationtime", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 3
          }
        ), /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react122.default.createElement(
          FormSelect,
          {
            id: "nsslapd-errorlog-logexpirationtimeunit",
            value: this.state["nsslapd-errorlog-logexpirationtimeunit"],
            onChange: (str, e) => {
              this.handleChange(e, "exp");
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
          /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
          /* @__PURE__ */ import_react122.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
        ))))
      )), /* @__PURE__ */ import_react122.default.createElement(
        Button,
        {
          key: "save del settings",
          isDisabled: this.state.saveExpDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("exp");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveDeletionName
      ))));
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react122.default.createElement("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react122.default.createElement(TextContent, null, /* @__PURE__ */ import_react122.default.createElement(Text, { component: TextVariants.h3 }, "Loading Error Log Settings ...")), /* @__PURE__ */ import_react122.default.createElement(Spinner, { className: "ds-margin-top", size: "lg" }));
      }
      return /* @__PURE__ */ import_react122.default.createElement("div", { id: "server-errorlog-page", className: this.state.loading ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md" }, /* @__PURE__ */ import_react122.default.createElement(Grid, null, /* @__PURE__ */ import_react122.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react122.default.createElement(TextContent, null, /* @__PURE__ */ import_react122.default.createElement(Text, { component: TextVariants.h3 }, "Error Log Settings", /* @__PURE__ */ import_react122.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh log settings",
          onClick: () => {
            this.handleRefreshConfig();
          }
        }
      ))))), body);
    }
  };
  ServerErrorLog.propTypes = {
    addNotification: import_prop_types99.default.func,
    serverId: import_prop_types99.default.string,
    attrs: import_prop_types99.default.object
  };
  ServerErrorLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/securityLog.jsx
  var import_react123 = __toESM(require_react(), 1);
  var import_prop_types100 = __toESM(require_prop_types(), 1);
  var settings_attrs5 = [
    "nsslapd-securitylog",
    "nsslapd-securitylog-level",
    "nsslapd-securitylog-logbuffering",
    "nsslapd-securitylog-logging-enabled"
  ];
  var rotation_attrs5 = [
    "nsslapd-securitylog-logrotationsync-enabled",
    "nsslapd-securitylog-logrotationsynchour",
    "nsslapd-securitylog-logrotationsyncmin",
    "nsslapd-securitylog-logrotationtime",
    "nsslapd-securitylog-logrotationtimeunit",
    "nsslapd-securitylog-maxlogsize",
    "nsslapd-securitylog-maxlogsperdir",
    "nsslapd-securitylog-compress"
  ];
  var rotation_attrs_no_time5 = [
    "nsslapd-securitylog-logrotationsync-enabled",
    "nsslapd-securitylog-logrotationtime",
    "nsslapd-securitylog-logrotationtimeunit",
    "nsslapd-securitylog-maxlogsize",
    "nsslapd-securitylog-maxlogsperdir",
    "nsslapd-securitylog-compress"
  ];
  var exp_attrs7 = [
    "nsslapd-securitylog-logexpirationtime",
    "nsslapd-securitylog-logexpirationtimeunit",
    "nsslapd-securitylog-logmaxdiskspace",
    "nsslapd-securitylog-logminfreediskspace"
  ];
  var ServerSecurityLog = class extends import_react123.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs,
        canSelectAll: false,
        isExpanded: false,
        rows: [
          { cells: ["Default Logging"], level: 256, selected: true },
          { cells: ["Internal Operations"], level: 4, selected: false },
          { cells: ["Entry Security and Referrals"], level: 512, selected: false }
        ],
        columns: [
          { title: "Logging Level" }
        ]
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleOnToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.handleOnSelect = this.handleOnSelect.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs5;
        disableBtnName = "saveSettingsDisabled";
        for (const row of this.state.rows) {
          for (const orig_row of this.state._rows) {
            if (orig_row.cells[0] === row.cells[0]) {
              if (orig_row.selected !== row.selected) {
                disableSaveBtn = false;
                break;
              }
            }
          }
        }
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs5;
      } else {
        config_attrs = exp_attrs7;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-securitylog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-securitylog-compress", value);
      });
    }
    handleTimeChange(time_str) {
      let disableSaveBtn = true;
      const time_parts = time_str.split(":");
      let hour = time_parts[0];
      let min3 = time_parts[1];
      if (hour.length === 2 && hour[0] === "0") {
        hour = hour[1];
      }
      if (min3.length === 2 && min3[0] === "0") {
        min3 = min3[1];
      }
      for (const config_attr of rotation_attrs_no_time5) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (hour !== this.state["_nsslapd-securitylog-logrotationsynchour"] || min3 !== this.state["_nsslapd-securitylog-logrotationsyncmin"]) {
        disableSaveBtn = false;
      }
      this.setState({
        "nsslapd-securitylog-logrotationsynchour": hour,
        "nsslapd-securitylog-logrotationsyncmin": min3,
        saveRotationDisabled: disableSaveBtn
      });
    }
    saveConfig(nav_tab) {
      let new_level = 0;
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs5;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs5;
      } else {
        config_attrs = exp_attrs7;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      for (const row of this.state.rows) {
        if (row.selected) {
          new_level += row.level;
        }
      }
      if (new_level.toString() !== this.state["_nsslapd-securitylog-level"]) {
        if (new_level === 0) {
          new_level = 256;
        }
        cmd.push("nsslapd-securitylog-level=" + new_level.toString());
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving security log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.refreshConfig();
        this.props.addNotification(
          "success",
          "Successfully updated Security Log settings"
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.refreshConfig();
        this.props.addNotification(
          "error",
          `Error saving Security Log settings - ${errMsg.desc}`
        );
      });
    }
    refreshConfig(refesh) {
      this.setState({
        loading: true,
        loaded: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Security Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        let enabled = false;
        let buffering = false;
        let compress = false;
        const level_val = parseInt(attrs["nsslapd-securitylog-level"][0]);
        const rows = [...this.state.rows];
        if (attrs["nsslapd-securitylog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-securitylog-logbuffering"][0] === "on") {
          buffering = true;
        }
        if (attrs["nsslapd-securitylog-compress"][0] === "on") {
          compress = true;
        }
        for (const row in rows) {
          if (rows[row].level & level_val) {
            rows[row].selected = true;
          } else {
            rows[row].selected = false;
          }
        }
        this.setState({
          loading: false,
          loaded: true,
          saveSettingsDisabled: true,
          saveRotationDisabled: true,
          saveExpDisabled: true,
          "nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
          "nsslapd-securitylog-level": attrs["nsslapd-securitylog-level"][0],
          "nsslapd-securitylog-logbuffering": buffering,
          "nsslapd-securitylog-logexpirationtime": attrs["nsslapd-securitylog-logexpirationtime"][0],
          "nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
          "nsslapd-securitylog-logging-enabled": enabled,
          "nsslapd-securitylog-logmaxdiskspace": attrs["nsslapd-securitylog-logmaxdiskspace"][0],
          "nsslapd-securitylog-logminfreediskspace": attrs["nsslapd-securitylog-logminfreediskspace"][0],
          "nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
          "nsslapd-securitylog-logrotationsynchour": attrs["nsslapd-securitylog-logrotationsynchour"][0],
          "nsslapd-securitylog-logrotationsyncmin": attrs["nsslapd-securitylog-logrotationsyncmin"][0],
          "nsslapd-securitylog-logrotationtime": attrs["nsslapd-securitylog-logrotationtime"][0],
          "nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
          "nsslapd-securitylog-maxlogsize": attrs["nsslapd-securitylog-maxlogsize"][0],
          "nsslapd-securitylog-maxlogsperdir": attrs["nsslapd-securitylog-maxlogsperdir"][0],
          "nsslapd-securitylog-compress": compress,
          rows,
          // Record original values
          _rows: JSON.parse(JSON.stringify(rows)),
          "_nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
          "_nsslapd-securitylog-level": attrs["nsslapd-securitylog-level"][0],
          "_nsslapd-securitylog-logbuffering": buffering,
          "_nsslapd-securitylog-logexpirationtime": attrs["nsslapd-securitylog-logexpirationtime"][0],
          "_nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
          "_nsslapd-securitylog-logging-enabled": enabled,
          "_nsslapd-securitylog-logmaxdiskspace": attrs["nsslapd-securitylog-logmaxdiskspace"][0],
          "_nsslapd-securitylog-logminfreediskspace": attrs["nsslapd-securitylog-logminfreediskspace"][0],
          "_nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
          "_nsslapd-securitylog-logrotationsynchour": attrs["nsslapd-securitylog-logrotationsynchour"][0],
          "_nsslapd-securitylog-logrotationsyncmin": attrs["nsslapd-securitylog-logrotationsyncmin"][0],
          "_nsslapd-securitylog-logrotationtime": attrs["nsslapd-securitylog-logrotationtime"][0],
          "_nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
          "_nsslapd-securitylog-maxlogsize": attrs["nsslapd-securitylog-maxlogsize"][0],
          "_nsslapd-securitylog-maxlogsperdir": attrs["nsslapd-securitylog-maxlogsperdir"][0],
          "_nsslapd-securitylog-compress": compress
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error loading Security Log configuration - ${errMsg.desc}`
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let buffering = false;
      let compress = false;
      const level_val = parseInt(attrs["nsslapd-securitylog-level"][0]);
      const rows = [...this.state.rows];
      if (attrs["nsslapd-securitylog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-securitylog-logbuffering"][0] === "on") {
        buffering = true;
      }
      if (attrs["nsslapd-securitylog-compress"][0] === "on") {
        compress = true;
      }
      for (const row in rows) {
        if (rows[row].level & level_val) {
          rows[row].selected = true;
        } else {
          rows[row].selected = false;
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
        "nsslapd-securitylog-level": attrs["nsslapd-securitylog-level"][0],
        "nsslapd-securitylog-logbuffering": buffering,
        "nsslapd-securitylog-logexpirationtime": attrs["nsslapd-securitylog-logexpirationtime"][0],
        "nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
        "nsslapd-securitylog-logging-enabled": enabled,
        "nsslapd-securitylog-logmaxdiskspace": attrs["nsslapd-securitylog-logmaxdiskspace"][0],
        "nsslapd-securitylog-logminfreediskspace": attrs["nsslapd-securitylog-logminfreediskspace"][0],
        "nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
        "nsslapd-securitylog-logrotationsynchour": attrs["nsslapd-securitylog-logrotationsynchour"][0],
        "nsslapd-securitylog-logrotationsyncmin": attrs["nsslapd-securitylog-logrotationsyncmin"][0],
        "nsslapd-securitylog-logrotationtime": attrs["nsslapd-securitylog-logrotationtime"][0],
        "nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
        "nsslapd-securitylog-maxlogsize": attrs["nsslapd-securitylog-maxlogsize"][0],
        "nsslapd-securitylog-maxlogsperdir": attrs["nsslapd-securitylog-maxlogsperdir"][0],
        "nsslapd-securitylog-compress": compress,
        rows,
        // Record original values
        _rows: JSON.parse(JSON.stringify(rows)),
        "_nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
        "_nsslapd-securitylog-level": attrs["nsslapd-securitylog-level"][0],
        "_nsslapd-securitylog-logbuffering": buffering,
        "_nsslapd-securitylog-logexpirationtime": attrs["nsslapd-securitylog-logexpirationtime"][0],
        "_nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
        "_nsslapd-securitylog-logging-enabled": enabled,
        "_nsslapd-securitylog-logmaxdiskspace": attrs["nsslapd-securitylog-logmaxdiskspace"][0],
        "_nsslapd-securitylog-logminfreediskspace": attrs["nsslapd-securitylog-logminfreediskspace"][0],
        "_nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
        "_nsslapd-securitylog-logrotationsynchour": attrs["nsslapd-securitylog-logrotationsynchour"][0],
        "_nsslapd-securitylog-logrotationsyncmin": attrs["nsslapd-securitylog-logrotationsyncmin"][0],
        "_nsslapd-securitylog-logrotationtime": attrs["nsslapd-securitylog-logrotationtime"][0],
        "_nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
        "_nsslapd-securitylog-maxlogsize": attrs["nsslapd-securitylog-maxlogsize"][0],
        "_nsslapd-securitylog-maxlogsperdir": attrs["nsslapd-securitylog-maxlogsperdir"][0],
        "_nsslapd-securitylog-compress": compress
      }, this.props.enableTree);
    }
    handleOnSelect(event, isSelected, rowId) {
      let disableSaveBtn = true;
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      rows[rowId].selected = isSelected;
      for (const config_attr of settings_attrs5) {
        if (this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const row of rows) {
        for (const orig_row of this.state._rows) {
          if (orig_row.cells[0] === row.cells[0]) {
            if (orig_row.selected !== row.selected) {
              disableSaveBtn = false;
              break;
            }
          }
        }
      }
      this.setState({
        rows,
        saveSettingsDisabled: disableSaveBtn
      });
    }
    render() {
      let saveSettingsName = "Save Log Settings";
      let saveRotationName = "Save Rotation Settings";
      let saveDeletionName = "Save Deletion Settings";
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-securitylog-logrotationsynchour"] ? this.state["nsslapd-securitylog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-securitylog-logrotationsyncmin"] ? this.state["nsslapd-securitylog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = "Saving settings ...";
        saveRotationName = "Saving settings ...";
        saveDeletionName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      let body = /* @__PURE__ */ import_react123.default.createElement("div", { className: "ds-margin-top-lg ds-left-margin" }, /* @__PURE__ */ import_react123.default.createElement(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react123.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react123.default.createElement(TabTitleText, null, "Settings") }, /* @__PURE__ */ import_react123.default.createElement(
        Checkbox,
        {
          className: "ds-margin-top-xlg",
          id: "nsslapd-securitylog-logging-enabled",
          isChecked: this.state["nsslapd-securitylog-logging-enabled"],
          onChange: (checked, e) => {
            this.handleChange(e, "settings");
          },
          title: "Enable security logging (nsslapd-securitylog-logging-enabled).",
          label: "Enable Security Logging"
        }
      ), /* @__PURE__ */ import_react123.default.createElement(Form, { className: "ds-margin-top-lg ds-left-margin-md", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react123.default.createElement(
        FormGroup,
        {
          label: "Security Log Location",
          fieldId: "nsslapd-securitylog",
          title: "Enable security logging (nsslapd-securitylog)."
        },
        /* @__PURE__ */ import_react123.default.createElement(
          TextInput,
          {
            value: this.state["nsslapd-securitylog"],
            type: "text",
            id: "nsslapd-securitylog",
            "aria-describedby": "horizontal-form-name-helper",
            name: "nsslapd-securitylog",
            onChange: (str, e) => {
              this.handleChange(e, "settings");
            }
          }
        )
      )), /* @__PURE__ */ import_react123.default.createElement(
        Checkbox,
        {
          className: "ds-left-margin-md ds-margin-top-lg",
          id: "nsslapd-securitylog-logbuffering",
          isChecked: this.state["nsslapd-securitylog-logbuffering"],
          onChange: (checked, e) => {
            this.handleChange(e, "settings");
          },
          title: "Disable security log buffering for faster troubleshooting, but this will impact server performance (nsslapd-securitylog-logbuffering).",
          label: "Security Log Buffering Enabled"
        }
      ), /* @__PURE__ */ import_react123.default.createElement(
        ExpandableSection,
        {
          className: "ds-hidden ds-left-margin-md ds-margin-top-lg ds-font-size-md",
          toggleText: this.state.isExpanded ? "Hide Logging Levels" : "Show Logging Levels",
          onToggle: this.handleOnToggle,
          isExpanded: this.state.isExpanded
        },
        /* @__PURE__ */ import_react123.default.createElement(
          Table,
          {
            className: "ds-left-margin",
            onSelect: this.handleOnSelect,
            canSelectAll: this.state.canSelectAll,
            variant: TableVariant.compact,
            "aria-label": "Selectable Table",
            cells: this.state.columns,
            rows: this.state.rows
          },
          /* @__PURE__ */ import_react123.default.createElement(TableHeader, null),
          /* @__PURE__ */ import_react123.default.createElement(TableBody, null)
        )
      ), /* @__PURE__ */ import_react123.default.createElement(
        Button,
        {
          key: "save settings",
          isDisabled: this.state.saveSettingsDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("settings");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveSettingsName
      )), /* @__PURE__ */ import_react123.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react123.default.createElement(TabTitleText, null, "Rotation Policy") }, /* @__PURE__ */ import_react123.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react123.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The maximum number of logs that are archived (nsslapd-securitylog-maxlogsperdir)."
        },
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Number Of Logs"),
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react123.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-securitylog-maxlogsperdir"],
            min: 1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-securitylog-maxlogsperdir", "rotation");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-securitylog-maxlogsperdir", 1, 2147483647, "rotation");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-securitylog-maxlogsperdir", "rotation");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react123.default.createElement(Grid, { title: "The maximum size of each log file in megabytes (nsslapd-securitylog-maxlogsize)." }, /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum Log Size (in MB)"), /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react123.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-securitylog-maxlogsize"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-securitylog-maxlogsize", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-securitylog-maxlogsize", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-securitylog-maxlogsize", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 6
        }
      ))), /* @__PURE__ */ import_react123.default.createElement("hr", null), /* @__PURE__ */ import_react123.default.createElement(Grid, { title: "Rotate the log based this number of time units (nsslapd-securitylog-logrotationtime)." }, /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Create New Log Every ..."), /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react123.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react123.default.createElement(
        NumberInput,
        {
          value: this.state["nsslapd-securitylog-logrotationtime"],
          min: -1,
          max: 2147483647,
          onMinus: () => {
            this.onMinusConfig("nsslapd-securitylog-logrotationtime", "rotation");
          },
          onChange: (e) => {
            this.onConfigChange(e, "nsslapd-securitylog-logrotationtime", -1, 2147483647, "rotation");
          },
          onPlus: () => {
            this.onPlusConfig("nsslapd-securitylog-logrotationtime", "rotation");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 3
        }
      ), /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react123.default.createElement(
        FormSelect,
        {
          id: "nsslapd-securitylog-logrotationtimeunit",
          value: this.state["nsslapd-securitylog-logrotationtimeunit"],
          onChange: (str, e) => {
            this.handleChange(e, "rotation");
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "0", value: "minute", label: "minute" }),
        /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "1", value: "hour", label: "hour" }),
        /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
        /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
        /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
      ))))), /* @__PURE__ */ import_react123.default.createElement(Grid, { title: "The time when the log should be rotated (nsslapd-securitylog-logrotationsynchour, nsslapd-securitylog-logrotationsyncmin)." }, /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Time Of Day"), /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react123.default.createElement(
        TimePicker,
        {
          time: rotationTime,
          onChange: this.handleTimeChange,
          is24Hour: true
        }
      ))), /* @__PURE__ */ import_react123.default.createElement(Grid, { title: "Compress (gzip) the log after it's rotated." }, /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Compress Rotated Logs"), /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 8 }, /* @__PURE__ */ import_react123.default.createElement(
        Switch,
        {
          id: "nsslapd-securitylog-compress",
          isChecked: this.state["nsslapd-securitylog-compress"],
          onChange: this.handleSwitchChange
        }
      )))), /* @__PURE__ */ import_react123.default.createElement(
        Button,
        {
          key: "save rot settings",
          isDisabled: this.state.saveRotationDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("rotation");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveRotationName
      )), /* @__PURE__ */ import_react123.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react123.default.createElement(TabTitleText, null, "Deletion Policy") }, /* @__PURE__ */ import_react123.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react123.default.createElement(
        Grid,
        {
          className: "ds-margin-top",
          title: "The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-securitylog-logmaxdiskspace)."
        },
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log Archive Exceeds (in MB)"),
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react123.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-securitylog-logmaxdiskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-securitylog-logmaxdiskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-securitylog-logmaxdiskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-securitylog-logmaxdiskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react123.default.createElement(
        Grid,
        {
          title: "The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-securitylog-logminfreediskspace)."
        },
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Free Disk Space (in MB)"),
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 1 }, /* @__PURE__ */ import_react123.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-securitylog-logminfreediskspace"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-securitylog-logminfreediskspace", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-securitylog-logminfreediskspace", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-securitylog-logminfreediskspace", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 6
          }
        ))
      ), /* @__PURE__ */ import_react123.default.createElement(
        Grid,
        {
          title: "Server deletes an old archived log file when it is older than the specified age. (nsslapd-securitylog-logexpirationtime)."
        },
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Log File is Older Than ..."),
        /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react123.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react123.default.createElement(
          NumberInput,
          {
            value: this.state["nsslapd-securitylog-logexpirationtime"],
            min: -1,
            max: 2147483647,
            onMinus: () => {
              this.onMinusConfig("nsslapd-securitylog-logexpirationtime", "exp");
            },
            onChange: (e) => {
              this.onConfigChange(e, "nsslapd-securitylog-logexpirationtime", -1, 2147483647, "exp");
            },
            onPlus: () => {
              this.onPlusConfig("nsslapd-securitylog-logexpirationtime", "exp");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 3
          }
        ), /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 2, className: "ds-left-indent" }, /* @__PURE__ */ import_react123.default.createElement(
          FormSelect,
          {
            id: "nsslapd-securitylog-logexpirationtimeunit",
            value: this.state["nsslapd-securitylog-logexpirationtimeunit"],
            onChange: (str, e) => {
              this.handleChange(e, "exp");
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "2", value: "day", label: "day" }),
          /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "3", value: "week", label: "week" }),
          /* @__PURE__ */ import_react123.default.createElement(FormSelectOption, { key: "4", value: "month", label: "month" })
        ))))
      )), /* @__PURE__ */ import_react123.default.createElement(
        Button,
        {
          key: "save del settings",
          isDisabled: this.state.saveExpDisabled || this.state.loading,
          variant: "primary",
          className: "ds-margin-top-xlg",
          onClick: () => {
            this.saveConfig("exp");
          },
          isLoading: this.state.loading,
          spinnerAriaValueText: this.state.loading ? "Saving" : void 0,
          ...extraPrimaryProps
        },
        saveDeletionName
      ))));
      if (!this.state.loaded) {
        body = /* @__PURE__ */ import_react123.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react123.default.createElement(TextContent, null, /* @__PURE__ */ import_react123.default.createElement(Text, { component: TextVariants.h3 }, "Loading Security Log Settings ...")), /* @__PURE__ */ import_react123.default.createElement(Spinner, { size: "xl" }));
      }
      return /* @__PURE__ */ import_react123.default.createElement("div", { id: "server-securitylog-page", className: this.state.loading ? "ds-disabled" : "" }, /* @__PURE__ */ import_react123.default.createElement(Grid, null, /* @__PURE__ */ import_react123.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react123.default.createElement(TextContent, null, /* @__PURE__ */ import_react123.default.createElement(Text, { component: TextVariants.h3 }, "Security Log Settings", /* @__PURE__ */ import_react123.default.createElement(
        FontAwesomeIcon,
        {
          size: "lg",
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh log settings",
          onClick: () => {
            this.refreshConfig();
          }
        }
      ))))), body);
    }
  };
  ServerSecurityLog.propTypes = {
    addNotification: import_prop_types100.default.func,
    serverId: import_prop_types100.default.string,
    attrs: import_prop_types100.default.object
  };
  ServerSecurityLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/security.jsx
  var import_react128 = __toESM(require_react(), 1);

  // src/lib/security/certificateManagement.jsx
  var import_react126 = __toESM(require_react(), 1);

  // src/lib/security/securityTables.jsx
  var import_react124 = __toESM(require_react(), 1);
  var import_prop_types101 = __toESM(require_prop_types(), 1);
  var KeyTable = class extends import_react124.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        hasRows: false,
        columns: [
          { title: "Cipher", transforms: [sortable] },
          { title: "Key Identifier", transforms: [sortable] },
          { title: "State", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let hasRows = true;
      for (const ServerKey of this.props.ServerKeys) {
        rows.push(
          {
            isOpen: false,
            cells: [ServerKey.attrs.cipher, ServerKey.attrs.key_id, ServerKey.attrs.state]
          }
        );
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Orphan keys"] }];
        columns = [{ title: "Orphan keys" }];
        hasRows = false;
      }
      this.setState({
        rows,
        columns,
        hasRows
      });
    }
    actions() {
      return [
        {
          title: "Delete Key",
          onClick: (event, rowId, rowData, extra) => {
            if (rowData.cells[1]) {
              this.props.delKey(rowData.cells[1]);
            }
          }
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, columns, hasRows } = this.state;
      return /* @__PURE__ */ import_react124.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react124.default.createElement(
        Tooltip,
        {
          content: /* @__PURE__ */ import_react124.default.createElement("div", null, /* @__PURE__ */ import_react124.default.createElement("p", null, "An orphan key is a private key in the NSS DB for which there is NO cert with the corresponding public key. An orphan key is created during CSR creation, when the certificate associated with a CSR has been imported into the NSS DB its orphan state will be removed.", /* @__PURE__ */ import_react124.default.createElement("br", null), /* @__PURE__ */ import_react124.default.createElement("br", null), "Make sure an orphan key is not associated with a submitted CSR before you delete it."))
        },
        /* @__PURE__ */ import_react124.default.createElement("a", { className: "ds-font-size-sm" }, "What is an orphan key?")
      ), /* @__PURE__ */ import_react124.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "orph key table",
          cells: columns,
          key: rows,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: hasRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react124.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react124.default.createElement(TableBody, null)
      ), hasRows && /* @__PURE__ */ import_react124.default.createElement(
        Pagination,
        {
          itemCount: this.state.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var CSRTable = class extends import_react124.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Name", transforms: [sortable] },
          { title: "Subject DN", transforms: [sortable] },
          { title: "Subject Alternative Names", transforms: [sortable] },
          { title: "Modification Date", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let hasRows = true;
      for (const ServerCSR of this.props.ServerCSRs) {
        rows.push(
          {
            isOpen: false,
            cells: [
              ServerCSR.attrs.name,
              ServerCSR.attrs.subject,
              ServerCSR.attrs.subject_alt_names.join(", "),
              ServerCSR.attrs.modified
            ]
          }
        );
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Certificate Signing Requests"] }];
        columns = [{ title: "Certificate Signing Requests" }];
        hasRows = false;
      }
      this.setState({
        rows,
        columns,
        hasRows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      for (const cert of this.props.ServerCSRs) {
        const val = value.toLowerCase();
        if (val !== "" && cert.attrs.name.toLowerCase().indexOf(val) === -1 && cert.attrs.subject.toLowerCase().indexOf(val) === -1 && cert.attrs.subject_alt_names.join().toLowerCase().indexOf(val) === -1 && cert.attrs.modified.toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              cert.attrs.name,
              cert.attrs.subject,
              cert.attrs.subject_alt_names.join(", "),
              cert.attrs.modified
            ]
          }
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Delete CSR",
          onClick: (event, rowId, rowData, extra) => {
            if (rowData.cells.length > 1) {
              this.props.delCSR(rowData.cells[0]);
            }
          }
        },
        {
          title: "View CSR",
          onClick: (event, rowId, rowData, extra) => {
            if (rowData.cells.length > 1) {
              this.props.viewCSR(rowData.cells[0]);
            }
          }
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, columns, hasRows } = this.state;
      return /* @__PURE__ */ import_react124.default.createElement("div", { className: "ds-margin-top-lg" }, hasRows && /* @__PURE__ */ import_react124.default.createElement(
        SearchInput,
        {
          placeholder: "Search CSRs",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react124.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "csr table",
          cells: columns,
          key: rows,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: hasRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react124.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react124.default.createElement(TableBody, null)
      ), hasRows && /* @__PURE__ */ import_react124.default.createElement(
        Pagination,
        {
          itemCount: rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var CertTable = class extends import_react124.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        dropdownIsOpen: false,
        hasRows: false,
        columns: [
          {
            title: "Nickname",
            transforms: [sortable],
            cellFormatters: [expandable]
          },
          { title: "Subject DN", transforms: [sortable] },
          { title: "Expiration Date", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          3: this.state.rows[idx].cells[2],
          issuer: this.state.rows[idx].issuer,
          flags: this.state.rows[idx].flags
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2],
            srow[3]
          ],
          issuer: srow.issuer,
          flags: srow.flags
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(issuer, flags) {
      return /* @__PURE__ */ import_react124.default.createElement(Grid, { className: "ds-left-indent-lg" }, /* @__PURE__ */ import_react124.default.createElement(GridItem, { span: 3 }, "Issuer DN:"), /* @__PURE__ */ import_react124.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react124.default.createElement("b", null, issuer)), /* @__PURE__ */ import_react124.default.createElement(GridItem, { span: 3 }, "Trust Flags:"), /* @__PURE__ */ import_react124.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react124.default.createElement("b", null, flags)));
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let count = 0;
      let hasRows = true;
      for (const cert of this.props.certs) {
        rows.push(
          {
            isOpen: false,
            cells: [cert.attrs.nickname, cert.attrs.subject, cert.attrs.expires],
            issuer: cert.attrs.issuer,
            flags: cert.attrs.flags
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(cert.attrs.issuer, cert.attrs.flags) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Certificates"] }];
        columns = [{ title: "Certificates" }];
        hasRows = false;
      }
      this.setState({
        rows,
        columns,
        hasRows
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const cert of this.props.certs) {
        const val = value.toLowerCase();
        if (val !== "" && cert.attrs.nickname.toLowerCase().indexOf(val) === -1 && cert.attrs.subject.toLowerCase().indexOf(val) === -1 && cert.attrs.issuer.toLowerCase().indexOf(val) === -1 && cert.attrs.expires.toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [cert.attrs.nickname, cert.attrs.subject, cert.attrs.expires],
            issuer: cert.attrs.issuer,
            flags: cert.attrs.flags
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(cert.attrs.issuer, cert.attrs.flags) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "Edit Trust Flags",
          onClick: (event, rowId, rowData, extra) => this.props.editCert(rowData.cells[0], rowData.flags)
        },
        {
          title: "Export Certificate",
          onClick: (event, rowId, rowData, extra) => this.props.exportCert(rowData.cells[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Delete Certificate",
          onClick: (event, rowId, rowData, extra) => this.props.delCert(rowData.cells[0])
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, columns, hasRows } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ import_react124.default.createElement("div", { className: "ds-margin-top-lg" }, hasRows && /* @__PURE__ */ import_react124.default.createElement(
        SearchInput,
        {
          placeholder: "Search Certificates",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react124.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "cert table",
          cells: columns,
          key: tableRows,
          rows: tableRows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          onCollapse: this.handleCollapse,
          actions: hasRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react124.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react124.default.createElement(TableBody, null)
      ), hasRows && /* @__PURE__ */ import_react124.default.createElement(
        Pagination,
        {
          itemCount: this.state.rows.length / 2,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  var CRLTable = class extends import_react124.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        dropdownIsOpen: false,
        hasRows: false,
        columns: [
          { title: "Issued By", transforms: [sortable] },
          { title: "Effective Date", transforms: [sortable] },
          { title: "Next Update", transforms: [sortable] },
          { title: "Type", transforms: [sortable] }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          3: this.state.rows[idx].cells[2],
          issuer: this.state.rows[idx].issuer,
          flags: this.state.rows[idx].flags
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2],
            srow[3]
          ],
          issuer: srow.issuer,
          flags: srow.flags
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const cert of this.props.certs) {
        const val = value.toLowerCase();
        if (val !== "" && cert.attrs.nickname.toLowerCase().indexOf(val) === -1 && cert.attrs.subject.toLowerCase().indexOf(val) === -1 && cert.attrs.issuer.toLowerCase().indexOf(val) === -1 && cert.attrs.expires.toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [cert.attrs.nickname, cert.attrs.subject, cert.attrs.expires],
            issuer: cert.attrs.issuer,
            flags: cert.attrs.flags
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(cert.attrs.issuer, cert.attrs.flags) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1,
        hasRows: rows.length !== 0
      });
    }
    actions() {
      return [
        {
          title: "View CRL",
          onClick: (event, rowId, rowData, extra) => this.props.editConfig(rowData.cells[0], rowData.cells[1], rowData.credsBindpw, rowData.pwInteractive)
        },
        {
          title: "Delete CRL",
          onClick: (event, rowId, rowData, extra) => this.props.deleteConfig(rowData.cells[0])
        }
      ];
    }
    render() {
      return /* @__PURE__ */ import_react124.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react124.default.createElement(
        SearchInput,
        {
          placeholder: "Search CRL's",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react124.default.createElement(
        Table,
        {
          variant: TableVariant.compact,
          "aria-label": "Cred Table",
          sortBy: this.sortBy,
          onSort: this.handleSort,
          cells: this.state.columns,
          rows: this.state.rows,
          actions: this.state.hasRows ? this.actions() : null,
          dropdownPosition: "right",
          dropdownDirection: "bottom"
        },
        /* @__PURE__ */ import_react124.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react124.default.createElement(TableBody, null)
      ), this.state.hasRows && /* @__PURE__ */ import_react124.default.createElement(
        Pagination,
        {
          itemCount: this.state.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage: this.state.perPage,
          page: this.state.page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ));
    }
  };
  CertTable.propTypes = {
    // serverId: PropTypes.string,
    certs: import_prop_types101.default.array,
    editCert: import_prop_types101.default.func,
    delCert: import_prop_types101.default.func
  };
  CertTable.defaultProps = {
    // serverId: "",
    certs: []
  };
  CSRTable.propTypes = {
    ServerCSRs: import_prop_types101.default.array,
    delCSR: import_prop_types101.default.func,
    viewCSR: import_prop_types101.default.func
  };
  CSRTable.defaultProps = {
    ServerCSRs: []
  };
  KeyTable.propTypes = {
    ServerKeys: import_prop_types101.default.array,
    delKey: import_prop_types101.default.func
  };
  KeyTable.defaultProps = {
    ServerKeys: []
  };

  // src/lib/security/securityModals.jsx
  var import_react125 = __toESM(require_react(), 1);
  var import_outlined_question_circle_icon4 = __toESM(require_outlined_question_circle_icon(), 1);
  var import_prop_types102 = __toESM(require_prop_types(), 1);
  var ExportCertModal = class extends import_react125.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        fileName,
        nickName,
        binaryFormat,
        certDir,
        spinning
      } = this.props;
      let exportBtnName = "Export Certificate";
      const extraPrimaryProps = {};
      if (spinning) {
        exportBtnName = "Exporting Certificate ...";
        extraPrimaryProps.spinnerAriaValueText = "Exporting";
      }
      const title = /* @__PURE__ */ import_react125.default.createElement(import_react125.default.Fragment, null, "Export Certificate: \xA0\xA0", /* @__PURE__ */ import_react125.default.createElement("i", null, nickName));
      const desc = /* @__PURE__ */ import_react125.default.createElement(import_react125.default.Fragment, null, "Enter the full path and file name, if the path portion is omitted the cetificate is written to the server's certificate directory ", /* @__PURE__ */ import_react125.default.createElement("i", null, certDir));
      return /* @__PURE__ */ import_react125.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react125.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Exporting" : void 0,
                ...extraPrimaryProps,
                isDisabled: fileName === "" || spinning
              },
              exportBtnName
            ),
            /* @__PURE__ */ import_react125.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react125.default.createElement(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react125.default.createElement(Grid, null, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 12 }, desc)), /* @__PURE__ */ import_react125.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Certificate File Name"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            type: "text",
            title: "Enter full path to and and including certificate file name",
            id: "exportFileName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "exportFileName",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: fileName === "" ? ValidatedOptions.error : ValidatedOptions.default
          }
        )), /* @__PURE__ */ import_react125.default.createElement(
          GridItem,
          {
            title: "Export certificate in its binary format.  Otherwise a PEM file is created.",
            className: "ds-margin-top-lg",
            span: 12
          },
          /* @__PURE__ */ import_react125.default.createElement(
            Checkbox,
            {
              label: "Export Certificate In Binary/DER Format",
              isChecked: binaryFormat,
              onChange: (checked, e) => {
                handleChange(e);
              },
              id: "exportDERFormat",
              name: "binaryFormat"
            }
          )
        )))
      );
    }
  };
  var SecurityAddCertModal = class extends import_react125.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        certName,
        certFile,
        certRadioFile,
        certRadioSelect,
        certRadioUpload,
        handleRadioChange,
        badCertText,
        certNames,
        // Select server cert
        handleCertSelect,
        selectCertName,
        // File Upload
        uploadValue,
        uploadFileName,
        uploadIsLoading,
        uploadIsRejected,
        handleFileInputChange,
        handleTextOrDataChange,
        handleFileReadStarted,
        handleFileReadFinished,
        handleClear,
        handleFileRejected,
        isCACert
      } = this.props;
      let saveBtnName = "Add Certificate";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Adding Certificate ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      const certTextLabel = /* @__PURE__ */ import_react125.default.createElement("div", null, /* @__PURE__ */ import_react125.default.createElement(
        Tooltip,
        {
          content: /* @__PURE__ */ import_react125.default.createElement("div", null, 'Paste the base64 encoded certificate that starts with "-----BEGIN CERTIFICATE-----" and ends with "-----END CERTIFICATE-----". Make sure there are no special carriage return characters after each line.')
        },
        /* @__PURE__ */ import_react125.default.createElement("div", null, "Upload PEM File, or Certificate Text ", /* @__PURE__ */ import_react125.default.createElement(import_outlined_question_circle_icon4.OutlinedQuestionCircleIcon, null))
      ));
      let title = "Add Server Certificate";
      let desc = "Add a Server Certificate to the security database.";
      if (isCACert) {
        title = "Add Certificate Authority";
        desc = "Add a CA Certificate to the security database.";
      }
      let selectValidated = ValidatedOptions.default;
      if (certRadioSelect && certNames.length === 0) {
        selectValidated = ValidatedOptions.error;
      }
      return /* @__PURE__ */ import_react125.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react125.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: () => {
                  saveHandler(isCACert);
                },
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: certName === "" || certRadioFile && certFile === "" || certRadioUpload && (uploadValue === "" || badCertText) || certRadioSelect && certNames.length === 0
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react125.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react125.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react125.default.createElement(TextContent, null, /* @__PURE__ */ import_react125.default.createElement(Text, { component: TextVariants.h4 }, desc)), /* @__PURE__ */ import_react125.default.createElement(
          Grid,
          {
            className: "ds-margin-top-lg",
            title: "Enter name/nickname of the certificate"
          },
          /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Certificate Nickname"),
          /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
            TextInput,
            {
              type: "text",
              id: "certName",
              "aria-describedby": "horizontal-form-name-helper",
              name: "certName",
              onChange: (str, e) => {
                handleChange(e);
              },
              validated: certName === "" ? ValidatedOptions.error : ValidatedOptions.default
            }
          ))
        ), /* @__PURE__ */ import_react125.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react125.default.createElement("div", { title: "Upload the contents of a PEM file from the client's system." }, /* @__PURE__ */ import_react125.default.createElement(
          Radio,
          {
            id: "certRadioUpload",
            label: certTextLabel,
            name: "certChoice",
            onChange: handleRadioChange,
            isChecked: certRadioUpload
          }
        )), /* @__PURE__ */ import_react125.default.createElement("div", { className: certRadioUpload ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled" }, /* @__PURE__ */ import_react125.default.createElement(
          FileUpload,
          {
            id: "uploadPEMFile",
            type: "text",
            value: uploadValue,
            filename: uploadFileName,
            filenamePlaceholder: "Drag and drop a file, or upload one",
            onFileInputChange: handleFileInputChange,
            onDataChange: handleTextOrDataChange,
            onTextChange: handleTextOrDataChange,
            onReadStarted: handleFileReadStarted,
            onReadFinished: handleFileReadFinished,
            onClearClick: handleClear,
            isLoading: uploadIsLoading,
            dropzoneProps: {
              accept: ".pem",
              onDropRejected: handleFileRejected
            },
            validated: uploadIsRejected || certRadioUpload && uploadValue === "" || certRadioUpload && badCertText ? "error" : "default",
            browseButtonText: "Upload PEM File"
          }
        )), /* @__PURE__ */ import_react125.default.createElement("div", { title: "Choose a cerificate from the server's certificate directory" }, /* @__PURE__ */ import_react125.default.createElement(
          Radio,
          {
            id: "certRadioSelect",
            className: "ds-margin-top-lg",
            label: "Choose Cerificate From Server",
            name: "certChoice",
            isChecked: certRadioSelect,
            onChange: handleRadioChange
          }
        )), /* @__PURE__ */ import_react125.default.createElement("div", { className: certRadioSelect ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled" }, /* @__PURE__ */ import_react125.default.createElement(
          FormSelect,
          {
            value: selectCertName,
            id: "selectCertName",
            onChange: handleCertSelect,
            "aria-label": "FormSelect Input",
            className: "ds-cert-select",
            validated: selectValidated
          },
          certNames.length === 0 && /* @__PURE__ */ import_react125.default.createElement(
            FormSelectOption,
            {
              key: "none",
              value: "",
              label: "No certificates present",
              isDisabled: true,
              isPlaceholder: true
            }
          ),
          certNames.length > 0 && certNames.map((option, index) => /* @__PURE__ */ import_react125.default.createElement(
            FormSelectOption,
            {
              key: index,
              value: option,
              label: option
            }
          ))
        )), /* @__PURE__ */ import_react125.default.createElement("div", { title: "Enter the full path on the server to and including the certificate file name" }, /* @__PURE__ */ import_react125.default.createElement(
          Radio,
          {
            id: "certRadioFile",
            className: "ds-margin-top-lg",
            label: "Certificate File Location",
            name: "certChoice",
            isChecked: certRadioFile,
            onChange: handleRadioChange
          }
        )), /* @__PURE__ */ import_react125.default.createElement("div", { className: certRadioFile ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled" }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            type: "text",
            id: "certFile",
            "aria-describedby": "horizontal-form-name-helper",
            name: "certFile",
            onChange: (value, e) => {
              handleChange(e);
            },
            validated: certRadioFile && certFile === "" ? ValidatedOptions.error : ValidatedOptions.default
          }
        )))))
      );
    }
  };
  var SecurityAddCSRModal = class extends import_react125.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        handleAltNameChange,
        saveHandler,
        previewValue,
        spinning,
        csrName,
        csrAltNames,
        csrIsSelectOpen,
        handleOnToggle,
        handleOnSelect,
        error
      } = this.props;
      let saveBtnName = "Create Certificate Signing Request";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Creating Certificate Signing Request ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let validAltNames = true;
      let invalidNames = "";
      for (const hostname of csrAltNames) {
        if (!validHostname(hostname)) {
          validAltNames = false;
          if (invalidNames === "") {
            invalidNames += '"' + hostname + '"';
          } else {
            invalidNames += ', "' + hostname + '"';
          }
        }
      }
      return /* @__PURE__ */ import_react125.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: "Create Certificate Signing Request",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react125.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: error.csrName || bad_file_name(csrName) || error.csrSubjectCommonName || spinning || !validAltNames
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react125.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react125.default.createElement(Form, { className: "ds-margin-top", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Name" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Name"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "Name used to identify a CSR",
            type: "text",
            id: "csrName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrName",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.csrName || bad_file_name(csrName) ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject alternative host names" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Subject Alternative Names"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a host name",
            onToggle: handleOnToggle,
            onSelect: handleOnSelect,
            selections: csrAltNames,
            "aria-labelledby": "typeAhead-alt-names",
            placeholderText: "Type an alternative host name",
            isOpen: csrIsSelectOpen,
            isCreatable: true,
            isCreateOptionOnTop: true,
            onCreateOption: handleAltNameChange,
            validated: validAltNames ? ValidatedOptions.default : ValidatedOptions.error
          },
          csrAltNames.map((hostname, index) => /* @__PURE__ */ import_react125.default.createElement(
            SelectOption,
            {
              key: index,
              value: hostname
            }
          ))
        ), /* @__PURE__ */ import_react125.default.createElement("div", { className: validAltNames ? "ds-hidden" : "" }, /* @__PURE__ */ import_react125.default.createElement(HelperText, null, /* @__PURE__ */ import_react125.default.createElement(HelperTextItem, { variant: "error" }, "Invalid host names: ", invalidNames))))), /* @__PURE__ */ import_react125.default.createElement(Divider, null), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject: Common Name" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Common Name (CN)"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "The fully qualified domain name (FQDN) of your server",
            type: "text",
            id: "csrSubjectCommonName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrSubjectCommonName",
            onChange: (str, e) => {
              handleChange(e);
            },
            validated: error.csrSubjectCommonName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject: Organisation" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Organization (O)"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "The legal name of your organization",
            type: "text",
            id: "csrSubjectOrg",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrSubjectOrg",
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject: Organisational Unit" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Organizational Unit (OU)"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "The division of your organization handling the certificate",
            type: "text",
            id: "csrSubjectOrgUnit",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrSubjectOrgUnit",
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject: City/Locality" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "City/Locality (L)"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "The city where your organization is located",
            type: "text",
            id: "csrSubjectLocality",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrSubjectLocality",
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject: State/Region" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "State/County/Region (ST)"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "The state/region where your organization is located",
            type: "text",
            id: "csrSubjectState",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrSubjectState",
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject: Country Code" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Country Code (C)"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "Two-letter country code where organization is located",
            type: "text",
            id: "csrSubjectCountry",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrSubjectCountry",
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Grid, { title: "CSR Subject: Email Address" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Email Address"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement(
          TextInput,
          {
            title: "Email address used to contact your organization",
            type: "text",
            id: "csrSubjectEmail",
            "aria-describedby": "horizontal-form-name-helper",
            name: "csrSubjectEmail",
            onChange: (str, e) => {
              handleChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react125.default.createElement(Divider, null), /* @__PURE__ */ import_react125.default.createElement(Grid, null, /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 3 }, "Computed Subject"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react125.default.createElement("b", null, previewValue))))
      );
    }
  };
  var SecurityViewCSRModal = class extends import_react125.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        item,
        name: name2
      } = this.props;
      return /* @__PURE__ */ import_react125.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: name2 + ".csr",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react125.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react125.default.createElement(TextContent, { title: "CSR content" }, /* @__PURE__ */ import_react125.default.createElement(Text, { component: TextVariants.pre }, /* @__PURE__ */ import_react125.default.createElement(Text, { component: TextVariants.small }, /* @__PURE__ */ import_react125.default.createElement(ClipboardCopy, { hoverTip: "Copy to clipboard", clickTip: "Copied", variant: ClipboardCopyVariant.expansion, isBlock: true }, item || "Nothing to display"))))
      );
    }
  };
  var SecurityEnableModal = class extends import_react125.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        primaryName,
        certs,
        spinning
      } = this.props;
      const certNames = [];
      for (const cert of certs) {
        certNames.push(cert.attrs.nickname);
      }
      let saveBtnName = "Enable Security";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Enabling Security ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react125.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          "aria-labelledby": "ds-modal",
          title: "Enable Security",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react125.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: spinning
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react125.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react125.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react125.default.createElement(TextContent, null, /* @__PURE__ */ import_react125.default.createElement(Text, { component: TextVariants.h4 }, "You are choosing to enable security for the Directory Server which allows the server to accept incoming client TLS connections.  Please select which certificate the server should use.")), /* @__PURE__ */ import_react125.default.createElement("hr", null), /* @__PURE__ */ import_react125.default.createElement(Grid, { className: "ds-margin-top", title: "The server certificates the Directory Server can use" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Available Certificates"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { sm: 8 }, /* @__PURE__ */ import_react125.default.createElement(
          FormSelect,
          {
            value: primaryName,
            id: "certNameSelect",
            onChange: (str, e) => {
              handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          certNames.map((option) => /* @__PURE__ */ import_react125.default.createElement(FormSelectOption, { key: option, value: option, label: option }))
        ))))
      );
    }
  };
  var EditCertModal = class extends import_react125.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        flags,
        spinning
      } = this.props;
      let saveBtnName = "Save Flags";
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = "Saving flags ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let CSSLChecked = false;
      let CEmailChecked = false;
      let COSChecked = false;
      let TSSLChecked = false;
      let TEmailChecked = false;
      let TOSChecked = false;
      let cSSLChecked = false;
      let cEmailChecked = false;
      let cOSChecked = false;
      let PSSLChecked = false;
      let PEmailChecked = false;
      let POSChecked = false;
      let pSSLChecked = false;
      let pEmailChecked = false;
      let pOSChecked = false;
      let uSSLChecked = false;
      let uEmailChecked = false;
      let uOSChecked = false;
      let SSLFlags = "";
      let EmailFlags = "";
      let OSFlags = "";
      if (flags !== "") {
        [SSLFlags, EmailFlags, OSFlags] = flags.split(",");
        if (SSLFlags.includes("T")) {
          TSSLChecked = true;
        }
        if (EmailFlags.includes("T")) {
          TEmailChecked = true;
        }
        if (OSFlags.includes("T")) {
          TOSChecked = true;
        }
        if (SSLFlags.includes("C")) {
          CSSLChecked = true;
        }
        if (EmailFlags.includes("C")) {
          CEmailChecked = true;
        }
        if (OSFlags.includes("C")) {
          COSChecked = true;
        }
        if (SSLFlags.includes("c")) {
          cSSLChecked = true;
        }
        if (EmailFlags.includes("c")) {
          cEmailChecked = true;
        }
        if (OSFlags.includes("c")) {
          cOSChecked = true;
        }
        if (SSLFlags.includes("P")) {
          PSSLChecked = true;
        }
        if (EmailFlags.includes("P")) {
          PEmailChecked = true;
        }
        if (OSFlags.includes("P")) {
          POSChecked = true;
        }
        if (SSLFlags.includes("p")) {
          pSSLChecked = true;
        }
        if (EmailFlags.includes("p")) {
          pEmailChecked = true;
        }
        if (OSFlags.includes("p")) {
          pOSChecked = true;
        }
        if (SSLFlags.includes("u")) {
          uSSLChecked = true;
        }
        if (EmailFlags.includes("u")) {
          uEmailChecked = true;
        }
        if (OSFlags.includes("u")) {
          uOSChecked = true;
        }
      }
      const title = "Edit Certificate Trust Flags (" + this.props.flags + ")";
      return /* @__PURE__ */ import_react125.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react125.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? "Saving" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.disableSaveBtn || spinning
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react125.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react125.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 6 }, "Flags"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, "SSL"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, "Email"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, "Object Signing"), /* @__PURE__ */ import_react125.default.createElement("hr", null), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 6, title: "Trusted CA (flag 'C', also implies 'c' flag)" }, "(C) - Trusted CA"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "CflagSSL",
            isChecked: CSSLChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "CflagEmail",
            isChecked: CEmailChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "CflagOS",
            isChecked: COSChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 6, title: "Trusted CA for client authentication (flag 'T')" }, "(T) - Trusted CA Client Auth"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "TflagSSL",
            isChecked: TSSLChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "TflagEmail",
            isChecked: TEmailChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "TflagOS",
            isChecked: TOSChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 6, title: "Valid CA (flag 'c')" }, "(c) - Valid CA"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "cflagSSL",
            isChecked: cSSLChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "cflagEmail",
            isChecked: cEmailChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "cflagOS",
            isChecked: cOSChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 6, title: "Trusted Peer (flag 'P', implies flag 'p')" }, "(P) - Trusted Peer"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "PflagSSL",
            isChecked: PSSLChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "PflagEmail",
            isChecked: PEmailChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "PflagOS",
            isChecked: POSChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 6, title: "Valid Peer (flag 'p')" }, "(p) - Valid Peer"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "pflagSSL",
            isChecked: pSSLChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "pflagEmail",
            isChecked: pEmailChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "pflagOS",
            isChecked: pOSChecked,
            onChange: (checked, e) => {
              handleChange(e);
            }
          }
        )), /* @__PURE__ */ import_react125.default.createElement("hr", null), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 6, title: "A private key is associated with the certificate. This is a dynamic flag and you cannot adjust it." }, "(u) - Private Key"), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "uflagSSL",
            isChecked: uSSLChecked,
            isDisabled: true
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "uflagEmail",
            isChecked: uEmailChecked,
            isDisabled: true
          }
        )), /* @__PURE__ */ import_react125.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react125.default.createElement(
          Checkbox,
          {
            id: "uflagOS",
            isChecked: uOSChecked,
            isDisabled: true
          }
        )))
      );
    }
  };
  SecurityEnableModal.propTypes = {
    showModal: import_prop_types102.default.bool,
    closeHandler: import_prop_types102.default.func,
    handleChange: import_prop_types102.default.func,
    saveHandler: import_prop_types102.default.func,
    primaryName: import_prop_types102.default.string,
    certs: import_prop_types102.default.array,
    spinning: import_prop_types102.default.bool
  };
  SecurityEnableModal.defaultProps = {
    showModal: false,
    primaryName: "",
    certs: [],
    spinning: false
  };
  EditCertModal.propTypes = {
    showModal: import_prop_types102.default.bool,
    closeHandler: import_prop_types102.default.func,
    handleChange: import_prop_types102.default.func,
    saveHandler: import_prop_types102.default.func,
    flags: import_prop_types102.default.string,
    spinning: import_prop_types102.default.bool
  };
  EditCertModal.defaultProps = {
    showModal: false,
    flags: "",
    spinning: false
  };
  ExportCertModal.propTypes = {
    showModal: import_prop_types102.default.bool,
    closeHandler: import_prop_types102.default.func,
    handleChange: import_prop_types102.default.func,
    saveHandler: import_prop_types102.default.func,
    binaryFormat: import_prop_types102.default.bool,
    fileName: import_prop_types102.default.string,
    spinning: import_prop_types102.default.bool
  };
  ExportCertModal.defaultProps = {
    showModal: false,
    fileName: "",
    binaryFormat: false,
    spinning: false
  };
  SecurityAddCertModal.propTypes = {
    showModal: import_prop_types102.default.bool,
    closeHandler: import_prop_types102.default.func,
    handleChange: import_prop_types102.default.func,
    saveHandler: import_prop_types102.default.func,
    spinning: import_prop_types102.default.bool,
    error: import_prop_types102.default.object
  };
  SecurityAddCertModal.defaultProps = {
    showModal: false,
    spinning: false,
    saveHandler: () => {
    },
    error: {}
  };
  SecurityAddCSRModal.propTypes = {
    showModal: import_prop_types102.default.bool,
    closeHandler: import_prop_types102.default.func,
    handleChange: import_prop_types102.default.func,
    saveHandler: import_prop_types102.default.func,
    spinning: import_prop_types102.default.bool,
    error: import_prop_types102.default.object
  };
  SecurityAddCSRModal.defaultProps = {
    showModal: false,
    spinning: false,
    error: {}
  };
  SecurityViewCSRModal.propTypes = {
    showModal: import_prop_types102.default.bool,
    closeHandler: import_prop_types102.default.func
  };
  SecurityViewCSRModal.defaultProps = {
    showModal: false,
    spinning: false
  };

  // src/lib/security/certificateManagement.jsx
  var import_prop_types103 = __toESM(require_prop_types(), 1);
  var CertificateManagement = class extends import_react126.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        ServerCerts: this.props.ServerCerts,
        CACerts: this.props.CACerts,
        ServerCSRs: this.props.ServerCSRs,
        ServerKeys: this.props.ServerKeys,
        tableKey: 0,
        showEditModal: false,
        showAddModal: false,
        showAddCAModal: false,
        showAddCSRModal: false,
        showViewCSRModal: false,
        modalSpinning: false,
        showConfirmDelete: false,
        showCSRConfirmDelete: false,
        showKeyConfirmDelete: false,
        showExportModal: false,
        certName: "",
        certFile: "",
        csrContent: "",
        csrName: "",
        csrAltNames: [],
        csrIsSelectOpen: false,
        csrSubject: "",
        csrSubjectCommonName: "",
        csrSubjectOrg: "",
        csrSubjectOrgUnit: "",
        csrSubjectLocality: "",
        csrSubjectState: "",
        csrSubjectCountry: "",
        csrSubjectEmail: "",
        keyID: "",
        flags: "",
        _flags: "",
        errObj: {},
        isCACert: false,
        showConfirmCAChange: false,
        loading: false,
        modalChecked: false,
        disableSaveBtn: true,
        exportNickname: "",
        exportDERFormat: false,
        exportFileName: "",
        certRadioFile: false,
        certRadioSelect: false,
        certRadioUpload: true,
        availCertNames: [],
        selectCertName: "",
        isSelectCertOpen: false,
        // Upload PEM file
        uploadValue: "",
        uploadFileName: "",
        uploadIsLoading: false,
        uploadIsRejected: false
      };
      this.onFileInputChange = (e, file) => {
        this.setState({
          uploadFile: file.name
        });
      };
      this.onTextOrDataChange = (value) => {
        this.setState({
          uploadValue: value.trim()
        }, () => this.validateCertText());
      };
      this.onFileReadStarted = () => {
        this.setState({
          uploadIsLoading: true
        });
      };
      this.onFileReadFinished = () => {
        this.setState({
          uploadIsLoading: false
        });
      };
      this.onClear = () => {
        this.setState({
          uploadValue: "",
          uploadFileName: "",
          uploadIsRejected: false
        });
      };
      this.handleFileRejected = () => {
        this.setState({
          uploadIsRejected: true
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.sortFlags = (str) => {
        const flags = str.split("");
        const sorted_flags = flags.sort();
        return sorted_flags.join("");
      };
      this.onCertSelect = (value) => {
        this.setState({
          selectCertName: value
        });
      };
      this.csrOnSelect = (e, selection) => {
        if (this.state.csrAltNames.includes(selection)) {
          this.setState(
            (prevState) => ({
              csrAltNames: prevState.csrAltNames.filter((item) => item !== selection),
              csrIsSelectOpen: false
            })
          );
        } else {
          this.setState({
            csrIsSelectOpen: false
          });
        }
      };
      this.csrOnToggle = (isOpen) => {
        this.setState({
          csrIsSelectOpen: isOpen
        });
      };
      this.onChange = this.onChange.bind(this);
      this.onCSRChange = this.onCSRChange.bind(this);
      this.onAltNameChange = this.onAltNameChange.bind(this);
      this.addCert = this.addCert.bind(this);
      this.showAddModal = this.showAddModal.bind(this);
      this.showAddCAModal = this.showAddCAModal.bind(this);
      this.closeAddModal = this.closeAddModal.bind(this);
      this.closeAddCAModal = this.closeAddCAModal.bind(this);
      this.showAddCSRModal = this.showAddCSRModal.bind(this);
      this.closeAddCSRModal = this.closeAddCSRModal.bind(this);
      this.showViewCSRModal = this.showViewCSRModal.bind(this);
      this.closeViewCSRModal = this.closeViewCSRModal.bind(this);
      this.showEditModal = this.showEditModal.bind(this);
      this.closeEditModal = this.closeEditModal.bind(this);
      this.showEditCAModal = this.showEditCAModal.bind(this);
      this.onFlagChange = this.onFlagChange.bind(this);
      this.editCert = this.editCert.bind(this);
      this.doEditCert = this.doEditCert.bind(this);
      this.closeConfirmCAChange = this.closeConfirmCAChange.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.showCSRDeleteConfirm = this.showCSRDeleteConfirm.bind(this);
      this.showKeyDeleteConfirm = this.showKeyDeleteConfirm.bind(this);
      this.delCert = this.delCert.bind(this);
      this.addCSR = this.addCSR.bind(this);
      this.delCSR = this.delCSR.bind(this);
      this.showCSR = this.showCSR.bind(this);
      this.delKey = this.delKey.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.closeCSRConfirmDelete = this.closeCSRConfirmDelete.bind(this);
      this.closeKeyConfirmDelete = this.closeKeyConfirmDelete.bind(this);
      this.reloadCerts = this.reloadCerts.bind(this);
      this.reloadCACerts = this.reloadCACerts.bind(this);
      this.reloadCSRs = this.reloadCSRs.bind(this);
      this.reloadOrphanKeys = this.reloadOrphanKeys.bind(this);
      this.buildSubject = this.buildSubject.bind(this);
      this.showExportModal = this.showExportModal.bind(this);
      this.closeExportModal = this.closeExportModal.bind(this);
      this.exportCert = this.exportCert.bind(this);
      this.onRadioChange = this.onRadioChange.bind(this);
      this.validateCertText = this.validateCertText.bind(this);
      this.getCertFiles = this.getCertFiles.bind(this);
    }
    componentDidMount() {
      this.getCertFiles();
    }
    showAddModal() {
      this.setState({
        showAddModal: true,
        certFile: "",
        certName: "",
        uploadFile: "",
        uploadValue: "",
        uploadIsRejected: false,
        uploadIsLoading: false,
        certRadioFile: false,
        certRadioSelect: false,
        certRadioUpload: true,
        isSelectCertOpen: false,
        modalSpinning: false
      });
    }
    closeAddModal() {
      this.setState({
        showAddModal: false
      });
    }
    showAddCAModal() {
      this.setState({
        showAddCAModal: true,
        certFile: "",
        certName: "",
        uploadFile: "",
        uploadValue: "",
        uploadIsRejected: false,
        uploadIsLoading: false,
        certRadioFile: false,
        certRadioSelect: false,
        certRadioUpload: true,
        isSelectCertOpen: false,
        modalSpinning: false
      });
    }
    closeAddCAModal() {
      this.setState({
        showAddCAModal: false
      });
    }
    onRadioChange(_, e) {
      let certRadioFile = false;
      let certRadioSelect = false;
      let certRadioUpload = false;
      if (e.target.id === "certRadioFile") {
        certRadioFile = true;
      } else if (e.target.id === "certRadioSelect") {
        certRadioSelect = true;
      } else if (e.target.id === "certRadioUpload") {
        certRadioUpload = true;
      }
      this.setState({
        certRadioFile,
        certRadioSelect,
        certRadioUpload
      });
    }
    showAddCSRModal() {
      this.setState({
        showAddCSRModal: true,
        csrSubject: "",
        csrName: "",
        csrSubjectCommonName: "",
        csrSubjectOrg: "",
        csrSubjectOrgUnit: "",
        csrSubjectLocality: "",
        csrSubjectState: "",
        csrSubjectCountry: "",
        csrSubjectEmail: "",
        csrAltNames: [],
        errObj: { csrName: true, csrSubjectCommonName: true }
      });
    }
    closeAddCSRModal() {
      this.setState({
        showAddCSRModal: false,
        csrSubject: "",
        csrName: "",
        csrSubjectCommonName: "",
        csrSubjectOrg: "",
        csrSubjectOrgUnit: "",
        csrSubjectLocality: "",
        csrSubjectState: "",
        csrSubjectCountry: "",
        csrSubjectEmail: ""
      });
    }
    showViewCSRModal(name2) {
      this.showCSR(name2);
      this.setState({
        showViewCSRModal: true,
        csrName: name2,
        errObj: { csrName: true }
      });
    }
    closeViewCSRModal() {
      this.setState({
        showViewCSRModal: false
      });
    }
    showExportModal(nickname) {
      this.setState({
        showExportModal: true,
        exportNickname: nickname,
        exportDERFormat: false,
        exportFileName: ""
      });
    }
    closeExportModal() {
      this.setState({
        showExportModal: false,
        exportNickname: ""
      });
    }
    exportCert() {
      this.setState({
        modalSpinning: true
      });
      let exportFileName = this.state.exportFileName;
      if (this.state.exportDERFormat && !exportFileName.toLowerCase().endsWith(".crt")) {
        exportFileName += ".crt";
      }
      if (!this.state.exportDERFormat && !exportFileName.toLowerCase().endsWith(".pem")) {
        exportFileName += ".pem";
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "export-cert",
        this.state.exportNickname,
        "--output-file=" + exportFileName
      ];
      if (this.state.exportDERFormat) {
        cmd.push("--binary-format");
      }
      log_cmd("exportCert", "Exporting certificate", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.getCertFiles();
        this.reloadCACerts();
        this.setState({
          showExportModal: false,
          exportNickname: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          "Successfully exported certificate as: " + exportFileName
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.setState({
          showExportModal: false,
          exportNickname: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "error",
          `Error exporting certificate - ${msg}`
        );
      });
    }
    deleteTmpCert(filename) {
      const cmd = [
        "rm",
        filename
      ];
      log_cmd("deleteTmpCert", "deleting tmp cert file", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).fail((err) => {
        this.props.addNotification(
          "warning",
          `Error deleting tmp certificate - ${err}`
        );
      });
    }
    getCertFiles() {
      const cmd = [
        // '/bin/sh', '-c',
        "find",
        this.props.certDir,
        "-type",
        "f",
        "-name",
        "*.pem",
        "-o",
        "-name",
        "*.crt"
      ];
      log_cmd("getCertFiles", "creating tmp cert file for importing", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((certs_raw) => {
        const certs = certs_raw.split(/\r?\n/);
        const certNames = [];
        for (let i = 0, count = 0; i < certs.length; i++) {
          if (certs[i] !== "") {
            certNames[count] = certs[i].replace(this.props.certDir + "/", "");
            count++;
          }
        }
        certNames.sort();
        let selectCertName = "";
        if (certNames.length > 0) {
          selectCertName = certNames[0];
        }
        this.setState({
          availCertNames: certNames,
          selectCertName
        });
      }).fail((err) => {
        console.log("Failed to get cert file names: ", err);
      });
    }
    addCert(isCACert) {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      let certType = "certificate";
      if (isCACert) {
        certType = "ca-certificate";
      }
      if (this.state.certRadioUpload && this.state.uploadValue) {
        const certFile = this.props.certDir + "/tmp-cert-" + Date.now() + ".tmp";
        const certText = this.state.uploadValue;
        const create_cert_cmd = [
          "/bin/sh",
          "-c",
          "/usr/bin/echo -e '" + certText + "' > " + certFile
        ];
        log_cmd("addCert", "creating tmp cert file for importing: ", create_cert_cmd);
        cockpit_default.spawn(create_cert_cmd, { superuser: true, err: "message" }).done(() => {
          const cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "security",
            certType,
            "add",
            "--name=" + this.state.certName,
            "--file=" + certFile
          ];
          log_cmd("addCert", "Adding cert (tmp): ", cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
            this.deleteTmpCert(certFile);
            this.reloadCACerts();
            this.setState({
              showAddModal: false,
              modalSpinning: false,
              loading: false
            });
            this.reloadOrphanKeys();
            this.props.addNotification(
              "success",
              `Successfully added certificate`
            );
            this.closeAddCAModal();
            this.closeAddModal();
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            let msg = errMsg.desc;
            if ("info" in errMsg) {
              msg = errMsg.desc + " - " + errMsg.info;
            }
            this.deleteTmpCert(certFile);
            this.closeAddCAModal();
            this.closeAddModal();
            this.setState({
              modalSpinning: false,
              loading: false
            });
            this.props.addNotification(
              "error",
              `Error adding certificate - ${msg}`
            );
          });
        }).fail((err) => {
          this.setState({
            modalSpinning: false,
            loading: false
          });
          this.props.addNotification(
            "error",
            `Faield to create temporary certificate file: ${err}`
          );
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "security",
          certType,
          "add",
          "--name=" + this.state.certName
        ];
        if (this.state.certRadioFile) {
          cmd.push("--file=" + this.state.certFile);
        } else {
          cmd.push("--file=" + this.props.certDir + "/" + this.state.selectCertName);
        }
        log_cmd("addCert", "Adding cert: ", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
          this.reloadCACerts();
          this.closeAddCAModal();
          this.closeAddModal();
          this.setState({
            showAddModal: false,
            certFile: "",
            certName: "",
            modalSpinning: false
          });
          this.reloadOrphanKeys();
          this.props.addNotification(
            "success",
            `Successfully added certificate`
          );
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          let msg = errMsg.desc;
          if ("info" in errMsg) {
            msg = errMsg.desc + " - " + errMsg.info;
          }
          this.closeAddCAModal();
          this.closeAddModal();
          this.setState({
            modalSpinning: false,
            loading: false
          });
          this.props.addNotification(
            "error",
            `Error adding certificate - ${msg}`
          );
        });
      }
    }
    addCSR() {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "req",
        "--name=" + this.state.csrName,
        "--subject=" + this.state.csrSubject
      ];
      for (const altname of this.state.csrAltNames) {
        cmd.push(altname);
      }
      log_cmd("addCSR", "Creating CSR", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCSRs();
        this.setState({
          showAddCSRModal: false,
          csrSubject: "",
          csrName: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          `Successfully created CSR`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (errMsg.desc.includes("certutil -s: improperly formatted name:")) {
          this.props.addNotification(
            "error",
            `Error Improperly formatted subject`
          );
        } else {
          this.props.addNotification(
            "error",
            `Error creating CSR - ${errMsg.desc}`
          );
        }
        this.setState({
          modalSpinning: false,
          loading: false
        });
      });
    }
    showCSR(name2) {
      if (name2 === "") {
        this.props.addNotification(
          "warning",
          `Missing CSR Name`
        );
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "get",
        name2
      ];
      log_cmd("showCSR", "Displaying CSR", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState({
          csrContent: content,
          showViewCSRModal: true
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error displaying CSR - ${errMsg.desc}`
        );
      });
    }
    showDeleteConfirm(nickname) {
      this.setState({
        showConfirmDelete: true,
        certName: nickname,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showCSRDeleteConfirm(name2) {
      this.setState({
        showCSRConfirmDelete: true,
        csrName: name2,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showKeyDeleteConfirm(key_id) {
      this.setState({
        showKeyConfirmDelete: true,
        keyID: key_id,
        modalSpinning: false,
        modalChecked: false
      });
    }
    delCert() {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "del",
        this.state.certName
      ];
      log_cmd("delCert", "Deleting certificate", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCACerts();
        this.setState({
          certName: "",
          modalSpinning: false,
          showConfirmDelete: false
        });
        this.props.addNotification(
          "success",
          `Successfully deleted certificate`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.setState({
          certName: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error deleting certificate - ${msg}`
        );
      });
    }
    delCSR(name2) {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "del",
        this.state.csrName
      ];
      log_cmd("delCSR", "Deleting CSR", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCSRs();
        this.setState({
          csrName: "",
          csrSubject: "",
          modalSpinning: false,
          showCSRConfirmDelete: false
        });
        this.props.addNotification(
          "success",
          `Successfully deleted CSR`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.setState({
          csrName: "",
          csrSubject: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error deleting CSR - ${msg}`
        );
      });
    }
    delKey(name2) {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "key",
        "del",
        this.state.keyID
      ];
      log_cmd("delKey", "Deleting key", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadOrphanKeys();
        this.setState({
          keyID: "",
          modalSpinning: false,
          showKeyConfirmDelete: false
        });
        this.props.addNotification(
          "success",
          `Successfully deleted key`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.setState({
          keyID: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error deleting key - ${msg}`
        );
      });
    }
    showEditModal(name2, flags) {
      this.setState({
        showEditModal: true,
        certName: name2,
        flags,
        isCACert: false
      });
    }
    closeEditModal() {
      this.setState({
        showEditModal: false,
        flags: ""
      });
    }
    showEditCAModal(nickname, flags) {
      this.setState({
        showEditModal: true,
        certName: nickname,
        flags,
        _flags: flags,
        isCACert: true
      });
    }
    editCert() {
      if (this.state.isCACert) {
        let SSLFlags = "";
        SSLFlags = this.state.flags.split(",", 1);
        if (!SSLFlags[0].includes("C") || !SSLFlags[0].includes("T")) {
          this.setState({
            showConfirmCAChange: true,
            modalSpinning: false,
            modalChecked: false
          });
          return;
        }
      }
      this.doEditCert();
    }
    closeConfirmCAChange() {
      this.setState({
        showConfirmCAChange: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    doEditCert() {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "set-trust-flags",
        this.state.certName,
        "--flags=" + this.state.flags
      ];
      log_cmd("doEditCert", "Editing trust flags", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCACerts();
        this.setState({
          showEditModal: false,
          flags: "",
          certName: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          `Successfully changed certificate's trust flags`
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.setState({
          showEditModal: false,
          flags: "",
          certName: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          `Error setting trust flags - ${msg}`
        );
      });
    }
    validateCertText() {
      const value = this.state.uploadValue;
      if (!value.startsWith("-----BEGIN CERTIFICATE-----") || !value.endsWith("-----END CERTIFICATE-----")) {
        this.setState({
          badCertText: true
        });
      } else {
        this.setState({
          badCertText: false
        });
      }
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    onCSRChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let valueErr = false;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [attr]: value,
        errObj
      }, this.buildSubject);
    }
    onAltNameChange(altName) {
      if (this.state.csrAltNames.includes(altName)) {
        this.setState(
          (prevState) => ({
            csrAltNames: prevState.csrAltNames.filter((item) => item !== altName),
            csrIsSelectOpen: false
          })
        );
      } else {
        this.setState(
          (prevState) => ({
            csrAltNames: [...prevState.csrAltNames, altName],
            csrIsSelectOpen: false
          })
        );
      }
    }
    buildSubject() {
      let subject = "";
      const csrSubjectCN = this.state.csrSubjectCommonName;
      const csrSubjectO = this.state.csrSubjectOrg;
      const csrSubjectOU = this.state.csrSubjectOrgUnit;
      const csrSubjectL = this.state.csrSubjectLocality;
      const csrSubjectST = this.state.csrSubjectState;
      const csrSubjectC = this.state.csrSubjectCountry;
      const csrSubjectE = this.state.csrSubjectEmail;
      if (csrSubjectCN.length !== 0) {
        subject = "CN=" + csrSubjectCN;
      }
      if (csrSubjectO.length !== 0) {
        subject += ",O=" + csrSubjectO;
      }
      if (csrSubjectOU.length !== 0) {
        subject += ",OU=" + csrSubjectOU;
      }
      if (csrSubjectL.length !== 0) {
        subject += ",L=" + csrSubjectL;
      }
      if (csrSubjectST.length !== 0) {
        subject += ",ST=" + csrSubjectST;
      }
      if (csrSubjectC.length !== 0) {
        subject += ",C=" + csrSubjectC;
      }
      if (csrSubjectE.length !== 0) {
        subject += ",E=" + csrSubjectE;
      }
      this.setState({
        csrSubject: subject
      });
    }
    onFlagChange(e) {
      const checked = e.target.checked;
      const id = e.target.id;
      const flags = this.state.flags;
      let SSLFlags = "";
      let EmailFlags = "";
      let OSFlags = "";
      let newFlags = "";
      let disableSaveBtn = true;
      [SSLFlags, EmailFlags, OSFlags] = flags.split(",");
      if (id.endsWith("SSL")) {
        for (const trustFlag of ["C", "T", "c", "P", "p"]) {
          if (id.startsWith(trustFlag)) {
            if (checked) {
              SSLFlags += trustFlag;
            } else {
              SSLFlags = SSLFlags.replace(trustFlag, "");
            }
            SSLFlags = this.sortFlags(SSLFlags);
          }
        }
      } else if (id.endsWith("Email")) {
        for (const trustFlag of ["C", "T", "c", "P", "p"]) {
          if (id.startsWith(trustFlag)) {
            if (checked) {
              EmailFlags += trustFlag;
            } else {
              EmailFlags = EmailFlags.replace(trustFlag, "");
            }
            EmailFlags = this.sortFlags(EmailFlags);
          }
        }
      } else {
        for (const trustFlag of ["C", "T", "c", "P", "p"]) {
          if (id.startsWith(trustFlag)) {
            if (checked) {
              OSFlags += trustFlag;
            } else {
              OSFlags = OSFlags.replace(trustFlag, "");
            }
            OSFlags = this.sortFlags(OSFlags);
          }
        }
      }
      newFlags = SSLFlags + "," + EmailFlags + "," + OSFlags;
      if (newFlags !== this.state._flags) {
        disableSaveBtn = false;
      }
      this.setState({
        flags: newFlags,
        disableSaveBtn
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeCSRConfirmDelete() {
      this.setState({
        showCSRConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeKeyConfirmDelete() {
      this.setState({
        showKeyConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    reloadCerts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "list"
      ];
      log_cmd("reloadCerts", "Load certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        const key = this.state.tableKey + 1;
        const certNames = [];
        for (const cert of certs) {
          certNames.push(cert.attrs.nickname);
        }
        this.setState({
          ServerCerts: certs,
          loading: false,
          tableKey: key,
          showConfirmCAChange: false
        }, this.getCertFiles);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading server certificates - ${msg}`
        );
      });
    }
    reloadCSRs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "list"
      ];
      log_cmd("reloadCSRs", "Reload CSRs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const csrs = JSON.parse(content);
        const key = this.state.tableKey + 1;
        this.setState({
          ServerCSRs: csrs,
          loading: false,
          tableKey: key,
          showConfirmCSRChange: false
        }, this.reloadOrphanKeys);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading CSRs - ${msg}`
        );
      });
    }
    reloadOrphanKeys() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "key",
        "list",
        "--orphan"
      ];
      log_cmd("reloadOrphanKeys", "Reload Orphan Keys", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const keys = JSON.parse(content);
        const key = this.state.tableKey + 1;
        this.setState(
          () => ({
            ServerKeys: keys,
            loading: false,
            tableKey: key
          })
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (!errMsg.desc.includes("certutil: no keys found")) {
          this.props.addNotification(
            "error",
            `Error loading Orphan Keys - ${errMsg.desc}`
          );
        }
        this.setState({
          loading: false,
          ServerKeys: []
        });
      });
    }
    reloadCACerts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ca-certificate",
        "list"
      ];
      log_cmd("reloadCACerts", "Load certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        this.setState({
          CACerts: certs,
          loading: false
        }, this.reloadCerts);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading CA certificates - ${msg}`
        );
      });
    }
    render() {
      let certificatePage = "";
      if (this.state.loading) {
        certificatePage = /* @__PURE__ */ import_react126.default.createElement("div", { className: "ds-loading-spinner ds-center ds-margin-top-xlg" }, /* @__PURE__ */ import_react126.default.createElement(TextContent, null, /* @__PURE__ */ import_react126.default.createElement(Text, { component: TextVariants.h3 }, "Loading Certificates ...")), /* @__PURE__ */ import_react126.default.createElement(Spinner, { size: "lg" }));
      } else {
        certificatePage = /* @__PURE__ */ import_react126.default.createElement(Tabs, { isBox: true, isSecondary: true, className: "ds-margin-top-xlg ds-left-indent", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react126.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react126.default.createElement(TabTitleText, null, "Trusted Certificate Authorites ", /* @__PURE__ */ import_react126.default.createElement("font", { size: "2" }, "(", this.state.CACerts.length, ")")) }, /* @__PURE__ */ import_react126.default.createElement("div", { className: "ds-margin-top-lg ds-left-indent" }, /* @__PURE__ */ import_react126.default.createElement(
          CertTable,
          {
            certs: this.state.CACerts,
            key: this.state.tableKey,
            editCert: this.showEditCAModal,
            exportCert: this.showExportModal,
            delCert: this.showDeleteConfirm
          }
        ), /* @__PURE__ */ import_react126.default.createElement(
          Button,
          {
            variant: "primary",
            className: "ds-margin-top-lg",
            onClick: () => {
              this.showAddCAModal();
            }
          },
          "Add CA Certificate"
        ))), /* @__PURE__ */ import_react126.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react126.default.createElement(TabTitleText, null, "TLS Certificates ", /* @__PURE__ */ import_react126.default.createElement("font", { size: "2" }, "(", this.state.ServerCerts.length, ")")) }, /* @__PURE__ */ import_react126.default.createElement("div", { className: "ds-margin-top-lg ds-left-indent" }, /* @__PURE__ */ import_react126.default.createElement(
          CertTable,
          {
            certs: this.state.ServerCerts,
            key: this.state.tableKey,
            editCert: this.showEditModal,
            exportCert: this.showExportModal,
            delCert: this.showDeleteConfirm
          }
        ), /* @__PURE__ */ import_react126.default.createElement(
          Button,
          {
            variant: "primary",
            className: "ds-margin-top-lg",
            onClick: () => {
              this.showAddModal();
            }
          },
          "Add Server Certificate"
        ))), /* @__PURE__ */ import_react126.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react126.default.createElement(TabTitleText, null, "Certificate Sigining Requests ", /* @__PURE__ */ import_react126.default.createElement("font", { size: "2" }, "(", this.state.ServerCSRs.length, ")")) }, /* @__PURE__ */ import_react126.default.createElement("div", { className: "ds-margin-top-lg ds-left-indent" }, /* @__PURE__ */ import_react126.default.createElement(
          CSRTable,
          {
            ServerCSRs: this.state.ServerCSRs,
            key: this.state.tableKey,
            delCSR: this.showCSRDeleteConfirm,
            viewCSR: this.showViewCSRModal
          }
        ), /* @__PURE__ */ import_react126.default.createElement(
          Button,
          {
            variant: "primary",
            className: "ds-margin-top-lg",
            onClick: () => {
              this.showAddCSRModal();
            }
          },
          "Create Certificate Sigining Request"
        ))), /* @__PURE__ */ import_react126.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react126.default.createElement(TabTitleText, null, " Orphan Keys ", /* @__PURE__ */ import_react126.default.createElement("font", { size: "2" }, "(", this.state.ServerKeys.length, ")")) }, /* @__PURE__ */ import_react126.default.createElement("div", { className: "ds-margin-top-lg ds-left-indent" }, /* @__PURE__ */ import_react126.default.createElement(
          KeyTable,
          {
            ServerKeys: this.state.ServerKeys,
            key: this.state.tableKey,
            delKey: this.showKeyDeleteConfirm
          }
        ))));
      }
      return /* @__PURE__ */ import_react126.default.createElement("div", null, certificatePage, /* @__PURE__ */ import_react126.default.createElement(
        ExportCertModal,
        {
          showModal: this.state.showExportModal,
          closeHandler: this.closeExportModal,
          handleChange: this.onChange,
          saveHandler: this.exportCert,
          nickName: this.state.exportNickname,
          binaryFormat: this.state.exportDERFormat,
          fileName: this.state.exportFileName,
          certDir: this.props.certDir,
          spinning: this.state.modalSpinning
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        EditCertModal,
        {
          showModal: this.state.showEditModal,
          closeHandler: this.closeEditModal,
          handleChange: this.onFlagChange,
          saveHandler: this.editCert,
          flags: this.state.flags,
          disableSaveBtn: this.state.disableSaveBtn,
          spinning: this.state.modalSpinning
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        SecurityAddCertModal,
        {
          showModal: this.state.showAddModal,
          closeHandler: this.closeAddModal,
          handleChange: this.onChange,
          saveHandler: this.addCert,
          spinning: this.state.modalSpinning,
          certFile: this.state.certFile,
          certName: this.state.certName,
          certNames: this.state.availCertNames,
          selectCertName: this.state.selectCertName,
          isSelectCertOpen: this.state.isSelectCertOpen,
          handleCertSelect: this.onCertSelect,
          certRadioFile: this.state.certRadioFile,
          certRadioSelect: this.state.certRadioSelect,
          certRadioUpload: this.state.certRadioUpload,
          handleRadioChange: this.onRadioChange,
          badCertText: this.state.badCertText,
          uploadValue: this.state.uploadValue,
          uploadFileName: this.state.uploadFileName,
          uploadIsLoading: this.state.uploadIsLoading,
          uploadIsRejected: this.state.uploadIsRejected,
          handleFileInputChange: this.onFileInputChange,
          handleTextOrDataChange: this.onTextOrDataChange,
          handleFileReadStarted: this.onFileReadStarted,
          handleFileReadFinished: this.onFileReadFinished,
          handleClear: this.onClear,
          handleFileRejected: this.state.uploadIsRejected
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        SecurityAddCertModal,
        {
          showModal: this.state.showAddCAModal,
          isCACert: true,
          closeHandler: this.closeAddCAModal,
          handleChange: this.onChange,
          saveHandler: this.addCert,
          spinning: this.state.modalSpinning,
          certFile: this.state.certFile,
          certName: this.state.certName,
          certNames: this.state.availCertNames,
          selectCertName: this.state.selectCertName,
          isSelectCertOpen: this.state.isSelectCertOpen,
          handleCertSelect: this.onCertSelect,
          certRadioFile: this.state.certRadioFile,
          certRadioSelect: this.state.certRadioSelect,
          certRadioUpload: this.state.certRadioUpload,
          handleRadioChange: this.onRadioChange,
          badCertText: this.state.badCertText,
          uploadValue: this.state.uploadValue,
          uploadFileName: this.state.uploadFileName,
          uploadIsLoading: this.state.uploadIsLoading,
          uploadIsRejected: this.state.uploadIsRejected,
          handleFileInputChange: this.onFileInputChange,
          handleTextOrDataChange: this.onTextOrDataChange,
          handleFileReadStarted: this.onFileReadStarted,
          handleFileReadFinished: this.onFileReadFinished,
          handleClear: this.onClear,
          handleFileRejected: this.state.uploadIsRejected
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        SecurityAddCSRModal,
        {
          showModal: this.state.showAddCSRModal,
          closeHandler: this.closeAddCSRModal,
          handleChange: this.onCSRChange,
          handleAltNameChange: this.onAltNameChange,
          saveHandler: this.addCSR,
          previewValue: this.state.csrSubject,
          csrName: this.state.csrName,
          csrAltNames: this.state.csrAltNames,
          csrIsSelectOpen: this.state.csrIsSelectOpen,
          handleOnSelect: this.csrOnSelect,
          handleOnToggle: this.csrOnToggle,
          spinning: this.state.modalSpinning,
          error: this.state.errObj
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        SecurityViewCSRModal,
        {
          showModal: this.state.showViewCSRModal,
          closeHandler: this.closeViewCSRModal,
          name: this.state.csrName,
          item: this.state.csrContent,
          error: this.state.errObj
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDelete,
          closeHandler: this.closeConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.delCert,
          spinning: this.state.modalSpinning,
          item: this.state.certName,
          checked: this.state.modalChecked,
          mTitle: "Delete Certificate",
          mMsg: "Are you sure you want to delete this certificate?",
          mSpinningMsg: "Deleting Certificate ...",
          mBtnName: "Delete Certificate"
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showCSRConfirmDelete,
          closeHandler: this.closeCSRConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.delCSR,
          spinning: this.state.modalSpinning,
          item: this.state.csrName,
          checked: this.state.modalChecked,
          mTitle: "Delete CSR",
          mMsg: "Are you sure you want to delete this CSR?",
          mSpinningMsg: "Deleting CSR ...",
          mBtnName: "Delete CSR"
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showKeyConfirmDelete,
          closeHandler: this.closeKeyConfirmDelete,
          handleChange: this.onChange,
          actionHandler: this.delKey,
          spinning: this.state.modalSpinning,
          item: this.state.keyID,
          checked: this.state.modalChecked,
          mTitle: "Delete Key",
          mMsg: "Are you sure you want to delete this Key?",
          mSpinningMsg: "Deleting Key ...",
          mBtnName: "Delete Key"
        }
      ), /* @__PURE__ */ import_react126.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmCAChange,
          closeHandler: this.closeConfirmCAChange,
          handleChange: this.onChange,
          actionHandler: this.doEditCert,
          spinning: this.state.modalSpinning,
          item: this.state.certName,
          checked: this.state.modalChecked,
          mTitle: "Warning - Altering CA Certificate Properties",
          mMsg: "Removing the 'C' or 'T' flags from the SSL trust catagory could break all TLS connectivity to and from the server, are you sure you want to proceed?",
          mSpinningMsg: "Editing CA Certificate ...",
          mBtnName: "Change Trust Flags"
        }
      ));
    }
  };
  CertificateManagement.propTypes = {
    serverId: import_prop_types103.default.string,
    CACerts: import_prop_types103.default.array,
    ServerCerts: import_prop_types103.default.array,
    ServerCSRs: import_prop_types103.default.array,
    ServerKeys: import_prop_types103.default.array,
    addNotification: import_prop_types103.default.func
  };
  CertificateManagement.defaultProps = {
    serverId: "",
    CACerts: [],
    ServerCerts: [],
    ServerCSRs: [],
    ServerKeys: []
  };

  // src/lib/security/ciphers.jsx
  var import_react127 = __toESM(require_react(), 1);
  var import_prop_types104 = __toESM(require_prop_types(), 1);
  var Ciphers = class extends import_react127.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        allowCiphers: [],
        denyCiphers: [],
        cipherPref: "default",
        prefs: this.props.cipherPref,
        saving: false,
        availableCiphers: this.props.supportedCiphers,
        // Select Typeahead
        isAllowCipherOpen: false,
        isDenyCipherOpen: false,
        disableSaveBtn: true
      };
      this.handleAllowCipherToggle = (isAllowCipherOpen) => {
        this.setState({
          isAllowCipherOpen
        });
      };
      this.handleAllowCipherClear = () => {
        this.setState({
          allowCiphers: [],
          isAllowCipherOpen: false
        });
      };
      this.handleDenyCipherToggle = (isDenyCipherOpen) => {
        this.setState({
          isDenyCipherOpen
        });
      };
      this.handleDenyCipherClear = () => {
        this.setState({
          denyCiphers: [],
          isDenyCipherOpen: false
        });
      };
      this.handlePrefChange = this.handlePrefChange.bind(this);
      this.saveCipherPref = this.saveCipherPref.bind(this);
      this.handleAllowCipherChange = this.handleAllowCipherChange.bind(this);
      this.handleDenyCipherChange = this.handleDenyCipherChange.bind(this);
    }
    componentDidMount() {
      let cipherPref = "default";
      const allowedCiphers = [];
      const deniedCiphers = [];
      const availableCiphers = this.props.supportedCiphers.slice(0);
      if (this.props.cipherPref !== "") {
        let rawCiphers = this.props.cipherPref.split(",");
        if (rawCiphers[0].toLowerCase() === "default") {
          rawCiphers.shift();
        } else if (rawCiphers[0].toLowerCase() === "+all") {
          cipherPref = "+all";
          rawCiphers.shift();
        } else if (rawCiphers[0].toLowerCase() === "-all") {
          cipherPref = "-all";
          rawCiphers.shift();
        }
        rawCiphers = rawCiphers.map(function(x2) {
          return x2.toUpperCase();
        });
        for (const cipher of rawCiphers) {
          if (cipher.startsWith("+")) {
            allowedCiphers.push(cipher.substring(1));
          } else if (cipher.startsWith("-")) {
            deniedCiphers.push(cipher.substring(1));
          }
        }
        for (const enabled_cipher of this.props.enabledCiphers) {
          if (availableCiphers.includes(enabled_cipher)) {
            const index = availableCiphers.indexOf(enabled_cipher);
            if (index > -1) {
              availableCiphers.splice(index, 1);
            }
          }
        }
        for (const allow_cipher of allowedCiphers) {
          if (availableCiphers.includes(allow_cipher)) {
            const index = availableCiphers.indexOf(allow_cipher);
            if (index > -1) {
              availableCiphers.splice(index, 1);
            }
          }
        }
        for (const deny_cipher of deniedCiphers) {
          if (availableCiphers.includes(deny_cipher)) {
            const index = availableCiphers.indexOf(deny_cipher);
            if (index > -1) {
              availableCiphers.splice(index, 1);
            }
          }
        }
      }
      this.setState({
        cipherPref,
        _cipherPref: cipherPref,
        allowCiphers: allowedCiphers,
        _allowCiphers: [...allowedCiphers],
        denyCiphers: deniedCiphers,
        _denyCiphers: [...deniedCiphers],
        availableCiphers
      });
    }
    saveCipherPref() {
      this.setState({
        saving: true
      });
      let prefs = this.state.cipherPref;
      if (this.state.cipherPref !== "default") {
        for (const cipher of this.state.allowCiphers) {
          prefs += ",+" + cipher;
        }
        for (const cipher of this.state.denyCiphers) {
          prefs += ",-" + cipher;
        }
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ciphers",
        "set",
        "--",
        prefs
      ];
      log_cmd("saveCipherPref", "Saving cipher preferences", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.props.addNotification(
          "success",
          `Successfully set cipher preferences.`
        );
        this.props.addNotification(
          "warning",
          `You must restart the Directory Server for these changes to take effect.`
        );
        this.setState({
          saving: false,
          disableSaveBtn: true
        });
        this.props.reload();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error setting cipher preferences - ${msg}`
        );
        this.setState({
          saving: false,
          disableSaveBtn: true
        });
      });
    }
    handlePrefChange(val) {
      let disableSaveBtn = true;
      if (JSON.stringify(this.state.allowCiphers) !== JSON.stringify(this.state._allowCiphers) || JSON.stringify(this.state.denyCiphers) !== JSON.stringify(this.state._denyCiphers)) {
        disableSaveBtn = false;
      }
      if (this.state._cipherPref !== val) {
        disableSaveBtn = false;
      }
      this.setState({
        cipherPref: val,
        disableSaveBtn
      });
    }
    handleAllowCipherChange(e, selection) {
      let disableSaveBtn = true;
      const availableCiphers = [...this.state.availableCiphers];
      if (this.state.cipherPref !== this.state._cipherPref) {
        disableSaveBtn = false;
      }
      if (this.state.allowCiphers.includes(selection)) {
        availableCiphers.push(selection);
        availableCiphers.sort();
        const copy_new_ciphers = [...this.state.allowCiphers];
        const index = copy_new_ciphers.indexOf(selection);
        if (index > -1) {
          copy_new_ciphers.splice(index, 1);
        }
        if (JSON.stringify(this.state._allowCiphers) !== JSON.stringify(copy_new_ciphers)) {
          disableSaveBtn = false;
        }
        this.setState(
          (prevState) => ({
            allowCiphers: prevState.allowCiphers.filter((item) => item !== selection),
            isAllowCipherOpen: false,
            availableCiphers,
            disableSaveBtn
          })
        );
      } else {
        const index = availableCiphers.indexOf(selection);
        if (index > -1) {
          availableCiphers.splice(index, 1);
          availableCiphers.sort();
        }
        if (JSON.stringify(this.state._allowCiphers) !== JSON.stringify([...this.state.allowCiphers, selection])) {
          disableSaveBtn = false;
        }
        this.setState(
          (prevState) => ({
            allowCiphers: [...prevState.allowCiphers, selection],
            isAllowCipherOpen: false,
            availableCiphers,
            disableSaveBtn
          })
        );
      }
    }
    handleDenyCipherChange(e, selection) {
      let disableSaveBtn = true;
      const availableCiphers = [...this.state.availableCiphers];
      if (this.state.cipherPref !== this.state._cipherPref) {
        disableSaveBtn = false;
      }
      if (this.state.denyCiphers.includes(selection)) {
        availableCiphers.push(selection);
        availableCiphers.sort();
        const copy_new_ciphers = [...this.state.denyCiphers];
        const index = copy_new_ciphers.indexOf(selection);
        if (index > -1) {
          copy_new_ciphers.splice(index, 1);
        }
        if (JSON.stringify(this.state._denyCiphers) !== JSON.stringify(copy_new_ciphers)) {
          disableSaveBtn = false;
        }
        this.setState(
          (prevState) => ({
            denyCiphers: prevState.denyCiphers.filter((item) => item !== selection),
            isDenyCipherOpen: false,
            availableCiphers,
            disableSaveBtn
          })
        );
      } else {
        const index = availableCiphers.indexOf(selection);
        if (index > -1) {
          availableCiphers.splice(index, 1);
          availableCiphers.sort();
        }
        if (JSON.stringify(this.state._denyCiphers) !== JSON.stringify([...this.state.denyCiphers, selection])) {
          disableSaveBtn = false;
        }
        this.setState(
          (prevState) => ({
            denyCiphers: [...prevState.denyCiphers, selection],
            isDenyCipherOpen: false,
            availableCiphers,
            disableSaveBtn
          })
        );
      }
    }
    render() {
      const supportedCiphers = [];
      const enabledCiphers = [];
      let cipherPage;
      let saveBtnName = "Save Settings";
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      for (const cipher of this.props.supportedCiphers) {
        if (!this.props.enabledCiphers.includes(cipher)) {
          supportedCiphers.push(cipher);
        }
      }
      for (const cipher of this.props.enabledCiphers) {
        enabledCiphers.push(cipher);
      }
      let supportedList = supportedCiphers.map(
        (name2) => /* @__PURE__ */ import_react127.default.createElement(SimpleListItem, { key: name2 }, name2)
      );
      if (supportedList.length === 0) {
        supportedList = "";
      }
      let enabledList = enabledCiphers.map(
        (name2) => /* @__PURE__ */ import_react127.default.createElement(SimpleListItem, { key: name2 }, name2)
      );
      if (enabledList.length === 0) {
        enabledList = "";
      }
      if (this.state.saving) {
        cipherPage = /* @__PURE__ */ import_react127.default.createElement("div", { className: "ds-center ds-margin-top-lg" }, /* @__PURE__ */ import_react127.default.createElement(TextContent, null, /* @__PURE__ */ import_react127.default.createElement(Text, { component: TextVariants.h3 }, "Saving Cipher Preferences ...")), /* @__PURE__ */ import_react127.default.createElement(Spinner, { size: "lg" }));
      } else {
        cipherPage = /* @__PURE__ */ import_react127.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react127.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true }, /* @__PURE__ */ import_react127.default.createElement(Grid, null, /* @__PURE__ */ import_react127.default.createElement(GridItem, { span: 5, title: "The current ciphers the server is accepting.  This list is only updated after a server restart." }, /* @__PURE__ */ import_react127.default.createElement(TextContent, null, /* @__PURE__ */ import_react127.default.createElement(Text, { component: TextVariants.h3 }, "Enabled Ciphers ", /* @__PURE__ */ import_react127.default.createElement("font", { size: "2" }, "(", enabledList.length, ")"))), /* @__PURE__ */ import_react127.default.createElement("hr", null), /* @__PURE__ */ import_react127.default.createElement("div", { className: "ds-box" }, /* @__PURE__ */ import_react127.default.createElement(SimpleList, { "aria-label": "enabled cipher list" }, enabledList))), /* @__PURE__ */ import_react127.default.createElement(GridItem, { span: 2 }), /* @__PURE__ */ import_react127.default.createElement(GridItem, { span: 5, title: "The current ciphers the server supports" }, /* @__PURE__ */ import_react127.default.createElement(TextContent, null, /* @__PURE__ */ import_react127.default.createElement(Text, { component: TextVariants.h3 }, "Supported Ciphers ", /* @__PURE__ */ import_react127.default.createElement("font", { size: "2" }, "(", supportedList.length, ")"))), /* @__PURE__ */ import_react127.default.createElement("hr", null), /* @__PURE__ */ import_react127.default.createElement("div", { className: "ds-box" }, /* @__PURE__ */ import_react127.default.createElement(SimpleList, { "aria-label": "supported cipher list" }, supportedList)))), /* @__PURE__ */ import_react127.default.createElement("hr", null), /* @__PURE__ */ import_react127.default.createElement(Grid, null, /* @__PURE__ */ import_react127.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Cipher Suite"), /* @__PURE__ */ import_react127.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react127.default.createElement(
          FormSelect,
          {
            id: "cipherPref",
            value: this.state.cipherPref,
            onChange: this.handlePrefChange,
            "aria-label": "pref select"
          },
          /* @__PURE__ */ import_react127.default.createElement(FormSelectOption, { key: "1", value: "default", label: "Default Ciphers" }),
          /* @__PURE__ */ import_react127.default.createElement(FormSelectOption, { key: "2", value: "+all", label: "All Ciphers" }),
          /* @__PURE__ */ import_react127.default.createElement(FormSelectOption, { key: "3", value: "-all", label: "No Ciphers" })
        ), /* @__PURE__ */ import_react127.default.createElement(FormHelperText, { isHidden: this.state.cipherPref !== "default" }, "Default cipher suite is chosen. It enables the default ciphers advertised by NSS except weak ciphers.", this.state.allowCiphers.length !== 0 || this.state.denyCiphers.length !== 0 ? " Any data in the 'Allow Specific Ciphers' and 'Deny Specific Ciphers' fields will be cleaned after the restart." : ""))), /* @__PURE__ */ import_react127.default.createElement(Grid, null, /* @__PURE__ */ import_react127.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Allow Specific Ciphers"), /* @__PURE__ */ import_react127.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react127.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a cipher",
            isDisabled: this.state.cipherPref === "default",
            onToggle: this.handleAllowCipherToggle,
            onSelect: this.handleAllowCipherChange,
            onClear: this.handleAllowCipherClear,
            selections: this.state.allowCiphers,
            isOpen: this.state.isAllowCipherOpen,
            "aria-labelledby": "typeAhead-allow-cipher",
            placeholderText: "Type a cipher...",
            noResultsFoundText: "There are no matching entries",
            maxHeight: "200px"
          },
          this.state.availableCiphers.map((cipher, index) => /* @__PURE__ */ import_react127.default.createElement(
            SelectOption,
            {
              key: index,
              value: cipher
            }
          ))
        ))), /* @__PURE__ */ import_react127.default.createElement(Grid, null, /* @__PURE__ */ import_react127.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Deny Specific Ciphers"), /* @__PURE__ */ import_react127.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react127.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type a cipher",
            isDisabled: this.state.cipherPref === "default",
            onToggle: this.handleDenyCipherToggle,
            onSelect: this.handleDenyCipherChange,
            onClear: this.handleDenyCipherClear,
            selections: this.state.denyCiphers,
            isOpen: this.state.isDenyCipherOpen,
            "aria-labelledby": "typeAhead-allow-deny",
            placeholderText: "Type a cipher...",
            noResultsFoundText: "There are no matching entries",
            maxHeight: "200px"
          },
          this.state.availableCiphers.map((cipher, index) => /* @__PURE__ */ import_react127.default.createElement(
            SelectOption,
            {
              key: index,
              value: cipher
            }
          ))
        )))), /* @__PURE__ */ import_react127.default.createElement(
          Button,
          {
            variant: "primary",
            className: "ds-margin-top-xlg",
            onClick: () => {
              this.saveCipherPref();
            },
            isDisabled: this.state.disableSaveBtn || this.state.saving,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        ));
      }
      return /* @__PURE__ */ import_react127.default.createElement("div", { className: this.state.saving ? "ds-disabled" : "" }, cipherPage);
    }
  };
  Ciphers.propTypes = {
    serverId: import_prop_types104.default.string,
    supportedCiphers: import_prop_types104.default.array,
    enabledCiphers: import_prop_types104.default.array,
    cipherPref: import_prop_types104.default.string,
    addNotification: import_prop_types104.default.func
  };
  Ciphers.defaultProps = {
    serverId: "",
    supportedCiphers: [],
    enabledCiphers: [],
    cipherPref: ""
  };

  // src/security.jsx
  var import_prop_types105 = __toESM(require_prop_types(), 1);
  var configAttrs = [
    "sslVersionMin",
    "sslVersionMax",
    "secureListenhost",
    "clientAuth",
    "validateCert",
    "requireSecureBinds",
    "checkHostname",
    "allowWeakCipher",
    "nstlsallowclientrenegotiation"
  ];
  var configCoreAttrs = [
    "secureListenhost",
    "requireSecureBinds",
    "checkHostname",
    "allowWeakCipher",
    "nstlsallowclientrenegotiation"
  ];
  var Security = class extends import_react128.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSelectToggle", (isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "onSelectClear", (toggleId, collection) => {
        this.setState({
          [toggleId]: false,
          [collection]: []
        });
      });
      this.state = {
        loaded: false,
        saving: false,
        activeTabKey: 0,
        errObj: {},
        showConfirmDisable: false,
        showSecurityEnableModal: false,
        primaryCertName: "",
        serverCertNames: [],
        serverCerts: [],
        isMinSSLOpen: false,
        isMaxSSLOpen: false,
        isClientAuthOpen: false,
        isValidateCertOpen: false,
        disableSaveBtn: true,
        modalChecked: false,
        modalSpinning: false,
        // Ciphers
        supportedCiphers: [],
        enabledCiphers: [],
        // Certificate Signing Requests
        serverCSRs: [],
        // Orphan keys
        serverOrphanKeys: [],
        // Config settings
        securityEnabled: false,
        requireSecureBinds: false,
        secureListenhost: false,
        clientAuth: false,
        checkHostname: false,
        validateCert: "",
        sslVersionMin: "",
        sslVersionMax: "",
        allowWeakCipher: false,
        nssslpersonalityssl: "",
        nstlsallowclientrenegotiation: true,
        // Original config Settings
        _securityEnabled: false,
        _requireSecureBinds: false,
        _secureListenhost: false,
        _clientAuth: false,
        _checkHostname: false,
        _validateCert: "",
        _sslVersionMin: "",
        _sslVersionMax: "",
        _allowWeakCipher: false,
        _nssslpersonalityssl: "",
        _nssslpersonalityssllist: "",
        _nstlsallowclientrenegotiation: true,
        isServerCertOpen: false
      };
      this.handleServerCertSelect = (event, selection) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._nssslpersonalityssl !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          nssslpersonalityssl: selection,
          isServerCertOpen: false,
          disableSaveBtn
        });
      };
      this.handleServerCertToggle = (isServerCertOpen) => {
        this.setState({
          isServerCertOpen
        });
      };
      this.handleServerCertClear = () => {
        this.setState({
          nssslpersonalityssl: "",
          isServerCertOpen: false
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.configChanged = () => {
        for (const config_attr of configCoreAttrs) {
          if (this.state[config_attr] !== this.state["_" + config_attr]) {
            return true;
          }
        }
        return false;
      };
      this.handleMinSSLToggle = (isMinSSLOpen) => {
        this.setState({
          isMinSSLOpen
        });
      };
      this.handleMinSSLSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._sslVersionMin !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          sslVersionMin: selection,
          isMinSSLOpen: false,
          disableSaveBtn
        });
      };
      this.handleMaxSSLToggle = (isMaxSSLOpen) => {
        this.setState({
          isMaxSSLOpen
        });
      };
      this.handleMaxSSLSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._sslVersionMax !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          sslVersionMax: selection,
          isMaxSSLOpen: false,
          disableSaveBtn
        });
      };
      this.handleClientAuthToggle = (isClientAuthOpen) => {
        this.setState({
          isClientAuthOpen
        });
      };
      this.handleClientAuthSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._clientAuth !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          clientAuth: selection,
          isClientAuthOpen: false,
          disableSaveBtn
        });
      };
      this.handleValidateCertToggle = (isValidateCertOpen) => {
        this.setState({
          isValidateCertOpen
        });
      };
      this.handleValidateCertSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._validateCert !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          validateCert: selection,
          isValidateCertOpen: false,
          disableSaveBtn
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTypeaheadChange = this.handleTypeaheadChange.bind(this);
      this.loadSecurityConfig = this.loadSecurityConfig.bind(this);
      this.loadEnabledCiphers = this.loadEnabledCiphers.bind(this);
      this.loadSupportedCiphers = this.loadSupportedCiphers.bind(this);
      this.loadCerts = this.loadCerts.bind(this);
      this.loadCACerts = this.loadCACerts.bind(this);
      this.loadCSRs = this.loadCSRs.bind(this);
      this.closeConfirmDisable = this.closeConfirmDisable.bind(this);
      this.enableSecurity = this.enableSecurity.bind(this);
      this.disableSecurity = this.disableSecurity.bind(this);
      this.saveSecurityConfig = this.saveSecurityConfig.bind(this);
      this.closeSecurityEnableModal = this.closeSecurityEnableModal.bind(this);
      this.handleReloadConfig = this.handleReloadConfig.bind(this);
      this.onSelectToggle = this.onSelectToggle.bind(this);
      this.onSelectClear = this.onSelectClear.bind(this);
      this.handleTypeaheadChange = this.handleTypeaheadChange.bind(this);
      this.onSecEnableChange = this.onSecEnableChange.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.setState({ securityEnabled: true }, this.setState({ securityEnabled: false }));
        this.loadSecurityConfig();
      } else {
        this.props.enableTree();
      }
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleReloadConfig() {
      this.setState({
        loaded: false
      }, this.loadSecurityConfig);
    }
    loadSupportedCiphers() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ciphers",
        "list",
        "--supported"
      ];
      log_cmd("loadSupportedCiphers", "Load the security configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          supportedCiphers: config2.items
        }, this.loadEnabledCiphers);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading security configuration - ${msg}`
        );
      });
    }
    loadEnabledCiphers() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ciphers",
        "list",
        "--enabled"
      ];
      log_cmd("loadEnabledCiphers", "Load the security configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        this.setState({
          enabledCiphers: config2.items
        }, this.loadCerts);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading security configuration - ${msg}`
        );
      });
    }
    loadCACerts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ca-certificate",
        "list"
      ];
      log_cmd("loadCACerts", "Load CA certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        this.setState(
          () => ({
            CACerts: certs
          }),
          this.loadCSRs
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading CA certificates - ${msg}`
        );
      });
    }
    loadCerts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "list"
      ];
      log_cmd("loadCerts", "Load certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        const certNames = [];
        for (const cert of certs) {
          certNames.push(cert.attrs.nickname);
        }
        this.setState(
          () => ({
            serverCerts: certs,
            serverCertNames: certNames
          }),
          this.loadCACerts
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading server certificates - ${msg}`
        );
      });
    }
    loadCSRs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "list"
      ];
      log_cmd("loadCSRs", "Load CSRs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const csrs = JSON.parse(content);
        this.setState(
          () => ({
            serverCSRs: csrs
          }),
          this.loadOrphanKeys
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading CSRs - ${msg}`
        );
      });
    }
    loadOrphanKeys() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "key",
        "list",
        "--orphan"
      ];
      log_cmd("loadOrphanKeys", "Load Orphan Keys", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const keys = JSON.parse(content);
        this.setState(
          () => ({
            serverOrphanKeys: keys,
            loaded: true
          }),
          this.props.enableTree()
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        if (!errMsg.desc.includes("certutil: no keys found")) {
          this.props.addNotification(
            "error",
            `Error loading Orphan Keys - ${errMsg.desc}`
          );
        }
        this.setState({
          loaded: true,
          serverOrphanKeys: []
        }, this.props.enableTree());
      });
    }
    loadRSAConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "rsa",
        "get"
      ];
      log_cmd("loadRSAConfig", "Load the RSA configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const nickname = config2.items.nssslpersonalityssl;
        this.setState(() => ({
          nssslpersonalityssl: nickname,
          _nssslpersonalityssl: nickname
        }), this.loadSupportedCiphers);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading security RSA configuration - ${msg}`
        );
      });
    }
    loadSecurityConfig(saving) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "get"
      ];
      log_cmd("loadSecurityConfig", "Load the security configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.items;
        let secEnabled = false;
        let secReqSecBinds = false;
        let clientAuth = "allowed";
        let validateCert = "warn";
        let cipherPref = "default";
        let allowWeak = false;
        let renegot = true;
        let checkHostname = false;
        if ("nstlsallowclientrenegotiation" in config2.items) {
          if (config2.items.nstlsallowclientrenegotiation === "off") {
            renegot = false;
          }
        }
        if ("nsslapd-security" in attrs) {
          if (attrs["nsslapd-security"].toLowerCase() === "on") {
            secEnabled = true;
          }
        }
        if ("nsslapd-require-secure-binds" in attrs) {
          if (attrs["nsslapd-require-secure-binds"].toLowerCase() === "on") {
            secReqSecBinds = true;
          }
        }
        if ("nssslclientauth" in attrs) {
          if (attrs.nssslclientauth !== "") {
            clientAuth = attrs.nssslclientauth;
          }
        }
        if ("nsslapd-validate-cert" in attrs) {
          if (attrs["nsslapd-validate-cert"] !== "") {
            validateCert = attrs["nsslapd-validate-cert"].toLowerCase();
          }
        }
        if ("allowweakcipher" in attrs) {
          if (attrs.allowweakcipher.toLowerCase() === "on") {
            allowWeak = true;
          }
        }
        if ("nsslapd-ssl-check-hostname" in attrs) {
          if (attrs["nsslapd-ssl-check-hostname"].toLowerCase() === "on") {
            checkHostname = true;
          }
        }
        if ("nsssl3ciphers" in attrs) {
          if (attrs.nsssl3ciphers !== "") {
            cipherPref = attrs.nsssl3ciphers;
          }
        }
        this.setState(() => ({
          securityEnabled: secEnabled,
          requireSecureBinds: secReqSecBinds,
          secureListenhost: attrs["nsslapd-securelistenhost"],
          clientAuth,
          checkHostname,
          validateCert,
          sslVersionMin: attrs.sslversionmin,
          sslVersionMax: attrs.sslversionmax,
          allowWeakCipher: allowWeak,
          cipherPref,
          nstlsallowclientrenegotiation: renegot,
          _nstlsallowclientrenegotiation: renegot,
          _securityEnabled: secEnabled,
          _requireSecureBinds: secReqSecBinds,
          _secureListenhost: attrs["nsslapd-securelistenhost"],
          _clientAuth: clientAuth,
          _checkHostname: checkHostname,
          _validateCert: validateCert,
          _sslVersionMin: attrs.sslversionmin,
          _sslVersionMax: attrs.sslversionmax,
          _allowWeakCipher: allowWeak,
          disableSaveBtn: true
        }), function() {
          if (!saving) {
            this.loadRSAConfig();
          }
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error loading security configuration - ${msg}`
        );
      });
    }
    handleSwitchChange(value) {
      if (!value) {
        this.setState({ showConfirmDisable: true });
      } else {
        if (this.state.serverCerts.length > 0) {
          this.setState({
            primaryCertName: this.state.nssslpersonalityssl,
            showSecurityEnableModal: true
          });
        } else {
          this.props.addNotification(
            "error",
            `There must be at least one server certificate present in the security database to enable security`
          );
        }
      }
    }
    closeSecurityEnableModal() {
      this.setState({
        showSecurityEnableModal: false
      });
    }
    onSecEnableChange(e) {
      const value = e.target.value.trim();
      this.setState({
        primaryCertName: value
      });
    }
    closeConfirmDisable() {
      this.setState({
        showConfirmDisable: false
      });
    }
    enableSecurity() {
      this.setState({
        secEnableSpinner: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "enable"
      ];
      if (this.state._nssslpersonalityssl !== this.state.primaryCertName) {
        const rsa_cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "security",
          "rsa",
          "set",
          "--nss-cert-name=" + this.state.primaryCertName
        ];
        log_cmd("enableSecurity", "Update RSA", rsa_cmd);
        cockpit_default.spawn(rsa_cmd, { superuser: true, err: "message" }).done(() => {
          this.loadSecurityConfig();
          log_cmd("enableSecurity", "Enable security", cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
            this.loadSecurityConfig();
            this.props.addNotification(
              "success",
              `Successfully enabled security.`
            );
            this.props.addNotification(
              "warning",
              `You must restart the Directory Server for these changes to take effect.`
            );
            this.setState({
              securityEnabled: true,
              secEnableSpinner: false,
              showSecurityEnableModal: false
            });
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            let msg = errMsg.desc;
            if ("info" in errMsg) {
              msg = errMsg.desc + " - " + errMsg.info;
            }
            this.props.addNotification(
              "error",
              `Error enabling security - ${msg}`
            );
            this.setState({
              secEnableSpinner: false,
              showSecurityEnableModal: false
            });
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          let msg = errMsg.desc;
          if ("info" in errMsg) {
            msg = errMsg.desc + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            `Error enabling security (RSA cert name)- ${msg}`
          );
          this.setState({
            secEnableSpinner: false,
            showSecurityEnableModal: false
          });
        });
      } else {
        log_cmd("enableSecurity", "Enable security", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
          this.props.addNotification(
            "success",
            `Successfully enabled security.`
          );
          this.props.addNotification(
            "warning",
            `You must restart the Directory Server for these changes to take effect.`
          );
          this.setState({
            securityEnabled: true,
            secEnableSpinner: false,
            showSecurityEnableModal: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          let msg = errMsg.desc;
          if ("info" in errMsg) {
            msg = errMsg.desc + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            `Error enabling security - ${msg}`
          );
          this.setState({
            secEnableSpinner: false,
            showSecurityEnableModal: false
          });
        });
      }
    }
    disableSecurity() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "disable"
      ];
      log_cmd("disableSecurity", "Disable security", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.props.addNotification(
          "success",
          `Successfully disabled security.`
        );
        this.props.addNotification(
          "warning",
          `You must restart the Directory Server for these changes to take effect.`
        );
        this.setState({
          securityEnabled: false,
          modalSpinning: false,
          showConfirmDisable: false
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        let msg = errMsg.desc;
        if ("info" in errMsg) {
          msg = errMsg.desc + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          `Error disabling security - ${msg}`
        );
        this.setState({
          modalSpinning: false,
          showConfirmDisable: false
        });
      });
    }
    saveSecurityConfig() {
      let sslMin = this.state._sslVersionMin;
      let sslMax = this.state._sslVersionMax;
      if (this.state._sslVersionMin !== this.state.sslVersionMin) {
        sslMin = this.state.sslVersionMin;
      }
      if (this.state._sslVersionMax !== this.state.sslVersionMax) {
        sslMax = this.state.sslVersionMax;
      }
      if (sslMin > sslMax) {
        this.props.addNotification(
          "error",
          `The TLS minimum version must be less than or equal to the TLS maximum version`
        );
        this.loadSecurityConfig();
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "set"
      ];
      const rsa_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "rsa",
        "set"
      ];
      if (this.state._validateCert !== this.state.validateCert) {
        cmd.push("--verify-cert-chain-on-startup=" + this.state.validateCert);
      }
      if (this.state._sslVersionMin !== this.state.sslVersionMin) {
        cmd.push("--tls-protocol-min=" + this.state.sslVersionMin);
      }
      if (this.state._sslVersionMax !== this.state.sslVersionMax) {
        cmd.push("--tls-protocol-max=" + this.state.sslVersionMax);
      }
      if (this.state._clientAuth !== this.state.clientAuth) {
        cmd.push("--tls-client-auth=" + this.state.clientAuth);
      }
      if (this.state._secureListenhost !== this.state.secureListenhost) {
        cmd.push("--listen-host=" + this.state.secureListenhost);
      }
      if (this.state._allowWeakCipher !== this.state.allowWeakCipher) {
        let val = "off";
        if (this.state.allowWeakCipher) {
          val = "on";
        }
        cmd.push("--allow-insecure-ciphers=" + val);
      }
      if (this.state._checkHostname !== this.state.checkHostname) {
        let val = "off";
        if (this.state.checkHostname) {
          val = "on";
        }
        cmd.push("--check-hostname=" + val);
      }
      if (this.state._requireSecureBinds !== this.state.requireSecureBinds) {
        let val = "off";
        if (this.state.requireSecureBinds) {
          val = "on";
        }
        cmd.push("--require-secure-authentication=" + val);
      }
      if (this.state._nstlsallowclientrenegotiation !== this.state.nstlsallowclientrenegotiation) {
        let val = "off";
        if (this.state.nstlsallowclientrenegotiation) {
          val = "on";
        }
        cmd.push("--tls-client-renegotiation=" + val);
      }
      if (this.state._nssslpersonalityssl !== this.state.nssslpersonalityssl) {
        rsa_cmd.push("--nss-cert-name=" + this.state.nssslpersonalityssl);
      }
      if (rsa_cmd.length > 6) {
        log_cmd("saveSecurityConfig", "Applying security RSA config change", rsa_cmd);
        const msg = "Successfully updated security RSA configuration.";
        this.setState({
          // Start the spinner
          saving: true
        });
        cockpit_default.spawn(rsa_cmd, { superuser: true, err: "message" }).done((content) => {
          this.loadSecurityConfig();
          if (cmd.length < 6) {
            this.props.addNotification(
              "success",
              msg
            );
            this.props.addNotification(
              "warning",
              `You must restart the Directory Server for these changes to take effect.`
            );
            this.setState({
              saving: false
            });
          }
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.loadSecurityConfig();
          this.setState({
            saving: false
          });
          let msg2 = errMsg.desc;
          if ("info" in errMsg) {
            msg2 = errMsg.desc + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            `Error updating security RSA configuration - ${msg2}`
          );
        });
      }
      if (cmd.length > 5) {
        log_cmd("saveSecurityConfig", "Applying security config change", cmd);
        const msg = "Successfully updated security configuration.";
        this.setState({
          // Start the spinner
          saving: true
        });
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.loadSecurityConfig(1);
          this.props.addNotification(
            "success",
            msg
          );
          this.props.addNotification(
            "warning",
            `You must restart the Directory Server for these changes to take effect.`
          );
          this.setState({
            saving: false
          });
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          this.loadSecurityConfig();
          this.setState({
            saving: false
          });
          let msg2 = errMsg.desc;
          if ("info" in errMsg) {
            msg2 = errMsg.desc + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            `Error updating security configuration - ${msg2}`
          );
        });
      }
    }
    handleTypeaheadChange(value, collection) {
      this.setState({
        [collection]: [...this.state[collection], value]
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const config_attr of configAttrs) {
        if (attr === config_attr && this.state["_" + config_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of configAttrs) {
        if (attr !== config_attr && this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        disableSaveBtn
      });
    }
    render() {
      let securityPage = "";
      const serverCert = [this.state.nssslpersonalityssl];
      let saveBtnName = "Save Settings";
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = "Saving settings ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      if (this.state.loaded && !this.state.saving) {
        let configPage = "";
        if (this.state.securityEnabled) {
          configPage = /* @__PURE__ */ import_react128.default.createElement("div", { className: "ds-margin-bottom-md" }, /* @__PURE__ */ import_react128.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "The name, or nickname, of the server certificate inthe NSS database the server should use (nsSSLPersonalitySSL)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Server Certificate Name"),
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react128.default.createElement(
              Select,
              {
                variant: SelectVariant.typeahead,
                typeAheadAriaLabel: "Type a server certificate nickname",
                onToggle: this.handleServerCertToggle,
                onSelect: this.handleServerCertSelect,
                onClear: this.handleServerCertClear,
                selections: serverCert,
                isOpen: this.state.isServerCertOpen,
                "aria-labelledby": "typeAhead-server-cert",
                placeholderText: "Type a sever certificate nickname...",
                noResultsFoundText: "There are no matching entries"
              },
              this.state.serverCertNames.map((cert, index) => /* @__PURE__ */ import_react128.default.createElement(
                SelectOption,
                {
                  key: index,
                  value: cert
                }
              ))
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "The minimum SSL/TLS version the server will accept (sslversionmin)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Minimum TLS Version"),
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react128.default.createElement(
              Select,
              {
                variant: SelectVariant.single,
                "aria-label": "Select Input",
                onToggle: this.handleMinSSLToggle,
                onSelect: this.handleMinSSLSelect,
                selections: this.state.sslVersionMin,
                isOpen: this.state.isMinSSLOpen,
                "aria-labelledby": "minssl"
              },
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 1, value: "TLS1.3" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 2, value: "TLS1.2" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 3, value: "TLS1.1" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 4, value: "TLS1.0" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 5, value: "SSL3" })
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "The maximum SSL/TLS version the server will accept (sslversionmax)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Maximum TLS Version"),
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react128.default.createElement(
              Select,
              {
                variant: SelectVariant.single,
                "aria-label": "Select Input",
                onToggle: this.handleMaxSSLToggle,
                onSelect: this.handleMaxSSLSelect,
                selections: this.state.sslVersionMax,
                isOpen: this.state.isMaxSSLOpen,
                "aria-labelledby": "maxssl"
              },
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 1, value: "TLS1.3" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 2, value: "TLS1.2" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 3, value: "TLS1.1" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 4, value: "TLS1.0" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 5, value: "SSL3" })
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "Sets how the Directory Server enforces TLS client authentication (nsSSLClientAuth)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Client Authentication"),
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react128.default.createElement(
              Select,
              {
                variant: SelectVariant.single,
                "aria-label": "Select Input",
                onToggle: this.handleClientAuthToggle,
                onSelect: this.handleClientAuthSelect,
                selections: this.state.clientAuth,
                isOpen: this.state.isClientAuthOpen,
                "aria-labelledby": "clientAuth"
              },
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 1, value: "off" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 2, value: "allowed" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 3, value: "required" })
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "Validate server's certificate expiration date (nsslapd-validate-cert)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Validate Certificate"),
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react128.default.createElement(
              Select,
              {
                variant: SelectVariant.single,
                "aria-label": "Select Input",
                onToggle: this.handleValidateCertToggle,
                onSelect: this.handleValidateCertSelect,
                selections: this.state.validateCert,
                isOpen: this.state.isValidateCertOpen,
                "aria-labelledby": "validateCert"
              },
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 1, value: "warn" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 2, value: "on" }),
              /* @__PURE__ */ import_react128.default.createElement(SelectOption, { key: 3, value: "off" })
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "This parameter can be used to restrict the Directory Server instance to a single IP interface (hostname, or IP address).  This parameter specifically sets what interface to use for TLS traffic.  Requires restart. (nsslapd-securelistenhost)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Secure Listen Host"),
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react128.default.createElement(
              TextInput,
              {
                value: this.state.secureListenhost,
                type: "text",
                id: "secureListenhost",
                "aria-describedby": "horizontal-form-name-helper",
                name: "server-hostname",
                onChange: (str, e) => {
                  this.handleChange(e);
                }
              }
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "Require all connections use TLS (nsslapd-require-secure-binds)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react128.default.createElement(
              Checkbox,
              {
                id: "requireSecureBinds",
                isChecked: this.state.requireSecureBinds,
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                label: "Require Secure Connections"
              }
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "Verify authenticity of a request by matching the host name against the value assigned to the common name (cn) attribute of the subject name (subjectDN field) in the certificate being presented. (nsslapd-ssl-check-hostname)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react128.default.createElement(
              Checkbox,
              {
                id: "checkHostname",
                isChecked: this.state.checkHostname,
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                label: "Verify Certificate Subject Hostname"
              }
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "Allow weak ciphers (allowWeakCipher)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react128.default.createElement(
              Checkbox,
              {
                id: "allowWeakCipher",
                isChecked: this.state.allowWeakCipher,
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                title: "Allow weak ciphers (allowWeakCipher).",
                label: "Allow Weak Ciphers"
              }
            ))
          ), /* @__PURE__ */ import_react128.default.createElement(
            Grid,
            {
              title: "Allow client-initiated renegotiation (nsTLSAllowClientRenegotiation)."
            },
            /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react128.default.createElement(
              Checkbox,
              {
                id: "nstlsallowclientrenegotiation",
                isChecked: this.state.nstlsallowclientrenegotiation,
                onChange: (checked, e) => {
                  this.handleChange(e);
                },
                title: "Allow client-initiated renegotiation (nsTLSAllowClientRenegotiation).",
                label: "Allow Client Renegotiation"
              }
            ))
          )), /* @__PURE__ */ import_react128.default.createElement(
            Button,
            {
              variant: "primary",
              className: "ds-margin-top-xlg",
              onClick: () => {
                this.saveSecurityConfig();
              },
              isDisabled: this.state.disableSaveBtn || this.state.saving,
              isLoading: this.state.saving,
              spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
              ...extraPrimaryProps
            },
            saveBtnName
          ));
        }
        securityPage = /* @__PURE__ */ import_react128.default.createElement("div", { className: "ds-margin-bottom-md" }, /* @__PURE__ */ import_react128.default.createElement(Grid, null, /* @__PURE__ */ import_react128.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react128.default.createElement(TextContent, null, /* @__PURE__ */ import_react128.default.createElement(Text, { component: TextVariants.h3 }, "Security Settings", /* @__PURE__ */ import_react128.default.createElement(
          FontAwesomeIcon,
          {
            size: "lg",
            className: "ds-left-margin ds-refresh",
            icon: faSyncAlt,
            title: "Refresh settings",
            onClick: this.handleReloadConfig
          }
        ))))), /* @__PURE__ */ import_react128.default.createElement("div", { className: "ds-tab-table" }, /* @__PURE__ */ import_react128.default.createElement(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react128.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react128.default.createElement(TabTitleText, null, "Security Configuration") }, /* @__PURE__ */ import_react128.default.createElement(Grid, { className: "ds-margin-top-xlg ds-left-indent-md" }, /* @__PURE__ */ import_react128.default.createElement(GridItem, { className: "ds-label", span: 4 }, /* @__PURE__ */ import_react128.default.createElement(
          Switch,
          {
            id: "simple-switch",
            label: "Security Enabled",
            labelOff: "Security Disabled",
            isChecked: this.state.securityEnabled,
            onChange: this.handleSwitchChange
          }
        )), /* @__PURE__ */ import_react128.default.createElement("hr", null), configPage)), /* @__PURE__ */ import_react128.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react128.default.createElement(TabTitleText, null, "Certificate Management") }, /* @__PURE__ */ import_react128.default.createElement(
          CertificateManagement,
          {
            serverId: this.props.serverId,
            CACerts: this.state.CACerts,
            ServerCerts: this.state.serverCerts,
            ServerCSRs: this.state.serverCSRs,
            ServerKeys: this.state.serverOrphanKeys,
            addNotification: this.props.addNotification,
            certDir: this.props.certDir
          }
        )), /* @__PURE__ */ import_react128.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react128.default.createElement(TabTitleText, null, "Cipher Preferences") }, /* @__PURE__ */ import_react128.default.createElement("div", { className: "ds-indent ds-tab-table" }, /* @__PURE__ */ import_react128.default.createElement(
          Ciphers,
          {
            key: this.state.cipherPref,
            serverId: this.props.serverId,
            supportedCiphers: this.state.supportedCiphers,
            cipherPref: this.state.cipherPref,
            enabledCiphers: this.state.enabledCiphers,
            addNotification: this.props.addNotification,
            reload: this.loadSecurityConfig
          }
        ))))));
      } else {
        securityPage = /* @__PURE__ */ import_react128.default.createElement("div", { className: "ds-margin-top-xlg ds-loading-spinner ds-center" }, /* @__PURE__ */ import_react128.default.createElement(TextContent, null, /* @__PURE__ */ import_react128.default.createElement(Text, { component: TextVariants.h3 }, "Loading Security Information ...")), /* @__PURE__ */ import_react128.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "lg" }));
      }
      return /* @__PURE__ */ import_react128.default.createElement("div", { className: this.state.saving ? "ds-disabled" : "" }, securityPage, /* @__PURE__ */ import_react128.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmDisable,
          closeHandler: this.closeConfirmDisable,
          handleChange: this.onModalChange,
          actionHandler: this.disableSecurity,
          spinning: this.state.modalSpinning,
          item: "Requires server restart to take effect.",
          checked: this.state.modalChecked,
          mTitle: "Disable Security",
          mMsg: "Are you sure you want to disable security?",
          mSpinningMsg: "Disabling ...",
          mBtnName: "Disable"
        }
      ), /* @__PURE__ */ import_react128.default.createElement(
        SecurityEnableModal,
        {
          showModal: this.state.showSecurityEnableModal,
          closeHandler: this.closeSecurityEnableModal,
          handleChange: this.onSecEnableChange,
          saveHandler: this.enableSecurity,
          primaryName: this.state.primaryCertName,
          certs: this.state.serverCerts,
          spinning: this.state.secEnableSpinner
        }
      ));
    }
  };
  Security.propTypes = {
    addNotification: import_prop_types105.default.func,
    serverId: import_prop_types105.default.string
  };
  Security.defaultProps = {
    serverId: ""
  };

  // src/server.jsx
  var Server = class extends import_react129.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        nodes: [],
        node_name: "settings-config",
        node_text: "",
        attrs: [],
        loaded: false,
        disableTree: false,
        activeItems: [
          {
            name: "Server Settings",
            id: "settings-config",
            icon: /* @__PURE__ */ import_react129.default.createElement(CogIcon, null)
          }
        ]
      };
      this.loadTree = this.loadTree.bind(this);
      this.reloadConfig = this.reloadConfig.bind(this);
      this.enableTree = this.enableTree.bind(this);
      this.handleTreeClick = this.handleTreeClick.bind(this);
    }
    componentDidUpdate() {
      if (this.props.wasActiveList.includes(1)) {
        if (this.state.firstLoad) {
          this.loadConfig();
        }
      }
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    loadConfig() {
      this.setState({
        loaded: false,
        firstLoad: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("loadConfig", "Load server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        this.setState(
          {
            loaded: true,
            attrs
          },
          this.loadTree()
        );
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loaded: true
        });
        this.props.addNotification(
          "error",
          `Error loading server configuration - ${errMsg.desc}`
        );
      });
    }
    reloadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadConfig", "Reload server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config2 = JSON.parse(content);
        const attrs = config2.attrs;
        this.setState({
          attrs
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.addNotification(
          "error",
          `Error reloading server configuration - ${errMsg.desc}`
        );
      });
    }
    loadTree() {
      const basicData = [
        {
          name: "Server Settings",
          id: "settings-config",
          icon: /* @__PURE__ */ import_react129.default.createElement(CogIcon, null)
        },
        {
          name: "Tuning & Limits",
          icon: /* @__PURE__ */ import_react129.default.createElement(TachometerAltIcon, null),
          id: "tuning-config"
        },
        {
          name: "Security",
          icon: /* @__PURE__ */ import_react129.default.createElement(LockIcon, null),
          id: "security-config"
        },
        {
          name: "SASL Settings & Mappings",
          icon: /* @__PURE__ */ import_react129.default.createElement(RouteIcon, null),
          id: "sasl-config"
        },
        {
          name: "LDAPI & Autobind",
          icon: /* @__PURE__ */ import_react129.default.createElement(KeyIcon, null),
          id: "ldapi-config"
        },
        {
          name: "Logging",
          icon: /* @__PURE__ */ import_react129.default.createElement(CatalogIcon, null),
          id: "logging-config",
          children: [
            {
              name: "Access Log",
              icon: /* @__PURE__ */ import_react129.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
              id: "access-log-config"
            },
            {
              name: "Audit Log",
              icon: /* @__PURE__ */ import_react129.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
              id: "audit-log-config"
            },
            {
              name: "Audit Failure Log",
              icon: /* @__PURE__ */ import_react129.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
              id: "auditfail-log-config"
            },
            {
              name: "Errors Log",
              icon: /* @__PURE__ */ import_react129.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
              id: "error-log-config"
            },
            {
              name: "Security Log",
              icon: /* @__PURE__ */ import_react129.default.createElement(FontAwesomeIcon, { size: "sm", icon: faBook }),
              id: "security-log-config"
            }
          ],
          defaultExpanded: true
        }
      ];
      this.setState({
        nodes: basicData,
        node_name: this.state.node_name
      });
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (treeViewItem.id !== "logging-config" && treeViewItem.id !== this.state.node_name) {
        this.setState({
          activeItems: [treeViewItem, parentItem],
          node_name: treeViewItem.id,
          disableTree: true
          // Disable the tree to allow node to be fully loaded
        });
      }
    }
    render() {
      const { nodes } = this.state;
      let serverPage = /* @__PURE__ */ import_react129.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react129.default.createElement(TextContent, null, /* @__PURE__ */ import_react129.default.createElement(Text, { component: TextVariants.h3 }, "Loading Server Configuration ...")), /* @__PURE__ */ import_react129.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" }));
      let server_element = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (this.state.loaded) {
        if (this.state.node_name === "settings-config" || this.state.node_name === "") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerSettings,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              version: this.props.version,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "tuning-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerTuning,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "sasl-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerSASL,
            {
              serverId: this.props.serverId,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "security-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            Security,
            {
              addNotification: this.props.addNotification,
              serverId: this.props.serverId,
              enableTree: this.enableTree,
              certDir: this.state.attrs["nsslapd-certdir"]
            }
          );
        } else if (this.state.node_name === "ldapi-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerLDAPI,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "access-log-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerAccessLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "audit-log-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerAuditLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "auditfail-log-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerAuditFailLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "error-log-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerErrorLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "security-log-config") {
          server_element = /* @__PURE__ */ import_react129.default.createElement(
            ServerSecurityLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        }
        serverPage = /* @__PURE__ */ import_react129.default.createElement("div", { className: "container-fluid" }, /* @__PURE__ */ import_react129.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react129.default.createElement("div", { className: "ds-tree" }, /* @__PURE__ */ import_react129.default.createElement(
          "div",
          {
            className: disabled,
            id: "server-tree"
          },
          /* @__PURE__ */ import_react129.default.createElement(
            TreeView,
            {
              data: nodes,
              activeItems: this.state.activeItems,
              onSelect: this.handleTreeClick
            }
          )
        )), /* @__PURE__ */ import_react129.default.createElement("div", { className: "ds-tree-content" }, server_element)));
      }
      return /* @__PURE__ */ import_react129.default.createElement("div", null, serverPage);
    }
  };
  Server.propTypes = {
    addNotification: import_prop_types106.default.func,
    serverId: import_prop_types106.default.string
  };
  Server.defaultProps = {
    serverId: ""
  };

  // src/dsModals.jsx
  var import_react130 = __toESM(require_react(), 1);
  var import_prop_types107 = __toESM(require_prop_types(), 1);
  var CreateInstanceModal = class extends import_react130.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        createServerId: "",
        createPort: 389,
        createSecurePort: 636,
        createDM: "cn=Directory Manager",
        createDMPassword: "",
        createDMPasswordConfirm: "",
        createDBCheckbox: false,
        createDBSuffix: "",
        createDBName: "",
        createTLSCert: true,
        createInitDB: "noInit",
        loadingCreate: false,
        createOK: false,
        modalMsg: "",
        errObj: {}
      };
      this.maxValue = 65535;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validate();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validate();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validate();
        });
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.validate = this.validate.bind(this);
      this.handleCreateInstance = this.handleCreateInstance.bind(this);
      this.validInstName = this.validInstName.bind(this);
      this.validRootDN = this.validRootDN.bind(this);
    }
    validInstName(name2) {
      return /^[\w@_:-]*$/.test(name2);
    }
    validRootDN(dn) {
      if (dn.endsWith(",")) {
        return false;
      }
      const dn_regex = /^([A-Za-z]+=(?=\\S)([ -~]+)$)/;
      const result = dn_regex.test(dn);
      return result;
    }
    validate() {
      let all_good = true;
      let createServerIdMsg = "";
      const errObj = {};
      const reqAttrs = [
        "createServerId",
        "createDM",
        "createDMPassword",
        "createDMPasswordConfirm"
      ];
      const dnAttrs = [
        "createDM"
      ];
      const optionalAttrs = [
        "createDBName"
      ];
      if (this.state.createServerId !== "") {
        if (this.state.createServerId.length > 80) {
          all_good = false;
          errObj.createServerId = true;
          createServerIdMsg = "Instance name must be less than 80 characters";
        } else if (!this.validInstName(this.state.createServerId)) {
          all_good = false;
          errObj.createServerId = true;
          createServerIdMsg = "Instance name can only contain letters, numbers, and these 4 characters:  - @ : _";
        }
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      if (this.state.createDMPassword !== this.state.createDMPasswordConfirm || this.state.createDMPassword.length < 8) {
        all_good = false;
        errObj.createDMPassword = true;
        errObj.createDMPasswordConfirm = true;
      }
      if (this.state.createDBCheckbox) {
        for (const attr of optionalAttrs) {
          if (this.state[attr] === "") {
            all_good = false;
            errObj[attr] = true;
          }
        }
        if (!valid_dn(this.state.createDBSuffix)) {
          all_good = false;
          errObj.createDBSuffix = true;
        }
      }
      this.setState({
        createOK: all_good,
        createServerIdMsg,
        errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    handleCreateInstance() {
      const {
        createServerId,
        createPort,
        createSecurePort,
        createDM,
        createDMPassword,
        createDBSuffix,
        createDBName,
        createTLSCert,
        createInitDB,
        createDBCheckbox
      } = this.state;
      const { closeHandler, addNotification, loadInstanceList } = this.props;
      let self_sign = "False";
      if (createTLSCert) {
        self_sign = "True";
      }
      let newServerId = createServerId;
      newServerId = newServerId.replace(/^slapd-/i, "");
      let setup_inf = "[general]\nconfig_version = 2\nfull_machine_name = FQDN\n\n[slapd]\nuser = dirsrv\ngroup = dirsrv\ninstance_name = " + newServerId + "\nport = " + createPort + "\nroot_dn = " + createDM + "\nsecure_port = " + createSecurePort + "\nself_sign_cert = " + self_sign + "\n";
      if (createDBCheckbox) {
        setup_inf += "\n[backend-" + createDBName + "]\nsuffix = " + createDBSuffix + "\n";
        if (createInitDB === "createSample") {
          setup_inf += "sample_entries = yes\n";
        }
        if (createInitDB === "createSuffix") {
          setup_inf += "create_suffix_entry = yes\n";
        }
      }
      this.setState({
        loadingCreate: true
      });
      const hostname_cmd = ["hostnamectl", "status", "--static"];
      log_cmd("handleCreateInstance", "Get FQDN ...", hostname_cmd);
      cockpit_default.spawn(hostname_cmd, { superuser: true, err: "message" }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.setState({
          loadingCreate: false
        });
        addNotification("error", `Failed to get hostname!", ${errMsg.desc}`);
      }).done((data) => {
        if (data.trim() === "") {
          data = "localhost.localdomain";
        }
        setup_inf = setup_inf.replace("FQDN", data);
        const setup_file = "/tmp/389-setup-" + (/* @__PURE__ */ new Date()).getTime() + ".inf";
        const rm_cmd = ["rm", setup_file];
        const create_file_cmd = ["touch", setup_file];
        log_cmd("handleCreateInstance", "Setting FQDN...", create_file_cmd);
        cockpit_default.spawn(create_file_cmd, { superuser: true, err: "message" }).fail((err) => {
          this.setState({
            loadingCreate: false
          });
          addNotification(
            "error",
            `Failed to create installation file!" ${err.message}`
          );
        }).done((_) => {
          const chmod_cmd = ["chmod", "600", setup_file];
          log_cmd("handleCreateInstance", "Setting initial INF file permissions...", chmod_cmd);
          cockpit_default.spawn(chmod_cmd, { superuser: true, err: "message" }).fail((err) => {
            cockpit_default.spawn(rm_cmd, { superuser: true, err: "message" });
            this.setState({
              loadingCreate: false
            });
            addNotification(
              "error",
              `Failed to set permissions on setup file ${setup_file}: ${err.message}`
            );
          }).done((_2) => {
            const cmd = [
              "/bin/sh",
              "-c",
              "/usr/bin/echo -e '" + setup_inf + "' >> " + setup_file
            ];
            log_cmd("handleCreateInstance", "Apply changes to INF file...", "");
            cockpit_default.spawn(cmd, { superuser: true, err: "message" }).fail((err) => {
              this.setState({
                loadingCreate: false
              });
              addNotification(
                "error",
                `Failed to populate installation file! ${err.message}`
              );
            }).done((_3) => {
              const cmd2 = ["dscreate", "-j", "from-file", setup_file];
              log_cmd("handleCreateInstance", "Creating instance...", cmd2);
              cockpit_default.spawn(cmd2, {
                superuser: true,
                err: "message"
              }).fail((err) => {
                const errMsg = JSON.parse(err.message);
                cockpit_default.spawn(rm_cmd, { superuser: true });
                this.setState({
                  loadingCreate: false
                });
                addNotification(
                  "error",
                  `${errMsg.desc}`
                );
              }).done((_4) => {
                log_cmd("handleCreateInstance", "Instance creation compelete, remove INF file...", rm_cmd);
                cockpit_default.spawn(rm_cmd, { superuser: true });
                const dm_pw_cmd = [
                  "dsconf",
                  "-j",
                  "ldapi://%2fvar%2frun%2fslapd-" + newServerId + ".socket",
                  "directory_manager",
                  "password_change"
                ];
                const config2 = {
                  cmd: dm_pw_cmd,
                  promptArg: "",
                  passwd: createDMPassword,
                  addNotification,
                  success_msg: `Successfully created instance: slapd-${createServerId}`,
                  error_msg: "Failed to set Directory Manager password",
                  state_callback: () => {
                    this.setState({ loadingCreate: false });
                  },
                  reload_func: loadInstanceList,
                  reload_arg: createServerId,
                  ext_func: closeHandler,
                  ext_arg: "",
                  funcName: "handleCreateInstance",
                  funcDesc: "Set Directory Manager password..."
                };
                callCmdStreamPassword(config2);
              });
            });
          });
        });
      });
    }
    render() {
      const { showModal, closeHandler } = this.props;
      const {
        loadingCreate,
        createServerId,
        createPort,
        createSecurePort,
        createDM,
        createDMPassword,
        createDMPasswordConfirm,
        createDBCheckbox,
        createDBSuffix,
        createDBName,
        createTLSCert,
        createInitDB,
        createOK,
        errObj
      } = this.state;
      let saveBtnName = "Create Instance";
      const extraPrimaryProps = {};
      if (loadingCreate) {
        saveBtnName = "Creating Instance ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      return /* @__PURE__ */ import_react130.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Create New Server Instance",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react130.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: this.handleCreateInstance,
                isDisabled: !createOK || loadingCreate,
                isLoading: loadingCreate,
                spinnerAriaValueText: loadingCreate ? "Saving" : void 0,
                ...extraPrimaryProps
              },
              saveBtnName
            ),
            /* @__PURE__ */ import_react130.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react130.default.createElement("div", { className: loadingCreate ? "ds-disabled" : "" }, /* @__PURE__ */ import_react130.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react130.default.createElement(Grid, { className: "ds-margin-top", title: "The instance name, this is what gets appended to 'slapi-'. The instance name can only contain letters, numbers, and: # @ : - _" }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Instance Name"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          TextInput,
          {
            value: createServerId,
            type: "text",
            id: "createServerId",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createServerId",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: errObj.createServerId ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react130.default.createElement(FormHelperText, { isError: true, isHidden: !errObj.createServerId }, this.state.createServerIdMsg))), /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "The server port number should be in the range of 0 to 65534." }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Port"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          NumberInput,
          {
            value: createPort,
            min: 1,
            max: 65534,
            onMinus: () => {
              this.onMinusConfig("createPort");
            },
            onChange: (e) => {
              this.onConfigChange(e, "createPort", 0);
            },
            onPlus: () => {
              this.onPlusConfig("createPort");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ), /* @__PURE__ */ import_react130.default.createElement(FormHelperText, { className: "ds-info-color", isHidden: createPort !== 0 }, "Port 0 will disable non-TLS connections"))), /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "The secure port number for TLS connections. It should be in the range of 1 to 65534." }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Secure Port"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          NumberInput,
          {
            value: createSecurePort,
            min: 1,
            max: 65534,
            onMinus: () => {
              this.onMinusConfig("createSecurePort");
            },
            onChange: (e) => {
              this.onConfigChange(e, "createSecurePort", 1);
            },
            onPlus: () => {
              this.onPlusConfig("createSecurePort");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))), /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "Create a self-signed certificate database in /etc/dirsrc/ssca directory." }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label-checkbox", span: 4 }, "Create Self-Signed TLS Certificate"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          Checkbox,
          {
            id: "createTLSCert",
            isChecked: createTLSCert,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            }
          }
        ))), /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "The DN for the unrestricted user" }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Directory Manager DN"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          TextInput,
          {
            value: createDM,
            type: "text",
            id: "createDM",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createDM",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: errObj.createDM ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react130.default.createElement(FormHelperText, { isError: true, isHidden: !errObj.createDM }, "Enter a valid DN"))), /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "Directory Manager password must be at least 8 characters in length." }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Directory Manager Password"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          TextInput,
          {
            value: createDMPassword,
            type: "password",
            id: "createDMPassword",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createDMPassword",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: errObj.createDMPassword ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react130.default.createElement(FormHelperText, { isError: true, isHidden: !errObj.createDMPassword }, "Password must be set and it must match the confirmation password."))), /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "Confirm the previously entered password." }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", span: 4 }, "Confirm Password"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          TextInput,
          {
            value: createDMPasswordConfirm,
            type: "password",
            id: "createDMPasswordConfirm",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createDMPasswordConfirm",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: errObj.createDMPasswordConfirm ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react130.default.createElement(FormHelperText, { isError: true, isHidden: !errObj.createDMPasswordConfirm }, "Confirmation password must be set and it must match the first password."))), /* @__PURE__ */ import_react130.default.createElement(Grid, { className: "ds-margin-top", title: "Create a database during the installation." }, /* @__PURE__ */ import_react130.default.createElement(
          Checkbox,
          {
            id: "createDBCheckbox",
            label: "Create Database",
            isChecked: createDBCheckbox,
            onChange: (checked, e) => {
              this.handleFieldChange(e);
            }
          }
        )), /* @__PURE__ */ import_react130.default.createElement("div", { className: createDBCheckbox ? "" : "ds-hidden" }, /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "Database suffix, like 'dc=example,dc=com'. The suffix must be a valid LDAP Distiguished Name (DN)" }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", offset: 1, span: 3 }, "Database Suffix"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          TextInput,
          {
            value: createDBSuffix,
            placeholder: "e.g. dc=company,dc=com",
            type: "text",
            id: "createDBSuffix",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createDBSuffix",
            isDisabled: !createDBCheckbox,
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: errObj.createDBSuffix ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react130.default.createElement(FormHelperText, { isError: true, isHidden: !errObj.createDBSuffix }, "Value must be a valid DN"))), /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "The name for the backend database, like 'userroot'. The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends." }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", offset: 1, span: 3 }, "Database Name"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          TextInput,
          {
            value: createDBName,
            placeholder: "e.g. userRoot",
            type: "text",
            id: "createDBName",
            "aria-describedby": "horizontal-form-name-helper",
            name: "createDBName",
            isDisabled: !createDBCheckbox,
            onChange: (str, e) => {
              this.handleFieldChange(e);
            },
            validated: errObj.createDBName ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), /* @__PURE__ */ import_react130.default.createElement(FormHelperText, { isError: true, isHidden: !errObj.createDBName }, "Name is required"))), /* @__PURE__ */ import_react130.default.createElement(Grid, null, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", offset: 1, span: 3 }, "Database Initialization"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react130.default.createElement(
          FormSelect,
          {
            id: "createInitDB",
            value: createInitDB,
            onChange: (value, event) => {
              this.handleFieldChange(event);
            },
            "aria-label": "FormSelect Input",
            isDisabled: !createDBCheckbox
          },
          /* @__PURE__ */ import_react130.default.createElement(FormSelectOption, { key: "1", value: "noInit", label: "Do Not Initialize Database" }),
          /* @__PURE__ */ import_react130.default.createElement(FormSelectOption, { key: "2", value: "createSuffix", label: "Create Suffix Entry" }),
          /* @__PURE__ */ import_react130.default.createElement(FormSelectOption, { key: "3", value: "createSample", label: "Create Sample Entries" })
        )))), /* @__PURE__ */ import_react130.default.createElement("div", { className: createDBCheckbox ? "ds-margin-bottom" : "ds-margin-bottom-md" })))
      );
    }
  };
  var SchemaReloadModal = class extends import_react130.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        reloadSchemaDir: "",
        loadingSchemaTask: false
      };
      this.handleReloadSchema = this.handleReloadSchema.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
    }
    handleFieldChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      });
    }
    handleReloadSchema(e) {
      const { addNotification, serverId, closeHandler } = this.props;
      const { reloadSchemaDir } = this.state;
      this.setState({
        loadingSchemaTask: true
      });
      let cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket", "schema", "reload", "--wait"];
      if (reloadSchemaDir !== "") {
        cmd = [...cmd, "--schemadir", reloadSchemaDir];
      }
      log_cmd("handleReloadSchema", "Reload schema files", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
        addNotification("success", "Successfully reloaded schema");
        this.setState({
          loadingSchemaTask: false
        });
        closeHandler();
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        addNotification("error", `Failed to reload schema files - ${errMsg.desc}`);
        closeHandler();
      });
    }
    render() {
      const { loadingSchemaTask, reloadSchemaDir } = this.state;
      const { showModal, closeHandler } = this.props;
      let spinner = "";
      if (loadingSchemaTask) {
        spinner = /* @__PURE__ */ import_react130.default.createElement(Grid, null, /* @__PURE__ */ import_react130.default.createElement("div", { className: "ds-margin-top ds-modal-spinner" }, /* @__PURE__ */ import_react130.default.createElement(Spinner, { size: "lg" }), "Reloading schema files..."));
      }
      return /* @__PURE__ */ import_react130.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "Reload Schema Files",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react130.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleReloadSchema }, "Reload Schema"),
            /* @__PURE__ */ import_react130.default.createElement(Button, { key: "cancel", variant: "link", onClick: closeHandler }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react130.default.createElement(Form, { isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react130.default.createElement(Grid, { title: "The name of the database link." }, /* @__PURE__ */ import_react130.default.createElement(GridItem, { className: "ds-label", span: 3 }, "Schema File Directory"), /* @__PURE__ */ import_react130.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react130.default.createElement(
          TextInput,
          {
            value: reloadSchemaDir,
            type: "text",
            id: "reloadSchemaDir",
            "aria-describedby": "horizontal-form-name-helper",
            name: "reloadSchemaDir",
            onChange: (str, e) => {
              this.handleFieldChange(e);
            }
          }
        ))), spinner)
      );
    }
  };
  var ManageBackupsModal = class extends import_react130.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeKey: 1,
        showConfirmBackupDelete: false,
        showConfirmBackup: false,
        showConfirmRestore: false,
        showConfirmRestoreReplace: false,
        showConfirmLDIFReplace: false,
        showBackupModal: false,
        backupSpinning: false,
        refreshing: false,
        backupName: "",
        deleteBackup: "",
        modalSpinning: false,
        modalChecked: false,
        errObj: {}
      };
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.doBackup = this.doBackup.bind(this);
      this.deleteBackup = this.deleteBackup.bind(this);
      this.restoreBackup = this.restoreBackup.bind(this);
      this.showConfirmRestore = this.showConfirmRestore.bind(this);
      this.closeConfirmRestore = this.closeConfirmRestore.bind(this);
      this.showConfirmBackup = this.showConfirmBackup.bind(this);
      this.closeConfirmBackup = this.closeConfirmBackup.bind(this);
      this.showConfirmBackupDelete = this.showConfirmBackupDelete.bind(this);
      this.closeConfirmBackupDelete = this.closeConfirmBackupDelete.bind(this);
      this.handleShowBackupModal = this.handleShowBackupModal.bind(this);
      this.closeBackupModal = this.closeBackupModal.bind(this);
      this.validateBackup = this.validateBackup.bind(this);
      this.closeConfirmRestoreReplace = this.closeConfirmRestoreReplace.bind(this);
    }
    closeExportModal() {
      this.setState({
        showExportModal: false
      });
    }
    handleShowBackupModal() {
      this.setState({
        showBackupModal: true,
        backupSpinning: false,
        backupName: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeBackupModal() {
      this.setState({
        showBackupModal: false
      });
    }
    showConfirmBackup(name2) {
      this.setState({
        showConfirmBackup: true,
        backupName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmBackup() {
      this.setState({
        showConfirmBackup: false
      });
    }
    showConfirmRestore(name2) {
      this.setState({
        showConfirmRestore: true,
        backupName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmRestore() {
      this.setState({
        showConfirmRestore: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmBackupDelete(name2) {
      this.setState({
        showConfirmBackupDelete: true,
        backupName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmBackupDelete() {
      this.setState({
        showConfirmBackupDelete: false
      });
    }
    closeConfirmRestoreReplace() {
      this.setState({
        showConfirmRestoreReplace: false
      });
    }
    validateBackup() {
      for (let i = 0; i < this.props.backups.length; i++) {
        if (this.state.backupName === this.props.backups[i].name) {
          this.setState({
            showConfirmRestoreReplace: true
          });
          return;
        }
      }
      this.doBackup();
    }
    doBackup() {
      this.setState({
        backupSpinning: true
      });
      const cmd = ["dsctl", "-j", this.props.serverId, "status"];
      cockpit_default.spawn(cmd, { superuser: true }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running === true) {
          const cmd2 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "backup",
            "create"
          ];
          if (this.state.backupName !== "") {
            if (bad_file_name(this.state.backupName)) {
              this.props.addNotification(
                "warning",
                `Backup name should not be a path.  All backups are stored in the server's backup directory`
              );
              return;
            }
            cmd2.push(this.state.backupName);
          }
          log_cmd("doBackup", "Add backup task online", cmd2);
          cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content) => {
            this.props.reload();
            this.closeBackupModal();
            const cmd3 = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
              "config",
              "get",
              "nsslapd-bakdir"
            ];
            log_cmd("doBackup", "Get the backup directory", cmd3);
            cockpit_default.spawn(cmd3, { superuser: true, err: "message" }).done((content2) => {
              const config2 = JSON.parse(content2);
              const attrs = config2.attrs;
              this.props.addNotification(
                "success",
                `Server has been backed up. You can find the backup in ${attrs["nsslapd-bakdir"][0]} directory on the server machine.`
              );
            }).fail((err) => {
              const errMsg = JSON.parse(err);
              this.props.addNotification(
                "success",
                `Server has been backed up.`
              );
              this.props.addNotification(
                "error",
                `Error while trying to get the server's backup directory- ${errMsg.desc}`
              );
            });
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.props.reload();
            this.closeBackupModal();
            this.props.addNotification(
              "error",
              `Failure backing up server - ${errMsg.desc}`
            );
          });
        } else {
          const cmd2 = ["dsctl", "-j", this.props.serverId, "db2bak"];
          if (this.state.backupName !== "") {
            if (bad_file_name(this.state.backupName)) {
              this.props.addNotification(
                "warning",
                `Backup name should not be a path.  All backups are stored in the server's backup directory`
              );
              return;
            }
            cmd2.push(this.state.backupName);
          }
          log_cmd("doBackup", "Doing backup of the server offline", cmd2);
          cockpit_default.spawn(cmd2, { superuser: true }).done((content) => {
            this.props.reload();
            this.closeBackupModal();
            this.props.addNotification("success", `Server has been backed up`);
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.props.reload();
            this.closeBackupModal();
            this.props.addNotification(
              "error",
              `Failure backing up server - ${errMsg.desc}`
            );
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        console.log("Failed to check the server status", errMsg.desc);
      });
    }
    restoreBackup() {
      this.setState({
        modalSpinning: true
      });
      const cmd = ["dsctl", "-j", this.props.serverId, "status"];
      cockpit_default.spawn(cmd, { superuser: true }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running === true) {
          const cmd2 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "backup",
            "restore",
            this.state.backupName
          ];
          log_cmd("restoreBackup", "Restoring server online", cmd2);
          cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content) => {
            this.closeConfirmRestore();
            this.props.addNotification("success", `Server has been restored`);
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.closeConfirmRestore();
            this.props.addNotification(
              "error",
              `Failure restoring up server - ${errMsg.desc}`
            );
          });
        } else {
          const cmd2 = [
            "dsctl",
            "-j",
            this.props.serverId,
            "bak2db",
            this.state.backupName
          ];
          log_cmd("restoreBackup", "Restoring server offline", cmd2);
          cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content) => {
            this.closeRestoreSpinningModal();
            this.props.addNotification("success", `Server has been restored`);
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.closeRestoreSpinningModal();
            this.props.addNotification(
              "error",
              `Failure restoring up server - ${errMsg.desc}`
            );
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        console.log("Failed to check the server status", errMsg.desc);
      });
    }
    deleteBackup(e) {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "backups",
        "--delete",
        this.state.backupName
      ];
      log_cmd("deleteBackup", "Deleting backup", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification("success", `Backup was successfully deleted`);
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.props.reload();
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification("error", `Failure deleting backup - ${errMsg.desc}`);
      });
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    render() {
      const { showModal, closeHandler, backups } = this.props;
      return /* @__PURE__ */ import_react130.default.createElement("div", null, /* @__PURE__ */ import_react130.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Manage Backups",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ import_react130.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleShowBackupModal }, "Create Backup")
          ]
        },
        /* @__PURE__ */ import_react130.default.createElement(
          BackupTable,
          {
            className: "ds-margin-top-xlg",
            rows: backups,
            key: backups,
            confirmRestore: this.showConfirmRestore,
            confirmDelete: this.showConfirmBackupDelete
          }
        )
      ), /* @__PURE__ */ import_react130.default.createElement(
        BackupModal,
        {
          showModal: this.state.showBackupModal,
          closeHandler: this.closeBackupModal,
          handleChange: this.onModalChange,
          saveHandler: this.validateBackup,
          spinning: this.state.backupSpinning,
          error: this.state.errObj
        }
      ), /* @__PURE__ */ import_react130.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmRestore,
          closeHandler: this.closeConfirmRestore,
          handleChange: this.onModalChange,
          actionHandler: this.restoreBackup,
          spinning: this.state.modalSpinning,
          item: this.state.backupName,
          checked: this.state.modalChecked,
          mTitle: "Restore Backup",
          mMsg: "Are you sure you want to restore this backup?",
          mSpinningMsg: "Restoring ...",
          mBtnName: "Restore Backup"
        }
      ), /* @__PURE__ */ import_react130.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmBackupDelete,
          closeHandler: this.closeConfirmBackupDelete,
          handleChange: this.onModalChange,
          actionHandler: this.deleteBackup,
          spinning: this.state.modalSpinning,
          item: this.state.backupName,
          checked: this.state.modalChecked,
          mTitle: "Delete Backup",
          mMsg: "Are you sure you want to delete this backup?",
          mSpinningMsg: "Deleting ...",
          mBtnName: "Delete Backup"
        }
      ), /* @__PURE__ */ import_react130.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showConfirmRestoreReplace,
          closeHandler: this.closeConfirmRestoreReplace,
          handleChange: this.onModalChange,
          actionHandler: this.deleteBackup,
          spinning: this.state.modalSpinning,
          item: this.state.doBackup,
          checked: this.state.modalChecked,
          mTitle: "Replace Existing Backup",
          mMsg: " backup already eixsts with the same name, do you want to replace it?",
          mSpinningMsg: "Replacing ...",
          mBtnName: "Replace Backup"
        }
      ));
    }
  };
  CreateInstanceModal.propTypes = {
    showModal: import_prop_types107.default.bool,
    closeHandler: import_prop_types107.default.func,
    addNotification: import_prop_types107.default.func,
    loadInstanceList: import_prop_types107.default.func
  };
  CreateInstanceModal.defaultProps = {
    showModal: false
  };
  SchemaReloadModal.propTypes = {
    showModal: import_prop_types107.default.bool,
    closeHandler: import_prop_types107.default.func,
    addNotification: import_prop_types107.default.func,
    serverId: import_prop_types107.default.string
  };
  SchemaReloadModal.defaultProps = {
    showModal: false,
    serverId: ""
  };
  ManageBackupsModal.propTypes = {
    showModal: import_prop_types107.default.bool,
    closeHandler: import_prop_types107.default.func,
    addNotification: import_prop_types107.default.func,
    serverId: import_prop_types107.default.string
  };
  ManageBackupsModal.defaultProps = {
    showModal: false,
    serverId: ""
  };

  // src/LDAPEditor.jsx
  var import_react157 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/utils.jsx
  var import_react131 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/options.jsx
  var LdapOptions = {
    sizeLimit: 2e3,
    timeLimit: 10
  };
  function getSizeLimit() {
    return LdapOptions.sizeLimit;
  }
  function getTimeLimit() {
    return LdapOptions.timeLimit;
  }

  // src/lib/ldap_editor/lib/constants.jsx
  var ENTRY_MENU = {
    search: "search",
    edit: "edit",
    new: "new",
    rename: "rename",
    lockRole: "lockRole",
    lockAccount: "lockAccount",
    unlockRole: "unlockRole",
    unlockAccount: "unlockAccount",
    acis: "acis",
    cos: "cos",
    delete: "delete",
    refresh: "refresh"
  };
  var BINARY_ATTRIBUTES = [
    "jpegphoto",
    "usercertificate",
    "usercertificate;binary",
    "cacertificate",
    "cacertificate;binary",
    "nssymmetrickey"
  ];
  var WEB_SOCKET_MAX_PAYLOAD = 1280 * 1024;
  var LDIF_MAX_CHAR_PER_LINE = 78;
  var LDAP_OPERATIONS = {
    add: "add",
    delete: "delete",
    replace: "replace"
  };
  var ENTRY_TYPE = {
    user: "USER",
    ou: "OU",
    other: "OTHER"
  };
  var INET_ORG_ATTRS = [
    "audio",
    "businessCategory",
    "carLicense",
    "departmentNumber",
    "displayName",
    "employeeNumber",
    "employeeType",
    "givenName",
    "homePhone",
    "homePostalAddress",
    "initials",
    "jpegPhoto",
    "labeledURI",
    "mail",
    "manager",
    "mobile",
    "o",
    "pager",
    "photo",
    "roomNumber",
    "secretary",
    "uid",
    "userCertificate",
    "x500UniqueIdentifier",
    "preferredLanguage",
    "userSMIMECertificate",
    "userPKCS12"
  ];
  var ORG_PERSON_ATTRS = [
    "title",
    "x121Address",
    "registeredAddress",
    "destinationIndicator",
    "preferredDeliveryMethod",
    "telexNumber",
    "teletexTerminalIdentifier",
    "internationalISDNNumber",
    "facsimileTelephoneNumber",
    "street",
    "postOfficeBox",
    "postalCode",
    "postalAddress",
    "physicalDeliveryOfficeName",
    "ou",
    "st",
    "l"
  ];
  var PERSON_REQ_ATTRS = ["cn", "sn"];
  var PERSON_OPT_ATTRS = [
    "userPassword",
    "telephoneNumber",
    "seeAlso",
    "description"
  ];
  var SINGLE_VALUED_ATTRS = [
    "preferredDeliveryMethod",
    "displayName",
    "employeeNumber",
    "preferredLanguage"
  ];
  var OU_REQ_ATTRS = ["ou"];
  var OU_OPT_ATTRS = [
    "businessCategory",
    "description",
    "destinationIndicator",
    "facsimileTelephoneNumber",
    "internationalISDNNumber",
    "l",
    "physicalDeliveryOfficeName",
    "postalAddress",
    "postalCode",
    "postOfficeBox",
    "preferredDeliveryMethod",
    "registeredAddress",
    "searchGuide",
    "seeAlso",
    "st",
    "street",
    "telephoneNumber",
    "teletexTerminalIdentifier",
    "telexNumber",
    "userPassword",
    "x121Address"
  ];

  // src/lib/ldap_editor/lib/utils.jsx
  function generateUniqueId() {
    return Math.random().toString(36).substring(2, 15);
  }
  function getModDateUTC(modDate) {
    if (!modDate) {
      return "";
    }
    const y2 = modDate.substring(0, 4);
    const m = modDate.substring(4, 6);
    const d = modDate.substring(6, 8);
    const h = modDate.substring(8, 10);
    const min3 = modDate.substring(10, 12);
    const sec = modDate.substring(12, 14);
    const value = `${y2}-${m}-${d}T${h}:${min3}:${sec}Z`;
    const date2 = new Date(value);
    return date2.toUTCString();
  }
  function getUserSuffixes(serverId, suffixCallback) {
    const suffixCmd = [
      "dsconf",
      "-j",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "backend",
      "suffix",
      "list",
      "--suffix"
    ];
    log_cmd("getUserSuffixes", "list suffixes", suffixCmd);
    cockpit_default.spawn(suffixCmd, { superuser: true, err: "message" }).done((content) => {
      const suffList = JSON.parse(content);
      suffixCallback(suffList.items);
    }).fail((_) => {
      console.log("FAIL " + _.toString());
    });
  }
  function getRootSuffixEntryDetails(params, entryDetailsCallback) {
    const timeLimit = getTimeLimit();
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      params.baseDn,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + params.serverId + ".socket",
      "-s",
      "base",
      "-l",
      timeLimit,
      "*",
      "numSubordinates",
      "modifyTimestamp"
      // 'entryId' // To uniquely identify the node in the treee view ==> <instanceId>_<entryId>
      // Doesn't work!! Some entries don't have an entryID (cn=config and its children for instance).
    ];
    log_cmd("getRootSuffixEntryDetails", "", cmd);
    let dn = null;
    let numSubordinates = "";
    let modifyTimestamp = "";
    let result = {};
    const entryArray = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const lines = data.split("\n");
      lines.map((currentLine) => {
        if (isAttributeLine(currentLine, "dn:")) {
          entryArray.push(splitAttributeValue(currentLine));
          const pos = currentLine.indexOf(":");
          if (currentLine.startsWith("dn::")) {
            dn = b64DecodeUnicode(currentLine.substring(pos + 2).trim());
          } else {
            dn = currentLine.substring(pos + 1).trim();
          }
        } else if (isAttributeLine(currentLine, "numSubordinates:")) {
          numSubordinates = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "modifyTimestamp:")) {
          modifyTimestamp = currentLine.split(":")[1].trim();
        } else {
          entryArray.push(splitAttributeValue(currentLine));
        }
        return [];
      });
      result = JSON.stringify(
        {
          dn,
          numSubordinates,
          modifyTimestamp: getModDateUTC(modifyTimestamp),
          parentId: params.parentId,
          fullEntry: entryArray,
          errorCode: 0
        }
      );
    }).fail((err) => {
      result = JSON.stringify(
        {
          dn: params.baseDn,
          numSubordinates: "???",
          modifyTimestamp: "???",
          // entryId: (Math.floor(Math.random() * Math.floor(1000000))).toString(), // Choose a random number between 0 and 1 million.
          parentId: params.parentId,
          fullEntry: [{ attribute: "???: ", value: "???" }],
          errorCode: err.exit_status
        }
      );
    }).always(() => entryDetailsCallback(result));
  }
  function getResourceLimits() {
    const timeLimit = getTimeLimit();
    const sizeLimit = getSizeLimit();
    const limits = [];
    if (timeLimit > 0) {
      limits.push("-l", timeLimit);
    }
    if (sizeLimit > 0) {
      limits.push("-z", sizeLimit);
    }
    return limits;
  }
  function getSearchEntries(params, resultCallback) {
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      params.searchBase,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + params.serverId + ".socket",
      "-s",
      params.searchScope,
      "-l",
      params.timeLimit,
      "-z",
      params.sizeLimit,
      params.searchFilter,
      "*",
      "+"
    ];
    log_cmd("getSearchEntries", "", cmd);
    let dn = "";
    let numSubordinates = "0";
    let modifyTimestamp = "";
    let searchResult = null;
    const allEntries = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      searchResult = data;
    }).catch((err, data) => {
      if (err.exit_status === 4) {
        console.log("Size limit hit");
        searchResult = data;
        params.addNotification(
          "info",
          `Size limit of ${params.sizeLimit} was exceeded.  The child entries of "${params.searchBase}" have been truncated.`
        );
      } else {
        searchResult = null;
        resultCallback(null, { status: err.exit_status, msg: err.message });
      }
    }).finally(() => {
      if (searchResult === null) {
        return;
      }
      const lines = searchResult.split("\n");
      let ldapsubentry = false;
      let isRole = false;
      let isLockable = false;
      lines.map((currentLine) => {
        const accountObjectclasses = [
          "nsaccount",
          "nsperson",
          "simplesecurityobject",
          "organization",
          "person",
          "account",
          "organizationalunit",
          "netscapeserver",
          "domain",
          "posixaccount",
          "shadowaccount",
          "posixgroup",
          "mailrecipient",
          "nsroledefinition"
        ];
        if (isAttributeLine(currentLine, "dn:")) {
          const pos = currentLine.indexOf(":");
          if (currentLine.startsWith("dn::")) {
            dn = b64DecodeUnicode(currentLine.substring(pos + 2).trim());
          } else {
            dn = currentLine.substring(pos + 1).trim();
          }
          ldapsubentry = false;
          isRole = false;
          isLockable = false;
        } else if (isAttributeLine(currentLine, "numSubordinates:")) {
          numSubordinates = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "modifyTimestamp:")) {
          modifyTimestamp = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "objectclass: ldapsubentry")) {
          ldapsubentry = true;
        } else if (isAttributeLine(currentLine, "objectclass: nsroledefinition")) {
          isRole = true;
        }
        for (const accountOC of accountObjectclasses) {
          if (isAttributeLine(currentLine, `objectclass: ${accountOC}`)) {
            isLockable = true;
          }
        }
        if (currentLine === "" && dn !== "") {
          const result = JSON.stringify(
            {
              dn,
              numSubordinates,
              modifyTimestamp: getModDateUTC(modifyTimestamp),
              ldapsubentry,
              isRole,
              isLockable
            }
          );
          allEntries.push(result);
          dn = "";
          numSubordinates = "0";
          modifyTimestamp = "";
        }
        return [];
      });
      resultCallback(allEntries, null);
    });
  }
  function getBaseLevelEntryAttributes(serverId, baseDn, entryAttributesCallback) {
    const timeLimit = getTimeLimit();
    const optionTimeLimit = timeLimit > 0 ? `-l ${timeLimit}` : "";
    const cmd = [
      "/usr/bin/sh",
      "-c",
      `ldapsearch -LLL -o ldif-wrap=no -Y EXTERNAL -b "${baseDn}" -H ldapi://%2fvar%2frun%2fslapd-${serverId}.socket ${optionTimeLimit} -s base "(|(objectClass=*)(objectClass=ldapSubEntry))" nsRoleDN nsAccountLock \\*`
      // +
      // ' | /usr/bin/head -c 150001' // Taking 1 additional character to check if the
      // the entry was indeed bigger than 150K.
    ];
    log_cmd("getBaseLevelEntryAttributes", "", cmd);
    const entryArray = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const lines = data.split("\n");
      lines.map((currentLine) => {
        if (currentLine !== "") {
          if (currentLine.length < 1e3 || currentLine.substring(0, 9).toLowerCase().startsWith("jpegphoto")) {
            entryArray.push(splitAttributeValue(currentLine));
          } else {
            const myTruncatedValue = /* @__PURE__ */ import_react131.default.createElement("div", { name: "truncated" }, /* @__PURE__ */ import_react131.default.createElement(Label, { icon: /* @__PURE__ */ import_react131.default.createElement(InfoCircleIcon, null), color: "blue" }, "Value is too large to display"));
            entryArray.push(myTruncatedValue);
          }
        }
        return [];
      });
      entryAttributesCallback(entryArray);
    }).catch((err) => {
      if (err.message === void 0) {
      } else {
        entryAttributesCallback([{
          attribute: "???: ",
          value: "???",
          // errMsg: err.message
          errorCode: err.exit_status
        }]);
        console.log("getBaseLevelEntryAttributes failed with exit_status = " + err.exit_status);
        console.log("getBaseLevelEntryAttributes error message = " + err.message);
      }
    });
  }
  function getBaseLevelEntryFullAttributes(serverId, baseDn, entryAttributesCallback) {
    const timeLimit = getTimeLimit();
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      baseDn,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "-s",
      "base",
      "-l",
      timeLimit,
      "(|(objectClass=*)(objectClass=ldapSubEntry))",
      "*",
      "+"
    ];
    log_cmd("getBaseLevelEntryFullAttributes", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      entryAttributesCallback(data);
    }).fail((err) => {
      console.log("getBaseLevelEntryFullAttributes failed with exit_status = " + err.exit_status);
      console.log("getBaseLevelEntryFullAttributes error message = " + err.message);
      entryAttributesCallback("");
    });
  }
  function isAttributeLine(line, attr) {
    return line.toLowerCase().startsWith(attr.toLowerCase());
  }
  function splitAttributeValue(attrVal) {
    const index = attrVal.indexOf(":");
    if (index === -1) {
      return { attribute: "", value: "" };
    }
    const attr = attrVal.substring(0, index);
    const val = attrVal.substring(index);
    return { attribute: attr, value: val };
  }
  function getOneLevelEntries(params, oneLevelCallback) {
    const limits = getResourceLimits();
    const filter = params.filter ? params.filter : "(|(objectClass=*)(objectClass=ldapSubEntry))";
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      params.baseDn,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + params.serverId + ".socket",
      "-s",
      "one",
      filter,
      /* '-l',
      timeLimit,
      '-z',
      sizeLimit, */
      ...limits,
      "1.1",
      "numSubordinates",
      "modifyTimestamp",
      "objectclass"
    ];
    log_cmd("getOneLevelEntries", "", cmd);
    let dn = "";
    let numSubordinates = "";
    let modifyTimestamp = "";
    let searchResult = null;
    const allEntries = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      searchResult = data;
    }).catch((err, data) => {
      console.log("FAIL err.exit_status ==> " + err.exit_status);
      console.log("FAIL err.message ==> " + err.message);
      if (err.exit_status === 4) {
        searchResult = data;
        const size_limit = getSizeLimit();
        params.addNotification(
          "info",
          `Size limit of ${size_limit} was exceeded.  The child entries of "${params.baseDn}" have been truncated.  Use the "Search" feature if you want to adjust the size limit and retrieve more entries`
        );
      } else {
        searchResult = null;
        oneLevelCallback(null, params, { status: err.exit_status, msg: err.message });
      }
    }).finally(() => {
      if (searchResult === null) {
        return;
      }
      const lines = searchResult.split("\n");
      let ldapsubentry = false;
      let isRole = false;
      let isLockable = false;
      lines.map((currentLine) => {
        const accountObjectclasses = [
          "nsaccount",
          "nsperson",
          "simplesecurityobject",
          "organization",
          "person",
          "account",
          "organizationalunit",
          "netscapeserver",
          "domain",
          "posixaccount",
          "shadowaccount",
          "posixgroup",
          "mailrecipient",
          "nsroledefinition"
        ];
        if (isAttributeLine(currentLine, "dn:")) {
          const pos = currentLine.indexOf(":");
          if (currentLine.startsWith("dn::")) {
            dn = b64DecodeUnicode(currentLine.substring(pos + 2).trim());
          } else {
            dn = currentLine.substring(pos + 1).trim();
          }
          ldapsubentry = false;
          isRole = false;
          isLockable = false;
        } else if (isAttributeLine(currentLine, "numSubordinates:")) {
          numSubordinates = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "modifyTimestamp:")) {
          modifyTimestamp = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "objectclass: ldapsubentry")) {
          ldapsubentry = true;
        } else if (isAttributeLine(currentLine, "objectclass: nsroledefinition")) {
          isRole = true;
        }
        for (const accountOC of accountObjectclasses) {
          if (isAttributeLine(currentLine, `objectclass: ${accountOC}`)) {
            isLockable = true;
          }
        }
        if (currentLine === "" && dn !== "") {
          const result = JSON.stringify(
            {
              dn,
              numSubordinates,
              modifyTimestamp: getModDateUTC(modifyTimestamp),
              ldapsubentry,
              isRole,
              isLockable
            }
          );
          allEntries.push(result);
          dn = "";
          numSubordinates = "0";
          modifyTimestamp = "";
        }
        return [];
      });
      oneLevelCallback(allEntries, params, null);
    });
  }
  function runGenericSearch(params, searchCallback) {
    const cmd = [
      "/usr/bin/sh",
      "-c",
      'ldapsearch -LLL -o ldif-wrap=no -Y EXTERNAL -b "' + params.baseDn + '" -H ldapi://%2fvar%2frun%2fslapd-' + params.serverId + ".socket -s " + params.scope + ' "' + params.filter + '" ' + params.attributes
    ];
    log_cmd("runGenericSearch", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const resulEntries = data.split("\n\n");
      resulEntries.pop();
      searchCallback(resulEntries);
    }).fail((err) => {
      console.log("FAIL err.exit_status ==> " + err.exit_status);
      console.log("FAIL err.message ==> " + err.message);
      searchCallback([]);
    });
  }
  function modifyLdapEntry(params, ldifArray, modifyEntryCallback) {
    const serverId = params.serverId;
    const addOption = params.isAddOp ? "-a" : "";
    let ldifData = "";
    let logLdifData = "";
    if (ldifArray.length === 0) {
      console.log("modifyLdapEntry() ==> Empty array! Nothing to do.");
      return;
    }
    for (const line of ldifArray) {
      ldifData += `${line}
`;
      if (line.toLowerCase().startsWith("userpassword")) {
        logLdifData += `userPassword: ********
`;
      } else {
        logLdifData += `${line}
`;
      }
    }
    const cmd = [
      "/usr/bin/sh",
      "-c",
      `ldapmodify ${addOption} -Y EXTERNAL -H ldapi://%2fvar%2frun%2fslapd-${serverId}.socket `
    ];
    const cmd_copy = [
      "/usr/bin/sh",
      "-c",
      `ldapmodify ${addOption} -Y EXTERNAL -H ldapi://%2fvar%2frun%2fslapd-${serverId}.socket
`,
      logLdifData
      // hides userpassword value from console log
    ];
    let result = {};
    log_cmd("modifyLdapEntry", "", cmd_copy);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).input(ldifData, true).input().done((data) => {
      result = { errorCode: 0, output: data };
    }).fail((err) => {
      console.log("FAIL - modifyLdapEntry() ==> " + err.message);
      console.log("Error code (err.exit_status) = " + err.exit_status);
      let errMessage = "";
      for (const msg of err.message.split("\n")) {
        if (!msg.startsWith("SASL")) {
          errMessage += msg;
        }
      }
      result = { errorCode: err.exit_status, output: errMessage };
    }).always(() => {
      modifyEntryCallback(result);
    });
  }
  function createLdapEntry(serverId, ldifArray, createEntryCallback) {
    const params = {
      serverId,
      isAddOp: true
    };
    modifyLdapEntry(params, ldifArray, createEntryCallback);
  }
  function getAllObjectClasses(serverId, allOcCallback) {
    const cmd = [
      "dsconf",
      "--json",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "schema",
      "objectclasses",
      "list"
    ];
    const result = [];
    log_cmd("getAllObjectClasses", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const myObject = JSON.parse(data);
      for (const oc of myObject.items) {
        result.push({
          name: oc.name[0],
          // name[0] is the attribute name in lower case.
          required: oc.must,
          optional: oc.may
        });
      }
    }).fail((err) => {
      console.log("FAIL - getAllObjectClasses - err.message ==> " + err.message);
    }).always(() => {
      allOcCallback(result);
    });
  }
  function getSingleValuedAttributes(serverId, svCallback) {
    const cmd = [
      "dsconf",
      "--json",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "schema",
      "attributetypes",
      "list"
    ];
    const result = [];
    log_cmd("getSingleValuedAttributes", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const myObject = JSON.parse(data);
      for (const attr of myObject.items) {
        if (attr.single_value) {
          result.push(attr.name[0]);
        }
      }
    }).fail((err) => {
      console.log("FAIL - getAttributeList - err.message ==> " + err.message);
    }).always(() => {
      svCallback(result);
    });
  }
  function getAttributesNameAndOid(serverId, attrCallback) {
    const cmd = [
      "dsconf",
      "--json",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "schema",
      "attributetypes",
      "list"
    ];
    const result = [];
    log_cmd("getAttributesNameAndOid", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const myObject = JSON.parse(data);
      for (const attr of myObject.items) {
        result.push([attr.names[0], attr.oid[0]]);
      }
    }).fail((err) => {
      console.log("FAIL - getAttributesNameAndOid - err.message ==> " + err.message);
    }).always(() => {
      attrCallback(result);
    });
  }
  function deleteLdapData(serverId, entryDN, numSubordinates, deleteCallback) {
    const cmd = [
      "ldapdelete",
      "-Y",
      "EXTERNAL",
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      entryDN
    ];
    if (numSubordinates > 0) {
      cmd.push("-r");
    }
    let result = {};
    log_cmd("deleteLdapData", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      result = { errorCode: 0, output: data };
    }).fail((err) => {
      console.log("FAIL - deleteLdapData() ==> " + err.message);
      let errMessage = "";
      for (const msg of err.message.split("\n")) {
        if (!msg.startsWith("SASL")) {
          errMessage += msg;
        }
      }
      result = { errorCode: err.exit_status, output: errMessage };
    }).always(() => {
      deleteCallback(result);
    });
  }
  function showCertificate(certificate, showCertCallback) {
    const cmd = [
      "/usr/bin/sh",
      "-c",
      "echo " + certificate + " | base64 --decode | openssl x509 -inform DER -noout -subject -issuer -dates -serial ; echo HOST_TIME_GMT=`TZ=GMT date`"
    ];
    let result = {};
    const certDataArray = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const lineArray = data.split("\n");
      let certEndTime = 0;
      let hostTime = 0;
      lineArray.map((line) => {
        const pos = line.indexOf("=");
        const param = line.substring(0, pos);
        const paramVal = line.substring(pos + 1);
        if (param !== "HOST_TIME_GMT") {
          certDataArray.push({
            param,
            paramVal
          });
          if (param === "notAfter") {
            certEndTime = Date.parse(paramVal);
          }
        } else {
          hostTime = Date.parse(paramVal);
        }
        return [];
      });
      result = {
        code: "OK",
        data: certDataArray,
        timeDifference: certEndTime - hostTime
      };
    }).fail((err) => {
      console.log("FAIL - showCertificate() ==> " + err.message);
      result = { code: "FAIL" };
    }).always(() => {
      showCertCallback(result);
    });
  }
  function b64DecodeUnicode(str) {
    try {
      const result = decodeURIComponent(atob(str).split("").map((c2) => {
        return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
      }).join(""));
      return result;
    } catch (e) {
      console.debug("b64DecodeUnicode failed to decode: ", str);
      return str;
    }
  }
  function decodeLine(line) {
    const pos = line.indexOf("::");
    return [
      line.substring(0, pos),
      b64DecodeUnicode(line.substring(pos + 2).trim())
    ];
  }
  function getRdnInfo(entryDn) {
    let myRdn = "";
    const myArray = entryDn.split(",");
    for (const datum of myArray) {
      myRdn += datum;
      if (datum.slice(-1) !== "\\") {
        break;
      }
      myRdn += ",";
    }
    const myRdnData = myRdn.split("=");
    return {
      rdnAttr: myRdnData[0],
      rdnVal: myRdnData[1]
    };
  }
  function generateRootEntryLdif(suffixDn, ldifCallback) {
    const rdnObj = getRdnInfo(suffixDn);
    const myRdnAttr = rdnObj.rdnAttr;
    const myRdnVal = rdnObj.rdnVal;
    let myObjectClass;
    let isValid = true;
    switch (myRdnAttr) {
      case "c":
        myObjectClass = "country";
        break;
      case "cn":
        myObjectClass = "nsContainer";
        break;
      case "dc":
        myObjectClass = "domain";
        break;
      case "o":
        myObjectClass = "organization";
        break;
      case "ou":
        myObjectClass = "organizationalUnit";
        break;
      default:
        isValid = false;
        console.log(`The RDN attribute ${myRdnAttr} is not supported for root entry creation!`);
    }
    const ldifArray = [];
    if (isValid) {
      ldifArray.push(`dn: ${suffixDn}`);
      ldifArray.push("objectClass: top");
      ldifArray.push(`objectClass: ${myObjectClass}`);
      ldifArray.push(`${myRdnAttr}: ${myRdnVal}`);
    } else {
      ldifArray.push(`The RDN attribute "${myRdnAttr}" is not supported for root entry creation!`);
    }
    ldifCallback(ldifArray);
  }
  function retrieveAllAcis(params, aciCallback) {
    const entryDn = params.baseDn;
    const resultArray = [];
    const myParams = {
      serverId: params.serverId,
      baseDn: entryDn,
      scope: "base",
      filter: "objectClass=*",
      attributes: "1.1 aci"
    };
    runGenericSearch(myParams, (result) => {
      if (result.length > 0) {
        const myAcis = result[0].split("\n");
        if (myAcis.length > 1) {
          myAcis.shift();
          const actualAcis = myAcis.map((aciLine) => {
            const pos = aciLine.indexOf(":");
            const theAci = aciLine.startsWith("aci:: ") ? b64DecodeUnicode(aciLine.substring(pos + 2).trim()) : aciLine.substring(pos + 1).trim();
            return theAci;
          });
          const myBaseDn = myParams.baseDn;
          const myObj = {
            entryDn: myBaseDn,
            aciArray: actualAcis
          };
          resultArray.push(myObj);
        }
      }
      aciCallback(resultArray);
    });
  }
  function isValidIpAddress(ipAddress) {
    const regexIPv4 = /^(?=(?:[^.]*\.){2,3}[^.]*$)(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){1,3}(?:\.\*)?$/;
    const regexIPv6 = /(?:^|(?<=\s))(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(?=\s|$)/;
    let result = false;
    if (ipAddress.includes(":")) {
      result = ipAddress.match(regexIPv6);
    } else {
      result = ipAddress.match(regexIPv4);
    }
    return result !== null;
  }
  function isValidHostname(hostname) {
    const regex = /^((\*)|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|((\*\.)?([a-zA-Z0-9-]+\.){0,5}[a-zA-Z0-9-]+\.[a-zA-Z]{2,63}?))$/;
    const result = hostname.match(regex);
    return result !== null;
  }
  function foldLine(line) {
    if (line.length <= LDIF_MAX_CHAR_PER_LINE) {
      return [line];
    }
    const size = Math.ceil(line.length / LDIF_MAX_CHAR_PER_LINE);
    const lineArray = new Array(size);
    lineArray[0] = line.substring(0, LDIF_MAX_CHAR_PER_LINE);
    for (let i = 1; i < size; i++) {
      lineArray[i] = " " + line.substring(i * LDIF_MAX_CHAR_PER_LINE, (i + 1) * LDIF_MAX_CHAR_PER_LINE);
    }
    return lineArray;
  }
  function isValidLDAPUrl(url) {
    if (url.startsWith("ldap:///")) {
      return true;
    }
    return false;
  }
  function getBaseDNFromTree(entrydn, treeViewRootSuffixes) {
    for (const suffixObj of treeViewRootSuffixes) {
      if (entrydn.toLowerCase().indexOf(suffixObj.name.toLowerCase()) !== -1) {
        return suffixObj.name;
      }
    }
    return "";
  }

  // src/lib/ldap_editor/lib/rootSuffix.jsx
  var import_react132 = __toESM(require_react(), 1);
  var CreateRootSuffix = class extends import_react132.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        isModalOpen: false,
        ldifArray: []
      };
      this.handleCreateRootEntry = () => {
        console.log(`Creating the root entry ${this.props.suffixDn}`);
        const resultParams = {
          message: `The suffix ${this.props.suffixDn} was successfully created.`,
          variant: "success"
        };
        createLdapEntry(
          this.props.editorLdapServer,
          this.state.ldifArray,
          (result) => {
            console.log(`result.errorCode = ${result.errorCode}`);
            if (result.errorCode === 0) {
              const params = { serverId: this.props.editorLdapServer, baseDn: this.props.suffixDn };
              getRootSuffixEntryDetails(params, (entryInfo) => {
                const info2 = JSON.parse(entryInfo);
                resultParams.rootEntryData = {
                  name: info2.dn,
                  fullEntry: info2.fullEntry,
                  modTime: info2.modifyTimestamp,
                  dn: info2.dn
                };
                this.props.handleEmptySuffixToggle(resultParams);
              });
            } else {
              resultParams.message = `Failed to create the suffix ${this.props.suffixDn}.`;
              resultParams.variant = "danger";
              this.props.handleEmptySuffixToggle(resultParams);
            }
          }
        );
      };
    }
    componentDidMount() {
      generateRootEntryLdif(this.props.suffixDn, (ldifArray) => {
        this.setState({
          ldifArray
        });
      });
    }
    render() {
      const { showEmptySuffixModal, handleEmptySuffixToggle } = this.props;
      const { ldifArray } = this.state;
      const ldifOk = ldifArray.length > 1;
      const ldifItems = ldifOk ? ldifArray.map((line, index) => {
        return /* @__PURE__ */ import_react132.default.createElement(SimpleListItem, { key: index }, line);
      }) : null;
      return /* @__PURE__ */ import_react132.default.createElement(
        Modal,
        {
          position: "top",
          variant: ModalVariant.medium,
          title: "Create Root Entry",
          isOpen: showEmptySuffixModal,
          onClose: handleEmptySuffixToggle,
          actions: [
            /* @__PURE__ */ import_react132.default.createElement(
              Button,
              {
                key: "create",
                variant: "primary",
                isDisabled: !ldifOk,
                onClick: this.handleCreateRootEntry
              },
              "Create"
            ),
            /* @__PURE__ */ import_react132.default.createElement(
              Button,
              {
                key: "cancel",
                variant: "link",
                onClick: handleEmptySuffixToggle
              },
              "Cancel"
            )
          ]
        },
        /* @__PURE__ */ import_react132.default.createElement(
          Alert,
          {
            variant: ldifOk ? "info" : "danger",
            isInline: true,
            title: ldifOk ? "LDIF data to create the suffix" : "Failed to generate the LDIF data"
          }
        ),
        /* @__PURE__ */ import_react132.default.createElement("div", { className: "ds-addons-bottom-margin" }),
        !ldifOk && /* @__PURE__ */ import_react132.default.createElement(Label, { variant: "outline", color: "red" }, ldifArray[0]),
        ldifOk && /* @__PURE__ */ import_react132.default.createElement(import_react132.default.Fragment, null, /* @__PURE__ */ import_react132.default.createElement(Divider, null), /* @__PURE__ */ import_react132.default.createElement(SimpleList, { "aria-label": "Simple List LDIF" }, ldifItems), /* @__PURE__ */ import_react132.default.createElement(Divider, null)),
        /* @__PURE__ */ import_react132.default.createElement("div", { className: "ds-addons-bottom-margin" })
      );
    }
  };
  var rootSuffix_default = CreateRootSuffix;

  // src/lib/ldap_editor/tableView.jsx
  var import_react133 = __toESM(require_react(), 1);
  var EditorTableView = class extends import_react133.default.Component {
    constructor(props) {
      super(props);
      this.state = {};
    }
    render() {
      const {
        loading
      } = this.props;
      let columns = [...this.props.columns];
      let rows = [...this.props.editorTableRows];
      let noBackend = false;
      if (rows.length === 0) {
        columns = ["Database Suffixes"];
        rows = [{ cells: ["No Databases"] }];
        noBackend = true;
      }
      let body = /* @__PURE__ */ import_react133.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react133.default.createElement(TextContent, null, /* @__PURE__ */ import_react133.default.createElement(Text, { component: TextVariants.h3 }, "Loading ...")), /* @__PURE__ */ import_react133.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "lg" }));
      if (!loading) {
        body = /* @__PURE__ */ import_react133.default.createElement("div", null, /* @__PURE__ */ import_react133.default.createElement(
          Table,
          {
            variant: TableVariant.compact,
            onCollapse: noBackend ? null : this.props.onCollapse,
            rows,
            cells: columns,
            actionResolver: noBackend ? null : this.props.actionResolver,
            "aria-label": "editor table view",
            header: this.props.header ? this.props.header : ""
          },
          /* @__PURE__ */ import_react133.default.createElement(TableHeader, null),
          /* @__PURE__ */ import_react133.default.createElement(TableBody, null)
        ), !noBackend && /* @__PURE__ */ import_react133.default.createElement(
          Pagination,
          {
            id: "ds-addons-editor-view-top",
            className: "ds-margin-top",
            widgetId: "pagination-options-menu-top",
            itemCount: this.props.itemCount,
            page: this.props.page,
            perPage: this.props.perPage,
            onSetPage: (_evt, value) => this.props.onSetPage(value),
            onPerPageSelect: (_evt, value) => this.props.onPerPageSelect(value),
            dropDirection: "up"
          }
        ));
      }
      return /* @__PURE__ */ import_react133.default.createElement("div", { className: "ds-indent-lg ds-margin-top-lg" }, body);
    }
  };
  var tableView_default = EditorTableView;

  // src/lib/ldap_editor/treeView.jsx
  var import_react136 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/genericPagination.jsx
  var import_react134 = __toESM(require_react(), 1);
  var GenericPagination = class extends import_react134.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSelectRow", (_event, isSelected, rowId) => {
        const cellValue = this.state.pagedRows[rowId].cells[0];
        const allItems = [...this.state.rows];
        let index = allItems.findIndex((item) => item.cells[0] === cellValue);
        allItems[index].selected = isSelected;
        const allRows = [...this.state.allRows];
        index = allRows.findIndex((item) => item.cells[0] === cellValue);
        allRows[index].selected = isSelected;
        const selectedAttrs = allRows.filter((row) => row.selected).map((attr) => attr.cells[0]);
        this.setState({
          rows: allItems,
          allRows,
          selectedAttrs,
          pagedRows: this.getRowsToShow(this.state.page, this.state.perPage)
        });
        this.props.handleSelectedAttrs(selectedAttrs);
      });
      __publicField(this, "handleDropDownToggle", (isOpen) => {
        this.setState({
          isDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isDropDownOpen: !prevState.isDropDownOpen };
        });
      });
      __publicField(this, "handleSetPage", (_event, pageNumber) => {
        this.setState({
          page: pageNumber,
          pagedRows: this.getRowsToShow(pageNumber, this.state.perPage)
        });
      });
      __publicField(this, "handlePerPageSelect", (_event, perPage) => {
        this.setState({
          page: 1,
          perPage,
          pagedRows: this.getRowsToShow(1, perPage)
        });
      });
      __publicField(this, "getRowsToShow", (page, perPage) => {
        const start2 = (page - 1) * perPage;
        const end2 = page * perPage;
        return this.state.rows.slice(start2, end2);
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isDropDownOpen, selectedAttrs } = this.state;
        const numSelected = selectedAttrs.length;
        const items = selectedAttrs.map(
          (attr) => /* @__PURE__ */ import_react134.default.createElement(DropdownItem, { key: attr }, attr)
        );
        let badgeProps = {
          className: "ds-badge-bgcolor"
        };
        if (numSelected === 0) {
          badgeProps = {
            isRead: true
          };
        }
        return /* @__PURE__ */ import_react134.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding ds-margin-top-lg",
            position: DropdownPosition.left,
            onSelect: this.handleDropDownSelect,
            toggle: /* @__PURE__ */ import_react134.default.createElement(BadgeToggle, { id: "toggle-attr-select", badgeProps, onToggle: this.handleDropDownToggle }, numSelected > 0 ? /* @__PURE__ */ import_react134.default.createElement(import_react134.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react134.default.createElement(import_react134.default.Fragment, null, "0 selected ")),
            isOpen: isDropDownOpen,
            dropdownItems: items
          }
        );
      });
      this.state = {
        itemCount: 0,
        page: 1,
        perPage: 10,
        pagedRows: [],
        searchValue: "",
        selectedAttrs: [],
        // sortedRows: this.props.enableSorting ? [...this.props.rows] : null,
        sortBy: {},
        isDropDownOpen: false,
        rows: [...this.props.rows],
        allRows: [...this.props.rows]
      };
      this.onSort = (_event, index, direction) => {
        const mySortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
        this.setState({
          sortBy: {
            index,
            direction
          },
          rows: direction === SortByDirection.asc ? mySortedRows : mySortedRows.reverse()
        }, () => this.setState({
          // Need to update this.state.rows prior to run getRowsToShow().
          pagedRows: this.getRowsToShow(this.state.page, this.state.perPage)
        }));
      };
      this.handleSearchChange = (event, value) => {
        let rows = [];
        const all = [];
        const val = value.toLowerCase();
        this.props.rows.map((attr) => {
          let selected = false;
          for (const selectedAttr of this.state.selectedAttrs) {
            if (attr.cells[0].toLowerCase() === selectedAttr.toLowerCase()) {
              selected = true;
              break;
            }
          }
          all.push(
            {
              cells: [
                attr.cells[0],
                attr.cells[1]
              ],
              selected
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of all) {
            const name2 = row.cells[0].toLowerCase();
            const oid = row.cells[1].toLowerCase();
            if (name2.includes(val) || oid.includes(val)) {
              rows.push(row);
            }
          }
        } else {
          rows = all;
        }
        this.setState({
          rows,
          itemCount: rows.length,
          pagedRows: rows.slice(0, this.state.perPage)
        });
      };
    }
    componentDidMount() {
      const selectedAttrs = this.props.rows.filter((row) => row.selected).map((attr) => attr.cells[0]);
      this.setState({
        rows: [...this.props.rows],
        allRows: [...this.props.rows],
        selectedAttrs
      }, () => this.setState({
        // pagedRows: this.getRowsToShow(this.state.page, this.state.perPage),
        pagedRows: this.getRowsToShow(1, this.state.perPage),
        page: 1,
        itemCount: this.props.rows.length
      }));
    }
    componentDidUpdate(prevProps) {
      if (this.props.tableModificationTime !== prevProps.tableModificationTime) {
        this.setState({
          rows: [...this.props.rows],
          allRows: [...this.props.rows]
        }, () => this.setState({
          // pagedRows: this.getRowsToShow(this.state.page, this.state.perPage),
          pagedRows: this.getRowsToShow(1, this.state.perPage),
          page: 1,
          itemCount: this.props.rows.length
        }));
      }
    }
    render() {
      const {
        itemCount,
        page,
        perPage,
        pagedRows
      } = this.state;
      const showPagination = itemCount > 10;
      return /* @__PURE__ */ import_react134.default.createElement(Grid, null, this.props.isSelectable && this.buildAttrDropdown(), /* @__PURE__ */ import_react134.default.createElement(GridItem, { span: 12, className: this.props.isSelectable ? "ds-margin-top" : "" }, /* @__PURE__ */ import_react134.default.createElement(Grid, null, this.props.isSearchable && /* @__PURE__ */ import_react134.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react134.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search",
          value: this.state.searchValue,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      )), /* @__PURE__ */ import_react134.default.createElement(GridItem, { span: this.props.isSearchable ? 7 : 12 }, showPagination && /* @__PURE__ */ import_react134.default.createElement(
        Pagination,
        {
          itemCount,
          page,
          perPage,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect,
          isCompact: true,
          widgetId: "pagination-options-menu-generic"
        }
      )))), /* @__PURE__ */ import_react134.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react134.default.createElement(
        Table,
        {
          variant: TableVariant.compact,
          rows: pagedRows,
          cells: this.props.columns,
          actions: this.props.actions,
          "aria-label": "generic table",
          caption: this.props.caption,
          sortBy: this.props.enableSorting ? this.state.sortBy : null,
          onSort: this.props.enableSorting ? this.onSort : null,
          canSelectAll: this.props.canSelectAll,
          onSelect: this.props.isSelectable ? this.onSelectRow : null
        },
        /* @__PURE__ */ import_react134.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react134.default.createElement(TableBody, null)
      )));
    }
  };
  var genericPagination_default = GenericPagination;

  // src/lib/ldap_editor/lib/ldapNavigator.jsx
  var import_react135 = __toESM(require_react(), 1);
  var import_prop_types108 = __toESM(require_prop_types(), 1);
  var LdapNavigator = class extends import_react135.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "updateTreeData", () => {
        if (this.props.wizardOperationInfo.resultCode !== 0) {
          const msg = `There was an LDAP error (code ${this.props.wizardOperationInfo.resultCode}). Not updating the LDAP tree.`;
          console.log(msg);
          return;
        }
        if (this.state.activeItems.length === 0) {
          return;
        }
        switch (this.props.wizardOperationInfo.operationType) {
          case "DELETE": {
            const currentActiveNode = this.state.activeItems[0];
            const nodeId = currentActiveNode.id;
            if (nodeId.indexOf(".") === -1) {
              this.updateRootSuffixNode(false);
            } else {
              const treeAllItems = this.state.allItems;
              const parentNode = this.state.activeItems[1];
              const parentId2 = parentNode.id;
              const parentChildren = [...parentNode.children];
              const nodeIndex = parentChildren.findIndex((datum) => datum.id === nodeId);
              console.log(`nodeIndex = ${nodeIndex}`);
              if (nodeIndex >= 0) {
                parentChildren.splice(nodeIndex, 1);
                const parentIdObject = {
                  fullId: parentId2,
                  remainingId: parentId2
                };
                this.updateMyChildren(treeAllItems, parentIdObject, parentChildren, true);
                const activeItems = this.state.activeItems.shift();
                this.setState(
                  {
                    allItems: treeAllItems,
                    // Unset the current active items.
                    // If there is an active item, it will give the false perception that the
                    // entry details ( empty ) table is showing its information.
                    activeItems
                  },
                  () => {
                    this.props.handleNodeOnClick(null);
                  }
                );
              }
            }
            break;
          }
          case "ADD": {
            const nodeDn = this.props.wizardOperationInfo.entryDn;
            const relativeDn = this.props.wizardOperationInfo.relativeDn;
            const myFutureParent = this.state.activeItems[0];
            const parentId2 = myFutureParent.id;
            const idArray = myFutureParent.children ? myFutureParent.children.map((elt) => elt.id.split(".").pop()) : [];
            const maxId = idArray.length > 0 ? Math.max(...idArray) : 0;
            const mySubId = maxId + 1;
            const params = {
              serverId: this.props.editorLdapServer,
              baseDn: nodeDn,
              addNotification: this.props.addNotification
            };
            getRootSuffixEntryDetails(
              params,
              (result) => {
                const info2 = JSON.parse(result);
                const entryTreeData = {
                  name: relativeDn,
                  fullEntry: info2.fullEntry,
                  modTime: info2.modifyTimestamp,
                  dn: info2.dn,
                  id: `${parentId2}.${mySubId}`,
                  loadChildren: false
                };
                const treeAllItems = this.state.allItems;
                const parentIdObject = {
                  fullId: parentId2,
                  remainingId: parentId2
                };
                this.updateMyChildren(treeAllItems, parentIdObject, [entryTreeData]);
                this.setState({ allItems: treeAllItems });
              }
            );
            break;
          }
          case "MODRDN":
          case "MODIFY":
            this.refreshNode(this.state.activeItems[0]);
            break;
          default:
            console.log(`Unknown operation type in LdapNavigator class: ${this.props.wizardOperationInfo.operationType}`);
        }
      });
      __publicField(this, "updateDirectChildren", (potentialChildren, params, resCode) => {
        if (!this.props.skipLeafEntries) {
          return;
        }
        if (potentialChildren === null) {
          if (resCode.exit_status !== 0) {
            this.props.addNotification(
              "error",
              `Error searching database - ${resCode.msg.split("\n").pop()}`
            );
          }
          return;
        }
        const updatedChildren = [];
        let nbIterations = 0;
        const child_params = {
          serverId: this.props.editorLdapServer,
          scope: "one",
          attributes: "1.1",
          addNotification: this.props.addNotification,
          filter: "(|(&(numSubordinates=*)(numSubordinates>=1))(objectClass=organizationalunit)(objectClass=organization))"
        };
        potentialChildren.map((aChild) => {
          const info2 = JSON.parse(aChild);
          params.baseDn = info2.dn;
          runGenericSearch(child_params, (resArray) => {
            if (resArray.length > 0) {
              info2.showChildren = true;
            }
            updatedChildren.push(JSON.stringify(info2));
            nbIterations++;
            if (nbIterations === potentialChildren.length) {
              this.processDirectChildren(updatedChildren, params, null);
            }
          });
          return [];
        });
      });
      // Process the entries that are direct children.
      __publicField(this, "processDirectChildren", (directChildren, params, resCode) => {
        const myActiveNode = this.state.activeItems[0];
        const myChildren = [];
        let childId = 0;
        if (directChildren === null) {
          this.setState({ ldapFailure: true });
          this.props.showTreeLoadingState(false);
          if (resCode.exit_status !== 0) {
            this.props.addNotification(
              "error",
              `Error searching database - ${resCode.msg.split("\n").pop()}`
            );
            const randomId = Math.random().toString(36).substring(2, 15);
            const nodeChildren = [{
              name: "Encountered an error, unable to display child entries",
              id: randomId,
              icon: /* @__PURE__ */ import_react135.default.createElement(ExclamationTriangleIcon, null),
              isFakeEntry: true
            }];
            const treeAllItems = this.state.allItems;
            const parentIdObject = {
              fullId: myActiveNode.id,
              remainingId: myActiveNode.id
            };
            this.updateMyParent(treeAllItems, parentIdObject, nodeChildren, true);
            this.setState({
              allItems: treeAllItems
            });
          }
          return;
        } else {
          this.setState({ ldapFailure: false });
        }
        for (const aChild of directChildren) {
          const info2 = JSON.parse(aChild);
          const numSubValue = parseInt(info2.numSubordinates);
          let nodeChildren = null;
          const showChildren = !this.props.skipLeafEntries || info2.showChildren;
          if (numSubValue > 0 && showChildren) {
            const randomId = Math.random().toString(36).substring(2, 15);
            nodeChildren = [{
              name: "Loading...",
              id: randomId,
              // icon: <UnknownIcon />,
              icon: /* @__PURE__ */ import_react135.default.createElement(Spinner, { size: "sm" }),
              isFakeEntry: true
            }];
          }
          const childData = {
            // TODO: Use a better logic to retrieve the entry RDN!!!
            name: info2.dn.slice(0, info2.dn.length - myActiveNode.dn.length - 1),
            fullEntry: info2.fullEntry,
            // IMPORTANT: Need to add the children so the tree shows the expansion button!
            children: nodeChildren,
            modTime: info2.modifyTimestamp,
            dn: info2.dn,
            id: `${myActiveNode.id}.${childId}`,
            loadChildren: numSubValue > 0
            // Used to insert child nodes when needed.
          };
          if (numSubValue > 0) {
            childData.customBadgeContent = numSubValue;
          }
          myChildren.push(childData);
          childId++;
        }
        if (directChildren.length > 0) {
          const treeAllItems = this.state.allItems;
          const parentIdObject = {
            fullId: myActiveNode.id,
            remainingId: myActiveNode.id
          };
          this.updateMyChildren(treeAllItems, parentIdObject, myChildren, true);
          this.setState({ allItems: treeAllItems });
        }
        this.props.showTreeLoadingState(false);
      });
      this.state = {
        // Need to use an initial object to avoid a JS exception.
        allItems: [{
          name: "Loading LDAP entries...",
          id: "Loading",
          icon: /* @__PURE__ */ import_react135.default.createElement(Spinner, { size: "sm" })
        }],
        activeItems: [],
        ldapFailure: false
      };
      this.handleTreeOnClick = (evt, treeViewItem, parentItem) => {
        if (treeViewItem.isFakeEntry) {
          return;
        }
        if (this.state.activeItems.length > 0 && treeViewItem.dn === this.state.activeItems[0].dn) {
          return;
        }
        this.setState(
          {
            activeItems: [treeViewItem, parentItem]
            // updatingTree: true
          },
          () => {
            if (typeof this.props.showTreeLoadingState === "function") {
              this.props.showTreeLoadingState(true);
            }
            this.refreshNode(treeViewItem, true);
          }
        );
      };
      this.refreshNode = (treeViewItem, forceReloadChildren) => {
        getBaseLevelEntryAttributes(
          this.props.editorLdapServer,
          treeViewItem.dn,
          (entryDetails) => {
            treeViewItem.fullEntry = [...entryDetails];
            if (treeViewItem.id.indexOf(".") === -1 && // No dot in the id ==> Entry is a root node in the tree.
            !this.state.ldapFailure) {
              const entryIsAnEmptySuffix = entryDetails[0].errorCode === 32;
              treeViewItem.isEmptySuffix = entryIsAnEmptySuffix;
              if (entryIsAnEmptySuffix) {
                this.props.handleNodeOnClick(treeViewItem);
                this.props.showTreeLoadingState(false);
                return;
              }
            }
            if (!this.state.ldapFailure) {
              this.props.handleNodeOnClick(treeViewItem);
            }
            if (treeViewItem.loadChildren || // Load child entries if any
            forceReloadChildren) {
              const params = {
                serverId: this.props.editorLdapServer,
                baseDn: treeViewItem.dn,
                name: treeViewItem.name,
                fullEntry: treeViewItem.fullEntry,
                modTime: treeViewItem.modTime,
                addNotification: this.props.addNotification,
                filter: this.props.skipLeafEntries ? "(|(&(numSubordinates=*)(numSubordinates>=1))(objectClass=organizationalunit)(objectClass=organization))" : null
                // getOneLevelEntries() will use its default filter '(|(objectClass=*)(objectClass=ldapSubEntry))'
              };
              if (this.props.skipLeafEntries) {
                getOneLevelEntries(params, this.updateDirectChildren);
              } else {
                getOneLevelEntries(params, this.processDirectChildren);
              }
            } else {
              this.props.showTreeLoadingState(false);
            }
          }
        );
      };
      this.updateMyParent = (treeNode, nodeIdObject, nodeChildren, removePreviousChildren) => {
        const res = nodeIdObject.remainingId.indexOf(".");
        if (res === -1) {
          const insertionNode = treeNode.find((elt) => elt.id === nodeIdObject.fullId);
          insertionNode.children = nodeChildren;
          insertionNode.loadChildren = false;
          insertionNode.customBadgeContent = "?";
        } else {
          const parentId2 = nodeIdObject.remainingId.substring(0, res);
          const startingId = nodeIdObject.startingId === void 0 ? parentId2 : `${nodeIdObject.startingId}.${parentId2}`;
          const parentNode = treeNode.find((elt) => elt.id === startingId);
          const remainingId = nodeIdObject.remainingId.substring(res + 1);
          const newNodeIdObject = {
            fullId: nodeIdObject.fullId,
            remainingId,
            startingId
          };
          this.updateMyParent(parentNode.children, newNodeIdObject, nodeChildren, removePreviousChildren);
        }
      };
      this.updateMyChildren = (treeNode, nodeIdObject, childArray, removePreviousChildren) => {
        const res = nodeIdObject.remainingId.indexOf(".");
        if (res === -1) {
          const insertionNode = treeNode.find((elt) => elt.id === nodeIdObject.fullId);
          if (!insertionNode) {
            return;
          }
          const childrenInfo = insertionNode.children;
          const myCurrentChildren = removePreviousChildren || !childrenInfo ? [] : childrenInfo;
          if (childArray.length > 0 || myCurrentChildren.length > 0) {
            const myFinalChildren = [...childArray, ...myCurrentChildren];
            insertionNode.children = myFinalChildren;
            insertionNode.customBadgeContent = myFinalChildren.length;
            delete insertionNode.expandedIcon;
          } else {
            insertionNode.children = null;
            insertionNode.action = null;
            insertionNode.expandedIcon = /* @__PURE__ */ import_react135.default.createElement(FolderIcon, null);
          }
          insertionNode.loadChildren = false;
        } else {
          const parentId2 = nodeIdObject.remainingId.substring(0, res);
          const startingId = nodeIdObject.startingId === void 0 ? parentId2 : `${nodeIdObject.startingId}.${parentId2}`;
          const parentNode = treeNode.find((elt) => elt.id === startingId);
          const remainingId = nodeIdObject.remainingId.substring(res + 1);
          const newNodeIdObject = {
            fullId: nodeIdObject.fullId,
            remainingId,
            startingId
          };
          this.updateMyChildren(parentNode.children, newNodeIdObject, childArray, removePreviousChildren);
        }
      };
      this.updateRootSuffixNode = (isAdded) => {
        const currentActiveNode = this.state.activeItems[0];
        const rootSuffId = currentActiveNode.id;
        const treeAllItems = this.state.allItems;
        const rootSuffixNode = treeAllItems.find((elt) => elt.id === rootSuffId);
        if (isAdded) {
          const newItem = Object.assign({}, this.props.newSuffixData.rootEntryData);
          newItem.id = rootSuffId;
          newItem.isEmptySuffix = false;
          newItem.loadChildren = false;
          treeAllItems.splice(rootSuffId, 1, newItem);
          this.setState({ allItems: treeAllItems });
          this.props.updateEntryRows(newItem);
        } else {
          const emptyItem = {
            dn: rootSuffixNode.dn,
            id: rootSuffId,
            children: null,
            isEmptySuffix: true,
            icon: /* @__PURE__ */ import_react135.default.createElement(ResourcesEmptyIcon, { color: "var(--pf-global--palette--orange-300)" }),
            name: rootSuffixNode.name,
            fullEntry: []
          };
          treeAllItems.splice(rootSuffId, 1, emptyItem);
          this.setState({ allItems: treeAllItems });
          this.props.updateEntryRows(emptyItem);
        }
      };
    }
    // End constructor.
    componentDidMount() {
      this.setState({
        allItems: [...this.props.treeItems]
      });
    }
    componentDidUpdate(prevProps) {
      if (this.props.timeOfCompletion !== prevProps.timeOfCompletion) {
        this.setState({ allItems: [...this.props.treeItems] });
      }
      if (this.props.newSuffixData !== void 0 && this.props.newSuffixData.creationDate > prevProps.newSuffixData.creationDate) {
        this.updateRootSuffixNode(true);
      }
      if (this.props.wizardOperationInfo !== void 0 && this.props.wizardOperationInfo.time !== prevProps.wizardOperationInfo.time) {
        this.updateTreeData();
      }
      if (this.props.refreshEntryTime !== prevProps.refreshEntryTime || this.props.refreshButtonTriggerTime !== prevProps.refreshButtonTriggerTime) {
        this.refreshNode(this.state.activeItems[0], true);
      }
    }
    // End processDirectChildren().
    render() {
      const { allItems, activeItems } = this.state;
      return /* @__PURE__ */ import_react135.default.createElement(import_react135.default.Fragment, null, allItems.length === 0 && /* @__PURE__ */ import_react135.default.createElement(Bullseye, null, /* @__PURE__ */ import_react135.default.createElement("div", null, "No Databases")), /* @__PURE__ */ import_react135.default.createElement("div", { className: this.props.isDisabled ? "ds-disabled ds-editor-tree" : "ds-editor-tree" }, /* @__PURE__ */ import_react135.default.createElement(
        TreeView,
        {
          data: allItems,
          onSelect: this.handleTreeOnClick,
          activeItems,
          icon: this.props.skipLeafEntries ? null : /* @__PURE__ */ import_react135.default.createElement(FolderIcon, null),
          expandedIcon: this.props.skipLeafEntries ? null : /* @__PURE__ */ import_react135.default.createElement(FolderOpenIcon, null),
          hasBadges: !this.props.skipLeafEntries
        }
      )));
    }
  };
  LdapNavigator.propTypes = {
    editorLdapServer: import_prop_types108.default.string,
    treeItems: import_prop_types108.default.array,
    skipLeafEntries: import_prop_types108.default.bool,
    showTreeLoadingState: import_prop_types108.default.func,
    handleNodeOnClick: import_prop_types108.default.func
  };
  LdapNavigator.defaultProps = {
    editorLdapServer: "",
    treeItems: [],
    skipLeafEntries: false
  };
  var ldapNavigator_default = LdapNavigator;

  // src/lib/ldap_editor/treeView.jsx
  var EditorTreeView = class extends import_react136.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "showEntryLoading", (isEntryLoading) => {
        this.setState({
          searching: !!isEntryLoading
        });
      });
      __publicField(this, "showTreeLoadingState", (isTreeLoading) => {
        this.setState({
          isTreeLoading
        });
      });
      __publicField(this, "updateEntryRows", (treeViewItem) => {
        if (treeViewItem === null) {
          this.setState({
            entryRows: this.tableEmtpyStateRow,
            tableModificationTime: Date.now(),
            // Passed as property.
            entryModTime: "",
            // An empty value will not be rendered.
            entryIcon: null,
            entryDn: "",
            // An empty value disables the actions dropdown menu.
            latestEntryRefreshTime: Date.now(),
            searching: false
          });
          return;
        }
        this.props.handleToggleEntryMenu(false);
        const entryRows = [];
        const isEmptySuffix = treeViewItem.isEmptySuffix;
        let entryIcon = treeViewItem.icon;
        let entryStateIcon = "";
        const entryDn = treeViewItem.dn === "" ? "Root DSE" : treeViewItem.dn;
        const isSuffixEntry = treeViewItem.id === "0";
        const entryModTime = treeViewItem.modTime;
        const fullEntry = treeViewItem.fullEntry;
        const encodedValues = [];
        let isRole = false;
        fullEntry.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
        data.attribute !== "???: ").map((line) => {
          if (line.attribute !== void 0) {
            const attr = line.attribute;
            const attrLowerCase = attr.trim().toLowerCase();
            let val = line.value.substring(1);
            if (line.value.substring(0, 2) === "::") {
              if (this.attributesSpecialHandling.includes(attrLowerCase)) {
                encodedValues.push({ index: entryRows.length, line });
              } else {
                if (attrLowerCase === "nssymmetrickey") {
                  val = line.value.substring(3);
                } else {
                  val = b64DecodeUnicode(line.value.substring(3));
                }
              }
            }
            if (attr.toLowerCase() === "userpassword") {
              val = "********";
            }
            entryRows.push([{ title: /* @__PURE__ */ import_react136.default.createElement("strong", null, attr) }, val]);
            const myVal = val.trim().toLowerCase();
            const accountObjectclasses = [
              "nsaccount",
              "nsperson",
              "simplesecurityobject",
              "organization",
              "person",
              "account",
              "organizationalunit",
              "netscapeserver",
              "domain",
              "posixaccount",
              "shadowaccount",
              "posixgroup",
              "mailrecipient",
              "nsroledefinition"
            ];
            if (accountObjectclasses.includes(myVal)) {
              entryStateIcon = /* @__PURE__ */ import_react136.default.createElement(LockIcon, { className: "ds-pf-blue-color" });
            }
            if (myVal === "nsroledefinition") {
              isRole = true;
            }
            if (!entryIcon && attrLowerCase === "objectclass") {
              if (myVal === "inetorgperson" || myVal === "posixaccount" || myVal === "person") {
                entryIcon = /* @__PURE__ */ import_react136.default.createElement(UserIcon, null);
              } else if (myVal === "organizationalunit" || myVal === "groupofuniquenames" || myVal === "groupofnames") {
                entryIcon = /* @__PURE__ */ import_react136.default.createElement(UsersIcon, null);
              } else if (myVal === "domain") {
                entryIcon = /* @__PURE__ */ import_react136.default.createElement(DomainIcon, null);
              }
            }
          } else {
            entryRows.push([{ title: /* @__PURE__ */ import_react136.default.createElement("strong", null, line.props.attr) }, line]);
          }
          return [];
        });
        if (!entryIcon) {
          entryIcon = isEmptySuffix ? /* @__PURE__ */ import_react136.default.createElement(ResourcesEmptyIcon, null) : /* @__PURE__ */ import_react136.default.createElement(CubeIcon, null);
        }
        const lastLine = fullEntry.length > 0 ? fullEntry.slice(-1).pop() : {};
        const isEntryTooLarge = isEmptySuffix ? false : lastLine.attribute === "MESSAGE" && lastLine.value === ":ENTRY TOO LARGE - OUTPUT TRUNCATED!";
        const entryIsLoading = false;
        let entryState = "";
        const cmd = [
          "dsidm",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.editorLdapServer + ".socket",
          "-b",
          entryDn,
          isRole ? "role" : "account",
          "entry-status",
          entryDn
        ];
        log_cmd("updateEntryRows", "Checking if entry is activated", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          if (entryDn !== "Root DSE" && entryStateIcon !== "") {
            const status = JSON.parse(content);
            entryState = status.info.state;
            if (entryState === "inactivity limit exceeded" || entryState.startsWith("probably activated or")) {
              entryStateIcon = /* @__PURE__ */ import_react136.default.createElement(ExclamationTriangleIcon, { className: "ds-pf-yellow-color ct-icon-exclamation-triangle" });
            }
          }
        }).fail((err) => {
          const errMsg = JSON.parse(err);
          if (entryDn !== "Root DSE" && entryStateIcon !== "" && !errMsg.desc.includes("Root suffix can't be locked or unlocked")) {
            console.error(
              "updateEntryRow",
              `${isRole ? "role" : "account"} account entry-status operation failed`,
              errMsg.desc
            );
            entryState = "error: please, check browser logs";
            entryStateIcon = /* @__PURE__ */ import_react136.default.createElement(ExclamationCircleIcon, { className: "ds-pf-red-color ct-exclamation-circle" });
          }
        }).finally(() => {
          const tableModificationTime = Date.now();
          this.setState({
            entryRows,
            entryDn,
            entryState,
            isSuffixEntry,
            entryModTime,
            isEmptySuffix,
            entryIsLoading,
            isEntryTooLarge,
            tableModificationTime,
            entryIcon,
            entryStateIcon,
            isRole
          }, () => {
            const finalRows = [...this.state.entryRows];
            let numberDecoded = 0;
            encodedValues.map((myObj) => {
              const attr = myObj.line.attribute;
              const attrLowerCase = attr.trim().toLowerCase();
              const encVal = myObj.line.value.substring(3);
              let decodedValue = encVal;
              switch (attrLowerCase) {
                case "jpegphoto": {
                  decodedValue = /* @__PURE__ */ import_react136.default.createElement(import_react136.default.Fragment, null, /* @__PURE__ */ import_react136.default.createElement(
                    "img",
                    {
                      src: `data:image/png;base64,${encVal}`,
                      alt: "",
                      style: { width: "256px" }
                    }
                  ));
                  const myPhoto = /* @__PURE__ */ import_react136.default.createElement(
                    "img",
                    {
                      src: `data:image/png;base64,${encVal}`,
                      alt: "",
                      style: { width: "48px" }
                    }
                  );
                  const newRow = [{ title: /* @__PURE__ */ import_react136.default.createElement("strong", null, attr) }, decodedValue];
                  finalRows.splice(myObj.index, 1, newRow);
                  numberDecoded++;
                  this.setState({ entryIcon: myPhoto });
                  break;
                }
                case "userpassword":
                  numberDecoded++;
                  break;
                case "usercertificate":
                case "usercertificate;binary":
                case "cacertificate":
                case "cacertificate;binary":
                  showCertificate(
                    encVal,
                    (result) => {
                      if (result.code === "OK") {
                        const timeDiff = result.timeDifference;
                        const certDays = Math.ceil(Math.abs(timeDiff) / (1e3 * 3600 * 24));
                        const dayMsg = certDays > 1 ? `${certDays} days` : `${certDays} day`;
                        const diffMessage = timeDiff > 0 ? `Certificate is valid for ${dayMsg}` : `Certificate is expired since ${dayMsg}`;
                        const type = timeDiff < 0 ? "danger" : timeDiff < 1e3 * 3600 * 24 * 30 ? "warning" : "info";
                        const certItems = result.data.map((datum) => {
                          return /* @__PURE__ */ import_react136.default.createElement(import_react136.default.Fragment, { key: datum.param }, /* @__PURE__ */ import_react136.default.createElement(TextListItem, { component: TextListItemVariants.dt }, datum.param), /* @__PURE__ */ import_react136.default.createElement(TextListItem, { component: TextListItemVariants.dd }, datum.paramVal));
                        });
                        decodedValue = /* @__PURE__ */ import_react136.default.createElement(import_react136.default.Fragment, null, /* @__PURE__ */ import_react136.default.createElement("div", null, /* @__PURE__ */ import_react136.default.createElement(Alert, { variant: type, isInline: true, title: diffMessage }), /* @__PURE__ */ import_react136.default.createElement(TextContent, null, /* @__PURE__ */ import_react136.default.createElement(TextList, { component: TextListVariants.dl }, certItems))));
                        const newRow = [{ title: /* @__PURE__ */ import_react136.default.createElement("strong", null, attr) }, decodedValue];
                        finalRows.splice(myObj.index, 1, newRow);
                        numberDecoded++;
                        if (encodedValues.length === numberDecoded) {
                          this.setState({
                            entryRows: finalRows,
                            tableModificationTime: Date.now()
                          });
                        }
                      }
                    }
                  );
                  break;
                default:
                  console.log(`Got an unexpected line ==> ${myObj.line}`);
                  console.log(`Got an unexpected line attr ==> ${myObj.line.attribute}`);
                  console.log(`Got an unexpected line value ==> ${myObj.line.value}`);
              }
              if (encodedValues.length === numberDecoded) {
                this.setState({
                  entryRows: finalRows,
                  tableModificationTime: Date.now()
                });
              }
              return [];
            });
            this.setState({
              latestEntryRefreshTime: Date.now()
            }, () => {
              this.showEntryLoading(false);
            });
          });
        });
      });
      this.attributesSpecialHandling = [
        "jpegphoto",
        "usercertificate",
        "usercertificate;binary",
        "cacertificate",
        "cacertificate;binary",
        "userpassword"
      ];
      this.tableEmtpyStateRow = [{
        showAnEmptyTable: true,
        // Used in the render() for a quick check.
        heightAuto: true,
        cells: [{
          props: { colSpan: 8 },
          title: /* @__PURE__ */ import_react136.default.createElement(Bullseye, null, /* @__PURE__ */ import_react136.default.createElement(EmptyState, { variant: EmptyStateVariant.small }, /* @__PURE__ */ import_react136.default.createElement(EmptyStateIcon, { icon: ResourcesEmptyIcon }), /* @__PURE__ */ import_react136.default.createElement(Title, { headingLevel: "h2", size: "lg" }, "No entry is selected"), /* @__PURE__ */ import_react136.default.createElement(EmptyStateBody, null, "Select an entry to see its details.")))
        }]
      }];
      this.state = {
        alerts: [],
        firstClickOnTree: false,
        searchInput: "",
        rowsValues: [],
        entryColumns: [
          { title: "Attribute" },
          // { title: 'Value', transforms: [wrappable] }],
          { title: "Value", cellTransforms: [breakWord] }
        ],
        entryRows: [],
        entryIsLoading: true,
        entryIcon: null,
        entryDn: "",
        entryState: "",
        entryStateIcon: null,
        isSuffixEntry: false,
        entryModTime: "",
        isEmptySuffix: false,
        showPagination: false,
        isEntryTooLarge: false,
        // To trigger an update in GenericPagination.componentDidUpdate().
        // Maybe just use a random number?
        tableModificationTime: 0,
        showEmptySuffixModal: false,
        newSuffixData: { creationDate: 0 },
        isTreeLoading: false,
        refreshButtonTriggerTime: 0,
        latestEntryRefreshTime: 0,
        searching: false,
        isRole: false
      };
      this.addAlert = (title, variant, key) => {
        this.setState({
          alerts: [...this.state.alerts, { title, variant, key }]
        });
      };
      this.removeAlert = (key) => {
        this.setState({ alerts: [...this.state.alerts.filter((el) => el.key !== key)] });
      };
      this.onNodeOnClick = (treeViewItem) => {
        if (treeViewItem && treeViewItem.dn === this.state.entryDn) {
          this.updateEntryRows(treeViewItem);
          return;
        }
        this.setState({
          searching: true
        }, () => {
          if (!this.state.firstClickOnTree) {
            this.setState({
              firstClickOnTree: true
            });
            this.props.setTreeFirstClicked(true);
          }
          this.updateEntryRows(treeViewItem);
        });
      };
      this.handleEmptySuffixToggle = (resultParams) => {
        this.onEmptySuffixToggle(resultParams);
      };
      this.onEmptySuffixToggle = (resultParams) => {
        this.setState(({ showEmptySuffixModal }) => ({
          showEmptySuffixModal: !showEmptySuffixModal
        }));
        if (resultParams.message) {
          const creationDate = Date.now();
          this.addAlert(resultParams.message, resultParams.variant, creationDate);
          if (resultParams.variant === "success") {
            const rootEntryData = resultParams.rootEntryData;
            this.setState({
              newSuffixData: { rootEntryData, creationDate }
            }, () => {
              this.props.onReload(true);
            });
          }
        }
      };
    }
    // End constructor.
    componentDidMount() {
      this.props.setTreeFirstClicked(false);
    }
    componentDidUpdate(prevProps) {
      if (this.props.loading !== prevProps.loading) {
        this.setState({ firstClickOnTree: false });
        this.props.setTreeFirstClicked(false);
      }
    }
    render() {
      const {
        alerts,
        searching,
        isSuffixEntry,
        isRole,
        firstClickOnTree,
        entryColumns,
        entryRows,
        entryIcon,
        entryDn,
        entryModTime,
        isEmptySuffix,
        isEntryTooLarge,
        tableModificationTime,
        showEmptySuffixModal,
        entryState,
        newSuffixData,
        isTreeLoading,
        refreshButtonTriggerTime,
        latestEntryRefreshTime,
        entryStateIcon
      } = this.state;
      const { loading } = this.props;
      let lockingDropdown = [];
      if (entryState !== "" && !entryState.startsWith("error:")) {
        if (entryState !== "activated") {
          if (entryState.includes("probably activated") || entryState.includes("indirectly locked")) {
            lockingDropdown = [
              /* @__PURE__ */ import_react136.default.createElement(
                DropdownItem,
                {
                  key: "tree-view-lock",
                  component: "button",
                  name: isRole ? ENTRY_MENU.lockRole : ENTRY_MENU.lockAccount,
                  value: entryDn
                },
                "Lock ..."
              )
            ];
          } else {
            lockingDropdown = [
              /* @__PURE__ */ import_react136.default.createElement(
                DropdownItem,
                {
                  key: "tree-view-unlock",
                  component: "button",
                  name: isRole ? ENTRY_MENU.unlockRole : ENTRY_MENU.unlockAccount,
                  value: entryDn
                },
                "Unlock ..."
              )
            ];
          }
        } else {
          lockingDropdown = [
            /* @__PURE__ */ import_react136.default.createElement(
              DropdownItem,
              {
                key: "tree-view-lock",
                component: "button",
                name: isRole ? ENTRY_MENU.lockRole : ENTRY_MENU.lockAccount,
                value: entryDn
              },
              "Lock ..."
            )
          ];
        }
      }
      const dropdownItems = [
        /* @__PURE__ */ import_react136.default.createElement(
          DropdownItem,
          {
            key: "tree-view-search",
            component: "button",
            name: ENTRY_MENU.search,
            value: entryDn
          },
          "Search ..."
        ),
        /* @__PURE__ */ import_react136.default.createElement(DropdownSeparator, { key: "separator-2" }),
        /* @__PURE__ */ import_react136.default.createElement(
          DropdownItem,
          {
            key: "tree-view-edit",
            component: "button",
            name: ENTRY_MENU.edit,
            value: entryDn,
            isDisabled: isEntryTooLarge
          },
          "Edit ..."
        ),
        /* @__PURE__ */ import_react136.default.createElement(
          DropdownItem,
          {
            key: "tree-view-new",
            component: "button",
            name: ENTRY_MENU.new,
            value: entryDn
          },
          "New ..."
        ),
        /* @__PURE__ */ import_react136.default.createElement(
          DropdownItem,
          {
            key: "tree-view-rename",
            component: "button",
            name: ENTRY_MENU.rename,
            value: entryDn,
            isDisabled: isSuffixEntry
          },
          "Rename ..."
        ),
        // Lock and Unlock buttons
        ...lockingDropdown,
        /* @__PURE__ */ import_react136.default.createElement(
          DropdownItem,
          {
            key: "tree-view-acis",
            component: "button",
            name: ENTRY_MENU.acis,
            value: entryDn
          },
          "ACIs ..."
        ),
        /* @__PURE__ */ import_react136.default.createElement(
          DropdownItem,
          {
            key: "tree-view-cos",
            component: "button",
            name: ENTRY_MENU.cos,
            value: entryDn
          },
          "Class of Service ..."
        ),
        /*
        <DropdownItem
            isDisabled
            key="tree-view-refs"
            component="button"
            name="smartRefs"
            value={entryDn}
        >
            Smart Referrals ...
        </DropdownItem>,
        */
        /* @__PURE__ */ import_react136.default.createElement(DropdownSeparator, { key: "separator-3" }),
        /* @__PURE__ */ import_react136.default.createElement(
          DropdownItem,
          {
            key: "tree-view-delete",
            component: "button",
            name: ENTRY_MENU.delete,
            value: entryDn
          },
          "Delete ..."
        )
      ];
      const loadingStateComponent = /* @__PURE__ */ import_react136.default.createElement(import_react136.default.Fragment, null, /* @__PURE__ */ import_react136.default.createElement("div", { className: "ds-margin-top-lg ds-indent" }, /* @__PURE__ */ import_react136.default.createElement(Label, { icon: /* @__PURE__ */ import_react136.default.createElement(CatalogIcon, null), color: "blue" }, /* @__PURE__ */ import_react136.default.createElement("strong", null, this.props.treeViewRootSuffixes.length > 1 ? "Suffix Trees" : "Suffix Tree"), /* @__PURE__ */ import_react136.default.createElement(
        Button,
        {
          variant: "link",
          title: "Refresh all the suffixes",
          icon: /* @__PURE__ */ import_react136.default.createElement(SyncAltIcon, null),
          onClick: () => {
            this.props.onReload(true);
          }
        }
      ))), /* @__PURE__ */ import_react136.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react136.default.createElement(TextContent, null, /* @__PURE__ */ import_react136.default.createElement(Text, { component: TextVariants.h3 }, "Loading ...")), /* @__PURE__ */ import_react136.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "lg" })));
      const loadingEntryComponent = /* @__PURE__ */ import_react136.default.createElement("div", { className: "ds-margin-top-xlg ds-center" }, /* @__PURE__ */ import_react136.default.createElement(TextContent, null, /* @__PURE__ */ import_react136.default.createElement(Text, { component: TextVariants.h3 }, "Loading ...")), /* @__PURE__ */ import_react136.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "lg" }));
      const finishedAt = /* @__PURE__ */ new Date();
      finishedAt.setTime(this.props.timeOfCompletion);
      const isValidData = entryDn ? true : entryRows[0] ? entryRows[0].showAnEmptyTable : false;
      let page_body = "";
      if (loading) {
        page_body = loadingStateComponent;
      } else {
        page_body = /* @__PURE__ */ import_react136.default.createElement("div", null, alerts.length > 0 && /* @__PURE__ */ import_react136.default.createElement(AlertGroup, { isToast: true }, alerts.map(({ key, variant, title }) => /* @__PURE__ */ import_react136.default.createElement(
          Alert,
          {
            isLiveRegion: true,
            variant: AlertVariant[variant],
            title,
            timeout: true,
            actionClose: /* @__PURE__ */ import_react136.default.createElement(
              AlertActionCloseButton,
              {
                title: "Suffix creation",
                variantLabel: `${variant} alert`,
                onClose: () => this.removeAlert(key)
              }
            ),
            key
          }
        ))), /* @__PURE__ */ import_react136.default.createElement(Grid, { hasGutter: true, className: "ds-margin-top-lg ds-indent" }, /* @__PURE__ */ import_react136.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react136.default.createElement(Label, { icon: /* @__PURE__ */ import_react136.default.createElement(CatalogIcon, null), color: "blue" }, /* @__PURE__ */ import_react136.default.createElement("strong", null, this.props.treeViewRootSuffixes.length > 1 ? "Suffix Trees" : "Suffix Tree"), /* @__PURE__ */ import_react136.default.createElement(
          Button,
          {
            variant: "link",
            title: "Refresh all the suffixes",
            icon: /* @__PURE__ */ import_react136.default.createElement(SyncAltIcon, null),
            onClick: () => {
              this.props.onReload(true);
            }
          }
        )), !loading && /* @__PURE__ */ import_react136.default.createElement(
          ldapNavigator_default,
          {
            key: this.props.loading,
            treeItems: [...this.props.treeViewRootSuffixes],
            timeOfCompletion: this.props.timeOfCompletion,
            editorLdapServer: this.props.editorLdapServer,
            wizardOperationInfo: this.props.wizardOperationInfo,
            newSuffixData,
            handleNodeOnClick: this.onNodeOnClick,
            updateEntryRows: this.updateEntryRows,
            refreshEntryTime: this.props.refreshEntryTime,
            showTreeLoadingState: this.showTreeLoadingState,
            refreshButtonTriggerTime,
            handleEntryRefresh: this.refreshEntry,
            addNotification: this.props.addNotification,
            isDisabled: isTreeLoading || searching
          }
        )), /* @__PURE__ */ import_react136.default.createElement(GridItem, { span: 6 }, firstClickOnTree && /* @__PURE__ */ import_react136.default.createElement(Label, { icon: /* @__PURE__ */ import_react136.default.createElement(InfoCircleIcon, null), color: "blue" }, /* @__PURE__ */ import_react136.default.createElement("strong", null, "Entry Details"), /* @__PURE__ */ import_react136.default.createElement(
          Tooltip,
          {
            position: "top",
            content: /* @__PURE__ */ import_react136.default.createElement("div", null, "Reload the LDAP entry.")
          },
          /* @__PURE__ */ import_react136.default.createElement(
            Button,
            {
              variant: "link",
              icon: /* @__PURE__ */ import_react136.default.createElement(SyncAltIcon, null),
              onClick: () => this.setState({ refreshButtonTriggerTime: Date.now() })
            }
          )
        )), /* @__PURE__ */ import_react136.default.createElement("div", { className: "ds-margin-bottom" }), searching && loadingEntryComponent, firstClickOnTree && !loading && !searching && isValidData && /* @__PURE__ */ import_react136.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react136.default.createElement(CardHeader, null, /* @__PURE__ */ import_react136.default.createElement(CardActions, null, /* @__PURE__ */ import_react136.default.createElement(
          Dropdown,
          {
            onSelect: this.props.onSelectEntryOptions,
            toggle: /* @__PURE__ */ import_react136.default.createElement(
              KebabToggle,
              {
                isDisabled: isEmptySuffix || entryDn === "",
                onToggle: this.props.handleToggleEntryMenu
              }
            ),
            isOpen: this.props.entryMenuIsOpen,
            isPlain: true,
            dropdownItems,
            position: "right"
          }
        )), /* @__PURE__ */ import_react136.default.createElement(CardHeaderMain, null, entryIcon), /* @__PURE__ */ import_react136.default.createElement(Title, { headingLevel: "h6", size: "md" }, /* @__PURE__ */ import_react136.default.createElement("span", null, "\u2002", entryDn, " "), entryState !== "" && entryStateIcon !== "" && entryState !== "activated" ? /* @__PURE__ */ import_react136.default.createElement(
          Tooltip,
          {
            position: "bottom",
            content: /* @__PURE__ */ import_react136.default.createElement("div", null, entryState)
          },
          /* @__PURE__ */ import_react136.default.createElement("a", { className: "ds-font-size-md" }, entryStateIcon)
        ) : "")), isEntryTooLarge && /* @__PURE__ */ import_react136.default.createElement(CardTitle, null, /* @__PURE__ */ import_react136.default.createElement(Label, { color: "orange", icon: /* @__PURE__ */ import_react136.default.createElement(InfoCircleIcon, null) }, "Entry is too large - Table is truncated.")), /* @__PURE__ */ import_react136.default.createElement(CardBody, null, /* @__PURE__ */ import_react136.default.createElement(
          genericPagination_default,
          {
            columns: entryColumns,
            rows: entryRows,
            tableModificationTime,
            ariaLabel: "Entry details table with pagination"
          }
        ), isEmptySuffix && /* @__PURE__ */ import_react136.default.createElement(EmptyState, { variant: EmptyStateVariant.small }, /* @__PURE__ */ import_react136.default.createElement(EmptyStateIcon, { icon: ResourcesEmptyIcon }), /* @__PURE__ */ import_react136.default.createElement(Title, { headingLevel: "h2", size: "lg" }, "Empty suffix!"), /* @__PURE__ */ import_react136.default.createElement(EmptyStateBody, null, /* @__PURE__ */ import_react136.default.createElement(Label, { variant: "outline", color: "orange", icon: /* @__PURE__ */ import_react136.default.createElement(InfoCircleIcon, null) }, "The suffix is configured, but it has no entries."), /* @__PURE__ */ import_react136.default.createElement(
          Button,
          {
            className: "ds-margin-top-lg",
            variant: "link",
            onClick: this.handleEmptySuffixToggle
          },
          "Create the root suffix entry ",
          /* @__PURE__ */ import_react136.default.createElement(ArrowRightIcon, null)
        ))), showEmptySuffixModal && /* @__PURE__ */ import_react136.default.createElement(
          rootSuffix_default,
          {
            showEmptySuffixModal,
            handleEmptySuffixToggle: this.onEmptySuffixToggle,
            suffixDn: entryDn,
            editorLdapServer: this.props.editorLdapServer,
            updateEntryRows: this.updateEntryRows
          }
        )), !isEmptySuffix && entryModTime.length > 0 && /* @__PURE__ */ import_react136.default.createElement(CardFooter, null, "Last Modified Time: ", entryModTime, /* @__PURE__ */ import_react136.default.createElement("div", { className: "ds-margin-bottom-md" }), /* @__PURE__ */ import_react136.default.createElement(Divider, null), /* @__PURE__ */ import_react136.default.createElement("div", { className: "ds-margin-bottom-md" }), /* @__PURE__ */ import_react136.default.createElement(Label, { variant: "outline", color: "blue" }, "Last Refresh at ", new Date(latestEntryRefreshTime).toLocaleString()), /* @__PURE__ */ import_react136.default.createElement(
          Tooltip,
          {
            position: "top",
            content: /* @__PURE__ */ import_react136.default.createElement("div", null, "Reload the LDAP entry.")
          },
          /* @__PURE__ */ import_react136.default.createElement(
            Button,
            {
              variant: "link",
              icon: /* @__PURE__ */ import_react136.default.createElement(SyncAltIcon, null),
              onClick: () => this.setState({ refreshButtonTriggerTime: Date.now() })
            }
          )
        ))))));
      }
      return /* @__PURE__ */ import_react136.default.createElement(import_react136.default.Fragment, null, page_body);
    }
  };
  var treeView_default = EditorTreeView;

  // src/lib/ldap_editor/search.jsx
  var import_react156 = __toESM(require_react(), 1);
  var import_prop_types110 = __toESM(require_prop_types(), 1);

  // src/lib/ldap_editor/wizards/genericWizard.jsx
  var import_react155 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/aci.jsx
  var import_react139 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/aciParser.jsx
  function getAciAttributes(aci) {
    let startIndex = 0;
    const aciAttributes = [];
    const length = aci.length;
    for (let i = 0; i < length; i++) {
      switch (aci.charAt(i)) {
        case " ":
        case "\n":
          break;
        case "(":
          i++;
        default:
          i = parseAciName(aci, i, aciAttributes, startIndex);
          startIndex = i;
          break;
      }
      if (i < 0) {
        i = -i;
        console.log("ACI ERROR: cannot parse at index " + i);
        console.log(aci);
        let spaces = "";
        for (let x2 = 0; x2 < i; x2++) {
          spaces += " ";
        }
        console.log(`${spaces}^`);
        break;
      }
    }
    return aciAttributes;
  }
  function parseAciName(aci, i, aciAttributes, startIndex) {
    const length = aci.length;
    let aciName = "";
    let isNameFound = false;
    for (; i < length; i++) {
      const x2 = aci.charAt(i);
      switch (x2) {
        case "\n":
          break;
        case "(":
        case " ":
          if (aciName.length > 0) {
            isNameFound = true;
          }
          break;
        case "|":
        case "<":
        case ">":
        case "!":
        case "=":
          isNameFound = true;
          break;
        case ")":
          return i;
        case ";":
          break;
        default:
          aciName += x2;
          break;
      }
      if (isNameFound) {
        if (aciName.length > 0) {
          const nameString = aciName.toString();
          if (nameString.toLowerCase() === "and" || nameString.toLowerCase() === "or") {
            const aciAttr = {
              aciName: "",
              operator: nameString,
              value: "",
              startIndex,
              endIndex: i
            };
            aciAttributes.push(aciAttr);
            startIndex = i + 1;
          } else {
            if (aci.charAt(i) === " " || aci.charAt(i) === "(") {
              i++;
            }
            i = parseAciValue(aci, i, nameString, aciAttributes, startIndex);
            startIndex = i;
          }
          if (i > 0) {
            isNameFound = false;
            aciName = null;
            aciName = "";
            i--;
            continue;
          }
        }
        return i;
      }
    }
    return i;
  }
  function parseAciValue(aci, i, aciName, aciAttributes, startIndex) {
    const length = aci.length;
    let value = "";
    let operator = "";
    let isValueFound = false;
    let isQuoteOpen = false;
    let countParenthesis = 0;
    for (; i < length; i++) {
      const x2 = aci.charAt(i);
      switch (x2) {
        case "\n":
          break;
        case "|":
        case "<":
        case ">":
        case "!":
        case "=":
          if (value.length > 0) {
            value += x2;
          } else {
            operator += x2;
          }
          break;
        case " ":
          if (value.length > 0) {
            value += x2;
          }
          break;
        case '"':
          value += x2;
          isQuoteOpen = !isQuoteOpen;
          if (isQuoteOpen === false) {
            isValueFound = true;
          }
          break;
        case "(":
          if (isQuoteOpen === false) {
            countParenthesis++;
          }
          value += x2;
          break;
        case ")":
          if (countParenthesis > 0 || isQuoteOpen) {
            value += x2;
          }
          if (!isQuoteOpen) {
            countParenthesis--;
            if (countParenthesis <= 0) {
              isValueFound = true;
            }
          }
          break;
        case ";":
          isValueFound = true;
          break;
        default:
          value += x2;
          break;
      }
      if (isValueFound) {
        const len = value.length;
        if (len > 0) {
          let v = value.toString();
          if (v.endsWith('"')) {
            v = v.substring(0, v.length - 1);
          }
          if (v.startsWith('"')) {
            v = v.substring(1);
          }
          const aciAttr = {
            aciName,
            operator: operator.toString(),
            value: v,
            startIndex,
            endIndex: i
          };
          aciAttributes.push(aciAttr);
          return i + 1;
        }
        break;
      }
    }
    return -i;
  }
  function getAciActualName(fullAci) {
    const aciData = getAciAttributes(fullAci);
    const aciName = aciData.filter((aci) => aci.aciName === "acl");
    const aciActualName = aciName[0].value;
    return aciActualName;
  }
  function isAciPermissionAllow(fullAci) {
    const aciData = getAciAttributes(fullAci);
    const aciAllow = aciData.filter((aci) => aci.aciName === "allow");
    return aciAllow.length > 0;
  }

  // src/lib/ldap_editor/wizards/operations/aciNew.jsx
  var import_react138 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/aciBindRuleTable.jsx
  var import_react137 = __toESM(require_react(), 1);
  var AciBindRuleTable = class extends import_react137.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        columns: ["Bind Rule", "Comparator", "LDAP URLs"],
        actions: [
          {
            title: "Remove Bind Rule",
            onClick: (event, rowId, rowData, extra) => this.props.removeRow(rowId)
          }
        ],
        rows: []
      };
    }
    componentDidMount() {
      let columns = ["Bind Rule", "Comparator", "LDAP URLs"];
      let rows = [...this.props.rows];
      if (this.props.rows.length === 0) {
        columns = ["Bind Rules"];
        rows = [{ cells: ["No bind rules"] }];
      }
      this.setState({
        rows,
        columns
      });
    }
    render() {
      const { columns, rows, actions } = this.state;
      return /* @__PURE__ */ import_react137.default.createElement(
        Table,
        {
          className: "ds-margin-top-lg",
          actions: this.props.rows.length !== 0 ? actions : null,
          "aria-label": "bind rule Table",
          variant: TableVariant.compact,
          cells: columns,
          rows
        },
        /* @__PURE__ */ import_react137.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react137.default.createElement(TableBody, null)
      );
    }
  };
  var aciBindRuleTable_default = AciBindRuleTable;

  // src/lib/ldap_editor/wizards/operations/aciNew.jsx
  var import_info_circle_icon4 = __toESM(require_info_circle_icon(), 1);
  var AddNewAci = class extends import_react138.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "showTreeLoadingState", (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      });
      __publicField(this, "handleCloseAddBindRuleModal", () => {
        this.setState({
          showAddBindRuleModal: false
        });
      });
      __publicField(this, "handleOpenAddBindRule", () => {
        this.setState({
          showAddBindRuleModal: true,
          bindRuleType: "userdn",
          bindRuleOperator: "=",
          bindRuleValue: "",
          authmethod: "none",
          authMethodOperator: "=",
          usersChosenOptions: [],
          usersAvailableOptions: [],
          dnsOperator: "=",
          ipOperator: "=",
          dns: "",
          ip: ""
        });
      });
      __publicField(this, "updateUserBindRulesState", () => {
        let haveUserRules = false;
        let haveUserAttrRules = false;
        let hasSelectionSelection = false;
        const specialSelect = this.state.specialSelection;
        for (const rule of this.state.bindRuleRows) {
          if (rule.cells[0].endsWith("dn")) {
            haveUserRules = true;
            if (rule.cells[0] === "userdn" && (rule.cells[2] === "ldap:///self" || rule.cells[2] === "ldap:///all" || rule.cells[2] === "ldap:///anyone" || rule.cells[2] === "ldap:///parent")) {
              hasSelectionSelection = true;
            }
          } else if (rule.cells[0] === "userattr") {
            haveUserAttrRules = true;
          }
        }
        this.setState({
          haveUserRules,
          haveUserAttrRules,
          specialSelection: hasSelectionSelection ? specialSelect : ""
        });
      });
      __publicField(this, "handleAddBindRule", () => {
        let bindRow = {};
        let selection = this.state.specialSelection;
        if (this.state.bindRuleType === "User DN Aliases") {
          if (selection === "") {
            selection = "ldap:///anyone";
          }
          bindRow = {
            cells: ["userdn", "=", selection]
          };
        } else if (this.state.bindRuleType === "authmethod") {
          bindRow = {
            cells: ["authmethod", this.state.authMethodOperator, this.state.authmethod]
          };
        } else if (this.state.bindRuleType === "ssf") {
          bindRow = {
            cells: ["ssf", this.state.ssfOperator, this.state.ssf]
          };
        } else if (this.state.bindRuleType === "ip") {
          bindRow = {
            cells: ["ip", this.state.ipOperator, this.state.ip]
          };
        } else if (this.state.bindRuleType === "dns") {
          bindRow = {
            cells: ["dns", this.state.dnsOperator, this.state.dns]
          };
        } else if (this.state.bindRuleType === "userattr") {
          const userattrVal = this.getUserattrVal();
          bindRow = {
            cells: ["userattr", this.state.userattrOperator, userattrVal]
          };
        } else {
          let value = "";
          for (const entryIdx in this.state.usersChosenOptions) {
            if (entryIdx > 0) {
              value += " || ";
            }
            const dn = this.state.usersChosenOptions[entryIdx].props.title;
            value += "ldap:///" + dn;
          }
          bindRow = {
            cells: [this.state.bindRuleType, this.state.bindRuleOperator, value]
          };
        }
        const rows = [...this.state.bindRuleRows];
        rows.push(bindRow);
        this.setState({
          bindRuleRows: rows,
          showAddBindRuleModal: false,
          specialSelection: selection
        }, () => {
          this.updateUserBindRulesState();
        });
      });
      __publicField(this, "removeBindRuleRow", (rowId) => {
        const revisedRows = [];
        for (const idx in this.state.bindRuleRows) {
          if (idx.toString() !== rowId.toString()) {
            revisedRows.push(this.state.bindRuleRows[idx]);
          }
        }
        this.setState({
          bindRuleRows: revisedRows
        }, () => {
          this.updateUserBindRulesState();
        });
      });
      this.rightsColumns = [{ title: "Right" }, { title: "Description" }];
      this.targetsColumns = [
        { title: "Name", transforms: [sortable] },
        { title: "OID", transforms: [sortable] }
      ];
      this.dayMap = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
      this.state = {
        // General
        editVisually: true,
        stepIdReachedVisual: 1,
        savedStepId: 1,
        isAciSyntaxValid: false,
        searchPattern: "",
        newAciName: "",
        isTreeLoading: false,
        searching: false,
        aciText: "",
        aciTextNew: "",
        attributes: [],
        resultVariant: "success",
        commandOutput: "",
        // targets
        target: this.props.wizardEntryDn,
        targetAttrs: [],
        targetAttrCompOp: "=",
        isOpenTargetAttrOperator: false,
        targetFilter: "",
        target_to: "",
        target_from: "",
        // Bind rules
        specialSelection: "",
        bindRuleRows: [],
        haveUserRules: false,
        haveUserAttrRules: false,
        userattrOperator: "=",
        userattrAttr: "",
        userattrBindType: "USERDN",
        userAttrParent0: false,
        userAttrParent1: false,
        userAttrParent2: false,
        userAttrParent3: false,
        userAttrParent4: false,
        authmethod: "none",
        authMethods: [],
        authMethodOperator: "=",
        hosts: [],
        ips: [],
        dayofweek: [],
        sunday: false,
        monday: false,
        tuesday: false,
        wednesday: false,
        thursday: false,
        friday: false,
        saturday: false,
        timeOfDayStart: "0000",
        timeStartCompOp: ">",
        timeOfDayEnd: "0000",
        timeEndCompOp: "<",
        ssf: "",
        ssfOperator: ">=",
        // Users
        usersSearchBaseDn: this.props.wizardEntryDn,
        isSearchRunning: false,
        usersAvailableOptions: [],
        usersChosenOptions: [],
        isUsersDrawerExpanded: false,
        isTargetsDrawerExpanded: false,
        // Rights
        rightType: "allow",
        isOpenRights: false,
        rightsRows: [
          { cells: ["read", "See the values of targeted attributes"], selected: false },
          { cells: ["compare", "Compare targeted attribute values"], selected: false },
          { cells: ["search", "Determine if targeted attributes exist"], selected: false },
          { cells: ["selfwrite", "Add one's own DN to the target"], selected: false },
          { cells: ["write", "Modify targeted attributes"], selected: false },
          { cells: ["delete", "Remove targeted entries"], selected: false },
          { cells: ["add", "Add targeted entries"], selected: false },
          { cells: ["moddn", "Move an entry from one subtree to another"], selected: false },
          { cells: ["proxy", "Authenticate as another user"], selected: false }
        ],
        // Targets
        targetAttrRows: [],
        sortBy: {},
        tableModificationTime: 0,
        // Add bind rule modal
        showAddBindRuleModal: false,
        bindRuleType: "userdn",
        bindRuleOperator: "=",
        ldapURL: "",
        adding: true
      };
      this.getUserattrVal = () => {
        const {
          userAttrParent1,
          userAttrParent2,
          userAttrParent3,
          userAttrParent4,
          userattrAttr,
          userattrBindType
        } = this.state;
        let inheritVal = "";
        if (userAttrParent1 || userAttrParent2 || userAttrParent3 || userAttrParent4) {
          inheritVal = "parent[0";
          if (userAttrParent1) {
            inheritVal += ",1";
          }
          if (userAttrParent2) {
            inheritVal += ",2";
          }
          if (userAttrParent3) {
            inheritVal += ",3";
          }
          if (userAttrParent4) {
            inheritVal += ",4";
          }
          inheritVal += "].";
        }
        inheritVal += userattrAttr + "#" + userattrBindType;
        return inheritVal;
      };
      this.handleBuildAciText = () => {
        const {
          bindRuleRows,
          newAciName,
          rightsRows,
          rightType,
          target_to,
          target_from,
          target,
          targetAttrs,
          targetAttrCompOp,
          targetFilter,
          timeOfDayStart,
          timeStartCompOp,
          timeOfDayEnd,
          timeEndCompOp,
          sunday,
          monday,
          tuesday,
          wednesday,
          thursday,
          friday,
          saturday
        } = this.state;
        if (target === "") {
          this.setState({
            aciText: "??????"
          });
          return;
        }
        const userDNs = [];
        const groupDNs = [];
        const roleDNs = [];
        const authMethods = [];
        const ssfs = [];
        const ips = [];
        const dns = [];
        const userattr = [];
        for (const rule of bindRuleRows) {
          if (rule.cells[0] === "userdn") {
            userDNs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "groupdn") {
            groupDNs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "roledn") {
            roleDNs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "authmethod") {
            authMethods.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "ssf") {
            ssfs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "ip") {
            ips.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "dns") {
            dns.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "userattr") {
            userattr.push(rule.cells[0] + rule.cells[1] + '"' + this.getUserattrVal() + '"');
          }
        }
        let aciText = '(target="ldap:///' + target + '")';
        if (targetAttrs.length > 0) {
          aciText += "(targetattr" + targetAttrCompOp + '"';
          for (const attrIdx in targetAttrs) {
            aciText += targetAttrs[attrIdx];
            if (targetAttrs.length > 1 && Number(attrIdx) + 1 < targetAttrs.length) {
              aciText += " || ";
            }
          }
          aciText += '")';
        } else {
          aciText += '(targetattr="*")';
        }
        if (targetFilter !== "") {
          aciText += '(targetfilter="' + targetFilter + '")';
        }
        if (target_from !== "" && target_to !== "") {
          aciText += '(target_from="' + target_from + '")';
          aciText += '(target_to="' + target_to + '")';
        }
        aciText += '(version 3.0; acl "' + newAciName + '"; ';
        const rights = rightsRows.filter((item) => item.selected).map((cells) => cells.cells[0]).toString();
        aciText += rightType + "(" + rights + ")";
        let brCount = 0;
        for (const bindRule of [userDNs, groupDNs, roleDNs, authMethods, ssfs, ips, dns, userattr]) {
          if (bindRule.length > 0) {
            const many = bindRule.length > 1;
            if (brCount > 0) {
              aciText += " and ";
            } else {
              aciText += " ";
            }
            if (many) {
              aciText += "(";
            }
            for (const idx in bindRule) {
              aciText += bindRule[idx];
              if (many && idx < bindRule.length) {
                aciText += " or ";
              }
            }
            if (many) {
              aciText += ")";
            }
            brCount += 1;
          }
        }
        if (sunday || monday || tuesday || wednesday || thursday || friday || saturday) {
          if (brCount > 0) {
            aciText += " and ";
          } else {
            aciText += " ";
          }
          const allDays = [sunday, monday, tuesday, wednesday, thursday, friday, saturday];
          const days = [];
          aciText += 'dayofweek="';
          for (const idx in allDays) {
            if (allDays[idx]) {
              days.push(this.dayMap[idx]);
            }
          }
          aciText += days.join(",") + '"';
          brCount += 1;
        }
        if (timeOfDayStart !== "0000" || timeOfDayEnd !== "0000") {
          if (brCount > 0) {
            aciText += " and ";
          } else {
            aciText += " ";
          }
          aciText += "(timeofday" + timeStartCompOp + '"' + timeOfDayStart + '"';
          aciText += " and timeofday" + timeEndCompOp + '"' + timeOfDayEnd + '")';
          brCount += 1;
        }
        aciText += ";)";
        this.setState({
          aciText,
          aciTextNew: aciText
        });
      };
      this.onSelectedAttrs = (attrs) => {
        this.setState({
          targetAttrs: attrs
        });
      };
      this.usersDrawerRef = import_react138.default.createRef();
      this.targetsDrawerRef = import_react138.default.createRef();
      this.handleToggleTargetAttrOp = (isOpenTargetAttrOperator) => {
        this.setState({
          isOpenTargetAttrOperator
        });
      };
      this.handleSelectTargetAttrOp = (event, selection) => {
        this.setState({
          targetAttrCompOp: selection,
          isOpenTargetAttrOperator: false
        });
      };
      this.handleToggleRights = (isOpenRights) => {
        this.setState({
          isOpenRights
        });
      };
      this.handleSelectRights = (event, selection) => {
        this.setState({
          rightType: selection,
          isOpenRights: false
        });
      };
      this.onUsersDrawerExpand = () => {
        this.usersDrawerRef.current && this.usersDrawerRef.current.focus();
      };
      this.onTargetsDrawerExpand = () => {
        this.targetsDrawerRef.current && this.targetsDrawerRef.current.focus();
      };
      this.handleUsersDrawerClick = () => {
        const isUsersDrawerExpanded = !this.state.isUsersDrawerExpanded;
        this.setState({
          isUsersDrawerExpanded
        });
      };
      this.onTargetsDrawerClick = () => {
        const isTargetsDrawerExpanded = !this.state.isTargetsDrawerExpanded;
        this.setState({
          isTargetsDrawerExpanded
        });
      };
      this.handleUsersDrawerCloseClick = () => {
        this.setState({
          isUsersDrawerExpanded: false
        });
      };
      this.onTargetsDrawerCloseClick = () => {
        this.setState({
          isTargetsDrawerExpanded: false
        });
      };
      this.handleSearchClick = () => {
        if (this.state.isSearchRunning) {
          return;
        }
        this.setState({
          isSearchRunning: true,
          usersAvailableOptions: []
        }, this.getEntries);
      };
      this.handleTimeChange = (time_str, id) => {
        const time_val = time_str.replace(":", "");
        this.setState({
          [id]: time_val
        });
      };
      this.getEntries = () => {
        const searchArea = this.state.bindRuleType;
        const baseDn = this.state.usersSearchBaseDn;
        let filter = "";
        const pattern = this.state.searchPattern;
        if (searchArea === "userdn") {
          filter = pattern === "" ? "(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))" : `(&(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))(|(cn=*${pattern}*)(uid=${pattern})))`;
        } else if (searchArea === "groupdn") {
          filter = pattern === "" ? "(|(objectClass=groupofuniquenames)(objectClass=groupofnames))" : `(&(|(objectClass=groupofuniquenames)(objectClass=groupofnames))(cn=*${pattern}*))`;
        } else if (searchArea === "roledn") {
          filter = pattern === "" ? "(&(objectClass=ldapsubentry)(objectClass=nsRoleDefinition))" : `(&(objectClass=ldapsubentry)(objectClass=nsRoleDefinition)(cn=*${pattern}*))`;
        }
        const params = {
          serverId: this.props.editorLdapServer,
          searchBase: baseDn,
          searchFilter: filter,
          searchScope: "sub",
          sizeLimit: 2e3,
          timeLimit: 5,
          addNotification: this.props.addNotification
        };
        getSearchEntries(params, (resultArray) => {
          const results = resultArray.map((result) => {
            const info2 = JSON.parse(result);
            return info2.dn;
          });
          results.sort();
          const newOptionsArray = results.map((entryDN) => {
            const rdnInfo = getRdnInfo(entryDN);
            return /* @__PURE__ */ import_react138.default.createElement("span", { title: entryDN, key: entryDN }, rdnInfo.rdnVal);
          });
          this.setState({
            usersAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.handleRightsOnSelect = (event, isSelected, rowId) => {
        let rows;
        if (rowId === -1) {
          rows = this.state.rightsRows.map((oneRow) => {
            oneRow.selected = isSelected;
            return oneRow;
          });
        } else {
          rows = [...this.state.rightsRows];
          rows[rowId].selected = isSelected;
        }
        this.setState({
          rightsRows: rows
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.removeDuplicates = (options4) => {
        const titles = options4.map((item) => item.props.title);
        const noDuplicates = options4.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleUsersOnListChange = (newAvailableOptions, newChosenOptions) => {
        const newAvailNoDups = this.removeDuplicates(newAvailableOptions);
        const newChosenNoDups = this.removeDuplicates(newChosenOptions);
        this.setState({
          usersAvailableOptions: newAvailNoDups.sort(),
          usersChosenOptions: newChosenNoDups.sort()
        });
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          usersSearchBaseDn: treeViewItem.dn
        }, () => {
          if (!treeViewItem.children || treeViewItem.children.length === 0) {
            this.handleUsersDrawerCloseClick();
          }
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReachedVisual: this.state.stepIdReachedVisual < id ? id : this.state.stepIdReachedVisual,
          savedStepId: id
        }, this.handleBuildAciText());
        if (id === 2) {
          if (this.state.targetAttrRows.length > 0) {
            return;
          }
          getAttributesNameAndOid(this.props.editorLdapServer, (resArray) => {
            const targetAttrRows = resArray.map((item) => {
              return { cells: [item[0], item[1]], selected: false };
            });
            const attributeList = resArray.map((item) => {
              return item[0];
            });
            const tableModificationTime = Date.now();
            this.setState({
              attributeList,
              targetAttrRows,
              tableModificationTime
            });
          });
        } else if (id === 9) {
          this.addAciToEntry();
        }
      };
      this.handleBackVisual = ({ id }) => {
        this.setState({ savedStepId: id });
      };
      this.addAciToEntry = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push("add: aci");
        ldifArray.push(`aci: ${this.state.aciTextNew}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          this.props.refreshAciTable();
          this.setState({
            commandOutput: result.errorCode === 0 ? "Successfully added ACI!" : "Failed to add ACI, error: " + result.errorCode,
            resultVariant: result.errorCode === 0 ? "success" : "danger",
            adding: false
          }, () => {
            this.props.onReload();
          });
          const opInfo = {
            // This is what refreshes treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.handleResetACIText = () => {
        const orig = this.state.aciText;
        this.setState({
          aciTextNew: orig
        });
      };
      this.handleChange = (e) => {
        const target = e.target;
        const value = target.type === "checkbox" ? target.checked : target.value;
        const attr = target.id;
        this.setState({
          [attr]: value
        });
      };
      this.handleTextChange = (value) => {
        this.setState({
          aciTextNew: value
        });
      };
    }
    render() {
      const {
        aciText,
        aciTextNew,
        bindRuleRows,
        bindRuleType,
        dns,
        ip,
        isSearchRunning,
        isUsersDrawerExpanded,
        newAciName,
        rightsRows,
        savedStepId,
        searchPattern,
        stepIdReachedVisual,
        tableModificationTime,
        target,
        target_from,
        target_to,
        targetAttrRows,
        targetFilter,
        userattrAttr,
        usersAvailableOptions,
        usersChosenOptions,
        usersSearchBaseDn
      } = this.state;
      const aciNameComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Choose a name for this ACI, and set the Target")), /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top-xlg", hasGutter: true }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 1, className: "ds-label" }, "Name"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react138.default.createElement(
        TextInput,
        {
          validated: newAciName === "" ? ValidatedOptions.error : ValidatedOptions.default,
          id: "newAciName",
          value: newAciName,
          type: "text",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          "aria-label": "Text input ACI name",
          autoComplete: "off"
        }
      ))), /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top-xlg", hasGutter: true }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 1, className: "ds-label" }, "Target"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react138.default.createElement(
        TextInput,
        {
          validated: target === "" ? ValidatedOptions.error : ValidatedOptions.default,
          id: "target",
          value: target,
          type: "text",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          "aria-label": "Text input ACI target",
          autoComplete: "off"
        }
      ))));
      const usersPanelContent = /* @__PURE__ */ import_react138.default.createElement(DrawerPanelContent, { isResizable: true }, /* @__PURE__ */ import_react138.default.createElement(DrawerHead, null, /* @__PURE__ */ import_react138.default.createElement("span", { tabIndex: isUsersDrawerExpanded ? 0 : -1, ref: this.usersDrawerRef }, /* @__PURE__ */ import_react138.default.createElement("strong", null, "LDAP Tree")), /* @__PURE__ */ import_react138.default.createElement(DrawerActions, null, /* @__PURE__ */ import_react138.default.createElement(DrawerCloseButton, { onClick: this.handleUsersDrawerCloseClick }))), /* @__PURE__ */ import_react138.default.createElement(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react138.default.createElement(CardBody, null, /* @__PURE__ */ import_react138.default.createElement(
        ldapNavigator_default,
        {
          treeItems: [...this.props.treeViewRootSuffixes],
          editorLdapServer: this.props.editorLdapServer,
          skipLeafEntries: true,
          handleNodeOnClick: this.onBaseDnSelection,
          showTreeLoadingState: this.showTreeLoadingState
        }
      ))));
      const userDrawerContent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(Divider, null), /* @__PURE__ */ import_react138.default.createElement("div", { className: "ds-margin-bottom-md" }), /* @__PURE__ */ import_react138.default.createElement(
        DualListSelector,
        {
          availableOptions: usersAvailableOptions,
          chosenOptions: usersChosenOptions,
          availableOptionsTitle: "Available Entries",
          chosenOptionsTitle: "Chosen Entries",
          onListChange: this.handleUsersOnListChange,
          id: "usersSelector",
          className: "ds-aci-dual-select"
        }
      ));
      const usersComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, isSearchRunning && /* @__PURE__ */ import_react138.default.createElement("center", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(Spinner, { size: "sm" }), "\xA0\xA0Searching database ..."), !isSearchRunning && /* @__PURE__ */ import_react138.default.createElement(
        SearchInput,
        {
          placeholder: "Search for entries ...",
          value: searchPattern,
          onChange: (evt, val) => this.handleSearchPattern(val),
          onClear: () => this.handleSearchPattern(""),
          onSearch: this.handleSearchClick,
          className: "ds-search-input"
        }
      ), /* @__PURE__ */ import_react138.default.createElement("div", { className: "ds-margin-bottom-md" }), /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, null, "Search Base:", /* @__PURE__ */ import_react138.default.createElement(
        Text,
        {
          className: "ds-left-margin",
          component: TextVariants.a,
          onClick: this.handleUsersDrawerClick,
          href: "#"
        },
        usersSearchBaseDn
      ))), /* @__PURE__ */ import_react138.default.createElement(Drawer, { className: "ds-margin-top", isExpanded: isUsersDrawerExpanded }, /* @__PURE__ */ import_react138.default.createElement(DrawerContent, { panelContent: usersPanelContent }, /* @__PURE__ */ import_react138.default.createElement(DrawerContentBody, null, userDrawerContent))));
      const bindRulesComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Define the Bind Rules", /* @__PURE__ */ import_react138.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react138.default.createElement("div", null, 'The bind rules in an ACI define the required bind parameters that must meet so that Directory Server applies the ACI. For example user-based access uses the "userdn" bind rule, while group access uses "groupdn" bind rule.  There are other combinations that are possible, as well as defining the authentication method allowed or the connection security level. Please see the Administration Guide for more information.')
        },
        /* @__PURE__ */ import_react138.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react138.default.createElement(
        aciBindRuleTable_default,
        {
          key: this.state.bindRuleRows,
          rows: this.state.bindRuleRows,
          removeRow: this.removeBindRuleRow
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Button,
        {
          className: "ds-margin-top-lg",
          variant: "primary",
          onClick: this.handleOpenAddBindRule,
          isSmall: true
        },
        "Add Bind Rule"
      ));
      const rightsComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Choose the Rights to Allow or Deny", /* @__PURE__ */ import_react138.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react138.default.createElement("div", null, "This section defines what permissions and rights are allowed/denied by this ACI.")
        },
        /* @__PURE__ */ import_react138.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react138.default.createElement(
        Select,
        {
          variant: SelectVariant.single,
          className: "ds-margin-top-lg",
          "aria-label": "Select rights",
          onToggle: this.handleToggleRights,
          onSelect: this.handleSelectRights,
          selections: this.state.rightType,
          isOpen: this.state.isOpenRights
        },
        /* @__PURE__ */ import_react138.default.createElement(SelectOption, { key: "allow", value: "allow" }),
        /* @__PURE__ */ import_react138.default.createElement(SelectOption, { key: "deny", value: "deny" })
      ), /* @__PURE__ */ import_react138.default.createElement(
        Table,
        {
          onSelect: this.handleRightsOnSelect,
          "aria-label": "Selectable Table User Rights",
          cells: this.rightsColumns,
          rows: rightsRows,
          variant: "compact",
          borders: false,
          className: "ds-margin-top-lg"
        },
        /* @__PURE__ */ import_react138.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react138.default.createElement(TableBody, null)
      ));
      const targetAttrComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Choose the Target Attributes", /* @__PURE__ */ import_react138.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react138.default.createElement("div", null, 'You can control what entry attributes are affected by an ACI. If no target attributes are defined then all attributes are impacted by the ACI.  It is strongly discouraged to use the comparison operator "!=" when defining target attributes because it implicitly allows access all the other attributes in the entry (including operational attributes).  This is a potential unintended security risk. Instead, just use "=" to only open up the attributes you want the ACI to allow.')
        },
        /* @__PURE__ */ import_react138.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react138.default.createElement("div", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react138.default.createElement("div", { className: "ds-inline ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement("b", null, "Comparison Operator")), /* @__PURE__ */ import_react138.default.createElement("div", { className: "ds-inline ds-left-margin ds-raise-field-md" }, /* @__PURE__ */ import_react138.default.createElement(
        Select,
        {
          variant: SelectVariant.single,
          "aria-label": "Select auth compare operator",
          onToggle: this.handleToggleTargetAttrOp,
          onSelect: this.handleSelectTargetAttrOp,
          selections: this.state.targetAttrCompOp,
          isOpen: this.state.isOpenTargetAttrOperator
        },
        /* @__PURE__ */ import_react138.default.createElement(SelectOption, { key: "targetattrequals", value: "=" }),
        /* @__PURE__ */ import_react138.default.createElement(SelectOption, { key: "targetattrequals", value: "!=" })
      ))), /* @__PURE__ */ import_react138.default.createElement(
        genericPagination_default,
        {
          columns: this.targetsColumns,
          rows: targetAttrRows,
          actions: null,
          isSelectable: true,
          canSelectAll: false,
          enableSorting: true,
          tableModificationTime,
          handleSelectedAttrs: this.onSelectedAttrs,
          isSearchable: true
        }
      ), targetAttrRows.length === 0 && // <div className="ds-margin-bottom-md" />
      /* @__PURE__ */ import_react138.default.createElement(Bullseye, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react138.default.createElement("center", null, /* @__PURE__ */ import_react138.default.createElement(Spinner, { size: "lg" }))));
      const targetFilterComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Target Filter", /* @__PURE__ */ import_react138.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react138.default.createElement("div", null, "Optionally set an LDAP search filter to further refine which entries this ACI will be applied to. Warning, using targetFilters can impact the server's performance and should be used sparingly.")
        },
        /* @__PURE__ */ import_react138.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react138.default.createElement(Form, { className: "ds-margin-top-xlg", autoComplete: "off" }, /* @__PURE__ */ import_react138.default.createElement(Grid, null, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Target Filter"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react138.default.createElement(
        TextInput,
        {
          id: "targetFilter",
          "aria-label": "Add target filter",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          value: targetFilter,
          validated: targetFilter !== "" && !valid_filter(targetFilter) ? ValidatedOptions.error : ValidatedOptions.default
        }
      ), /* @__PURE__ */ import_react138.default.createElement(FormHelperText, { isError: true, isHidden: targetFilter === "" || valid_filter(targetFilter) }, "The filter must be enclosed with parentheses")))));
      const moddnComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Moving Entries", /* @__PURE__ */ import_react138.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react138.default.createElement("div", null, "If you need to control access for moving an entry between specific subtrees then use the target_from and target_to keywords. These keywords use LDAP URL's to specify the database resources/locations: ldap:///uid=*,cn=staging,dc=example,dc=com, ldap:///ou=people,dc=example,dc=com")
        },
        /* @__PURE__ */ import_react138.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react138.default.createElement(Form, { className: "ds-margin-top-xlg", autoComplete: "off" }, /* @__PURE__ */ import_react138.default.createElement(Grid, null, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2, className: "ds-label", title: "Specifies the entries that can be moved.  Example: ldap:///uid=*,cn=staging,dc=example,dc=com" }, "Target From"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react138.default.createElement(
        TextInput,
        {
          id: "target_from",
          "aria-label": "Add target_from",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          value: target_from,
          validated: target_from !== "" && !isValidLDAPUrl(target_from) ? ValidatedOptions.error : ValidatedOptions.default
        }
      ), /* @__PURE__ */ import_react138.default.createElement(FormHelperText, { isError: true, isHidden: target_from === "" || isValidLDAPUrl(target_from) }, 'The LDAP URL must start with "ldap:///"')), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2, className: "ds-label", title: "Specifies where the entries can be moved to.  Example: ldap:///ou=people,dc=example,dc=com" }, "Target To"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react138.default.createElement(
        TextInput,
        {
          id: "target_to",
          "aria-label": "Add target_to",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          value: target_to,
          validated: target_to !== "" && !isValidLDAPUrl(target_to) ? ValidatedOptions.error : ValidatedOptions.default
        }
      ), /* @__PURE__ */ import_react138.default.createElement(FormHelperText, { isError: true, isHidden: target_to === "" || isValidLDAPUrl(target_to) }, 'The LDAP URL must start with "ldap:///"')))));
      const timesComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Define Day and Time Restrictions", /* @__PURE__ */ import_react138.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react138.default.createElement("div", null, "These bind rules control access based off of specific days or times. If no days are selected then all the days of the week are assumed.")
        },
        /* @__PURE__ */ import_react138.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react138.default.createElement(TextContent, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h4 }, "Choose Days To Allow Access")), /* @__PURE__ */ import_react138.default.createElement("div", { className: "ds-margin-top ds-margin-left" }, /* @__PURE__ */ import_react138.default.createElement(
        Checkbox,
        {
          className: "",
          label: "Sunday",
          isChecked: this.state.sunday,
          onChange: (checked, e) => this.handleChange(e),
          "aria-label": "Sunday",
          id: "sunday"
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Checkbox,
        {
          className: "",
          label: "Monday",
          isChecked: this.state.monday,
          onChange: (checked, e) => this.handleChange(e),
          "aria-label": "monday",
          id: "monday"
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Checkbox,
        {
          className: "",
          label: "Tuesday",
          isChecked: this.state.tuesday,
          onChange: (checked, e) => this.handleChange(e),
          "aria-label": "Tuesday",
          id: "tuesday"
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Checkbox,
        {
          className: "",
          label: "Wednesday",
          isChecked: this.state.wednesday,
          onChange: (checked, e) => this.handleChange(e),
          "aria-label": "wednesday",
          id: "wednesday"
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Checkbox,
        {
          className: "",
          label: "Thursday",
          isChecked: this.state.thursday,
          onChange: (checked, e) => this.handleChange(e),
          "aria-label": "thursday",
          id: "thursday"
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Checkbox,
        {
          className: "",
          label: "Friday",
          isChecked: this.state.friday,
          onChange: (checked, e) => this.handleChange(e),
          "aria-label": "friday",
          id: "friday"
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Checkbox,
        {
          className: "",
          label: "Saturday",
          isChecked: this.state.saturday,
          onChange: (checked, e) => this.handleChange(e),
          "aria-label": "saturday",
          id: "saturday"
        }
      )), /* @__PURE__ */ import_react138.default.createElement(TextContent, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h4 }, "Time Range Restrictions")), /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top-lg ds-margin-left" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2, className: "ds-label", title: "First part of the time range" }, "Time Start"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react138.default.createElement(
        FormSelect,
        {
          id: "timeStartCompOp",
          value: this.state.timeStartCompOp,
          onChange: (str, e) => {
            this.handleChange(e);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: ">", label: ">", value: ">" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "<", label: "<", value: "<" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: ">=", label: ">=", value: ">=" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "<=", label: "<=", value: "<=" })
      )), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react138.default.createElement(
        TimePicker,
        {
          className: "ds-left-margin",
          time: this.state.timeOfDayStart,
          is24Hour: true,
          onChange: (val) => this.handleTimeChange(val, "timeOfDayStart")
        }
      ))), /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top ds-margin-left" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2, className: "ds-label", title: "Second part of the time range" }, "Time End"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react138.default.createElement(
        FormSelect,
        {
          id: "timeEndCompOp",
          value: this.state.timeEndCompOp,
          onChange: (str, e) => {
            this.handleChange(e);
          },
          "aria-label": "FormSelect Input"
        },
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: ">", label: ">", value: ">" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "<", label: "<", value: "<" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: ">=", label: ">=", value: ">=" }),
        /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "<=", label: "<=", value: "<=" })
      )), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react138.default.createElement(
        TimePicker,
        {
          className: "ds-left-margin",
          time: this.state.timeOfDayEnd,
          is24Hour: true,
          onChange: (val) => this.handleTimeChange(val, "timeOfDayEnd")
        }
      ))));
      const reviewComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(TextContent, null, /* @__PURE__ */ import_react138.default.createElement(Text, { component: TextVariants.h3 }, "Review & Edit", /* @__PURE__ */ import_react138.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react138.default.createElement("div", null, "Review the new ACI, and make any edits as needed, but once you edit the ACI you can not go back to the previous wizard steps without undoing your changes.")
        },
        /* @__PURE__ */ import_react138.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react138.default.createElement(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react138.default.createElement(Card, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react138.default.createElement(CardBody, { className: "ds-indent" }, /* @__PURE__ */ import_react138.default.createElement(
        TextArea,
        {
          className: "ds-textarea",
          id: "aciTextNew",
          value: aciTextNew,
          onChange: this.handleTextChange,
          "aria-label": "aci text edit area",
          autoResize: true,
          resizeOrientation: "vertical"
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Button,
        {
          className: "ds-margin-top",
          key: "undo",
          variant: "primary",
          onClick: this.handleResetACIText,
          isDisabled: aciText === aciTextNew,
          isSmall: true
        },
        "Undo Changes"
      ))));
      const resultComponent = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react138.default.createElement(
        Alert,
        {
          variant: this.state.resultVariant,
          isInline: true,
          title: "Result for ACI addition"
        },
        this.state.resultVariant === "success" ? "Successfully added ACI" : this.state.commandOutput,
        this.state.adding && /* @__PURE__ */ import_react138.default.createElement("div", null, /* @__PURE__ */ import_react138.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding ACI ...")
      )), this.state.resultVariant === "danger" && /* @__PURE__ */ import_react138.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react138.default.createElement(CardTitle, null, "ACI Value"), /* @__PURE__ */ import_react138.default.createElement(CardBody, null, aciTextNew)));
      const newAciStepsVisual = [
        {
          id: 1,
          name: "ACI Name & Target",
          component: aciNameComponent,
          canJumpTo: stepIdReachedVisual >= 1 && aciText === aciTextNew,
          enableNext: newAciName !== "" && target !== ""
        },
        {
          id: 2,
          name: "Target Attributes",
          component: targetAttrComponent,
          canJumpTo: stepIdReachedVisual >= 2 && aciText === aciTextNew
        },
        {
          id: 3,
          name: "Target Filter",
          component: targetFilterComponent,
          canJumpTo: stepIdReachedVisual >= 3 && aciText === aciTextNew,
          enableNext: targetFilter === "" || targetFilter !== "" && valid_filter(targetFilter)
        },
        {
          id: 4,
          name: "Moving Entries",
          component: moddnComponent,
          canJumpTo: stepIdReachedVisual >= 4 && aciText === aciTextNew,
          enableNext: (target_from === "" || (target_from === "" || target_from !== "" && isValidLDAPUrl(target_from))) && (target_to === "" || (target_to === "" || target_to !== "" && isValidLDAPUrl(target_to))) && (target_to === "" && target_from === "" || target_to !== "" && target_from !== "")
        },
        {
          id: 5,
          name: "Access Rights",
          component: rightsComponent,
          canJumpTo: stepIdReachedVisual >= 5 && aciText === aciTextNew,
          enableNext: rightsRows.filter((item) => item.selected).map((cells) => cells.cells[0]).toString() !== ""
        },
        {
          id: 6,
          name: "Bind Rules",
          component: bindRulesComponent,
          canJumpTo: stepIdReachedVisual >= 6 && aciText === aciTextNew,
          enableNext: bindRuleRows.length > 0
        },
        {
          id: 7,
          name: "Days & Times",
          component: timesComponent,
          canJumpTo: stepIdReachedVisual >= 7 && aciText === aciTextNew
        },
        {
          id: 8,
          name: "Review & Edit",
          component: reviewComponent,
          nextButtonText: "Add ACI",
          canJumpTo: stepIdReachedVisual >= 8,
          hideBackButton: this.state.aciText !== this.state.aciTextNew
        },
        {
          id: 9,
          name: "Result",
          component: resultComponent,
          nextButtonText: "Finish",
          canJumpTo: stepIdReachedVisual >= 9,
          hideBackButton: true,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, "ACI: \xA0\xA0", /* @__PURE__ */ import_react138.default.createElement("strong", null, this.state.aciText));
      return /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBackVisual,
          onGoToStep: this.handleBuildAciText,
          startAtStep: savedStepId,
          title: "Add a new Access Control Instruction",
          description: this.state.savedStepId < 2 ? "" : title,
          steps: newAciStepsVisual
        }
      ), /* @__PURE__ */ import_react138.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Add Bind Rule",
          isOpen: this.state.showAddBindRuleModal,
          onClose: this.handleCloseAddBindRuleModal,
          actions: [
            /* @__PURE__ */ import_react138.default.createElement(
              Button,
              {
                key: "add",
                variant: "primary",
                onClick: this.handleAddBindRule,
                isDisabled: bindRuleType.endsWith("dn") && usersChosenOptions.length === 0 || bindRuleType === "dns" && !isValidHostname(dns) || bindRuleType === "ip" && !isValidIpAddress(ip) || bindRuleType === "userattr" && userattrAttr === ""
              },
              "Add Bind Rule"
            ),
            /* @__PURE__ */ import_react138.default.createElement(
              Button,
              {
                key: "cancel",
                variant: "link",
                onClick: this.handleCloseAddBindRuleModal
              },
              "Cancel"
            )
          ]
        },
        /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Choose Bind Rule"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "bindRuleType", value: bindRuleType, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, this.state.specialSelection === "" && !this.state.haveUserAttrRules && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "userdn", label: "User DN (userdn)", value: "userdn", title: "Bind rules for user entries" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "groupdn", label: "Group DN (groupdn)", value: "groupdn", title: "Bind rules for groups" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "roledn", label: "Role DN (roledn)", value: "roledn", title: "Bind rules for Roles" })), !this.state.haveUserRules && !this.state.haveUserAttrRules && /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "special", label: "User DN Aliases (userdn)", value: "User DN Aliases", title: "Special bind rules for user DN catagories" }), !this.state.haveUserRules && !this.state.haveUserAttrRules && /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "userattr", label: "User Attribute (userattr)", value: "userattr", title: "Bind rule to specify which attribute must match between the entry used to bind to the directory and the targeted entry" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "authmethod", label: "Authentication Method (authmethod)", value: "authmethod", title: "Specify the authentication methods to restrict" }), this.state.ssf === "" && /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "ssf", label: "Connection Security (ssf)", value: "ssf", title: "Specify the connection security strength factor (ssf)" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "ip", label: "IP Address (ip)", value: "ip", title: "Specify an IP address or range to restrict" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "hostname", label: "Hostname (dns)", value: "dns", title: "Specify a hostname or domain to restrict" })))),
        bindRuleType === "User DN Aliases" && /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Select Alias URL"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "specialSelection", value: this.state.specialSelection, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "anyone", label: "ldap:///anyone", value: "ldap:///anyone", title: "Grants Anonymous Access" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "all", label: "ldap:///all", value: "ldap:///all", title: "Grants Access to Authenticated Users" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "self", label: "ldap:///self", value: "ldap:///self", title: "Enables Users to Access Their Own Entries" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "parent", label: "ldap:///parent", value: "ldap:///parent", title: "Grants Access for Child Entries of a User" })))),
        bindRuleType.endsWith("dn") && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Choose Comparator"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "bindRuleOperator", value: bindRuleType, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" })))), /* @__PURE__ */ import_react138.default.createElement(Card, { isSelectable: true, className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(CardBody, null, usersComponent))),
        bindRuleType === "ip" && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label" }, "IP Address"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "ipOperator", value: this.state.ipOperator, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" }))), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 7, className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(
          TextInput,
          {
            id: "ip",
            "aria-label": "Add IP restriction",
            onChange: (str, e) => {
              this.handleChange(e);
            },
            value: ip,
            autoComplete: "off",
            validated: ip === "" || ip !== "" && !isValidIpAddress(ip) ? ValidatedOptions.error : ValidatedOptions.default
          }
        ), (ip === "" || !isValidIpAddress(ip)) && /* @__PURE__ */ import_react138.default.createElement(HelperText, { className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(HelperTextItem, { variant: "error" }, "Invalid format for IP address"))))),
        bindRuleType === "dns" && /* @__PURE__ */ import_react138.default.createElement(import_react138.default.Fragment, null, /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Hostname"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "dnsOperator", value: this.state.dnsOperator, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" }))), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 7, className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(
          TextInput,
          {
            id: "dns",
            "aria-label": "Add Hostname restriction",
            onChange: (str, e) => {
              this.handleChange(e);
            },
            value: dns,
            validated: dns === "" || dns !== "" && !isValidHostname(dns) ? ValidatedOptions.error : ValidatedOptions.default,
            autoComplete: "off"
          }
        ), (dns === "" || !isValidHostname(dns)) && /* @__PURE__ */ import_react138.default.createElement(HelperText, { className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(HelperTextItem, { variant: "error" }, "Invalid format for hostname"))))),
        bindRuleType === "authmethod" && /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Authentication Method"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react138.default.createElement(
          FormSelect,
          {
            id: "authMethodOperator",
            value: this.state.authMethodOperator,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" })
        )), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 7, className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "authmethod", value: this.state.authmethod, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "none", value: "none", label: "none" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "simple", value: "simple", label: "simple" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "SSL", value: "SSL", label: "SSL" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "SASL", value: "SASL", label: "SASL" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "LDAPI", value: "LDAPI", label: "LDAPI" })))),
        bindRuleType === "ssf" && /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label", title: "Security Strength Factor (ssf) - encryption key strength" }, "Connection Security"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react138.default.createElement(
          FormSelect,
          {
            id: "ssfOperator",
            value: this.state.ssfOperator,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: ">", label: ">", value: ">" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "<", label: "<", value: "<" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: ">=", label: ">=", value: ">=" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "<=", label: "<=", value: "<=" })
        )), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 7, className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(
          FormSelect,
          {
            id: "ssf",
            value: this.state.ssf,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "0", label: "0", value: "0", title: "No connection security restrictions" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "128", label: "128", value: "128" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "192", label: "192", value: "192" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "256", label: "256", value: "256" })
        ))),
        bindRuleType === "userattr" && /* @__PURE__ */ import_react138.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 3, className: "ds-label" }, "User Attribute"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react138.default.createElement(
          FormSelect,
          {
            id: "userattrOperator",
            value: this.state.userattrOperator,
            onChange: (str, e) => {
              this.handleChange(e);
            },
            "aria-label": "FormSelect Input"
          },
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "=", label: "=", value: "=" }),
          /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "!=", label: "!=", value: "!=" })
        )), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 5, className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "userattrAttr", value: this.state.userattrAttr, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { value: "", label: "Select an attribute", isPlaceholder: true }), this.state.attributeList.map((attr, index) => /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr })))), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 2, className: "ds-left-margin" }, /* @__PURE__ */ import_react138.default.createElement(FormSelect, { id: "userattrBindType", value: this.state.userattrBindType, onChange: (str, e) => {
          this.handleChange(e);
        }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "USERDN", value: "USERDN", label: "USERDN" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "GROUPDN", value: "GROUPDN", label: "GROUPDN" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "ROLEDN", value: "ROLEDN", label: "ROLEDN" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "SELFDN", value: "SELFDN", label: "SELFDN" }), /* @__PURE__ */ import_react138.default.createElement(FormSelectOption, { key: "LDAPURL", value: "LDAPURL", label: "LDAPURL" }))), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 12, className: "ds-margin-top ds-label", title: "Extend the application of the ACI several levels below the targeted entry. This is possible by specifying the number of levels below the target that should inherit the ACI." }, "Inheritance Levels"), /* @__PURE__ */ import_react138.default.createElement(GridItem, { span: 12, className: "ds-left-indent ds-margin-top" }, /* @__PURE__ */ import_react138.default.createElement(
          Checkbox,
          {
            className: "",
            label: "0",
            isChecked: this.state.userAttrParent0,
            onChange: (checked, e) => this.handleChange(e),
            "aria-label": "0",
            id: "userAttrParent0",
            title: "Default value, this userattr bind rule only applies to the target entry (no child entries)."
          }
        ), /* @__PURE__ */ import_react138.default.createElement(
          Checkbox,
          {
            className: "",
            label: "1",
            isChecked: this.state.userAttrParent1,
            onChange: (checked, e) => this.handleChange(e),
            "aria-label": "1",
            id: "userAttrParent1"
          }
        ), /* @__PURE__ */ import_react138.default.createElement(
          Checkbox,
          {
            className: "",
            label: "2",
            isChecked: this.state.userAttrParent2,
            onChange: (checked, e) => this.handleChange(e),
            "aria-label": "2",
            id: "userAttrParent2"
          }
        ), /* @__PURE__ */ import_react138.default.createElement(
          Checkbox,
          {
            className: "",
            label: "3",
            isChecked: this.state.userAttrParent3,
            onChange: (checked, e) => this.handleChange(e),
            "aria-label": "3",
            id: "userAttrParent3"
          }
        ), /* @__PURE__ */ import_react138.default.createElement(
          Checkbox,
          {
            className: "",
            label: "4",
            isChecked: this.state.userAttrParent4,
            onChange: (checked, e) => this.handleChange(e),
            "aria-label": "4",
            id: "userAttrParent4"
          }
        )))
      ));
    }
  };
  var aciNew_default = AddNewAci;

  // src/lib/ldap_editor/wizards/aci.jsx
  var AciWizard = class extends import_react139.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "buildAciTable", (firstLoad) => {
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn: this.props.wizardEntryDn
        };
        retrieveAllAcis(params, (resultArray) => {
          const rows = [];
          const columns = [...this.state.columns];
          const actions = this.state.actions;
          let count = 0;
          if (resultArray.length !== 0) {
            const myAciArray = [...resultArray[0].aciArray];
            for (const anAci of myAciArray) {
              const aciName = getAciActualName(anAci);
              const aciAllow = isAciPermissionAllow(anAci);
              rows.push({
                isOpen: false,
                cells: [aciName, aciAllow ? "allow" : "deny"],
                fullAci: anAci
              });
              rows.push({
                parent: count,
                fullWidth: true,
                cells: [anAci]
              });
              count += 2;
            }
          }
          this.setState({
            rows,
            columns,
            actions
          }, () => {
            if (!firstLoad) {
              this.props.onReload();
            }
          });
        });
      });
      __publicField(this, "handleToggleWizard", () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      });
      __publicField(this, "onToggleWizard", () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      });
      __publicField(this, "handleToggleManual", () => {
        this.setState({
          isManualOpen: !this.state.isManualOpen,
          aciTextNew: "",
          modalSpinning: false
        });
      });
      this.state = {
        firstLoad: true,
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "ACI Name", transforms: [sortable], cellFormatters: [expandable] },
          { title: "ACI Rule Type", transforms: [sortable] }
        ],
        actions: [
          {
            title: "Edit ACI",
            onClick: (event, rowId, rowData, extra) => this.showEditAci(rowData)
          },
          {
            isSeparator: true
          },
          {
            title: "Remove ACI",
            onClick: (event, rowId, rowData, extra) => this.showDeleteConfirm(rowData)
          }
        ],
        isWizardOpen: false,
        isManualOpen: false,
        showModal: true,
        showConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false,
        showEditAci: false,
        attrName: "",
        aciText: "",
        aciTextNew: ""
      };
      this.onToggle = (isOpen) => {
        this.setState({
          isOpen
        });
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleCloseModal = () => {
        this.setState({
          showModal: false
        });
      };
      this.onChange = (e) => {
        const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
        this.setState({
          [e.target.id]: value
        });
      };
      this.showDeleteConfirm = (rowData) => {
        this.setState({
          aciText: rowData.fullAci,
          aciName: rowData.cells[0],
          showDeleteConfirm: true,
          modalChecked: false,
          modalSpinning: false
        });
      };
      this.closeDeleteConfirm = (rowData) => {
        this.setState({
          aciText: "",
          showDeleteConfirm: false,
          modalChecked: false,
          modalSpinning: false
        });
      };
      this.showEditAci = (rowData) => {
        this.setState({
          aciText: rowData.fullAci,
          aciTextNew: rowData.fullAci,
          showEditAci: true,
          modalChecked: false,
          modalSpinning: false
        });
      };
      this.handleCloseEditAci = () => {
        this.setState({
          showEditAci: false
        });
      };
      this.handleResetACIText = () => {
        const orig = this.state.aciText;
        this.setState({
          aciTextNew: orig
        });
      };
      this.handleSaveACI = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push("delete: aci");
        ldifArray.push(`aci: ${this.state.aciText}`);
        ldifArray.push("-");
        ldifArray.push(`add: aci`);
        ldifArray.push(`aci: ${this.state.aciTextNew}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          if (result.errorCode === 0) {
            this.props.addNotification(
              "success",
              `Successfully replace ACI`
            );
            this.buildAciTable();
          } else {
            this.props.addNotification(
              "error",
              `Failed to update ACI: error ${result.errorCode} - ${result.output}`
            );
          }
          this.handleCloseEditAci();
          const opInfo = {
            // This is what refreshes treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.deleteACI = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push("delete: aci");
        ldifArray.push(`aci: ${this.state.aciText}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          if (result.errorCode === 0) {
            this.props.addNotification(
              "success",
              `Successfully removed ACI`
            );
            this.buildAciTable();
          } else {
            this.props.addNotification(
              "error",
              `Failed to remove ACI: error ${result.errorCode} - ${result.output}`
            );
          }
          this.closeDeleteConfirm();
          const opInfo = {
            // This is what refreshes treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.handleAddAciManual = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push(`add: aci`);
        ldifArray.push(`aci: ${this.state.aciTextNew}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          if (result.errorCode === 0) {
            this.props.addNotification(
              "success",
              `Successfully added ACI`
            );
            this.buildAciTable();
          } else {
            this.props.addNotification(
              "error",
              `Failed to add ACI: error ${result.errorCode} - ${result.output}`
            );
          }
          this.handleToggleManual();
          const opInfo = {
            // This is what refreshes the treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollpase = this.handleCollpase.bind(this);
    }
    // End constructor
    componentDidMount() {
      this.buildAciTable(this.state.firstLoad);
      this.setState({
        firstLoad: false
      });
    }
    handleCollpase(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (const aci of this.state.rows) {
        if (aci.cells[1]) {
          sorted_rows.push({
            name: aci.cells[0],
            type: aci.cells[1],
            fullAci: aci.fullAci
          });
        }
      }
      if (index === 1) {
        sorted_rows.sort((a2, b) => a2.name > b.name ? 1 : -1);
      } else {
        sorted_rows.sort((a2, b) => a2.type > b.type ? 1 : -1);
      }
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const aci of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [aci.name, aci.type],
          fullAci: aci.fullAci
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [aci.fullAci]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy, showModal, actions, modalSpinning } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      let tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      let btnName = "Save ACI";
      const extraPrimaryProps = {};
      if (modalSpinning) {
        btnName = "Saving ACI ...";
        extraPrimaryProps.spinnerAriaValueText = "Loading";
      }
      const title = "Manage ACI's For " + this.props.wizardEntryDn;
      let cols = columns;
      if (rows.length === 0) {
        tableRows = [{ cells: ["No ACI's"] }];
        cols = [{ title: "Access Control Instructions" }];
      }
      return /* @__PURE__ */ import_react139.default.createElement(import_react139.default.Fragment, null, /* @__PURE__ */ import_react139.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          className: "ds-modal-select",
          title,
          isOpen: showModal,
          onClose: this.handleCloseModal,
          actions: [
            /* @__PURE__ */ import_react139.default.createElement(
              Button,
              {
                key: "acc aci",
                variant: "primary",
                onClick: this.handleToggleWizard
              },
              "Add ACI Wizard"
            ),
            /* @__PURE__ */ import_react139.default.createElement(
              Button,
              {
                key: "acc aci manual",
                variant: "primary",
                onClick: this.handleToggleManual
              },
              "Add ACI Manually"
            ),
            /* @__PURE__ */ import_react139.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseModal }, "Close")
          ]
        },
        /* @__PURE__ */ import_react139.default.createElement(
          Table,
          {
            className: "ds=margin-top-lg",
            "aria-label": "Expandable table",
            cells: cols,
            rows: tableRows,
            actions: rows.length > 0 ? actions : null,
            onCollapse: this.handleCollpase,
            variant: TableVariant.compact,
            sortBy,
            onSort: this.handleSort,
            key: tableRows
          },
          /* @__PURE__ */ import_react139.default.createElement(TableHeader, null),
          /* @__PURE__ */ import_react139.default.createElement(TableBody, null)
        ),
        rows.length > 0 && /* @__PURE__ */ import_react139.default.createElement(
          Pagination,
          {
            itemCount: rows.length / 2,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: PaginationVariant.bottom,
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        ),
        /* @__PURE__ */ import_react139.default.createElement("div", { className: "ds-margin-top-xlg" }),
        this.state.isWizardOpen && /* @__PURE__ */ import_react139.default.createElement(
          aciNew_default,
          {
            wizardEntryDn: this.props.wizardEntryDn,
            editorLdapServer: this.props.editorLdapServer,
            onReload: this.props.onReload,
            refreshAciTable: this.buildAciTable,
            isWizardOpen: this.state.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            addNotification: this.props.addNotification
          }
        ),
        /* @__PURE__ */ import_react139.default.createElement(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteConfirm,
            closeHandler: this.closeDeleteConfirm,
            handleChange: this.onChange,
            actionHandler: this.deleteACI,
            spinning: modalSpinning,
            item: this.state.aciName,
            checked: this.state.modalChecked,
            mTitle: "Delete ACI",
            mMsg: "Are you sure you want to delete this ACI?",
            mSpinningMsg: "Deleting ...",
            mBtnName: "Delete ACI"
          }
        )
      ), /* @__PURE__ */ import_react139.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Edit ACI",
          isOpen: this.state.showEditAci,
          onClose: this.handleCloseEditAci,
          actions: [
            /* @__PURE__ */ import_react139.default.createElement(
              Button,
              {
                key: "acc aci",
                variant: "primary",
                onClick: this.handleSaveACI,
                isLoading: modalSpinning,
                spinnerAriaValueText: modalSpinning ? "Loading" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.state.aciText === this.state.aciTextNew || modalSpinning
              },
              btnName
            ),
            /* @__PURE__ */ import_react139.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleCloseEditAci }, "Close")
          ]
        },
        /* @__PURE__ */ import_react139.default.createElement(
          TextArea,
          {
            className: "ds-textarea",
            id: "aciTextNew",
            value: this.state.aciTextNew,
            onChange: (str, e) => {
              this.onChange(e);
            },
            "aria-label": "aci text edit area",
            autoResize: true,
            resizeOrientation: "vertical"
          }
        ),
        /* @__PURE__ */ import_react139.default.createElement(
          Button,
          {
            className: "ds-margin-top",
            key: "reset",
            variant: "secondary",
            onClick: this.handleResetACIText,
            isDisabled: this.state.aciText === this.state.aciTextNew,
            isSmall: true
          },
          "Reset ACI"
        )
      ), /* @__PURE__ */ import_react139.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Add ACI Manually",
          isOpen: this.state.isManualOpen,
          onClose: this.handleToggleManual,
          actions: [
            /* @__PURE__ */ import_react139.default.createElement(
              Button,
              {
                key: "acc aci manual add",
                variant: "primary",
                onClick: this.handleAddAciManual,
                isLoading: modalSpinning,
                spinnerAriaValueText: modalSpinning ? "Loading" : void 0,
                ...extraPrimaryProps,
                isDisabled: this.state.aciTextNew === "" || modalSpinning
              },
              btnName
            ),
            /* @__PURE__ */ import_react139.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleToggleManual }, "Close")
          ]
        },
        /* @__PURE__ */ import_react139.default.createElement(
          TextArea,
          {
            className: "ds-textarea",
            id: "aciTextNew",
            value: this.state.aciTextNew,
            onChange: (str, e) => {
              this.onChange(e);
            },
            "aria-label": "aci text edit area",
            autoResize: true,
            resizeOrientation: "vertical",
            placeholder: "Enter ACI ..."
          }
        )
      ));
    }
  };
  var aci_default = AciWizard;

  // src/lib/ldap_editor/wizards/cos.jsx
  var import_react143 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/addCosDefinition.jsx
  var import_react142 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/addCosTemplate.jsx
  var import_react141 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/editableTable.jsx
  var import_react140 = __toESM(require_react(), 1);
  var import_prop_types109 = __toESM(require_prop_types(), 1);
  var EditableTable = class extends import_react140.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onTextInputChange", (newValue, evt, rowIndex, cellIndex) => {
        const newRows = [...this.state.tableRows];
        newRows[rowIndex].cells[cellIndex].props.editableValue = newValue;
        this.setState({
          tableRows: newRows
        });
      });
      __publicField(this, "handleUpdateEditableRows", (evt, type, isEditable, rowIndex, validationErrors) => {
        if (this.props.quickUpdate && type === "edit") {
          if (rowIndex === 0) {
            this.handleDnModalToggle();
            return;
          }
          const attrCell = this.state.tableRows[rowIndex].cells[0];
          const valCell = this.state.tableRows[rowIndex].cells[1];
          const myAttr = attrCell.props.value.toLowerCase();
          const myVal = valCell.props.value;
          const rdnInfo = getRdnInfo(this.props.wizardEntryDn);
          if (myAttr === rdnInfo.rdnAttr.toLowerCase() && myVal === rdnInfo.rdnVal) {
            this.handleDnModalToggle();
            return;
          }
        }
        if (type === "edit") {
          const myCellData = this.state.tableRows[rowIndex].cells[0];
          const myAttr = myCellData.props.value.toLowerCase();
          if (myAttr === "userpassword") {
            this.setState({
              isPasswordField: true,
              pwdRowIndex: rowIndex
            });
            return;
          } else if (BINARY_ATTRIBUTES.includes(myAttr)) {
            this.setState({
              showFileUri: true,
              attrIsJpegPhoto: myAttr === "jpegphoto",
              currentRowIndex: rowIndex
            });
            return;
          }
        }
        const newRows = [...this.state.tableRows];
        if (validationErrors && Object.keys(validationErrors).length) {
          newRows[rowIndex] = validateCellEdits(newRows[rowIndex], type, validationErrors);
          this.setState({ tableRows: newRows });
          return;
        }
        if (type === "cancel") {
          newRows[rowIndex] = cancelCellEdits(newRows[rowIndex]);
          this.setState({
            tableRows: newRows
          });
          const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
          this.props.enableNextStep(foundEmptyValue === void 0);
          return;
        }
        newRows[rowIndex] = applyCellEdits(newRows[rowIndex], type);
        this.setState(
          { tableRows: newRows },
          () => {
            const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
            if (foundEmptyValue === void 0) {
              const noEmptyValueCheck = type === "save";
              const namingAttrSet = this.state.namingRowID !== -1;
              const enableNext = noEmptyValueCheck && namingAttrSet;
              this.props.enableNextStep(enableNext);
            } else {
              this.props.enableNextStep(false);
            }
            if (type === "save") {
              const rowDataToSave = this.buildRowDataToSave();
              this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
            }
          }
        );
      });
      // Returns an array of row data to store in the parent component.
      __publicField(this, "buildRowDataToSave", () => {
        return this.state.tableRows.map((datum) => {
          const obj = {
            id: datum.cells[0].props.name,
            attr: datum.cells[0].props.value,
            val: datum.cells[1].props.value,
            namingAttr: datum.namingAttr,
            required: datum.required,
            objectClass: datum.objectClass,
            rowEditValidationRules: [...datum.rowEditValidationRules]
          };
          if (datum.cells[1].props.encodedvalue) {
            obj.encodedvalue = datum.cells[1].props.encodedvalue;
          }
          return obj;
        });
      });
      // Check if there is only one occurrence of an attribute
      // so we prevent its removal in case it is required.
      __publicField(this, "hasSingleOccurrence", (attributeName) => {
        let nb = 0;
        for (const datum of this.state.tableRows) {
          const attr = datum.cells[0].props.value;
          if (attr === attributeName) {
            nb++;
            if (nb > 1) {
              return false;
            }
          }
        }
        return true;
      });
      __publicField(this, "generateSingleRow", (myData) => {
        const attrName = myData.attr;
        const attrId = myData.id;
        if (attrName.toLowerCase() === "userpassword") {
          return {
            objectClass: myData.obj,
            required: myData.required,
            namingAttr: myData.namingAttr,
            rowEditValidationRules: this.attributeValidationRules,
            cells: [
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null, /* @__PURE__ */ import_react140.default.createElement(
                  EditableTextCell,
                  {
                    value,
                    rowIndex,
                    cellIndex,
                    props,
                    handleTextInputChange: this.onTextInputChange,
                    isDisabled: true,
                    inputAriaLabel: attrName
                  }
                )),
                props: {
                  value: attrName,
                  name: attrId
                }
              },
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null, /* @__PURE__ */ import_react140.default.createElement(
                  EditableTextCell,
                  {
                    value: value !== "" ? "********" : /* @__PURE__ */ import_react140.default.createElement(Label, { color: "red", icon: /* @__PURE__ */ import_react140.default.createElement(InfoCircleIcon, null) }, " Empty value! "),
                    rowIndex,
                    cellIndex,
                    props,
                    handleTextInputChange: this.onTextInputChange,
                    inputAriaLabel: "_" + value
                  }
                )),
                props: {
                  value: myData.val,
                  encodedvalue: myData.encodedvalue,
                  name: `${attrId}_val`
                }
              }
            ]
          };
        } else {
          return {
            objectClass: myData.obj,
            required: myData.required,
            namingAttr: myData.namingAttr,
            rowEditValidationRules: this.attributeValidationRules,
            cells: [
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null, /* @__PURE__ */ import_react140.default.createElement(
                  EditableTextCell,
                  {
                    value,
                    rowIndex,
                    cellIndex,
                    props,
                    handleTextInputChange: this.onTextInputChange,
                    isDisabled: true,
                    inputAriaLabel: attrName
                  }
                ), (attrId === this.state.namingRowID || myData.namingAttr) && /* @__PURE__ */ import_react140.default.createElement(
                  Popover,
                  {
                    headerContent: /* @__PURE__ */ import_react140.default.createElement("div", null, "Naming Attribute"),
                    bodyContent: /* @__PURE__ */ import_react140.default.createElement("div", null, "This attribute and value are part of the entry's DN and can not be changed except by doing a Rename (modrdn) operation on the entry.")
                  },
                  /* @__PURE__ */ import_react140.default.createElement("a", { href: "#", className: "ds-font-size-sm" }, "Naming Attribute")
                )),
                props: {
                  value: attrName,
                  name: attrId
                }
              },
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null, /* @__PURE__ */ import_react140.default.createElement(
                  EditableTextCell,
                  {
                    value: value === "" ? /* @__PURE__ */ import_react140.default.createElement(Label, { color: "red", icon: /* @__PURE__ */ import_react140.default.createElement(InfoCircleIcon, null) }, " Empty value! ") : value,
                    rowIndex,
                    cellIndex,
                    props,
                    handleTextInputChange: this.onTextInputChange,
                    inputAriaLabel: "_" + value
                  }
                )),
                props: {
                  value: myData.val,
                  encodedvalue: myData.encodedvalue,
                  name: `${attrId}_val`
                }
              }
            ]
          };
        }
      });
      __publicField(this, "createTableRows", () => {
        this.setState({
          namingRowID: this.props.namingRowID
        }, () => {
          const tableRows = this.props.editableTableData.map((attrData) => {
            return this.generateSingleRow(attrData);
          });
          this.setState({
            tableRows
          });
        });
      });
      __publicField(this, "actionResolver", (rowData, { rowIndex }) => {
        const myAttr = rowData.cells[0].props.value;
        const myName = rowData.cells[0].props.name;
        if (myAttr === "dn") {
          return [];
        }
        const namingAction = myName === this.state.namingRowID || this.props.disableNamingChange ? [] : this.props.namingAttr && myAttr !== this.props.namingAttr || this.props.namingAttr === "" ? [{
          title: "Set as Naming Attribute",
          onClick: () => {
            const foundEmptyValue = this.state.tableRows.find((el) => el.cells[1].props.value === "");
            this.props.enableNextStep(foundEmptyValue === void 0);
            this.setState(
              {
                namingRowID: myName,
                rdnAttr: myAttr
              },
              () => {
                this.props.setNamingRowID(myName);
              }
            );
          }
        }] : [];
        const duplicationAction = this.props.isAttributeSingleValued(myAttr) ? [] : [{
          title: "Add Another Value",
          onClick: (event, rowId, rowData2) => {
            const myData = {
              id: generateUniqueId(),
              attr: myAttr,
              val: ""
            };
            const tableRows = [...this.state.tableRows];
            const newItem = this.generateSingleRow(myData);
            tableRows.splice(rowIndex + 1, 0, newItem);
            this.setState(
              { tableRows },
              () => {
                const rowDataToSave = this.buildRowDataToSave();
                this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
                this.props.enableNextStep(false);
              }
            );
          }
        }];
        const removalAction = this.state.tableRows.length === 1 || rowData.namingAttr || (this.props.isAttributeRequired(myAttr) || rowData.required) && this.hasSingleOccurrence(myAttr) ? [] : [
          {
            title: "Remove this Row",
            onClick: (event, rowId) => {
              const tableRows = this.state.tableRows.filter((aRow) => aRow.cells[0].props.name !== myName);
              this.setState(
                { tableRows },
                () => {
                  const rowDataToSave = this.buildRowDataToSave();
                  const foundEmptyValue = tableRows.find((el) => el.cells[1].props.value === "");
                  this.props.enableNextStep(foundEmptyValue === void 0);
                  let namingRowID = this.state.namingRowID;
                  if (rowId === namingRowID) {
                    namingRowID = -1;
                    this.props.setNamingRowID(-1);
                    this.props.enableNextStep(false);
                  }
                  this.setState({ namingRowID });
                  this.props.saveCurrentRows(rowDataToSave, namingRowID);
                }
              );
            }
          }
        ];
        const nam = namingAction.length > 0;
        const dup = duplicationAction.length > 0;
        const rem = removalAction.length > 0;
        const firstSeparator = nam && (dup || rem) ? [{ isSeparator: true }] : [];
        const secondSeparator = dup && rem ? [{ isSeparator: true }] : [];
        if (this.props.quickUpdate) {
          let actions = [];
          if (dup) {
            actions = duplicationAction;
            if (rem) {
              actions.push({ isSeparator: true });
            }
          }
          if (rem) {
            actions.push(removalAction[0]);
          } else {
            actions.push({
              title: "Required Attribute",
              isDisabled: true
            });
          }
          return actions;
        } else {
          return [
            ...namingAction,
            ...firstSeparator,
            ...duplicationAction,
            ...secondSeparator,
            ...removalAction
          ];
        }
      });
      this.attributeValidationRules = [
        {
          name: "required",
          validator: (value) => value.trim() !== "",
          errorText: "This field is required"
        }
      ];
      this.columns = [
        { title: "Attribute" },
        { title: "Value", cellTransforms: [breakWord] }
      ];
      this.state = {
        tableRows: [],
        namingRowID: 0,
        isPasswordField: false,
        showPassword: false,
        pwdValue: "",
        pwdRowIndex: -1,
        fileValue: "",
        fileName: "",
        encodedValueIsEmpty: true,
        strPathValueIsEmpty: true,
        showFileUrl: false,
        isDnModalOpen: false,
        attrIsJpegPhoto: false,
        currentRowIndex: 0,
        binaryAttributeRadio: "Upload",
        binaryAttributeFilePath: "",
        isFileTooLarge: false
      };
      this.handleDnModalToggle = () => {
        this.setState(({ isDnModalOpen }) => ({
          isDnModalOpen: !isDnModalOpen
        }));
      };
      this.handlePasswordToggle = (event) => {
        this.setState(({ isPasswordField }) => ({
          isPasswordField: !isPasswordField
        }));
      };
      this.handlePwdChange = (str, e) => {
        this.setState({
          pwdValue: str
        });
      };
      this.handlePwdSave = () => {
        const newRows = [...this.state.tableRows];
        if (this.state.pwdRowIndex !== -1) {
          newRows[this.state.pwdRowIndex].cells[1].props.value = this.state.pwdValue;
          this.setState({
            tableRows: newRows,
            isPasswordField: false
          }, () => {
            const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
            if (foundEmptyValue === void 0) {
              this.props.enableNextStep(true);
            } else {
              this.props.enableNextStep(false);
            }
            const rowDataToSave = this.buildRowDataToSave();
            this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
          });
        }
      };
      this.handleShowOrHidePassword = () => {
        this.setState(({ showPassword }) => ({
          showPassword: !showPassword
        }));
      };
      this.applyCustomPath = (filePath) => {
        const encodedValueIsEmpty = true;
        const strPathValueIsEmpty = true;
        this.setState({
          encodedValueIsEmpty,
          strPathValueIsEmpty
        });
        const encodedValue = "";
        const myDecodedValue = `file://${filePath}`;
        const newRows = [...this.state.tableRows];
        newRows[this.state.currentRowIndex].cells[1].props.value = myDecodedValue;
        newRows[this.state.currentRowIndex].cells[1].props.encodedvalue = encodedValue;
        this.setState(({ showFileUri }) => ({
          encodedValueIsEmpty: true,
          strPathValueIsEmpty: false,
          showFileUri: !showFileUri,
          tableRows: newRows
        }));
        const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
        if (foundEmptyValue === void 0) {
          this.props.enableNextStep(true);
        } else {
          this.props.enableNextStep(false);
        }
        const rowDataToSave = this.buildRowDataToSave();
        this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
      };
      this.handleToggleUri = () => {
        if (!this.state.strPathValueIsEmpty) {
          this.applyCustomPath(this.state.binaryAttributeFilePath);
        } else {
          this.setState(({ showFileUri }) => ({
            showFileUri: !showFileUri
          }));
        }
      };
      this.handleClear = () => {
        this.setState({
          fileName: ""
        });
      };
      this.handleFileChange = (e, file) => {
        let encodedValue;
        const encodedValueIsEmpty = true;
        const strPathValueIsEmpty = true;
        const isFileTooLarge = false;
        this.setState({
          fileName: file.name,
          encodedValueIsEmpty,
          strPathValueIsEmpty,
          isFileTooLarge
        });
        console.debug("handleFileChange - file: ", file);
        if (file.size === void 0) {
          return;
        }
        if (file.size === 0) {
          console.log("An empty file was selected. Nothing to do.");
          return;
        }
        if (file.size > WEB_SOCKET_MAX_PAYLOAD) {
          console.log("handleFileChange - File too large!");
          this.setState({ isFileTooLarge: true });
          return;
        }
        const reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = () => {
          const pattern = ";base64,";
          const pos = reader.result.indexOf(pattern);
          const toDel = reader.result.substring(0, pos + pattern.length);
          const isAnImage = file.type.startsWith("image/");
          encodedValue = this.state.attrIsJpegPhoto ? isAnImage ? reader.result.replace(toDel, "") : "" : file.type === "application/x-x509-ca-cert" || file.type === "application/x-x509-user-cert" || file.type === "application/pkix-cert" ? reader.result.replace(toDel, "") : "";
          if (encodedValue === "") {
            console.log("handleFileChange - encodedValue is null. Nothing to do.");
            return;
          }
          let myDecodedValue = "";
          if (isAnImage) {
            if (this.state.attrIsJpegPhoto) {
              myDecodedValue = /* @__PURE__ */ import_react140.default.createElement(
                "img",
                {
                  src: `data:image/png;base64,${encodedValue}`,
                  alt: "",
                  style: { width: "48px" }
                }
              );
            }
          } else {
            myDecodedValue = /* @__PURE__ */ import_react140.default.createElement("div", null, /* @__PURE__ */ import_react140.default.createElement(Label, { icon: /* @__PURE__ */ import_react140.default.createElement(InfoCircleIcon, null), color: "blue" }, "Value is too large to display"));
          }
          console.log(`handleFileChange - encodedValue.substring(0, 100) = ${encodedValue.substring(0, 100)}`);
          const newRows = [...this.state.tableRows];
          newRows[this.state.currentRowIndex].cells[1].props.value = myDecodedValue;
          newRows[this.state.currentRowIndex].cells[1].props.encodedvalue = encodedValue;
          this.setState({
            encodedValueIsEmpty: false,
            strPathValueIsEmpty: true,
            tableRows: newRows
          });
          const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
          if (foundEmptyValue === void 0) {
            this.props.enableNextStep(true);
          } else {
            this.props.enableNextStep(false);
          }
          const rowDataToSave = this.buildRowDataToSave();
          this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
        };
        reader.onerror = (error) => {
          console.log(`handleFileChange - Failed to encode the file : ${file.name}`, error);
        };
      };
      this.handleRadioOnChange = (_, event) => {
        this.setState({ binaryAttributeRadio: event.currentTarget.value });
      };
      this.handleBinaryAttributeInput = (str, e) => {
        const invalidPath = !file_is_path(str);
        this.setState({
          binaryAttributeFilePath: str,
          encodedValueIsEmpty: true,
          // If we say strPathValueIsEmpty is true then the 'Confirm' button will be disabled
          // Hense if we say strPathValueIsEmpty = invalidPath = true then the button is disabled
          strPathValueIsEmpty: invalidPath
        });
      };
    }
    // End constructor().
    componentDidMount() {
      this.createTableRows();
      const foundEmptyValue = this.props.editableTableData.find((el) => el.val === "");
      this.props.enableNextStep(foundEmptyValue === void 0);
    }
    render() {
      const {
        tableRows,
        isPasswordField,
        showPassword,
        showFileUri,
        isDnModalOpen,
        fileName,
        attrIsJpegPhoto,
        encodedValueIsEmpty,
        strPathValueIsEmpty,
        binaryAttributeRadio,
        binaryAttributeFilePath,
        isFileTooLarge
      } = this.state;
      const uploadSelected = showFileUri ? binaryAttributeRadio === "Upload" : null;
      const fileUriModalTitle = uploadSelected ? `Upload File ${attrIsJpegPhoto ? "(Photo)" : "(Certificate)"}` : `Type File Path ${attrIsJpegPhoto ? "(Photo)" : "(Certificate)"}`;
      return /* @__PURE__ */ import_react140.default.createElement(import_react140.default.Fragment, null, isDnModalOpen && /* @__PURE__ */ import_react140.default.createElement(
        Modal,
        {
          id: "modal-dn-id",
          variant: ModalVariant.small,
          titleIconVariant: "info",
          title: "DN Renaming",
          isOpen: this.state.isDnModalOpen,
          onClose: this.handleDnModalToggle,
          actions: [
            /* @__PURE__ */ import_react140.default.createElement(Button, { key: "close", variant: "primary", onClick: this.handleDnModalToggle }, "Close")
          ]
        },
        "You cannot modify the RDN ( Relative Distinguished Name ) in the ",
        /* @__PURE__ */ import_react140.default.createElement("strong", null, "Quick Update"),
        " mode.",
        /* @__PURE__ */ import_react140.default.createElement("br", null),
        "If you want to modify the RDN, please use the ",
        /* @__PURE__ */ import_react140.default.createElement("strong", null, "Rename"),
        " action option"
      ), isPasswordField && /* @__PURE__ */ import_react140.default.createElement(
        Modal,
        {
          id: "modal-password-id",
          variant: ModalVariant.medium,
          title: "Set Password",
          isOpen: isPasswordField,
          onClose: this.handlePasswordToggle,
          actions: [
            /* @__PURE__ */ import_react140.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                name: "confirm",
                onClick: this.handlePwdSave
              },
              "Confirm"
            ),
            /* @__PURE__ */ import_react140.default.createElement(
              Button,
              {
                key: "cancel",
                variant: "link",
                onClick: this.handlePasswordToggle
              },
              "Cancel"
            )
          ]
        },
        /* @__PURE__ */ import_react140.default.createElement(InputGroup, null, /* @__PURE__ */ import_react140.default.createElement(
          TextInput,
          {
            name: "passwordField",
            id: "passwordField",
            type: showPassword ? "text" : "password",
            onChange: this.handlePwdChange,
            "aria-label": "password field"
          }
        ), /* @__PURE__ */ import_react140.default.createElement(
          Button,
          {
            variant: "control",
            "aria-label": "password field icon",
            onClick: this.handleShowOrHidePassword,
            icon: showPassword ? /* @__PURE__ */ import_react140.default.createElement(EyeSlashIcon, null) : /* @__PURE__ */ import_react140.default.createElement(EyeIcon, null)
          }
        ))
      ), showFileUri && /* @__PURE__ */ import_react140.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: fileUriModalTitle,
          isOpen: showFileUri,
          onClose: this.handleToggleUri,
          actions: [
            /* @__PURE__ */ import_react140.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                isDisabled: encodedValueIsEmpty && strPathValueIsEmpty,
                onClick: this.handleToggleUri
              },
              "Confirm"
            ),
            /* @__PURE__ */ import_react140.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleToggleUri }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react140.default.createElement(
          Radio,
          {
            value: "Upload",
            className: "ds-margin-top",
            isChecked: uploadSelected,
            onChange: this.handleRadioOnChange,
            label: "Upload a file local to the browser.",
            description: "Select a file from the machine on which the browser was launched.",
            name: "radio-binary-attribute",
            id: "radio-upload-binary-attribute"
          }
        ),
        /* @__PURE__ */ import_react140.default.createElement(
          Radio,
          {
            className: "ds-margin-top-lg",
            value: "TextInput",
            isChecked: !uploadSelected,
            onChange: this.handleRadioOnChange,
            label: "Write the complete file path.",
            description: "Type the full path of the file on the server host the LDAP server.",
            name: "radio-binary-attribute",
            id: "radio-type-binary-attribute"
          }
        ),
        /* @__PURE__ */ import_react140.default.createElement("hr", null),
        fileName !== "" && encodedValueIsEmpty && strPathValueIsEmpty && /* @__PURE__ */ import_react140.default.createElement(Alert, { variant: "danger", isInline: true, title: "There was an issue with the uploaded file ( incorrect type? )." }),
        isFileTooLarge && /* @__PURE__ */ import_react140.default.createElement(Alert, { variant: "danger", isInline: true, title: "The file size larger than 128 MB. Use the file path option." }),
        !attrIsJpegPhoto && /* @__PURE__ */ import_react140.default.createElement(Label, { className: "ds-margin-top-lg", icon: /* @__PURE__ */ import_react140.default.createElement(InfoCircleIcon, null), color: "blue" }, "The certificate must be stored in the Distinguished Encoding Rules (DER) format."),
        uploadSelected && /* @__PURE__ */ import_react140.default.createElement(
          FileUpload,
          {
            id: "file-upload",
            type: "dataURL",
            className: "ds-margin-top-lg",
            filename: fileName,
            value: fileName,
            onFileInputChange: this.handleFileChange,
            onClearClick: this.handleClear,
            validated: uploadSelected && fileName === "" ? "error" : "default",
            hideDefaultPreview: true,
            browseButtonText: "Choose Binary File"
          }
        ),
        !uploadSelected && /* @__PURE__ */ import_react140.default.createElement(
          TextInput,
          {
            value: binaryAttributeFilePath,
            onChange: this.handleBinaryAttributeInput,
            isRequired: true,
            validated: file_is_path(binaryAttributeFilePath) ? ValidatedOptions.default : ValidatedOptions.error,
            type: "text",
            "aria-label": "File input for a binary attribute."
          }
        )
      ), /* @__PURE__ */ import_react140.default.createElement(
        Table,
        {
          actionResolver: this.actionResolver,
          onRowEdit: this.handleUpdateEditableRows,
          dropdownDirection: "up",
          "aria-label": "Editable Rows Table",
          variant: TableVariant.compact,
          cells: this.columns,
          rows: tableRows,
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react140.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react140.default.createElement(TableBody, null)
      ));
    }
  };
  EditableTable.propTypes = {
    wizardEntryDn: import_prop_types109.default.string,
    editableTableData: import_prop_types109.default.array,
    isAttributeSingleValued: import_prop_types109.default.func,
    isAttributeRequired: import_prop_types109.default.func,
    enableNextStep: import_prop_types109.default.func,
    saveCurrentRows: import_prop_types109.default.func,
    disableNamingChange: import_prop_types109.default.bool
  };
  EditableTable.defaultProps = {
    wizardEntryDn: "",
    editableTableData: [],
    disableNamingChange: false
  };
  var editableTable_default = EditableTable;

  // src/lib/ldap_editor/wizards/operations/addCosTemplate.jsx
  var AddCosTemplate = class extends import_react141.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr.toLowerCase());
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "enableNextStep", (yes) => {
        this.setState({
          validMods: yes
        });
      });
      __publicField(this, "saveCurrentRows", (editableTableData) => {
        let validMods = true;
        let namingVal = this.state.namingVal;
        let namingAttrVal = this.state.namingAttrVal;
        for (const row of editableTableData) {
          if (row.val === "") {
            validMods = false;
            break;
          }
          if (row.id === this.state.namingRowID) {
            namingVal = row.val;
            namingAttrVal = row.attr + "=" + row.val;
          }
        }
        this.setState({
          editableTableData,
          validMods,
          namingVal,
          namingAttrVal
        });
      });
      __publicField(this, "handleSetPageOc", (_event, pageNumber) => {
        this.setState({
          pageOc: pageNumber,
          pagedRowsOc: this.getItemsToShow(pageNumber, this.state.perPageOc, "ObjectClassTable")
        });
      });
      __publicField(this, "handleSetPageAttr", (_event, pageNumber) => {
        this.setState({
          pageAttr: pageNumber,
          pagedRowsAttr: this.getItemsToShow(pageNumber, this.state.perPageAttr, "AttributeTable")
        });
      });
      __publicField(this, "handlePerPageSelectOc", (_event, perPage) => {
        this.setState({
          pageOc: 1,
          perPageOc: perPage,
          pagedRowsOc: this.getItemsToShow(1, perPage, "ObjectClassTable")
        });
      });
      __publicField(this, "handlePerPageSelectAttr", (_event, perPage) => {
        this.setState({
          pageAttr: 1,
          perPageAttr: perPage,
          pagedRowsAttr: this.getItemsToShow(1, perPage, "AttributeTable")
        });
      });
      __publicField(this, "handleSelectOc", (event, isSelected, rowId) => {
        const rows = [...this.state.pagedRowsOc];
        rows[rowId].selected = isSelected;
        const ocName = this.state.pagedRowsOc[rowId].cells[0];
        const allItems = [...this.state.rowsOc];
        const index = allItems.findIndex((item) => item.cells[0] === ocName);
        allItems[index].selected = isSelected;
        let selectedObjectClasses = [...this.state.selectedObjectClasses];
        if (isSelected) {
          selectedObjectClasses.push(allItems[index]);
        } else {
          selectedObjectClasses = selectedObjectClasses.filter((row) => row.cells[0] !== allItems[index].cells[0]);
        }
        const attrsToRemove = [];
        if (!isSelected) {
          let ocAttrs = allItems[index].cells[1].toLowerCase().replace(/\s/g, "").split(",");
          ocAttrs = ocAttrs.concat(allItems[index].cells[2].toLowerCase().replace(/\s/g, "").split(","));
          let currAttrs = [];
          for (const oc of selectedObjectClasses) {
            currAttrs = currAttrs.concat(oc.cells[1].toLowerCase().replace(/\s/g, "").split(","));
            currAttrs = currAttrs.concat(oc.cells[2].toLowerCase().replace(/\s/g, "").split(","));
          }
          for (const attr of ocAttrs) {
            if (currAttrs.indexOf(attr) === -1) {
              attrsToRemove.push(attr);
            }
          }
        }
        this.setState({
          rowsOc: allItems,
          pagedRowsOc: rows,
          selectedObjectClasses,
          attrsToRemove
        }, () => {
          this.updateAttributeTableRows();
        });
      });
      __publicField(this, "handleSelectAttr", (event, isSelected, rowId) => {
        let newEditableData = this.state.editableTableData;
        const rows = [...this.state.pagedRowsAttr];
        if (this.state.pagedRowsAttr[rowId].disableCheckbox === true) {
          return;
        }
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].cells[0];
        const allItems = [...this.state.rowsAttr];
        const index = allItems.findIndex((item) => item.cells[0] === attrName);
        allItems[index].isAttributeSelected = isSelected;
        const selectedAttributes = allItems.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]);
        const rowAttr = rows[rowId].attributeName.toLowerCase();
        const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === rowAttr);
        if (isSelected) {
          if (found.length === 0 && rowAttr !== "objectclass") {
            const obj = {};
            obj.id = generateUniqueId();
            obj.attr = rows[rowId].attributeName;
            obj.val = "";
            obj.namingAttr = false;
            obj.required = false;
            newEditableData = [...newEditableData, obj];
          }
        } else if (found.length > 0) {
          newEditableData = this.state.editableTableData.filter((item) => item.attr.toLowerCase() !== rowAttr);
        }
        let validMods = true;
        for (const row of newEditableData) {
          if (row.val === "") {
            validMods = false;
          }
        }
        this.setState({
          rowsAttr: allItems,
          pagedRowsAttr: rows,
          editableTableData: newEditableData,
          selectedAttributes,
          validMods
        });
      });
      __publicField(this, "updateAttributeTableRows", () => {
        const ocToProcess = [...this.state.selectedObjectClasses];
        const rowsAttr = [];
        const attrList = [];
        let namingRowID = this.state.namingRowID;
        let namingAttr = this.state.namingAttr;
        const namingVal = this.state.namingVal;
        const cospriority = this.state.cospriority;
        for (const oc of ocToProcess) {
          const required = oc.cells[1].split(",");
          const optional = oc.cells[2].split(",");
          for (let attr of required) {
            attr = attr.trim().toLowerCase();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              attrList.push(attr);
              rowsAttr.push({
                selected: true,
                disableCheckbox: true,
                // TODO: Hack until upgrading!
                isAttributeSelected: true,
                attributeName: attr,
                cells: [
                  {
                    title: /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, /* @__PURE__ */ import_react141.default.createElement("strong", null, attr))
                  },
                  oc.cells[0]
                ]
              });
            }
            const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === attr);
            if (found.length === 0 && attr !== "objectclass") {
              const new_id = generateUniqueId();
              if (namingRowID === -1) {
                namingRowID = new_id;
                namingAttr = attr;
              }
              const obj = {};
              obj.id = new_id;
              obj.attr = attr;
              if (attr.toLowerCase() === "cn") {
                obj.val = namingVal;
              } else if (attr.toLowerCase() === "cospriority") {
                obj.val = cospriority;
              } else {
                obj.val = "";
              }
              obj.namingAttr = false;
              obj.required = true;
              this.setState((prevState) => ({
                editableTableData: [...prevState.editableTableData, obj],
                validMods: false,
                namingRowID,
                namingAttr
              }));
            }
          }
          for (let attr of optional) {
            attr = attr.trim();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === attr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(attr);
              rowsAttr.push({
                attributeName: attr,
                isAttributeSelected: selected,
                selected,
                cells: [attr, oc.cells[0]]
              });
            }
          }
        }
        rowsAttr.sort((a2, b) => a2.attributeName > b.attributeName ? 1 : -1);
        this.setState({
          rowsAttr,
          rowsAttrOrig: [...rowsAttr],
          selectedAttributes: rowsAttr.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]),
          itemCountAttr: rowsAttr.length
        }, () => {
          this.setState({
            pagedRowsAttr: this.getItemsToShow(
              this.state.pageAttr,
              this.state.perPageAttr,
              "AttributeTable"
            )
          });
        });
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = ["top"];
        const attribute = this.state.namingAttr;
        const value = this.state.namingVal;
        const valueData = [];
        for (const oc of this.state.selectedObjectClasses) {
          if (oc && !objectClassData.includes(oc.cells[0])) {
            objectClassData.push(oc.cells[0]);
          }
        }
        for (const item of this.state.editableTableData) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
        }
        const ocArray = objectClassData.map((oc) => `ObjectClass: ${oc}`);
        const dnLine = `dn: ${attribute}=${value},${this.props.wizardEntryDn}`;
        const ldifArray = [
          dnLine,
          ...ocArray,
          ...valueData
        ];
        const cleanLdifArray = [...ldifArray];
        for (const idx in cleanLdifArray) {
          if (cleanLdifArray[idx].toLowerCase().startsWith("userpassword")) {
            cleanLdifArray[idx] = "userpassword: ********";
            break;
          }
        }
        this.setState({
          ldifArray,
          cleanLdifArray
        });
      });
      __publicField(this, "handleOCDropDownToggle", (isOpen) => {
        this.setState({
          isOCDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleOCDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isOCDropDownOpen: !prevState.isOCDropDownOpen };
        });
      });
      __publicField(this, "buildOCDropdown", () => {
        const { isOCDropDownOpen, selectedObjectClasses } = this.state;
        const numSelected = this.state.rowsOc.filter((item) => item.selected).length;
        const items = selectedObjectClasses.map(
          (oc) => /* @__PURE__ */ import_react141.default.createElement(DropdownItem, { key: oc.cells[0] }, oc.cells[0])
        );
        return /* @__PURE__ */ import_react141.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleOCDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react141.default.createElement(BadgeToggle, { id: "toggle-oc-select", onToggle: this.handleOCDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, "0 selected ")),
            isOpen: isOCDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ import_react141.default.createElement(DropdownItem, { key: attr[0] }, attr[0])
        );
        return /* @__PURE__ */ import_react141.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react141.default.createElement(BadgeToggle, { id: "toggle-attr-select", onToggle: this.handleAttrDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, "0 selected ")),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        const rows = this.state.editableTableData;
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      this.originalEntryRows = [];
      this.singleValuedAttributes = ["cn"];
      this.requiredAttributes = ["dn"];
      this.operationColumns = [
        { title: "Statement" },
        { title: "Attribute" },
        { title: "Value", cellTransforms: [breakWord] }
      ];
      this.state = {
        loading: true,
        isOCDropDownOpen: false,
        isAttrDropDownOpen: false,
        namingAttributeData: ["", ""],
        namingAttrPropsName: "",
        namingRowID: -1,
        namingAttr: "",
        namingVal: "",
        cospriority: 0,
        editableTableData: [],
        ldifArray: [],
        cleanLdifArray: [],
        validMods: false,
        commandOutput: "",
        resultVariant: "default",
        stepIdReached: this.props.stepReached,
        itemCountOc: 0,
        pageOc: 1,
        perPageOc: 6,
        itemCountAttr: 0,
        pageAttr: 1,
        perPageAttr: 10,
        columnsAttr: [
          { title: "Attribute Name", cellTransforms: [headerCol()] },
          { title: "From ObjectClass" }
        ],
        columnsOc: [
          { title: "ObjectClass Name", cellTransforms: [headerCol()] },
          { title: "Required Attributes", cellTransforms: [breakWord] },
          { title: "Optional Attributes", cellTransforms: [breakWord] }
        ],
        rowsOc: [],
        rowsAttr: [],
        rowsAttrOrig: [],
        rowsValues: [],
        pagedRowsOc: [],
        pagedRowsAttr: [],
        selectedObjectClasses: [],
        selectedAttributes: [],
        attrsToRemove: [],
        adding: true,
        goBackToCoSDefinition: false,
        createdTemplate: "",
        isConfirmModalOpen: false,
        createTemplateEnd: false,
        searchValue: "",
        searchAttrValue: ""
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.handleCreateTemplateEnd = () => {
        this.setState({
          createTemplateEnd: true
        }, () => {
          this.props.onReload();
        });
      };
      this.handleMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        });
      };
      this.handleConfigChange = (event, id, min3, max3) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue
        });
      };
      this.handlePlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.updateAttributeTableRows();
        } else if (id === 5) {
          this.cleanUpEntry();
        } else if (id === 6) {
          this.generateLdifData();
        } else if (id === 7) {
          createLdapEntry(
            this.props.editorLdapServer,
            this.state.ldifArray,
            (result) => {
              const myDn = this.state.ldifArray[0].substring(4);
              this.setState({
                commandOutput: result.errorCode === 0 ? "Successfully added entry!" : "Failed to add entry, error: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false,
                createdTemplate: myDn
              }, () => {
                this.props.onReload();
              });
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        } else if (id === 8 && this.props.cosDefCreateMoreTemplate) {
          this.setState({
            isConfirmModalOpen: true
          });
        } else if (id === 8 && this.props.definitionWizardEntryDn !== "") {
          this.setState({
            goBackToCoSDefinition: true
          }, () => {
            this.props.onReload();
          });
        }
      };
      this.handleToggleOpenWizard = () => {
        if (this.props.definitionWizardEntryDn !== "") {
          this.setState({
            goBackToCoSDefinition: true
          }, () => {
            this.props.onReload();
          });
        } else {
          this.props.handleToggleWizard();
        }
      };
      this.handleCreateTemplate = () => {
        this.setState({
          goBackToCoSDefinition: true
        });
      };
      this.cleanUpEntry = () => {
        const newRows = [];
        let validMods = true;
        for (const row of this.state.editableTableData) {
          const attr = row.attr.toLowerCase();
          if (this.state.attrsToRemove.indexOf(attr) === -1) {
            if (row.val === "") {
              validMods = false;
            }
            newRows.push(row);
          }
        }
        this.setState({
          editableTableData: newRows,
          validMods
        });
      };
      this.handleOCSearchChange = (event, value) => {
        let ocRows = [];
        const allOCs = [];
        const val = value.toLowerCase();
        this.props.allObjectclasses.map((oc) => {
          let selected = false;
          let selectionDisabled = false;
          for (const selectedOC of this.state.selectedObjectClasses) {
            if (selectedOC.cells[0].toLowerCase() === oc.name.toLowerCase()) {
              selected = true;
              break;
            }
          }
          if (oc.name === "top") {
            selectionDisabled = true;
          } else if (oc.name === "costemplate") {
            selectionDisabled = true;
            selected = true;
          }
          allOCs.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of allOCs) {
            const name2 = row.cells[0].toLowerCase();
            const reqAttrs = row.cells[1].toLowerCase();
            const optAttrs = row.cells[2].toLowerCase();
            if (name2.includes(val) || reqAttrs.includes(val) || optAttrs.includes(val)) {
              ocRows.push(row);
            }
          }
        } else {
          ocRows = allOCs;
        }
        this.setState({
          rowsOc: ocRows,
          pagedRowsOc: ocRows.slice(0, this.state.perPageOc),
          itemCountOc: ocRows.length,
          searchValue: value
        });
      };
      this.handleAttrSearchChange = (event, value) => {
        let attrRows = [];
        const allAttrs = this.state.rowsAttrOrig;
        const val = value.toLowerCase();
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.attributeName.toLowerCase();
            if (name2.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsAttr: attrRows,
          pagedRowsAttr: attrRows.slice(0, this.state.perPageAttr),
          itemCountAttr: attrRows.length,
          searchAttrValue: value
        });
      };
    }
    componentDidMount() {
      const ocArray = [];
      getSingleValuedAttributes(
        this.props.editorLdapServer,
        (myAttrs) => {
          this.singleValuedAttributes = [...myAttrs];
        }
      );
      this.props.allObjectclasses.map((oc) => {
        let selectionDisabled = false;
        let selected = false;
        if (oc.name === "top") {
          selectionDisabled = true;
        }
        if (oc.name === "costemplate") {
          selectionDisabled = true;
          selected = true;
          ocArray.push(
            {
              cells: [
                oc.name,
                oc.required.concat(oc.optional).join(", "),
                ""
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          const selectedOC = [...this.state.selectedObjectClasses];
          selectedOC.push(ocArray[ocArray.length - 1]);
          this.setState({
            selectedObjectClasses: selectedOC
          });
        } else {
          ocArray.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
        }
        return [];
      });
      this.setState({
        itemCountOc: ocArray.length,
        rowsOc: ocArray,
        pagedRowsOc: ocArray.slice(0, this.state.perPageOc),
        loading: false
      });
    }
    getItemsToShow(page, perPage, option) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = option === "ObjectClassTable" ? this.state.rowsOc.slice(start2, end2) : option === "AttributeTable" ? this.state.rowsAttr.slice(start2, end2) : [];
      return newRows;
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    onToggleWizard() {
      this.props.handleToggleWizard();
    }
    render() {
      const {
        loading,
        itemCountOc,
        pageOc,
        perPageOc,
        columnsOc,
        pagedRowsOc,
        itemCountAttr,
        pageAttr,
        perPageAttr,
        columnsAttr,
        pagedRowsAttr,
        commandOutput,
        namingAttr,
        namingVal,
        cospriority,
        stepIdReached,
        ldifArray,
        resultVariant,
        editableTableData,
        validMods,
        cleanLdifArray,
        selectedAttributes,
        selectedObjectClasses,
        goBackToCoSDefinition,
        createTemplateEnd
      } = this.state;
      if (createTemplateEnd) {
        return /* @__PURE__ */ import_react141.default.createElement(
          AddCosTemplate,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.opToggleWizard,
            wizardEntryDn: this.props.wizardEntryDn,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            firstStep: this.props.firstStep,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            stepReached: 2,
            cosDefCreateMoreTemplate: true
          }
        );
      } else if (goBackToCoSDefinition) {
        let myDn = this.state.createdTemplate;
        if (resultVariant === "danger") {
          myDn = "";
        }
        return /* @__PURE__ */ import_react141.default.createElement(
          addCosDefinition_default,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            wizardEntryDn: this.props.definitionWizardEntryDn,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            firstStep: this.props.firstStep,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            createdTemplateDN: myDn,
            stepReached: 2,
            cosDefName: this.props.cosDefName,
            cosDefDesc: this.props.cosDefDesc,
            cosDefType: this.props.cosDefType
          }
        );
      }
      const namingValAndPriority = /* @__PURE__ */ import_react141.default.createElement("div", null, /* @__PURE__ */ import_react141.default.createElement(Grid, null, /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react141.default.createElement(TextContent, null, /* @__PURE__ */ import_react141.default.createElement(Text, { component: TextVariants.h3 }, "Select Name And CoS Priority"))), /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react141.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react141.default.createElement(Text, null, "The CoS template entry contains the value or values of the attributes generated by the CoS logic. The CoS template entry contains a general object class of cosTemplate. The CoS template entries for a given CoS are stored in the directory tree along with the CoS definition."), /* @__PURE__ */ import_react141.default.createElement(Text, null, "The relative distinguished name (RDN) of the template entry is determined by one of the following:"), /* @__PURE__ */ import_react141.default.createElement(TextList, null, /* @__PURE__ */ import_react141.default.createElement(TextListItem, null, "The DN of the template entry alone. This type of template is associated with a pointer CoS definition."), /* @__PURE__ */ import_react141.default.createElement(TextListItem, null, "The value of one of the target entry's attributes. The attribute used to provide the relative DN to the template entry is specified in the CoS definition entry using the cosIndirectSpecifier attribute. This type of template is associated with an indirect CoS definition."), /* @__PURE__ */ import_react141.default.createElement(TextListItem, null, "By a combination of the DN of the subtree where the CoS performs a one level search for templates and the value of one of the target entry's attributes. This type of template is associated with a classic CoS definition.")), /* @__PURE__ */ import_react141.default.createElement(Text, null, "Please, consult official documentation for more information and examples.")))), /* @__PURE__ */ import_react141.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react141.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 3, className: "ds-label" }, /* @__PURE__ */ import_react141.default.createElement(TextContent, null, /* @__PURE__ */ import_react141.default.createElement(Text, null, "CoS Template Name"))), /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react141.default.createElement(
        TextInput,
        {
          value: namingVal,
          type: "text",
          id: "namingVal",
          "aria-describedby": "namingVal",
          name: "namingVal",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          validated: this.state.namingVal === "" ? ValidatedOptions.error : ValidatedOptions.default
        }
      ))), /* @__PURE__ */ import_react141.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react141.default.createElement(GridItem, { className: "ds-label", span: 3 }, /* @__PURE__ */ import_react141.default.createElement(TextContent, null, /* @__PURE__ */ import_react141.default.createElement(Text, null, "CoS Priority", /* @__PURE__ */ import_react141.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react141.default.createElement("div", null, "Specifies which template provides the attribute value when CoS templates compete to provide an attribute value. This attribute represents the global priority of a template. A priority of zero is the highest priority.")
        },
        /* @__PURE__ */ import_react141.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react141.default.createElement(InfoCircleIcon, { className: "ds-info-icon" }))
      )))), /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react141.default.createElement(
        NumberInput,
        {
          value: cospriority,
          min: 0,
          max: 2147483647,
          onMinus: () => {
            this.handleMinusConfig("cospriority");
          },
          onChange: (e) => {
            this.handleConfigChange(e, "cospriority", 0, 2147483647);
          },
          onPlus: () => {
            this.handlePlusConfig("cospriority");
          },
          inputName: "input",
          inputAriaLabel: "number input",
          minusBtnAriaLabel: "minus",
          plusBtnAriaLabel: "plus",
          widthChars: 8
        }
      )))));
      const objectClassStep = /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, /* @__PURE__ */ import_react141.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react141.default.createElement(TextContent, null, /* @__PURE__ */ import_react141.default.createElement(Text, { component: TextVariants.h3 }, "Select ObjectClasses")), this.buildOCDropdown()), loading && /* @__PURE__ */ import_react141.default.createElement("div", null, /* @__PURE__ */ import_react141.default.createElement(Bullseye, { className: "ds-margin-top-xlg", key: "add-entry-bulleye" }, /* @__PURE__ */ import_react141.default.createElement(Title, { headingLevel: "h3", size: "lg", key: "loading-title" }, "Loading ObjectClasses ...")), /* @__PURE__ */ import_react141.default.createElement(Spinner, { className: "ds-center", size: "lg", key: "loading-spinner" })), /* @__PURE__ */ import_react141.default.createElement("div", { className: loading ? "ds-hidden" : "" }, /* @__PURE__ */ import_react141.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react141.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search Objectclasses",
          value: this.state.searchValue,
          onChange: this.handleOCSearchChange,
          onClear: (evt, val) => this.handleOCSearchChange(evt, "")
        }
      )), /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react141.default.createElement(
        Pagination,
        {
          value: "ObjectClassTable",
          itemCount: itemCountOc,
          page: pageOc,
          perPage: perPageOc,
          onSetPage: this.handleSetPageOc,
          widgetId: "pagination-step-objectclass",
          onPerPageSelect: this.handlePerPageSelectOc,
          variant: "top",
          isCompact: true
        }
      ))), /* @__PURE__ */ import_react141.default.createElement(
        Table,
        {
          cells: columnsOc,
          rows: pagedRowsOc,
          canSelectAll: false,
          onSelect: this.handleSelectOc,
          variant: TableVariant.compact,
          "aria-label": "Pagination All ObjectClasses"
        },
        /* @__PURE__ */ import_react141.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react141.default.createElement(TableBody, null)
      )));
      const attributeStep = /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, /* @__PURE__ */ import_react141.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react141.default.createElement(TextContent, null, /* @__PURE__ */ import_react141.default.createElement(Text, { component: TextVariants.h3 }, "Select Attributes")), this.buildAttrDropdown()), /* @__PURE__ */ import_react141.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react141.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search Attributes",
          value: this.state.searchAttrValue,
          onChange: this.handleAttrSearchChange,
          onClear: (evt, val) => this.handleAttrSearchChange(evt, "")
        }
      )), /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react141.default.createElement(
        Pagination,
        {
          itemCount: itemCountAttr,
          page: pageAttr,
          perPage: perPageAttr,
          onSetPage: this.handleSetPageAttr,
          widgetId: "pagination-step-attributes",
          onPerPageSelect: this.handlePerPageSelectAttr,
          dropDirection: "up",
          isCompact: true
        }
      ))), /* @__PURE__ */ import_react141.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          cells: columnsAttr,
          rows: pagedRowsAttr,
          onSelect: this.handleSelectAttr,
          variant: TableVariant.compact,
          "aria-label": "Pagination Attributes",
          canSelectAll: false
        },
        /* @__PURE__ */ import_react141.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react141.default.createElement(TableBody, null)
      ));
      const myTitle = "DN ( Distinguished Name )";
      const entryValuesStep = /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, /* @__PURE__ */ import_react141.default.createElement(
        Alert,
        {
          variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
          isInline: true,
          title: myTitle
        },
        /* @__PURE__ */ import_react141.default.createElement("b", null, "Entry DN:\xA0\xA0\xA0"),
        namingAttr || "??????",
        "=",
        namingVal || "??????",
        ",",
        this.props.wizardEntryDn
      ), /* @__PURE__ */ import_react141.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react141.default.createElement(Text, { component: TextVariants.h3 }, "Set Attribute Values")), /* @__PURE__ */ import_react141.default.createElement(
        editableTable_default,
        {
          key: editableTableData,
          wizardEntryDn: this.props.wizardEntryDn,
          editableTableData,
          isAttributeSingleValued: this.isAttributeSingleValued,
          isAttributeRequired: this.isAttributeRequired,
          enableNextStep: this.enableNextStep,
          saveCurrentRows: this.saveCurrentRows,
          allObjectclasses: this.props.allObjectclasses,
          namingRowID: this.state.namingRowID,
          namingAttr: this.state.namingAttr,
          setNamingRowID: this.setNamingRowID
        }
      ));
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ import_react141.default.createElement(SimpleListItem, { key: index, isCurrent: line.startsWith("dn: ") }, line)
      );
      const ldifStatementsStep = /* @__PURE__ */ import_react141.default.createElement("div", null, /* @__PURE__ */ import_react141.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react141.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Statements"
        }
      )), /* @__PURE__ */ import_react141.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react141.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react141.default.createElement(SimpleList, { "aria-label": "LDIF data User" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const entryReviewStep = /* @__PURE__ */ import_react141.default.createElement("div", null, /* @__PURE__ */ import_react141.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react141.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for Entry Modification"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react141.default.createElement("div", null, /* @__PURE__ */ import_react141.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding entry ...")
      )), resultVariant === "danger" && /* @__PURE__ */ import_react141.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react141.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react141.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react141.default.createElement("h6", { key: line.id }, line.data)))), /* @__PURE__ */ import_react141.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "Create CoS Template",
          isOpen: this.state.isConfirmModalOpen,
          onClose: this.handleConfirmModalToggle,
          actions: [
            /* @__PURE__ */ import_react141.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleCreateTemplateEnd }, "Create Template"),
            /* @__PURE__ */ import_react141.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleConfirmModalToggle }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react141.default.createElement(Grid, null, /* @__PURE__ */ import_react141.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react141.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react141.default.createElement(Text, null, "You've chosen 'Classic' CoS type. cosTemplateDN attribute is set to ", this.props.wizardEntryDn, "."), /* @__PURE__ */ import_react141.default.createElement(Text, null, "Do you want to create a CoS template now?"), /* @__PURE__ */ import_react141.default.createElement(Text, null, "It will be added as a child to this entry: '", this.props.wizardEntryDn, "'"))))
      ));
      let finishButtonName;
      if (this.props.cosDefCreateMoreTemplate) {
        finishButtonName = "Create More Templates";
      } else if (this.props.definitionWizardEntryDn !== "") {
        finishButtonName = "Back to CoS Definition";
      } else {
        finishButtonName = "Finish";
      }
      const addEntrySteps = [
        ...this.props.definitionWizardEntryDn !== "" || this.props.cosDefCreateMoreTemplate ? [] : [
          {
            id: 1,
            name: this.props.firstStep[0].name,
            component: this.props.firstStep[0].component,
            canJumpTo: stepIdReached >= 1 && stepIdReached < 8,
            hideBackButton: true
          }
        ],
        {
          id: 2,
          name: "Select Name & Priority",
          component: namingValAndPriority,
          enableNext: namingVal !== "",
          canJumpTo: stepIdReached >= 2 && stepIdReached < 8
        },
        {
          id: 3,
          name: "Select ObjectClasses",
          component: objectClassStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 8,
          enableNext: selectedObjectClasses.length > 1
        },
        {
          id: 4,
          name: "Select Attributes",
          component: attributeStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 8,
          enableNext: selectedAttributes.length > 0
        },
        {
          id: 5,
          name: "Edit Values",
          component: entryValuesStep,
          canJumpTo: stepIdReached >= 5 && stepIdReached < 8,
          enableNext: validMods
        },
        {
          id: 6,
          name: "LDIF Statements",
          component: ldifStatementsStep,
          nextButtonText: "Create Entry",
          canJumpTo: stepIdReached >= 6 && stepIdReached < 8
        },
        {
          id: 7,
          name: "Review Result",
          component: entryReviewStep,
          nextButtonText: finishButtonName,
          canJumpTo: stepIdReached >= 7 && stepIdReached < 8,
          hideBackButton: true,
          enableNext: !this.state.adding
        },
        ...this.props.definitionWizardEntryDn !== "" || this.props.cosDefCreateMoreTemplate ? [
          {
            id: 8,
            name: this.props.cosDefCreateMoreTemplate ? "Create More Templates" : "Back to CoS Definition",
            component: entryReviewStep,
            nextButtonText: "Finish",
            canJumpTo: stepIdReached >= 7 && stepIdReached < 8,
            hideBackButton: true
          }
        ] : []
      ];
      const title = /* @__PURE__ */ import_react141.default.createElement(import_react141.default.Fragment, null, "Parent DN: \xA0\xA0", /* @__PURE__ */ import_react141.default.createElement("strong", null, this.props.wizardEntryDn));
      return /* @__PURE__ */ import_react141.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.handleToggleOpenWizard,
          steps: addEntrySteps,
          title: "Add CoS Template",
          description: title,
          onNext: this.handleNext
        }
      );
    }
  };
  var addCosTemplate_default = AddCosTemplate;

  // src/lib/ldap_editor/wizards/operations/addCosDefinition.jsx
  var AddCosDefinition = class extends import_react142.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSetpageAddCoS", (_event, pageNumber) => {
        this.setState({
          pageAddCoS: pageNumber,
          pagedRowsCoS: this.getAttributesToShow(pageNumber, this.state.perpageAddCoS)
        });
      });
      __publicField(this, "onPerPageSelectAddCoS", (_event, perPage) => {
        this.setState({
          pageAddCoS: 1,
          perpageAddCoS: perPage,
          pagedRowsCoS: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "onSelect", (event, isSelected, rowId) => {
        let rows;
        let selectedAttributes;
        if (rowId === -1) {
          rows = this.state.rowsCoS.map((oneRow) => {
            oneRow.selected = isSelected;
            oneRow.isAttributeSelected = isSelected;
            return oneRow;
          });
          rows[0].selected = true;
          rows[0].isAttributeSelected = true;
          selectedAttributes = ["cn"];
          if (this.state.cosType === "pointer") {
            selectedAttributes.push("cosPointerDefinition");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          } else if (this.state.cosType === "indirect") {
            selectedAttributes.push("cosIndirectDefinition");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          } else if (this.state.cosType === "classic") {
            selectedAttributes.push("cosClassicDefinition");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          }
          this.setState(
            {
              rowsCoS: rows,
              allAttributesSelected: isSelected,
              selectedAttributes
            },
            () => {
              this.setState({
                pagedRowsCoS: this.getAttributesToShow(this.state.pageAddCoS, this.state.perpageAddCoS)
              });
              this.updateValuesTableRows();
            }
          );
        } else {
          if (this.state.pagedRowsCoS[rowId].disableCheckbox === true) {
            return;
          }
          rows = [...this.state.pagedRowsCoS];
          rows[rowId].selected = isSelected;
          const attrName = this.state.pagedRowsCoS[rowId].cells[0];
          const allItems = [...this.state.rowsCoS];
          const index = allItems.findIndex((item) => item.cells[0] === attrName);
          allItems[index].isAttributeSelected = isSelected;
          const selectedAttributes2 = allItems.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
          this.setState({
            rowsCoS: allItems,
            pagedRowsCoS: rows,
            selectedAttributes: selectedAttributes2
          }, () => this.updateValuesTableRows());
        }
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = ["cn"];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        let editableTableData = [];
        let namingAttr = this.state.namingAttr;
        let namingVal = this.state.namingVal;
        const cosAttrs = this.state.cosAttrs;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: namingVal || "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          namingRowID = editableTableData[0].id;
          namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          namingAttr = editableTableData[0].attr;
          namingVal = editableTableData[0].val;
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.state.namingRowID === -1) {
              namingRowID = editableTableData[0].id;
            }
          }
        }
        if (this.state.cosDescription !== "") {
          const decs = this.state.cosDescription;
          editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "description" || item.val !== decs);
          editableTableData.push({
            id: generateUniqueId(),
            attr: "description",
            val: decs || "",
            required: true,
            namingAttr: false
          });
        }
        if (cosAttrs.length > 0) {
          for (const i in cosAttrs) {
            const found = editableTableData.find((el) => el.attr.toLowerCase() === "cosattribute" && el.val.toLowerCase() === cosAttrs[i].name.toLowerCase());
            const attrVal = cosAttrs[i].name + (cosAttrs[i].def ? " default" : "") + (cosAttrs[i].override ? " override" : "") + (cosAttrs[i].operational ? " operational" : "") + (cosAttrs[i].opdefault ? " operational-default" : "") + (cosAttrs[i].mergeschemes ? " merge-schemes" : "");
            if (found === void 0) {
              editableTableData.push({
                id: generateUniqueId(),
                attr: "cosattribute",
                val: attrVal,
                required: true,
                namingAttr: false
              });
            }
          }
        }
        if (this.state.cosType === "pointer") {
          const dn_val = this.state.cosTemplateDNSelected;
          editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "costemplatedn" || item.val !== dn_val);
          editableTableData.push({
            id: generateUniqueId(),
            attr: "cosTemplateDn",
            val: dn_val || "",
            required: false,
            namingAttr: false
          });
        }
        let spec_attr;
        if (this.state.cosType !== "pointer") {
          if (this.state.cosType === "indirect") {
            spec_attr = "cosindirectspecifier";
          } else {
            spec_attr = "cosspecifier";
          }
          const spec_val = this.state.cosspecAttr;
          editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== spec_attr || item.val !== spec_val);
          editableTableData.push({
            id: generateUniqueId(),
            attr: spec_attr,
            val: spec_val || "",
            required: true,
            namingAttr: false
          });
        }
        this.setState({
          savedRows: editableTableData
        });
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        }, () => {
          this.generateLdifData();
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        let rows = this.state.savedRows;
        if (rows.length === 0) {
          rows = this.state.editableTableData;
        }
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        const dn_val = `${namingAttr}=${namingVal},${this.props.wizardEntryDn}`;
        rows = rows.filter((item) => item.attr.toLowerCase() === "costemplatedn");
        rows.push({
          id: generateUniqueId(),
          attr: "cosTemplateDn",
          val: dn_val,
          required: true,
          namingAttr: false
        });
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal,
          editableTableData: rows
        });
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ import_react142.default.createElement(DropdownItem, { key: attr }, attr)
        );
        return /* @__PURE__ */ import_react142.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react142.default.createElement(BadgeToggle, { id: "toggle-attr-select", onToggle: this.handleAttrDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, "0 selected ")),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState(
          { savedRows },
          () => {
            if (namingID !== -1) {
              this.setNamingRowID(namingID);
            }
          }
        );
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = [
          "ObjectClass: top",
          "ObjectClass: LdapSubEntry",
          "ObjectClass: cosSuperDefinition"
        ];
        if (this.state.cosType === "pointer") {
          objectClassData.push("ObjectClass: cosPointerDefinition");
        } else if (this.state.cosType === "indirect") {
          objectClassData.push("ObjectClass: cosIndirectDefinition");
        } else if (this.state.cosType === "classic") {
          objectClassData.push("ObjectClass: cosClassicDefinition");
        }
        const valueData = [];
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (objectClassData.length === 4) {
            continue;
          }
        }
        const ldifArray = [
          `dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      __publicField(this, "onSelectedAttrs", (attrs) => {
        this.setState({
          cosAttrs: attrs.map((attr) => {
            return {
              name: attr,
              def: false,
              override: false,
              operational: false,
              opdefault: false,
              mergeschemes: false
            };
          })
        });
      });
      this.cosAttrsColumns = [
        { title: "Name", transforms: [sortable] },
        { title: "OID", transforms: [sortable] }
      ];
      this.singleValuedAttributes = ["cosTemplateDn", "cosspecifier", "cosIndirectSpecifier"];
      this.requiredAttributes = ["cn", "cosattribute", "cosspecifier", "cosIndirectSpecifier"];
      this.attributeValidationRules = [
        {
          name: "required",
          validator: (value) => value.trim() !== "",
          errorText: "This field is required"
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        namingAttr: "",
        namingVal: this.props.cosDefName,
        cosDescription: this.props.cosDefDesc,
        ldifArray: [],
        cleanLdifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        attributeList: [],
        stepIdReached: this.props.stepReached,
        cosAttrs: [],
        // currentStepId: 1,
        itemCountAddCoS: 0,
        cosattrAttr: "",
        cosspecAttr: "",
        pageAddCoS: 1,
        perpageAddCoS: 10,
        columnsCoS: [
          { title: "Attribute Name", cellTransforms: [headerCol()] },
          { title: "From ObjectClass" }
        ],
        rowsCoS: [],
        pagedRowsCoS: [],
        selectedAttributes: ["cn"],
        isAttrDropDownOpen: false,
        cosAttrRows: [],
        tableModificationTime: 0,
        createTemplate: false,
        createTemplateEnd: false,
        createdDefiniton: "",
        // Values
        noEmptyValue: false,
        columnsValues: [
          "Attribute",
          "Value"
        ],
        // Review step
        reviewValue: "",
        reviewInvalidText: "Invalid LDIF",
        reviewIsValid: true,
        reviewValidated: "default",
        adding: true,
        // reviewHelperText: 'LDIF data'
        editableTableData: [],
        rdn: "",
        rdnValue: "",
        parentDN: "",
        isTreeLoading: false,
        cosType: this.props.cosDefType,
        cosDNs: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        showTemplateCreateModal: false,
        cosSearchBaseDn: "",
        cosParentBaseDn: "",
        cosAvailableOptions: [],
        cosTemplateDNSelected: this.props.createdTemplateDN,
        selectedItemProps: "",
        cossChosenOptions: [],
        isConfirmModalOpen: false
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          cosSearchBaseDn: treeViewItem.dn
        });
      };
      this.onParentDnSelection = (treeViewItem) => {
        this.setState({
          cosParentBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleOpenTemplateCreateModal = () => {
        this.setState({
          showTemplateCreateModal: true
        });
      };
      this.handleCloseTemplateCreateModal = () => {
        this.setState({
          showTemplateCreateModal: false
        });
      };
      this.handleCreateTemplate = () => {
        this.setState({
          createTemplate: true
        });
      };
      this.handleCreateTemplateEnd = () => {
        this.setState({
          createTemplateEnd: true
        }, () => {
          this.props.onReload();
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 7) {
          this.updateValuesTableRows();
        } else if (id === 8) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              const myDn = myLdifArray[0].substring(4);
              this.setState({
                commandOutput: result.errorCode === 0 ? "CoS Definition successfully created!" : "Failed to create cos: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false,
                createdDefiniton: myDn
              }, () => {
                this.props.onReload();
              });
              const relativeDn = myLdifArray[5].replace(": ", "=");
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        } else if (id === 9 && this.state.cosType === "classic" && this.state.resultVariant !== "danger") {
          this.setState({
            isConfirmModalOpen: true
          });
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 5) {
          this.updateValuesTableRows(true);
        }
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          cosAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.cosSearchBaseDn;
        const pattern = this.state.searchPattern;
        const filter = pattern === "" ? "(objectClass=costemplate)" : `(&(objectClass=costemplate)(cn=*${pattern}*))`;
        const attrs = "cn";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const pos0 = lines[0].indexOf(":: ");
            let dnLine = lines[0];
            if (pos0 > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = `${decoded[0]}: ${decoded[1]}`;
            }
            return /* @__PURE__ */ import_react142.default.createElement(SimpleListItem, { key: dnLine }, dnLine);
          });
          this.setState({
            cosAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.removeDuplicates = (options4) => {
        const titles = options4.map((item) => item.props.title);
        const noDuplicates = options4.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleRadioChange = (_, event) => {
        this.setState({
          cosType: event.currentTarget.id
        });
      };
      this.handleSelectTemplate = (selectedItem, selectedItemProps) => {
        this.setState({ cosTemplateDNSelected: selectedItemProps.children.substring(4) });
      };
      this.handleChange = this.handleChange.bind(this);
    }
    componentDidMount() {
      if (this.state.cosAttrRows.length > 0) {
        return;
      }
      getAttributesNameAndOid(this.props.editorLdapServer, (resArray) => {
        const cosAttrRows = resArray.map((item) => {
          return { cells: [item[0], item[1]], selected: false };
        });
        const attributeList = resArray.map((item) => {
          return item[0];
        });
        const tableModificationTime = Date.now();
        this.setState({
          cosAttrRows,
          attributeList,
          tableModificationTime
        });
      });
      this.setState({
        parentDN: this.props.wizardEntryDn,
        cosSearchBaseDn: this.props.wizardEntryDn
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsCoS.slice(start2, end2);
      return newRows;
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    handleCheckboxChange(e, name2) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const param = e.target.id;
      if (param === "def") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, def: value } : el)
        }));
      } else if (param === "override") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, override: value } : el)
        }));
      } else if (param === "operational") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, operational: value } : el)
        }));
      } else if (param === "opdefault") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, opdefault: value } : el)
        }));
      } else if (param === "mergeschemes") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, mergeschemes: value } : el)
        }));
      }
    }
    onToggleWizard() {
      this.props.handleToggleWizard();
    }
    render() {
      const {
        cosDescription,
        ldifArray,
        resultVariant,
        cosAttrRows,
        stepIdReached,
        namingVal,
        cosSearchBaseDn,
        cosAvailableOptions,
        tableModificationTime,
        showLDAPNavModal,
        commandOutput,
        cosType,
        createTemplate,
        showTemplateCreateModal,
        cosTemplateDNSelected,
        createTemplateEnd,
        cosAttrs
      } = this.state;
      if (createTemplate) {
        return /* @__PURE__ */ import_react142.default.createElement(
          addCosTemplate_default,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            wizardEntryDn: this.state.cosParentBaseDn,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            firstStep: this.props.firstStep,
            stepReached: 2,
            definitionWizardEntryDn: this.props.wizardEntryDn,
            cosDefName: this.state.namingVal,
            cosDefDesc: this.state.cosDescription,
            cosDefType: this.state.cosType
          }
        );
      } else if (createTemplateEnd) {
        return /* @__PURE__ */ import_react142.default.createElement(
          addCosTemplate_default,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            wizardEntryDn: this.state.createdDefiniton,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            firstStep: this.props.firstStep,
            stepReached: 2,
            definitionWizardEntryDn: "",
            cosDefCreateMoreTemplate: true
          }
        );
      }
      const namingValAndTypeStep = /* @__PURE__ */ import_react142.default.createElement("div", null, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h3 }, "Select Name And CoS Type")), /* @__PURE__ */ import_react142.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react142.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 2, className: "ds-label" }, "CoS Name"), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react142.default.createElement(
        TextInput,
        {
          value: namingVal,
          type: "text",
          id: "namingVal",
          "aria-describedby": "namingVal",
          name: "namingVal",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          validated: this.state.namingVal === "" ? ValidatedOptions.error : ValidatedOptions.default
        }
      )), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 2, className: "ds-label ds-margin-top-xlg" }, "Description"), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 10, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react142.default.createElement(
        TextInput,
        {
          value: cosDescription,
          type: "text",
          id: "cosDescription",
          "aria-describedby": "cosDescription",
          name: "cosDescription",
          onChange: (str, e) => {
            this.handleChange(e);
          }
        }
      ))), /* @__PURE__ */ import_react142.default.createElement(TextContent, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h5 }, "Choose CoS Type")), /* @__PURE__ */ import_react142.default.createElement("div", { className: "ds-left-margin" }, /* @__PURE__ */ import_react142.default.createElement(
        Radio,
        {
          name: "cosType",
          id: "pointer",
          value: "pointer",
          label: "Pointer",
          isChecked: this.state.cosType === "pointer",
          onChange: this.handleRadioChange,
          description: "Identifies the template entry using the template DN only."
        }
      ), /* @__PURE__ */ import_react142.default.createElement(
        Radio,
        {
          name: "cosType",
          id: "indirect",
          value: "indirect",
          label: "Indirect",
          isChecked: this.state.cosType === "indirect",
          onChange: this.handleRadioChange,
          description: "Identifies the template entry using the value of one of the target entry's attributes.",
          className: "ds-margin-top"
        }
      ), /* @__PURE__ */ import_react142.default.createElement(
        Radio,
        {
          name: "cosType",
          id: "classic",
          value: "classic",
          label: "Classic",
          isChecked: this.state.cosType === "classic",
          onChange: this.handleRadioChange,
          description: "Identifies the template entry using a combination of the template entry's base DN and the value of one of the target entry's attributes.",
          className: "ds-margin-top"
        }
      ))));
      const selectCoSTemplate = /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react142.default.createElement(Grid, null, /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h3 }, "Select CoS Template"))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react142.default.createElement(Text, null, "The CoS template entry contains the value or values of the attributes generated by the CoS logic. The CoS template entry contains a general object class of cosTemplate The CoS template entries for a given CoS are stored in the directory tree along with the CoS definition."))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 9, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, null, "Search Base:", /* @__PURE__ */ import_react142.default.createElement(
        Text,
        {
          className: "ds-left-margin",
          component: TextVariants.a,
          onClick: this.handleOpenLDAPNavModal,
          href: "#"
        },
        cosSearchBaseDn
      )))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3, className: "ds-margin-top-xlg ds-right-align" }, /* @__PURE__ */ import_react142.default.createElement(
        Button,
        {
          key: "createTemplate",
          variant: "primary",
          onClick: this.handleOpenTemplateCreateModal
        },
        "Create Template"
      )), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12, className: "ds-margin-top" }, /* @__PURE__ */ import_react142.default.createElement(
        SearchInput,
        {
          placeholder: "Find CoS Template...",
          value: this.state.searchPattern,
          onChange: (evt, val) => this.handleSearchPattern(val),
          onSearch: this.handleSearchClick,
          onClear: (evt, val) => {
            this.handleSearchPattern("");
          }
        }
      )), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12, className: "ds-margin-top" }, "CoS Template Selected: ", /* @__PURE__ */ import_react142.default.createElement("strong", null, "\xA0\xA0", cosTemplateDNSelected)), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, cosAvailableOptions.length !== 0 ? /* @__PURE__ */ import_react142.default.createElement(SimpleList, { onSelect: this.handleSelectTemplate }, cosAvailableOptions) : ""), /* @__PURE__ */ import_react142.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Choose The New CoS Template Parent DN",
          isOpen: showTemplateCreateModal,
          onClose: this.handleCloseTemplateCreateModal,
          actions: [
            /* @__PURE__ */ import_react142.default.createElement(
              Button,
              {
                key: "createTemplateModal",
                variant: "primary",
                onClick: this.handleConfirmModalToggle,
                isDisabled: this.state.cosParentBaseDn === ""
              },
              "Confirm"
            ),
            /* @__PURE__ */ import_react142.default.createElement(
              Button,
              {
                key: "cancelCreateTemplateModal",
                variant: "primary",
                onClick: this.handleCloseTemplateCreateModal
              },
              "Close"
            )
          ]
        },
        /* @__PURE__ */ import_react142.default.createElement(Card, { isHoverable: true, className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react142.default.createElement(CardBody, null, /* @__PURE__ */ import_react142.default.createElement(
          ldapNavigator_default,
          {
            treeItems: [...this.props.treeViewRootSuffixes],
            editorLdapServer: this.props.editorLdapServer,
            handleNodeOnClick: this.onParentDnSelection,
            showTreeLoadingState: this.showTreeLoadingState
          }
        )))
      ), /* @__PURE__ */ import_react142.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "Leaving CoS Definiton Creation Wizard",
          isOpen: this.state.isConfirmModalOpen,
          onClose: this.handleConfirmModalToggle,
          actions: [
            /* @__PURE__ */ import_react142.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleCreateTemplate }, "Confirm"),
            /* @__PURE__ */ import_react142.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleConfirmModalToggle }, "Cancel")
          ]
        },
        "You are about to leave CoS Definiton creation wizard. After you click 'Confirm', you'll appear in CoS Template creation wizard and you won't able to return from there until the process is finished. Then you'll be able to use the created entry in the CoS definiton creation. It'll be preselected for you automatically."
      ), /* @__PURE__ */ import_react142.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Choose A Parent DN",
          isOpen: showLDAPNavModal,
          onClose: this.handleCloseLDAPNavModal,
          actions: [
            /* @__PURE__ */ import_react142.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: this.handleCloseLDAPNavModal
              },
              "Done"
            )
          ]
        },
        /* @__PURE__ */ import_react142.default.createElement(Card, { isHoverable: true, className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react142.default.createElement(CardBody, null, /* @__PURE__ */ import_react142.default.createElement(
          ldapNavigator_default,
          {
            treeItems: [...this.props.treeViewRootSuffixes],
            editorLdapServer: this.props.editorLdapServer,
            skipLeafEntries: true,
            handleNodeOnClick: this.onBaseDnSelection,
            showTreeLoadingState: this.showTreeLoadingState
          }
        )))
      ))));
      const cosAttributesStep = /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h3 }, "Choose CoS Attributes", /* @__PURE__ */ import_react142.default.createElement(
        Tooltip,
        {
          position: "bottom",
          content: /* @__PURE__ */ import_react142.default.createElement("div", null, "The cosAttribute contains the name of the attribute for which to generate a value for the CoS. There can be more than one cosAttribute value specified.")
        },
        /* @__PURE__ */ import_react142.default.createElement("a", { className: "ds-font-size-md" }, /* @__PURE__ */ import_react142.default.createElement(InfoCircleIcon, { className: "ds-info-icon" }))
      ))), /* @__PURE__ */ import_react142.default.createElement(
        genericPagination_default,
        {
          columns: this.cosAttrsColumns,
          rows: cosAttrRows,
          actions: null,
          isSelectable: true,
          canSelectAll: false,
          enableSorting: true,
          tableModificationTime,
          handleSelectedAttrs: this.onSelectedAttrs,
          isSearchable: true
        }
      ), cosAttrRows.length === 0 && // <div className="ds-margin-bottom-md" />
      /* @__PURE__ */ import_react142.default.createElement(Bullseye, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react142.default.createElement("center", null, /* @__PURE__ */ import_react142.default.createElement(Spinner, { size: "lg" }))));
      const cosConfigAttributesStep = /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement(Grid, null, /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h3 }, "Configure CoS Attributes"))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react142.default.createElement(Text, null, "The CoS attribute contains the name of another attribute which is governed by the class of service. This attribute allows an override qualifier after the attribute value which sets how the CoS handles existing attribute values on entries when it generates attribute values."), /* @__PURE__ */ import_react142.default.createElement(Text, null, "Please, consult official documentation for more information."), /* @__PURE__ */ import_react142.default.createElement(Text, null, "If no qualifier is set, default is assumed.")))), /* @__PURE__ */ import_react142.default.createElement(Grid, { key: "header", className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h4 }, "Attribute Name"))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h4 }, "Override Qualifiers")))), /* @__PURE__ */ import_react142.default.createElement("hr", null), cosAttrs.map(({ name: name2, def, override, operational, opdefault, mergeschemes }, idx) => /* @__PURE__ */ import_react142.default.createElement(Grid, { key: idx }, /* @__PURE__ */ import_react142.default.createElement(GridItem, { className: "ds-label", span: 3 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h4 }, name2))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3, title: "Only returns a generated value if there is no corresponding attribute value stored with the entry." }, /* @__PURE__ */ import_react142.default.createElement(
        Checkbox,
        {
          id: "def",
          label: "Default",
          isChecked: def,
          onChange: (checked, e) => {
            this.handleCheckboxChange(e, name2, "def");
          }
        }
      )), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3, title: "Always returns the value generated by the CoS, even when there is a value stored with the entry." }, /* @__PURE__ */ import_react142.default.createElement(
        Checkbox,
        {
          id: "override",
          label: "Override",
          isChecked: override,
          onChange: (checked, e) => {
            this.handleCheckboxChange(e, name2, "override");
          }
        }
      )), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3, title: "Returns a generated attribute only if it is explicitly requested in the search. Operational attributes do not need to pass a schema check in order to be returned. When operational is used, it also overrides any existing attribute values." }, /* @__PURE__ */ import_react142.default.createElement(
        Checkbox,
        {
          id: "operational",
          label: "Operational",
          isChecked: operational,
          onChange: (checked, e) => {
            this.handleCheckboxChange(e, name2, "operational");
          }
        }
      )), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3 }), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3, title: "Only returns a generated value if there is no corresponding attribute value stored with the entry and if it is explicitly requested in the search." }, /* @__PURE__ */ import_react142.default.createElement(
        Checkbox,
        {
          id: "opdefault",
          label: "Operational-Default",
          isChecked: opdefault,
          onChange: (checked, e) => {
            this.handleCheckboxChange(e, name2, "opdefault");
          }
        }
      )), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 6, title: "Using the merge-schemes qualifier tells the CoS that it will, or can, generate multiple values for the managed attribute." }, /* @__PURE__ */ import_react142.default.createElement(
        Checkbox,
        {
          id: "mergeschemes",
          label: "Merge-Schemes",
          isChecked: mergeschemes,
          onChange: (checked, e) => {
            this.handleCheckboxChange(e, name2, "mergeschemes");
          }
        }
      )), /* @__PURE__ */ import_react142.default.createElement("hr", null))));
      const cosSpecifierStep = /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, /* @__PURE__ */ import_react142.default.createElement(Grid, null, /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h3 }, "Select CoS Specifier"))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react142.default.createElement(Text, null, this.state.cosType === "indirect" ? "Indirect type of CoS identifies the template entry based on the value of one of the target entry's attributes, as specified in the cosIndirectSpecifier attribute." : "Classic type of CoS identifies the template entry using both the template entry's DN (which you will assign later) and the value of one of the target entry's attributes (set in the cosSpecifier attribute).")))), /* @__PURE__ */ import_react142.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 3, className: "ds-label" }, /* @__PURE__ */ import_react142.default.createElement(TextContent, null, /* @__PURE__ */ import_react142.default.createElement(Text, { component: TextVariants.h4 }, this.state.cosType === "indirect" ? "Indirect " : "Classic ", "Specifier"))), /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 5, className: "ds-left-margin" }, /* @__PURE__ */ import_react142.default.createElement(FormSelect, { id: "cosspecAttr", value: this.state.cosspecAttr, onChange: (str, e) => {
        this.handleChange(e);
      }, "aria-label": "FormSelect Input" }, /* @__PURE__ */ import_react142.default.createElement(FormSelectOption, { value: "", label: "Select an attribute", isPlaceholder: true }), this.state.attributeList.map((attr, index) => /* @__PURE__ */ import_react142.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }))))));
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ import_react142.default.createElement(SimpleListItem, { key: index, isCurrent: line.startsWith("dn: ") }, line)
      );
      const cosCreationStep = /* @__PURE__ */ import_react142.default.createElement("div", null, /* @__PURE__ */ import_react142.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Content for CoS Creation"
        }
      ), /* @__PURE__ */ import_react142.default.createElement(Card, { isHoverable: true }, /* @__PURE__ */ import_react142.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react142.default.createElement(SimpleList, { "aria-label": "LDIF data User" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const cosReviewStep = /* @__PURE__ */ import_react142.default.createElement("div", null, /* @__PURE__ */ import_react142.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for CoS Creation"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react142.default.createElement("div", null, /* @__PURE__ */ import_react142.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding CoS definition ...")
      ), resultVariant === "danger" && /* @__PURE__ */ import_react142.default.createElement(Card, { isHoverable: true }, /* @__PURE__ */ import_react142.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react142.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react142.default.createElement("h6", { key: line.id }, line.data)))), /* @__PURE__ */ import_react142.default.createElement(
        Modal,
        {
          variant: ModalVariant.small,
          title: "Create CoS Template",
          isOpen: this.state.isConfirmModalOpen,
          onClose: this.handleConfirmModalToggle,
          actions: [
            /* @__PURE__ */ import_react142.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleCreateTemplateEnd }, "Confirm"),
            /* @__PURE__ */ import_react142.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleConfirmModalToggle }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react142.default.createElement(Grid, null, /* @__PURE__ */ import_react142.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react142.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react142.default.createElement(Text, null, "You've chosen 'Classic' CoS type. cosTemplateDN attribute is set to ", this.state.createdDefiniton, "."), /* @__PURE__ */ import_react142.default.createElement(Text, null, "Do you want to create a CoS template now?"), /* @__PURE__ */ import_react142.default.createElement(Text, null, "It will be added as a child to this entry: '", this.state.createdDefiniton, "'"))))
      ));
      const addCoSSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 9,
          hideBackButton: true
        },
        {
          id: 2,
          name: "Select Type",
          component: namingValAndTypeStep,
          enableNext: namingVal !== "",
          canJumpTo: stepIdReached >= 2 && stepIdReached < 9
        },
        ...cosType === "pointer" ? [
          {
            id: 3,
            name: "Select CoS Template",
            component: selectCoSTemplate,
            canJumpTo: stepIdReached >= 3 && stepIdReached < 9,
            enableNext: this.state.cosTemplateDNSelected !== ""
          }
        ] : [],
        {
          id: 4,
          name: "Select CoS Attributes",
          component: cosAttributesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 9,
          enableNext: this.state.cosAttrs.length > 0
        },
        {
          id: 5,
          name: "Configure CoS Attributes",
          component: cosConfigAttributesStep,
          canJumpTo: stepIdReached >= 5 && stepIdReached < 9,
          enableNext: this.state.cosAttrs.length > 0
        },
        ...cosType !== "pointer" ? [
          {
            id: 6,
            name: "Select CoS Specifier",
            component: cosSpecifierStep,
            canJumpTo: stepIdReached >= 6 && stepIdReached < 9,
            enableNext: this.state.cosspecAttr !== ""
          }
        ] : [],
        {
          id: 7,
          name: "Create CoS",
          component: cosCreationStep,
          nextButtonText: "Create",
          canJumpTo: stepIdReached >= 7 && stepIdReached < 9
        },
        {
          id: 8,
          name: "Review Result",
          component: cosReviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached >= 8 && stepIdReached < 9,
          hideBackButton: true,
          enableNext: !this.state.adding
        },
        ...this.state.cosType === "classic" && resultVariant !== "danger" ? [
          {
            id: 9,
            name: "Create Templates",
            component: cosReviewStep,
            nextButtonText: "Finish",
            canJumpTo: stepIdReached > 9,
            hideBackButton: true,
            enableNext: !this.state.adding
          }
        ] : []
      ];
      const title = /* @__PURE__ */ import_react142.default.createElement(import_react142.default.Fragment, null, "Parent DN: \xA0\xA0", /* @__PURE__ */ import_react142.default.createElement("strong", null, this.props.wizardEntryDn));
      return /* @__PURE__ */ import_react142.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: "Add A CoS Definition",
          description: title,
          steps: addCoSSteps
        }
      );
    }
  };
  var addCosDefinition_default = AddCosDefinition;

  // src/lib/ldap_editor/wizards/cos.jsx
  var CoSEntryWizard = class extends import_react143.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleOnChange", (_, event) => {
        this.setState({ getStartedStepRadio: event.currentTarget.value });
      });
      __publicField(this, "createInitialLayout", () => {
        return [
          {
            id: 1,
            name: "Get Started",
            component: /* @__PURE__ */ import_react143.default.createElement("div", null, /* @__PURE__ */ import_react143.default.createElement(Grid, null, /* @__PURE__ */ import_react143.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react143.default.createElement(TextContent, null, /* @__PURE__ */ import_react143.default.createElement(Text, { component: TextVariants.h3 }, "Select CoS Type"))), /* @__PURE__ */ import_react143.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react143.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react143.default.createElement(Text, null, "A class of service definition (CoS) shares attributes between entries in a way that is transparent to applications. CoS simplifies entry management and reduces storage requirements."), /* @__PURE__ */ import_react143.default.createElement(Text, null, "Clients of the Directory Server read the attributes in a user's entry. With CoS, some attribute values may not be stored within the entry itself. Instead, these attribute values are generated by class of service logic as the entry is sent to the client application.")))), /* @__PURE__ */ import_react143.default.createElement(
              Radio,
              {
                className: "ds-margin-top-lg",
                value: "CoSDefinition",
                isChecked: this.state.getStartedStepRadio === "CoSDefinition",
                onChange: this.handleOnChange,
                label: "Create a new CoS Definition",
                description: "The CoS definition entry identifies the type of CoS used. The CoS definition entry is below the branch at which it is effective.",
                name: "radio-new-step-start",
                id: "radio-new-step-start-1"
              }
            ), /* @__PURE__ */ import_react143.default.createElement(
              Radio,
              {
                className: "ds-margin-top-lg",
                value: "CoSTemplate",
                isChecked: this.state.getStartedStepRadio === "CoSTemplate",
                onChange: this.handleOnChange,
                label: "Create a new CoS Template",
                description: "The CoS template entry contains a list of the shared attribute values. Changes to the template entry attribute values are automatically applied to all the entries within the scope of the CoS.",
                name: "radio-new-step-start",
                id: "radio-new-step-start-2"
              }
            ))
          }
        ];
      });
      this.state = {
        stepIdReached: 1,
        getStartedStepRadio: "CoSDefinition"
      };
    }
    render() {
      const {
        getStartedStepRadio
      } = this.state;
      const initialStep = this.createInitialLayout();
      const wizardProps = {
        isWizardOpen: this.props.isWizardOpen,
        handleToggleWizard: this.props.handleToggleWizard,
        wizardEntryDn: this.props.wizardEntryDn,
        editorLdapServer: this.props.editorLdapServer,
        setWizardOperationInfo: this.props.setWizardOperationInfo,
        firstStep: initialStep,
        onReload: this.props.onReload
      };
      if (getStartedStepRadio === "CoSDefinition") {
        return /* @__PURE__ */ import_react143.default.createElement(
          addCosDefinition_default,
          {
            ...wizardProps,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            createdTemplateDN: "",
            stepReached: 1,
            cosDefName: "",
            cosDefDesc: "",
            cosDefType: "pointer"
          }
        );
      } else if (getStartedStepRadio === "CoSTemplate") {
        return /* @__PURE__ */ import_react143.default.createElement(
          addCosTemplate_default,
          {
            ...wizardProps,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            definitionWizardEntryDn: "",
            stepReached: 1
          }
        );
      }
    }
  };
  var cos_default = CoSEntryWizard;

  // src/lib/ldap_editor/wizards/newEntry.jsx
  var import_react149 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/addUser.jsx
  var import_react144 = __toESM(require_react(), 1);
  var AddUser = class extends import_react144.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSetPageAddUser", (_event, pageNumber) => {
        this.setState({
          pageAddUser: pageNumber,
          pagedRowsUser: this.getAttributesToShow(pageNumber, this.state.perPageAddUser)
        });
      });
      __publicField(this, "handlePerPageSelectAddUser", (_event, perPage) => {
        this.setState({
          pageAddUser: 1,
          perPageAddUser: perPage,
          pagedRowsUser: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttrs[this.state.accountType].includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttrs[this.state.accountType].includes(attr);
      });
      __publicField(this, "handleSelect", (event, isSelected, rowId) => {
        if (this.state.pagedRowsUser[rowId].disableCheckbox === true) {
          return;
        }
        const rows = [...this.state.pagedRowsUser];
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].cells[0];
        const allItems = [...this.state.rowsUser];
        const allAttrs = this.state.rowsOrig;
        const index = allItems.findIndex((item) => item.cells[0] === attrName);
        allItems[index].isAttributeSelected = isSelected;
        const selectedAttributes = allAttrs.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
        this.setState(
          {
            rowsUser: allItems,
            pagedRowsUser: rows,
            selectedAttributes
          },
          () => this.updateValuesTableRows()
        );
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = [...this.state.selectedAttributes];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        let editableTableData = [];
        let namingAttr = this.state.namingAttr;
        let namingVal = this.state.namingVal;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          namingRowID = editableTableData[0].id;
          namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          namingAttr = editableTableData[0].attr;
          namingVal = editableTableData[0].val;
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.state.namingRowID === -1) {
              namingRowID = editableTableData[0].id;
            }
          }
        }
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        let rows = this.state.savedRows;
        if (rows.length === 0) {
          rows = this.state.editableTableData;
        }
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ import_react144.default.createElement(DropdownItem, { key: attr }, attr)
        );
        return /* @__PURE__ */ import_react144.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react144.default.createElement(BadgeToggle, { id: "toggle-attr-select", onToggle: this.handleAttrDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, "0 selected ")),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState({
          savedRows
        }, () => {
          if (namingID !== -1) {
            this.setNamingRowID(namingID);
          }
        });
      });
      __publicField(this, "generateLdifData", () => {
        const ldifArray = [];
        let isFilePath = false;
        const objectClassData = this.userObjectclasses[this.state.accountType];
        const cleanLdifArray = [];
        ldifArray.push(`dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`);
        ldifArray.push(...objectClassData);
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          const attrVal = item.val;
          isFilePath = false;
          if ((typeof attrVal === "string" || attrVal instanceof String) && attrVal.toLowerCase().startsWith("file:/")) {
            isFilePath = true;
          }
          const mySeparator = BINARY_ATTRIBUTES.includes(attrName.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
          const valueToUse = item.encodedvalue ? item.encodedvalue : attrVal;
          const remainingData = foldLine(`${attrName}${mySeparator} ${valueToUse}`);
          ldifArray.push(...remainingData);
          if (attrName.toLowerCase().startsWith("userpassword")) {
            cleanLdifArray.push("userpassword: ********");
          } else if (attrName.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
            const myTruncatedValue = /* @__PURE__ */ import_react144.default.createElement("div", null, "jpegphoto:: ", /* @__PURE__ */ import_react144.default.createElement(Label, { icon: /* @__PURE__ */ import_react144.default.createElement(InfoCircleIcon, null), color: "blue" }, "Value is too large to display"));
            cleanLdifArray.push(myTruncatedValue);
          } else {
            cleanLdifArray.push(...remainingData);
          }
        }
        this.setState({ ldifArray, cleanLdifArray });
      });
      this.userObjectclasses = {
        "Basic Account": [
          "objectclass: top",
          "objectClass: nsPerson",
          "objectClass: nsAccount",
          "objectClass: nsOrgPerson"
        ],
        "Posix Account": [
          "objectclass: top",
          "objectClass: nsPerson",
          "objectClass: nsAccount",
          "objectClass: nsOrgPerson",
          "objectClass: posixAccount"
        ],
        "Service Account": [
          "objectclass: top",
          "objectClass: applicationProcess",
          "objectClass: nsAccount"
        ]
      };
      this.allowedAttrs = {
        "Basic Account": [
          "businessCategory",
          "carLicense",
          "departmentNumber",
          "description",
          "employeeNumber",
          "employeeType",
          "homePhone",
          "homePostalAddress",
          "initials",
          "jpegPhoto",
          "labeledURI",
          "legalName",
          "mail",
          "manager",
          "mobile",
          "nsRoleDN",
          "o",
          "pager",
          "photo",
          "preferredLanguage",
          "nsCertSubjectDN",
          "nsSshPublicKey",
          "roomNumber",
          "seeAlso",
          "telephoneNumber",
          "uid",
          "userCertificate",
          "userPassword",
          "userSMIMECertificate",
          "userPKCS12",
          "x500UniqueIdentifier"
        ],
        "Posix Account": [
          "businessCategory",
          "carLicense",
          "departmentNumber",
          "description",
          "employeeNumber",
          "employeeType",
          "homePhone",
          "homePostalAddress",
          "initials",
          "jpegPhoto",
          "labeledURI",
          "legalName",
          "mail",
          "manager",
          "mobile",
          "nsRoleDN",
          "o",
          "pager",
          "photo",
          "preferredLanguage",
          "nsCertSubjectDN",
          "nsSshPublicKey",
          "roomNumber",
          "seeAlso",
          "telephoneNumber",
          "userCertificate",
          "userPassword",
          "userSMIMECertificate",
          "userPKCS12",
          "x500UniqueIdentifier",
          "loginShell",
          "gecos"
        ],
        "Service Account": [
          "seeAlso",
          "ou",
          "l",
          "description",
          "userCertificate",
          "nsCertSubjectDN",
          "nsRoleDN",
          "nsSshPublicKey",
          "userPassword"
        ]
      };
      this.requiredAttrs = {
        "Basic Account": [
          "cn",
          "displayName"
        ],
        "Posix Account": [
          "cn",
          "uid",
          "uidNumber",
          "gidNumber",
          "homeDirectory",
          "displayName"
        ],
        "Service Account": [
          "cn"
        ]
      };
      this.singleValuedAttrs = {
        "Basic Account": [
          "preferredDeliveryMethod",
          "displayName",
          "employeeNumber",
          "preferredLanguage",
          "userPassword"
        ],
        "Posix Account": [
          "preferredDeliveryMethod",
          "displayName",
          "employeeNumber",
          "preferredLanguage",
          "userPassword",
          "uidNumber",
          "gidNumber",
          "homeDirectory",
          "loginShell",
          "gecos"
        ],
        "Service Account": [
          "userpassword"
        ]
      };
      this.attributeValidationRules = [
        {
          name: "required",
          validator: (value) => value.trim() !== "",
          errorText: "This field is required"
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        namingAttr: "",
        namingVal: "",
        ldifArray: [],
        cleanLdifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        searchValue: "",
        stepIdReached: 1,
        itemCountAddUser: 0,
        pageAddUser: 1,
        perPageAddUser: 10,
        columnsUser: [
          { title: "Attribute Name", cellTransforms: [headerCol()] }
        ],
        rowsUser: [],
        rowsOrig: [],
        pagedRowsUser: [],
        selectedAttributes: [],
        isAttrDropDownOpen: false,
        // Values
        noEmptyValue: false,
        columnsValues: [
          "Attribute",
          "Value"
        ],
        // Review step
        reviewValue: "",
        reviewInvalidText: "Invalid LDIF",
        reviewIsValid: true,
        reviewValidated: "default",
        editableTableData: [],
        rdn: "",
        rdnValue: "",
        adding: true,
        accountType: "Basic Account",
        isOpenType: false
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.updateValuesTableRows();
        } else if (id === 5) {
          this.generateLdifData();
        } else if (id === 6) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? "Successfully added user!" : "Failed to add user, error: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 4) {
          this.updateValuesTableRows(true);
        }
      };
      this.handleToggleType = (isOpenType) => {
        this.setState({
          isOpenType
        });
      };
      this.handleSelectType = (event, selection) => {
        const attributesArray = [];
        let selectedAttrs = [];
        this.allowedAttrs[selection].map((attr) => {
          attributesArray.push({ cells: [attr] });
          return [];
        });
        this.requiredAttrs[selection].map((attr) => {
          attributesArray.push({
            cells: [attr],
            selected: true,
            isAttributeSelected: true,
            disableCheckbox: true
          });
          return [];
        });
        selectedAttrs = [...this.requiredAttrs[selection]];
        attributesArray.sort((a2, b) => a2.cells[0] > b.cells[0] ? 1 : -1);
        this.setState({
          itemCountAddUser: attributesArray.length,
          rowsUser: attributesArray,
          rowsOrig: [...attributesArray],
          pagedRowsUser: attributesArray.slice(0, this.state.perPageAddUser),
          accountType: selection,
          selectedAttributes: selectedAttrs,
          isOpenType: false
        });
      };
      this.handleAttrSearchChange = (value) => {
        let attrRows = [];
        let allAttrs = [];
        const val = value.toLowerCase();
        allAttrs = this.state.rowsOrig;
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.cells[0].toLowerCase();
            if (name2.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsUser: attrRows,
          pagedRowsUser: attrRows.slice(0, this.state.perPageAttr),
          itemCountAddUser: attrRows.length,
          searchValue: value
        });
      };
    }
    componentDidMount() {
      const attributesArray = [];
      this.allowedAttrs[this.state.accountType].map((attr) => {
        attributesArray.push({ cells: [attr] });
        return [];
      });
      this.requiredAttrs[this.state.accountType].map((attr) => {
        attributesArray.push({
          cells: [attr],
          selected: true,
          isAttributeSelected: true,
          disableCheckbox: true
        });
        return [];
      });
      attributesArray.sort((a2, b) => a2.cells[0] > b.cells[0] ? 1 : -1);
      this.setState({
        itemCountAddUser: attributesArray.length,
        rowsUser: attributesArray,
        rowsOrig: [...attributesArray],
        pagedRowsUser: attributesArray.slice(0, this.state.perPageAddUser),
        selectedAttributes: [...this.requiredAttrs[this.state.accountType]]
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsUser.slice(start2, end2);
      return newRows;
    }
    render() {
      const {
        commandOutput,
        itemCountAddUser,
        pageAddUser,
        perPageAddUser,
        columnsUser,
        pagedRowsUser,
        ldifArray,
        cleanLdifArray,
        noEmptyValue,
        namingAttrVal,
        namingAttr,
        namingVal,
        resultVariant,
        editableTableData,
        stepIdReached
      } = this.state;
      const rdnValue = namingVal;
      const myTitle = namingAttrVal === "" || rdnValue === "" ? "Invalid Naming Attribute - Empty Value!" : "DN ( Distinguished Name )";
      const userSelectStep = /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, /* @__PURE__ */ import_react144.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react144.default.createElement(TextContent, null, /* @__PURE__ */ import_react144.default.createElement(Text, { component: TextVariants.h3 }, "Select Entry Type"))), /* @__PURE__ */ import_react144.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react144.default.createElement(
        Select,
        {
          variant: SelectVariant.single,
          className: "ds-margin-top-lg",
          "aria-label": "Select user type",
          onToggle: this.handleToggleType,
          onSelect: this.handleSelectType,
          selections: this.state.accountType,
          isOpen: this.state.isOpenType
        },
        /* @__PURE__ */ import_react144.default.createElement(SelectOption, { key: "user", value: "Basic Account" }),
        /* @__PURE__ */ import_react144.default.createElement(SelectOption, { key: "posix", value: "Posix Account" }),
        /* @__PURE__ */ import_react144.default.createElement(SelectOption, { key: "service", value: "Service Account" })
      ), /* @__PURE__ */ import_react144.default.createElement(TextContent, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react144.default.createElement(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md" }, /* @__PURE__ */ import_react144.default.createElement("b", null, "Basic Account"), " - This type of user entry uses a common set of objectclasses (nsPerson, nsAccount, and nsOrgPerson)."), /* @__PURE__ */ import_react144.default.createElement(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md" }, /* @__PURE__ */ import_react144.default.createElement("b", null, "Posix Account"), " - This type of user entry uses a similar set of objectclasses as the ", /* @__PURE__ */ import_react144.default.createElement("i", null, "Basic Account"), " (nsPerson, nsAccount, nsOrgPerson, and posixAccount), but it includes POSIX attributes like:", /* @__PURE__ */ import_react144.default.createElement("i", null, "uidNumber, gidNumber, homeDirectory, loginShell, and gecos"), "."), /* @__PURE__ */ import_react144.default.createElement(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md" }, /* @__PURE__ */ import_react144.default.createElement("b", null, "Service Account"), " - This type of entry uses a bare minimum of objectclasses (nsAccount, and applicationProcess) and attributes to create a simple object used to represent a service (not a user identity)."))));
      const userAttributesStep = /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, /* @__PURE__ */ import_react144.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react144.default.createElement(TextContent, null, /* @__PURE__ */ import_react144.default.createElement(Text, { component: TextVariants.h3 }, "Select Entry Attributes")), this.buildAttrDropdown()), /* @__PURE__ */ import_react144.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react144.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react144.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search Attributes",
          value: this.state.searchValue,
          onChange: (evt, val) => this.handleAttrSearchChange(val),
          onClear: () => this.handleAttrSearchChange("")
        }
      )), /* @__PURE__ */ import_react144.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react144.default.createElement(
        Pagination,
        {
          itemCount: itemCountAddUser,
          page: pageAddUser,
          perPage: perPageAddUser,
          onSetPage: this.handleSetPageAddUser,
          widgetId: "pagination-options-menu-add-user",
          onPerPageSelect: this.handlePerPageSelectAddUser,
          isCompact: true
        }
      ))), /* @__PURE__ */ import_react144.default.createElement(
        Table,
        {
          cells: columnsUser,
          rows: pagedRowsUser,
          onSelect: this.handleSelect,
          variant: TableVariant.compact,
          "aria-label": "Pagination User Attributes",
          canSelectAll: false
        },
        /* @__PURE__ */ import_react144.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react144.default.createElement(TableBody, null)
      ));
      const userValuesStep = /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, /* @__PURE__ */ import_react144.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react144.default.createElement(Grid, null, /* @__PURE__ */ import_react144.default.createElement(GridItem, { className: "ds-margin-top", span: 12 }, /* @__PURE__ */ import_react144.default.createElement(
        Alert,
        {
          variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
          isInline: true,
          title: myTitle
        },
        /* @__PURE__ */ import_react144.default.createElement("b", null, "Entry DN:\xA0\xA0\xA0"),
        namingAttr || "??????",
        "=",
        namingVal || "??????",
        ",",
        this.props.wizardEntryDn
      )), /* @__PURE__ */ import_react144.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react144.default.createElement(TextContent, null, /* @__PURE__ */ import_react144.default.createElement(Text, { component: TextVariants.h3 }, "Set Attribute Values"))))), /* @__PURE__ */ import_react144.default.createElement(GridItem, { className: "ds-left-margin", span: 11 }, /* @__PURE__ */ import_react144.default.createElement(
        editableTable_default,
        {
          key: editableTableData,
          editableTableData,
          isAttributeSingleValued: this.isAttributeSingleValued,
          isAttributeRequired: this.isAttributeRequired,
          enableNextStep: this.enableNextStep,
          setNamingRowID: this.setNamingRowID,
          saveCurrentRows: this.saveCurrentRows,
          namingRowID: this.state.namingRowID,
          namingAttr: this.state.namingAttr
        }
      )));
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ import_react144.default.createElement(SimpleListItem, { key: index, isCurrent: (typeof line === "string" || line instanceof String) && line.startsWith("dn: ") }, line)
      );
      const userCreationStep = /* @__PURE__ */ import_react144.default.createElement("div", null, /* @__PURE__ */ import_react144.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Content for User Creation"
        }
      ), /* @__PURE__ */ import_react144.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react144.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react144.default.createElement(SimpleList, { "aria-label": "LDIF data User" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const userReviewStep = /* @__PURE__ */ import_react144.default.createElement("div", null, /* @__PURE__ */ import_react144.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for User Creation"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react144.default.createElement("div", null, /* @__PURE__ */ import_react144.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding user ...")
      ), resultVariant === "danger" && /* @__PURE__ */ import_react144.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react144.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react144.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react144.default.createElement("h6", { key: line.id }, line.data)))));
      const addUserSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          hideBackButton: true
        },
        {
          id: 2,
          name: "Choose User Type",
          component: userSelectStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6
        },
        {
          id: 3,
          name: "Select Attributes",
          component: userAttributesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6
        },
        {
          id: 4,
          name: "Set Values",
          component: userValuesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6,
          enableNext: noEmptyValue
        },
        {
          id: 5,
          name: "Create User",
          component: userCreationStep,
          nextButtonText: "Create User",
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: "Review Result",
          component: userReviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached >= 6,
          hideBackButton: true,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ import_react144.default.createElement(import_react144.default.Fragment, null, "Parent DN: \xA0\xA0", /* @__PURE__ */ import_react144.default.createElement("strong", null, this.props.wizardEntryDn));
      return /* @__PURE__ */ import_react144.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: "Add A User",
          description: title,
          steps: addUserSteps
        }
      );
    }
  };
  var addUser_default = AddUser;

  // src/lib/ldap_editor/wizards/operations/addGroup.jsx
  var import_react145 = __toESM(require_react(), 1);
  var AddGroup = class extends import_react145.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "generateLdifData", () => {
        const objectClassData = ["objectClass: top"];
        const valueData = [];
        let memberAttr = "";
        if (this.state.posixGroup) {
          objectClassData.push("objectClass: groupOfNames");
          objectClassData.push("objectClass: posixGroup");
          memberAttr = "member";
        } else {
          if (this.state.memberAttr === "uniquemember") {
            objectClassData.push("objectClass: groupOfUniqueNames");
            memberAttr = "uniquemember";
          } else {
            objectClassData.push("objectClass: groupOfNames");
            memberAttr = "member";
          }
        }
        if (this.state.groupDesc !== "") {
          valueData.push(`description: ${this.state.groupDesc}`);
        }
        if (this.state.posixGroup && this.state.gidNumber > 0) {
          valueData.push(`gidNumber: ${this.state.gidNumber}`);
        }
        for (const userObj of this.state.usersChosenOptions) {
          const dn_val = userObj.props.title.replace(/^dn: /, "");
          valueData.push(`${memberAttr}: ${dn_val}`);
        }
        const ldifArray = [
          `dn: cn=${this.state.groupName},${this.props.wizardEntryDn}`,
          ...objectClassData,
          `cn: ${this.state.groupName}`,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      this.minValue = 0;
      this.maxValue = 1878982656;
      this.state = {
        parentDN: "",
        groupName: "",
        isTreeLoading: false,
        groupType: "Basic Group",
        isOpenType: false,
        memberAttr: "member",
        members: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        usersSearchBaseDn: "",
        usersAvailableOptions: [],
        usersChosenOptions: [],
        ldifArray: [],
        resultVariant: "default",
        commandOutput: "",
        stepIdReached: 1,
        noEmptyValue: false,
        adding: true,
        posixGroup: false,
        gidNumber: 0,
        groupDesc: ""
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          usersSearchBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 5) {
          this.generateLdifData();
        } else if (id === 6) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? "Group successfully created!" : "Failed to create group, error: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const relativeDn = myLdifArray[3].replace(": ", "=");
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 5) {
          this.updateValuesTableRows(true);
        }
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          usersAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.usersSearchBaseDn;
        const pattern = this.state.searchPattern;
        const filter = pattern === "" ? "(|(objectClass=person)(objectClass=nsPerson))" : `(&(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))(|(cn=*${pattern}*)(uid=${pattern})))`;
        const attrs = "cn uid";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const pos0 = lines[0].indexOf(":: ");
            const pos1 = lines[1].indexOf(":: ");
            let dnLine = lines[0];
            if (pos0 > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = `${decoded[0]}: ${decoded[1]}`;
            }
            const value = pos1 === -1 ? lines[1].split(": ")[1] : decodeLine(lines[1])[1];
            return /* @__PURE__ */ import_react145.default.createElement("span", { title: dnLine, key: dnLine }, value);
          });
          this.setState({
            usersAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.removeDuplicates = (options4) => {
        const titles = options4.map((item) => item.props.title);
        const noDuplicates = options4.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleUsersOnListChange = (newAvailableOptions, newChosenOptions) => {
        const newAvailNoDups = this.removeDuplicates(newAvailableOptions);
        const newChosenNoDups = this.removeDuplicates(newChosenOptions);
        this.setState({
          usersAvailableOptions: newAvailNoDups.sort(),
          usersChosenOptions: newChosenNoDups.sort()
        });
      };
      this.handleRadioChange = (_, event) => {
        this.setState({
          memberAttr: event.currentTarget.id
        });
      };
      this.handleToggleType = (isOpenType) => {
        this.setState({
          isOpenType
        });
      };
      this.handleSelectType = (event, selection) => {
        this.setState({
          posixGroup: selection === "Posix Group",
          groupType: selection,
          isOpenType: false
        });
      };
      this.onMinusConfig = (id) => {
        if (Number(this.state[id]) - 1 < 1) {
          return;
        }
        this.setState({
          [id]: Number(this.state[id]) - 1
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        });
      };
      this.handleChange = this.handleChange.bind(this);
    }
    componentDidMount() {
      this.setState({
        parentDN: this.props.wizardEntryDn,
        usersSearchBaseDn: this.props.wizardEntryDn
      });
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    render() {
      const {
        groupName,
        usersSearchBaseDn,
        usersAvailableOptions,
        usersChosenOptions,
        showLDAPNavModal,
        ldifArray,
        resultVariant,
        commandOutput,
        stepIdReached,
        groupDesc
      } = this.state;
      const groupSelectStep = /* @__PURE__ */ import_react145.default.createElement(import_react145.default.Fragment, null, /* @__PURE__ */ import_react145.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react145.default.createElement(TextContent, null, /* @__PURE__ */ import_react145.default.createElement(Text, { component: TextVariants.h3 }, "Select Group Type"))), /* @__PURE__ */ import_react145.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react145.default.createElement(
        Select,
        {
          variant: SelectVariant.single,
          className: "ds-margin-top-lg",
          "aria-label": "Select group type",
          onToggle: this.handleToggleType,
          onSelect: this.handleSelectType,
          selections: this.state.groupType,
          isOpen: this.state.isOpenType
        },
        /* @__PURE__ */ import_react145.default.createElement(SelectOption, { key: "group", value: "Basic Group" }),
        /* @__PURE__ */ import_react145.default.createElement(SelectOption, { key: "posix", value: "Posix Group" })
      ), /* @__PURE__ */ import_react145.default.createElement(TextContent, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react145.default.createElement(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md" }, /* @__PURE__ */ import_react145.default.createElement("b", null, "Basic Group"), " - This type of group can use membership attributes: member, or uniqueMember common set of objectclasses and attributes."), /* @__PURE__ */ import_react145.default.createElement(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md" }, /* @__PURE__ */ import_react145.default.createElement("b", null, "Posix Group"), " - This type of group uses the 'GroupOfNames' and 'PosixGroup' objectclasses which allows for attributes like ", /* @__PURE__ */ import_react145.default.createElement("i", null, "gidNumber"), ", etc"))));
      const groupNameStep = /* @__PURE__ */ import_react145.default.createElement("div", null, /* @__PURE__ */ import_react145.default.createElement(TextContent, null, /* @__PURE__ */ import_react145.default.createElement(Text, { component: TextVariants.h3 }, "Select Name")), /* @__PURE__ */ import_react145.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react145.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Group Name"), /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react145.default.createElement(
        TextInput,
        {
          value: groupName,
          type: "text",
          id: "groupName",
          "aria-describedby": "groupName",
          name: "groupName",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          validated: this.state.groupName === "" ? ValidatedOptions.error : ValidatedOptions.default
        }
      ))), /* @__PURE__ */ import_react145.default.createElement(Grid, { title: "Optional description for this group." }, /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Group Description"), /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react145.default.createElement(
        TextInput,
        {
          value: groupDesc,
          type: "text",
          id: "groupDesc",
          "aria-describedby": "groupDesc",
          name: "groupDesc",
          onChange: (str, e) => {
            this.handleChange(e);
          }
        }
      ))), !this.state.posixGroup && /* @__PURE__ */ import_react145.default.createElement(import_react145.default.Fragment, null, /* @__PURE__ */ import_react145.default.createElement(TextContent, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react145.default.createElement(Text, { component: TextVariants.h5 }, "Choose The Membership")), /* @__PURE__ */ import_react145.default.createElement("div", { className: "ds-left-margin" }, /* @__PURE__ */ import_react145.default.createElement(
        Radio,
        {
          name: "memberAttrGroup",
          id: "member",
          value: "member",
          label: "member",
          isChecked: this.state.memberAttr === "member",
          onChange: this.handleRadioChange,
          description: "This group uses objectclass 'GroupOfNames'."
        }
      ), /* @__PURE__ */ import_react145.default.createElement(
        Radio,
        {
          name: "memberAttrGroup",
          id: "uniquemember",
          value: "uniquemember",
          label: "uniquemember",
          isChecked: this.state.memberAttr === "uniquemember",
          onChange: this.handleRadioChange,
          description: "This group uses objectclass 'GroupOfUniqueNames'.",
          className: "ds-margin-top"
        }
      ))), this.state.posixGroup && /* @__PURE__ */ import_react145.default.createElement(import_react145.default.Fragment, null, /* @__PURE__ */ import_react145.default.createElement(
        Grid,
        {
          title: "This setting corresponds to the attribute: gidNumber.  The gid must be greater than zero for this attribute to be set.",
          className: "ds-margin-top"
        },
        /* @__PURE__ */ import_react145.default.createElement(GridItem, { className: "ds-label", span: 2 }, "Group ID Number"),
        /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react145.default.createElement(
          NumberInput,
          {
            value: this.state.gidNumber,
            min: this.minValue,
            max: this.maxValue,
            onMinus: () => {
              this.onMinusConfig("gidNumber");
            },
            onChange: (e) => {
              this.onConfigChange(e, "gidNumber", 0);
            },
            onPlus: () => {
              this.onPlusConfig("gidNumber");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))
      ))));
      const selectMembersStep = /* @__PURE__ */ import_react145.default.createElement(import_react145.default.Fragment, null, /* @__PURE__ */ import_react145.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react145.default.createElement(Grid, null, /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react145.default.createElement(TextContent, null, /* @__PURE__ */ import_react145.default.createElement(Text, { component: TextVariants.h3 }, "Add Members To The Group"))), /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react145.default.createElement(TextContent, null, /* @__PURE__ */ import_react145.default.createElement(Text, null, "Search Base:", /* @__PURE__ */ import_react145.default.createElement(
        Text,
        {
          className: "ds-left-margin",
          component: TextVariants.a,
          onClick: this.handleOpenLDAPNavModal,
          href: "#"
        },
        usersSearchBaseDn
      )))), /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 12, className: "ds-margin-top" }, /* @__PURE__ */ import_react145.default.createElement(
        SearchInput,
        {
          placeholder: "Find members...",
          value: this.state.searchPattern,
          onChange: (_event, value) => this.handleSearchPattern(value),
          onSearch: this.handleSearchClick,
          onClear: () => {
            this.handleSearchPattern("");
          }
        }
      )), /* @__PURE__ */ import_react145.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react145.default.createElement(
        DualListSelector,
        {
          availableOptions: usersAvailableOptions,
          chosenOptions: usersChosenOptions,
          availableOptionsTitle: "Available Members",
          chosenOptionsTitle: "Chosen Members",
          onListChange: this.handleUsersOnListChange,
          id: "usersSelector"
        }
      )), /* @__PURE__ */ import_react145.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Choose A Branch To Search",
          isOpen: showLDAPNavModal,
          onClose: this.handleCloseLDAPNavModal,
          actions: [
            /* @__PURE__ */ import_react145.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: this.handleCloseLDAPNavModal
              },
              "Done"
            )
          ]
        },
        /* @__PURE__ */ import_react145.default.createElement(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react145.default.createElement(CardBody, null, /* @__PURE__ */ import_react145.default.createElement(
          ldapNavigator_default,
          {
            treeItems: [...this.props.treeViewRootSuffixes],
            editorLdapServer: this.props.editorLdapServer,
            skipLeafEntries: true,
            handleNodeOnClick: this.onBaseDnSelection,
            showTreeLoadingState: this.showTreeLoadingState
          }
        )))
      ))));
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ import_react145.default.createElement(SimpleListItem, { key: index, isCurrent: line.startsWith("dn: ") }, line)
      );
      const groupCreationStep = /* @__PURE__ */ import_react145.default.createElement("div", null, /* @__PURE__ */ import_react145.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Content for Group Creation"
        }
      ), /* @__PURE__ */ import_react145.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react145.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react145.default.createElement(SimpleList, { "aria-label": "LDIF data User" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const groupReviewStep = /* @__PURE__ */ import_react145.default.createElement("div", null, /* @__PURE__ */ import_react145.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for Group Creation"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react145.default.createElement("div", null, /* @__PURE__ */ import_react145.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding group ...")
      ), resultVariant === "danger" && /* @__PURE__ */ import_react145.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react145.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react145.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react145.default.createElement("h6", { key: line.id }, line.data)))));
      const addGroupSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          hideBackButton: true
        },
        {
          id: 2,
          name: "Select Group Type",
          component: groupSelectStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6
        },
        {
          id: 3,
          name: "Select Name",
          component: groupNameStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6,
          enableNext: groupName !== ""
        },
        {
          id: 4,
          name: "Add Members",
          component: selectMembersStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6
        },
        {
          id: 5,
          name: "Create Group",
          component: groupCreationStep,
          nextButtonText: "Create",
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: "Review Result",
          component: groupReviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached >= 6,
          hideBackButton: true,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ import_react145.default.createElement(import_react145.default.Fragment, null, "Parent DN: \xA0\xA0", /* @__PURE__ */ import_react145.default.createElement("strong", null, this.props.wizardEntryDn));
      return /* @__PURE__ */ import_react145.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: "Add A Group",
          description: title,
          steps: addGroupSteps
        }
      );
    }
  };
  var addGroup_default = AddGroup;

  // src/lib/ldap_editor/wizards/operations/addRole.jsx
  var import_react146 = __toESM(require_react(), 1);
  var AddRole = class extends import_react146.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSetpageAddRole", (_event, pageNumber) => {
        this.setState({
          pageAddRole: pageNumber,
          pagedRowsRole: this.getAttributesToShow(pageNumber, this.state.perpageAddRole)
        });
      });
      __publicField(this, "handlePerPageSelectAddRole", (_event, perPage) => {
        this.setState({
          pageAddRole: 1,
          perpageAddRole: perPage,
          pagedRowsRole: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "handleSelect", (event, isSelected, rowId) => {
        let rows;
        let selectedAttributes;
        if (rowId === -1) {
          rows = this.state.rowsRole.map((oneRow) => {
            oneRow.selected = isSelected;
            oneRow.isAttributeSelected = isSelected;
            return oneRow;
          });
          rows[0].selected = true;
          rows[0].isAttributeSelected = true;
          selectedAttributes = ["cn"];
          if (this.state.roleType === "filtered") {
            selectedAttributes.push("nsRoleFilter");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          } else if (this.state.roleType === "nested") {
            selectedAttributes.push("nsRoleDN");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          }
          this.setState(
            {
              rowsRole: rows,
              allAttributesSelected: isSelected,
              selectedAttributes
            },
            () => {
              this.setState({
                pagedRowsRole: this.getAttributesToShow(this.state.pageAddRole, this.state.perpageAddRole)
              });
              this.updateValuesTableRows();
            }
          );
        } else {
          if (this.state.pagedRowsRole[rowId].disableCheckbox === true) {
            return;
          }
          rows = [...this.state.pagedRowsRole];
          rows[rowId].selected = isSelected;
          const attrName = this.state.pagedRowsRole[rowId].cells[0];
          const allItems = [...this.state.rowsRole];
          const index = allItems.findIndex((item) => item.cells[0] === attrName);
          allItems[index].isAttributeSelected = isSelected;
          const selectedAttributes2 = allItems.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
          this.setState(
            {
              rowsRole: allItems,
              pagedRowsRole: rows,
              selectedAttributes: selectedAttributes2
            },
            () => this.updateValuesTableRows()
          );
        }
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = this.state.allAttributesSelected ? [
          "cn",
          ...this.roleDefinitionArray,
          ...this.filteredRoleDefinitionArray,
          ...this.nestedRoleDefinitionArray
        ] : [...this.state.selectedAttributes];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        let editableTableData = [];
        let namingAttr = this.state.namingAttr;
        let namingVal = this.state.namingVal;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: namingVal || "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          namingRowID = editableTableData[0].id;
          namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          namingAttr = editableTableData[0].attr;
          namingVal = editableTableData[0].val;
          if (this.state.roleType === "nested") {
            for (const userObj of this.state.rolesChosenOptions) {
              const dn_val = userObj.props.title.replace(/^dn: /, "");
              editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "nsroledn" || item.val !== dn_val);
              editableTableData.push({
                id: generateUniqueId(),
                attr: "nsRoleDN",
                val: dn_val,
                required: true,
                namingAttr: false
              });
            }
          }
          this.setState({
            savedRows: editableTableData
          });
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.state.namingRowID === -1) {
              namingRowID = editableTableData[0].id;
            }
          }
          if (this.state.roleType === "nested") {
            for (const userObj of this.state.rolesChosenOptions) {
              const dn_val = userObj.props.title.replace(/^dn: /, "");
              editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "nsroledn" || item.val !== dn_val);
              editableTableData.push({
                id: generateUniqueId(),
                attr: "nsRoleDN",
                val: dn_val,
                required: true,
                namingAttr: false
              });
            }
          }
          this.setState({
            savedRows: editableTableData
          });
        }
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        let rows = this.state.savedRows;
        if (rows.length === 0) {
          rows = this.state.editableTableData;
        }
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ import_react146.default.createElement(DropdownItem, { key: attr }, attr)
        );
        return /* @__PURE__ */ import_react146.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react146.default.createElement(BadgeToggle, { id: "toggle-attr-select", onToggle: this.handleAttrDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react146.default.createElement(import_react146.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react146.default.createElement(import_react146.default.Fragment, null, "0 selected ")),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState({
          savedRows
        }, () => {
          if (namingID !== -1) {
            this.setNamingRowID(namingID);
          }
        });
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = [
          "ObjectClass: top",
          "ObjectClass: LdapSubEntry",
          "ObjectClass: nsRoleDefinition"
        ];
        if (this.state.roleType === "managed") {
          objectClassData.push(
            "ObjectClass: nsSimpleRoleDefinition",
            "ObjectClass: nsManagedRoleDefinition"
          );
        } else if (this.state.roleType === "filtered") {
          objectClassData.push(
            "ObjectClass: nsComplexRoleDefinition",
            "ObjectClass: nsFilteredRoleDefinition"
          );
        } else if (this.state.roleType === "nested") {
          objectClassData.push(
            "ObjectClass: nsComplexRoleDefinition",
            "ObjectClass: nsNestedRoleDefinition"
          );
        }
        const valueData = [];
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (objectClassData.length === 5) {
            continue;
          }
        }
        const ldifArray = [
          `dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      this.roleDefinitionArray = ["description", "nsRoleScopeDN"];
      this.filteredRoleDefinitionArray = ["nsRoleFilter"];
      this.nestedRoleDefinitionArray = ["nsRoleDN"];
      this.singleValuedAttributes = ["nsRoleFilter", "nsRoleDN", "nsRoleScopeDN"];
      this.requiredAttributes = ["cn", "nsRoleFilter", "nsRoleDN"];
      this.attributeValidationRules = [
        {
          name: "required",
          validator: (value) => value.trim() !== "",
          errorText: "This field is required"
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        namingAttr: "",
        namingVal: "",
        ldifArray: [],
        cleanLdifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        stepIdReached: 1,
        // currentStepId: 1,
        itemCountAddRole: 0,
        pageAddRole: 1,
        perpageAddRole: 10,
        columnsRole: [
          { title: "Attribute Name", cellTransforms: [headerCol()] },
          { title: "From ObjectClass" }
        ],
        rowsRole: [],
        pagedRowsRole: [],
        selectedAttributes: ["cn"],
        isAttrDropDownOpen: false,
        // Values
        noEmptyValue: false,
        columnsValues: [
          "Attribute",
          "Value"
        ],
        // Review step
        reviewValue: "",
        reviewInvalidText: "Invalid LDIF",
        reviewIsValid: true,
        reviewValidated: "default",
        // reviewHelperText: 'LDIF data'
        editableTableData: [],
        rdn: "",
        rdnValue: "",
        parentDN: "",
        isTreeLoading: false,
        roleType: "managed",
        roleDNs: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        rolesSearchBaseDn: "",
        rolesAvailableOptions: [],
        rolesChosenOptions: [],
        adding: true
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          rolesSearchBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.updateAttributesTableRows();
          this.updateValuesTableRows();
        } else if (id === 5) {
          this.updateValuesTableRows();
        } else if (id === 6) {
          this.generateLdifData();
        } else if (id === 7) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? "Role successfully created!" : "Failed to create role, error: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const relativeDn = myLdifArray[6].replace(": ", "=");
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 5) {
          this.updateValuesTableRows(true);
        }
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          rolesAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.rolesSearchBaseDn;
        const pattern = this.state.searchPattern;
        const filter = pattern === "" ? "(|(objectClass=LDAPsubentry)(objectClass=nsRoleDefinition))" : `(&(|(objectClass=LDAPsubentry)(objectClass=nsRoleDefinition)(objectClass=nsSimpleRoleDefinition)(objectClass=nsComplexRoleDefinition)(objectClass=nsManagedRoleDefinition)(objectClass=nsFilteredRoleDefinition)(objectClass=nsNestedRoleDefinition))(|(cn=*${pattern}*)(uid=${pattern})))`;
        const attrs = "cn";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const pos0 = lines[0].indexOf(":: ");
            const pos1 = lines[1].indexOf(":: ");
            let dnLine = lines[0];
            if (pos0 > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = `${decoded[0]}: ${decoded[1]}`;
            }
            const value = pos1 === -1 ? lines[1].split(": ")[1] : decodeLine(lines[1])[1];
            return /* @__PURE__ */ import_react146.default.createElement("span", { title: dnLine, key: dnLine }, value);
          });
          this.setState({
            rolesAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.removeDuplicates = (options4) => {
        const titles = options4.map((item) => item.props.title);
        const noDuplicates = options4.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleUsersListChange = (newAvailableOptions, newChosenOptions) => {
        const newAvailNoDups = this.removeDuplicates(newAvailableOptions);
        const newChosenNoDups = this.removeDuplicates(newChosenOptions);
        this.setState({
          rolesAvailableOptions: newAvailNoDups.sort(),
          rolesChosenOptions: newChosenNoDups.sort()
        });
      };
      this.handleRadioChange = (_, event) => {
        this.setState({
          roleType: event.currentTarget.id
        });
      };
      this.handleChange = this.handleChange.bind(this);
    }
    updateAttributesTableRows() {
      const attributesArray = [];
      attributesArray.push({
        cells: ["cn", "LdapSubEntry"],
        selected: true,
        isAttributeSelected: true,
        disableCheckbox: true
      });
      this.roleDefinitionArray.map((attr) => {
        attributesArray.push({ cells: [attr, "nsRoleDefinition"] });
        return [];
      });
      if (this.state.roleType === "filtered") {
        this.filteredRoleDefinitionArray.map((attr) => {
          attributesArray.push({
            cells: [attr, "nsFilteredRoleDefinition"],
            selected: true,
            isAttributeSelected: true,
            disableCheckbox: true
          });
          return [];
        });
      } else if (this.state.roleType === "nested") {
        this.nestedRoleDefinitionArray.map((attr) => {
          attributesArray.push({
            cells: [attr, "nsNestedRoleDefinition"],
            selected: true,
            isAttributeSelected: true,
            disableCheckbox: true
          });
          return [];
        });
      }
      attributesArray.sort((a2, b) => a2.cells[0] > b.cells[0] ? 1 : -1);
      this.setState({
        selectedAttributes: [
          "cn",
          ...this.state.roleType === "filtered" ? ["nsRoleFilter"] : [],
          ...this.state.roleType === "nested" ? ["nsRoleDN"] : []
        ],
        itemCountAddRole: attributesArray.length,
        rowsRole: attributesArray,
        pagedRowsRole: attributesArray.slice(0, this.state.perpageAddRole),
        parentDN: this.props.wizardEntryDn,
        rolesSearchBaseDn: this.props.wizardEntryDn
      });
    }
    componentDidMount() {
      this.setState({
        parentDN: this.props.wizardEntryDn,
        rolesSearchBaseDn: this.props.wizardEntryDn
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsRole.slice(start2, end2);
      return newRows;
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    render() {
      const {
        itemCountAddRole,
        pageAddRole,
        perpageAddRole,
        columnsRole,
        pagedRowsRole,
        ldifArray,
        noEmptyValue,
        namingAttrVal,
        namingAttr,
        resultVariant,
        editableTableData,
        stepIdReached,
        namingVal,
        rolesSearchBaseDn,
        rolesAvailableOptions,
        rolesChosenOptions,
        showLDAPNavModal,
        commandOutput,
        roleType
      } = this.state;
      const rdnValue = namingVal;
      const myTitle = namingAttrVal === "" || rdnValue === "" ? "Invalid Naming Attribute - Empty Value!" : "DN ( Distinguished Name )";
      const namingValAndTypeStep = /* @__PURE__ */ import_react146.default.createElement("div", null, /* @__PURE__ */ import_react146.default.createElement(TextContent, null, /* @__PURE__ */ import_react146.default.createElement(Text, { component: TextVariants.h3 }, "Select Name And Role Type")), /* @__PURE__ */ import_react146.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react146.default.createElement(Grid, { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react146.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Role Name"), /* @__PURE__ */ import_react146.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react146.default.createElement(
        TextInput,
        {
          value: namingVal,
          type: "text",
          id: "namingVal",
          "aria-describedby": "namingVal",
          name: "namingVal",
          onChange: (str, e) => {
            this.handleChange(e);
          },
          validated: this.state.namingVal === "" ? ValidatedOptions.error : ValidatedOptions.default
        }
      ))), /* @__PURE__ */ import_react146.default.createElement(TextContent, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react146.default.createElement(Text, { component: TextVariants.h5 }, "Choose Role Type")), /* @__PURE__ */ import_react146.default.createElement("div", { className: "ds-left-margin" }, /* @__PURE__ */ import_react146.default.createElement(
        Radio,
        {
          name: "roleType",
          id: "managed",
          value: "managed",
          label: "Managed",
          isChecked: this.state.roleType === "managed",
          onChange: this.handleRadioChange,
          description: "This attribute uses objectclass 'RoleOfNames'"
        }
      ), /* @__PURE__ */ import_react146.default.createElement(
        Radio,
        {
          name: "roleType",
          id: "filtered",
          value: "filtered",
          label: "Filtered",
          isChecked: this.state.roleType === "filtered",
          onChange: this.handleRadioChange,
          description: "This attribute uses objectclass 'RoleOfUniqueNames'",
          className: "ds-margin-top"
        }
      ), /* @__PURE__ */ import_react146.default.createElement(
        Radio,
        {
          name: "roleType",
          id: "nested",
          value: "nested",
          label: "Nested",
          isChecked: this.state.roleType === "nested",
          onChange: this.handleRadioChange,
          description: "This attribute uses objectclass 'RoleOfUniqueNames'",
          className: "ds-margin-top"
        }
      ))));
      const addRolesStep = /* @__PURE__ */ import_react146.default.createElement(import_react146.default.Fragment, null, /* @__PURE__ */ import_react146.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react146.default.createElement(Grid, null, /* @__PURE__ */ import_react146.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react146.default.createElement(TextContent, null, /* @__PURE__ */ import_react146.default.createElement(Text, { component: TextVariants.h3 }, "Add Roles to the Nested Role"))), /* @__PURE__ */ import_react146.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react146.default.createElement(TextContent, null, /* @__PURE__ */ import_react146.default.createElement(Text, null, "Search Base:", /* @__PURE__ */ import_react146.default.createElement(
        Text,
        {
          className: "ds-left-margin",
          component: TextVariants.a,
          onClick: this.handleOpenLDAPNavModal,
          href: "#"
        },
        rolesSearchBaseDn
      )))), /* @__PURE__ */ import_react146.default.createElement(GridItem, { span: 12, className: "ds-margin-top" }, /* @__PURE__ */ import_react146.default.createElement(
        SearchInput,
        {
          placeholder: "Find roles...",
          value: this.state.searchPattern,
          onChange: (evt, val) => this.handleSearchPattern(val),
          onSearch: this.handleSearchClick,
          onClear: () => {
            this.handleSearchPattern("");
          }
        }
      )), /* @__PURE__ */ import_react146.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react146.default.createElement(
        DualListSelector,
        {
          availableOptions: rolesAvailableOptions,
          chosenOptions: rolesChosenOptions,
          availableOptionsTitle: "Available Roles",
          chosenOptionsTitle: "Chosen Roles",
          onListChange: this.handleUsersListChange,
          id: "usersSelector"
        }
      )), /* @__PURE__ */ import_react146.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: "Choose A Branch To Search",
          isOpen: showLDAPNavModal,
          onClose: this.handleCloseLDAPNavModal,
          actions: [
            /* @__PURE__ */ import_react146.default.createElement(
              Button,
              {
                key: "confirm",
                variant: "primary",
                onClick: this.handleCloseLDAPNavModal
              },
              "Done"
            )
          ]
        },
        /* @__PURE__ */ import_react146.default.createElement(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react146.default.createElement(CardBody, null, /* @__PURE__ */ import_react146.default.createElement(
          ldapNavigator_default,
          {
            treeItems: [...this.props.treeViewRootSuffixes],
            editorLdapServer: this.props.editorLdapServer,
            skipLeafEntries: true,
            handleNodeOnClick: this.onBaseDnSelection,
            showTreeLoadingState: this.showTreeLoadingState
          }
        )))
      ))));
      const roleAttributesStep = /* @__PURE__ */ import_react146.default.createElement(import_react146.default.Fragment, null, /* @__PURE__ */ import_react146.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react146.default.createElement(TextContent, null, /* @__PURE__ */ import_react146.default.createElement(Text, { component: TextVariants.h3 }, "Select Entry Attributes")), this.buildAttrDropdown()), /* @__PURE__ */ import_react146.default.createElement(
        Pagination,
        {
          itemCount: itemCountAddRole,
          page: pageAddRole,
          perPage: perpageAddRole,
          onSetPage: this.handleSetpageAddRole,
          widgetId: "pagination-options-menu-add-role",
          onPerPageSelect: this.handlePerPageSelectAddRole,
          isCompact: true
        }
      ), /* @__PURE__ */ import_react146.default.createElement(
        Table,
        {
          cells: columnsRole,
          rows: pagedRowsRole,
          onSelect: this.handleSelect,
          variant: TableVariant.compact,
          "aria-label": "Pagination Role Attributes"
        },
        /* @__PURE__ */ import_react146.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react146.default.createElement(TableBody, null)
      ));
      const roleValuesStep = /* @__PURE__ */ import_react146.default.createElement(import_react146.default.Fragment, null, /* @__PURE__ */ import_react146.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react146.default.createElement(Grid, null, /* @__PURE__ */ import_react146.default.createElement(GridItem, { className: "ds-margin-top", span: 12 }, /* @__PURE__ */ import_react146.default.createElement(
        Alert,
        {
          variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
          isInline: true,
          title: myTitle
        },
        /* @__PURE__ */ import_react146.default.createElement("b", null, "Entry DN:\xA0\xA0\xA0"),
        namingAttr || "??????",
        "=",
        namingVal || "??????",
        ",",
        this.props.wizardEntryDn
      )), /* @__PURE__ */ import_react146.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react146.default.createElement(TextContent, null, /* @__PURE__ */ import_react146.default.createElement(Text, { component: TextVariants.h3 }, "Set Attribute Values"))))), /* @__PURE__ */ import_react146.default.createElement(GridItem, { className: "ds-left-margin", span: 11 }, /* @__PURE__ */ import_react146.default.createElement(
        editableTable_default,
        {
          editableTableData,
          isAttributeSingleValued: this.isAttributeSingleValued,
          isAttributeRequired: this.isAttributeRequired,
          enableNextStep: this.enableNextStep,
          setNamingRowID: this.setNamingRowID,
          saveCurrentRows: this.saveCurrentRows,
          namingRowID: this.state.namingRowID,
          namingAttr: this.state.namingAttr
        }
      )));
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ import_react146.default.createElement(SimpleListItem, { key: index, isCurrent: line.startsWith("dn: ") }, line)
      );
      const roleCreationStep = /* @__PURE__ */ import_react146.default.createElement("div", null, /* @__PURE__ */ import_react146.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Content for Role Creation"
        }
      ), /* @__PURE__ */ import_react146.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react146.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react146.default.createElement(SimpleList, { "aria-label": "LDIF data User" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const roleReviewStep = /* @__PURE__ */ import_react146.default.createElement("div", null, /* @__PURE__ */ import_react146.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for Role Creation"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react146.default.createElement("div", null, /* @__PURE__ */ import_react146.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding Role ...")
      ), resultVariant === "danger" && /* @__PURE__ */ import_react146.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react146.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react146.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react146.default.createElement("h6", { key: line.id }, line.data)))));
      const addRoleSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 7,
          hideBackButton: true
        },
        {
          id: 2,
          name: "Select Name & Type",
          component: namingValAndTypeStep,
          enableNext: namingVal !== "",
          canJumpTo: stepIdReached >= 2 && stepIdReached < 7
        },
        ...roleType === "nested" ? [
          {
            id: 3,
            name: "Add Nested Roles",
            component: addRolesStep,
            canJumpTo: stepIdReached >= 3 && stepIdReached < 7
          }
        ] : [],
        {
          id: 4,
          name: "Select Attributes",
          component: roleAttributesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 7
        },
        {
          id: 5,
          name: "Set Values",
          component: roleValuesStep,
          canJumpTo: stepIdReached >= 5 && stepIdReached < 7,
          enableNext: noEmptyValue
        },
        {
          id: 6,
          name: "Create Role",
          component: roleCreationStep,
          nextButtonText: "Create",
          canJumpTo: stepIdReached >= 6 && stepIdReached < 7
        },
        {
          id: 7,
          name: "Review Result",
          component: roleReviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached >= 7,
          hideBackButton: true,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ import_react146.default.createElement(import_react146.default.Fragment, null, "Parent DN: \xA0\xA0", /* @__PURE__ */ import_react146.default.createElement("strong", null, this.props.wizardEntryDn));
      return /* @__PURE__ */ import_react146.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: "Add A Role",
          description: title,
          steps: addRoleSteps
        }
      );
    }
  };
  var addRole_default = AddRole;

  // src/lib/ldap_editor/wizards/operations/addLdapEntry.jsx
  var import_react147 = __toESM(require_react(), 1);
  var AddLdapEntry = class extends import_react147.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr.toLowerCase());
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "enableNextStep", (yes) => {
        this.setState({
          validMods: yes
        });
      });
      __publicField(this, "saveCurrentRows", (editableTableData) => {
        let validMods = true;
        let namingVal = this.state.namingVal;
        let namingAttrVal = this.state.namingAttrVal;
        for (const row of editableTableData) {
          if (row.val === "") {
            validMods = false;
            break;
          }
          if (row.id === this.state.namingRowID) {
            namingVal = row.val;
            namingAttrVal = row.attr + "=" + row.val;
          }
        }
        this.setState({
          editableTableData,
          validMods,
          namingVal,
          namingAttrVal
        });
      });
      __publicField(this, "handleSetPageOc", (_event, pageNumber) => {
        this.setState({
          pageOc: pageNumber,
          pagedRowsOc: this.getItemsToShow(pageNumber, this.state.perPageOc, "ObjectClassTable")
        });
      });
      __publicField(this, "handleSetPageAttr", (_event, pageNumber) => {
        this.setState({
          pageAttr: pageNumber,
          pagedRowsAttr: this.getItemsToShow(pageNumber, this.state.perPageAttr, "AttributeTable")
        });
      });
      __publicField(this, "handlePerPageSelectOc", (_event, perPage) => {
        this.setState({
          pageOc: 1,
          perPageOc: perPage,
          pagedRowsOc: this.getItemsToShow(1, perPage, "ObjectClassTable")
        });
      });
      __publicField(this, "handlePerPageSelectAttr", (_event, perPage) => {
        this.setState({
          pageAttr: 1,
          perPageAttr: perPage,
          pagedRowsAttr: this.getItemsToShow(1, perPage, "AttributeTable")
        });
      });
      __publicField(this, "handleSelectOc", (event, isSelected, rowId) => {
        const rows = [...this.state.pagedRowsOc];
        rows[rowId].selected = isSelected;
        const ocName = this.state.pagedRowsOc[rowId].cells[0];
        const allItems = [...this.state.rowsOc];
        const index = allItems.findIndex((item) => item.cells[0] === ocName);
        allItems[index].selected = isSelected;
        let selectedObjectClasses = [...this.state.selectedObjectClasses];
        if (isSelected) {
          selectedObjectClasses.push(allItems[index]);
        } else {
          selectedObjectClasses = selectedObjectClasses.filter((row) => row.cells[0] !== allItems[index].cells[0]);
        }
        const attrsToRemove = [];
        if (!isSelected) {
          let ocAttrs = allItems[index].cells[1].toLowerCase().replace(/\s/g, "").split(",");
          ocAttrs = ocAttrs.concat(allItems[index].cells[2].toLowerCase().replace(/\s/g, "").split(","));
          let currAttrs = [];
          for (const oc of selectedObjectClasses) {
            currAttrs = currAttrs.concat(oc.cells[1].toLowerCase().replace(/\s/g, "").split(","));
            currAttrs = currAttrs.concat(oc.cells[2].toLowerCase().replace(/\s/g, "").split(","));
          }
          for (const attr of ocAttrs) {
            if (currAttrs.indexOf(attr) === -1) {
              attrsToRemove.push(attr);
            }
          }
        }
        this.setState({
          rowsOc: allItems,
          pagedRowsOc: rows,
          selectedObjectClasses,
          attrsToRemove
        }, () => {
          this.updateAttributeTableRows();
        });
      });
      __publicField(this, "handleSelectAttr", (event, isSelected, rowId) => {
        let newEditableData = this.state.editableTableData;
        if (this.state.pagedRowsAttr[rowId].disableCheckbox === true) {
          return;
        }
        const rows = [...this.state.pagedRowsAttr];
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].cells[0];
        const allItems = [...this.state.rowsAttrOrig];
        const index = allItems.findIndex((item) => item.cells[0] === attrName);
        allItems[index].isAttributeSelected = isSelected;
        const selectedAttributes = allItems.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]);
        const rowAttr = rows[rowId].attributeName.toLowerCase();
        const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === rowAttr);
        if (isSelected) {
          if (found.length === 0 && rowAttr !== "objectclass") {
            const obj = {};
            obj.id = generateUniqueId();
            obj.attr = rows[rowId].attributeName;
            obj.val = "";
            obj.namingAttr = false;
            obj.required = false;
            newEditableData = [...newEditableData, obj];
          }
        } else if (found.length > 0) {
          newEditableData = this.state.editableTableData.filter((item) => item.attr.toLowerCase() !== rowAttr);
        }
        let validMods = true;
        for (const row of newEditableData) {
          if (row.val === "") {
            validMods = false;
          }
        }
        this.setState({
          rowsAttr: allItems,
          pagedRowsAttr: rows,
          editableTableData: newEditableData,
          selectedAttributes,
          validMods
        });
      });
      __publicField(this, "updateAttributeTableRows", () => {
        const ocToProcess = [...this.state.selectedObjectClasses];
        const rowsAttr = [];
        const attrList = [];
        let namingRowID = this.state.namingRowID;
        let namingAttr = this.state.namingAttr;
        for (const oc of ocToProcess) {
          const required = oc.cells[1].split(",");
          const optional = oc.cells[2].split(",");
          for (let attr of required) {
            attr = attr.trim().toLowerCase();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              attrList.push(attr);
              rowsAttr.push({
                selected: true,
                disableCheckbox: true,
                // TODO: Hack until upgrading!
                isAttributeSelected: true,
                attributeName: attr,
                cells: [
                  {
                    title: /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, /* @__PURE__ */ import_react147.default.createElement("strong", null, attr))
                  },
                  oc.cells[0]
                ]
              });
            }
            const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === attr);
            if (found.length === 0 && attr !== "objectclass") {
              const new_id = generateUniqueId();
              if (namingRowID === -1) {
                namingRowID = new_id;
                namingAttr = attr;
              }
              const obj = {};
              obj.id = new_id;
              obj.attr = attr;
              obj.val = "";
              obj.namingAttr = false;
              obj.required = true;
              this.setState((prevState) => ({
                editableTableData: [...prevState.editableTableData, obj],
                validMods: false,
                namingRowID,
                namingAttr
              }));
            }
          }
          for (let attr of optional) {
            attr = attr.trim();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === attr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(attr);
              rowsAttr.push({
                attributeName: attr,
                isAttributeSelected: selected,
                selected,
                cells: [attr, oc.cells[0]]
              });
            }
          }
        }
        rowsAttr.sort((a2, b) => a2.attributeName > b.attributeName ? 1 : -1);
        this.setState({
          rowsAttr,
          rowsAttrOrig: [...rowsAttr],
          selectedAttributes: rowsAttr.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]),
          itemCountAttr: rowsAttr.length
        }, () => {
          this.setState({
            pagedRowsAttr: this.getItemsToShow(
              this.state.pageAttr,
              this.state.perPageAttr,
              "AttributeTable"
            )
          });
        });
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = ["top"];
        const attribute = this.state.namingAttr;
        const value = this.state.namingVal;
        const valueData = [];
        for (const oc of this.state.selectedObjectClasses) {
          if (oc && !objectClassData.includes(oc.cells[0])) {
            objectClassData.push(oc.cells[0]);
          }
        }
        for (const item of this.state.editableTableData) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
        }
        const ocArray = objectClassData.map((oc) => `ObjectClass: ${oc}`);
        const dnLine = `dn: ${attribute}=${value},${this.props.wizardEntryDn}`;
        const ldifArray = [
          dnLine,
          ...ocArray,
          ...valueData
        ];
        const cleanLdifArray = [...ldifArray];
        for (const idx in cleanLdifArray) {
          if (cleanLdifArray[idx].toLowerCase().startsWith("userpassword")) {
            cleanLdifArray[idx] = "userpassword: ********";
            break;
          }
        }
        this.setState({
          ldifArray,
          cleanLdifArray
        });
      });
      __publicField(this, "handleOCDropDownToggle", (isOpen) => {
        this.setState({
          isOCDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleOCDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isOCDropDownOpen: !prevState.isOCDropDownOpen };
        });
      });
      __publicField(this, "buildOCDropdown", () => {
        const { isOCDropDownOpen, selectedObjectClasses } = this.state;
        const numSelected = this.state.rowsOc.filter((item) => item.selected).length;
        const items = selectedObjectClasses.map(
          (oc) => /* @__PURE__ */ import_react147.default.createElement(DropdownItem, { key: oc.cells[0] }, oc.cells[0])
        );
        return /* @__PURE__ */ import_react147.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleOCDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react147.default.createElement(BadgeToggle, { id: "toggle-oc-select", onToggle: this.handleOCDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, "0 selected ")),
            isOpen: isOCDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ import_react147.default.createElement(DropdownItem, { key: attr[0] }, attr[0])
        );
        return /* @__PURE__ */ import_react147.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react147.default.createElement(BadgeToggle, { id: "toggle-attr-select", onToggle: this.handleAttrDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, "0 selected ")),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        const rows = this.state.editableTableData;
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      this.originalEntryRows = [];
      this.singleValuedAttributes = [];
      this.requiredAttributes = ["dn"];
      this.operationColumns = [
        { title: "Statement" },
        { title: "Attribute" },
        { title: "Value", cellTransforms: [breakWord] }
      ];
      this.state = {
        loading: true,
        isOCDropDownOpen: false,
        isAttrDropDownOpen: false,
        namingAttributeData: ["", ""],
        namingAttrPropsName: "",
        namingRowID: -1,
        namingVal: "",
        editableTableData: [],
        statementRows: [],
        ldifArray: [],
        cleanLdifArray: [],
        validMods: false,
        commandOutput: "",
        resultVariant: "default",
        stepIdReached: 1,
        itemCountOc: 0,
        pageOc: 1,
        perPageOc: 6,
        itemCountAttr: 0,
        pageAttr: 1,
        perPageAttr: 10,
        columnsAttr: [
          { title: "Attribute Name", cellTransforms: [headerCol()] },
          { title: "From ObjectClass" }
        ],
        columnsOc: [
          { title: "ObjectClass Name", cellTransforms: [headerCol()] },
          { title: "Required Attributes", cellTransforms: [breakWord] },
          { title: "Optional Attributes", cellTransforms: [breakWord] }
        ],
        rowsOc: [],
        rowsAttr: [],
        rowsAttrOrig: [],
        rowsValues: [],
        pagedRowsOc: [],
        pagedRowsAttr: [],
        selectedObjectClasses: [],
        selectedAttributes: [],
        attrsToRemove: [],
        namingAttr: "",
        adding: true,
        searchOCValue: "",
        searchAttrValue: ""
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 3) {
          this.updateAttributeTableRows();
        } else if (id === 4) {
          this.cleanUpEntry();
        } else if (id === 5) {
          this.generateLdifData();
        } else if (id === 6) {
          createLdapEntry(
            this.props.editorLdapServer,
            this.state.ldifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? "Successfully added entry!" : "Failed to add entry, error: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = this.state.ldifArray[0].substring(4);
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.cleanUpEntry = () => {
        const newRows = [];
        let validMods = true;
        for (const row of this.state.editableTableData) {
          const attr = row.attr.toLowerCase();
          if (this.state.attrsToRemove.indexOf(attr) === -1) {
            if (row.val === "") {
              validMods = false;
            }
            newRows.push(row);
          }
        }
        this.setState({
          editableTableData: newRows,
          validMods
        });
      };
      this.handleOCSearchChange = (event, value) => {
        let ocRows = [];
        const allOCs = [];
        const val = value.toLowerCase();
        this.props.allObjectclasses.map((oc) => {
          let selected = false;
          let selectionDisabled = false;
          for (const selectedOC of this.state.selectedObjectClasses) {
            if (selectedOC.cells[0].toLowerCase() === oc.name.toLowerCase()) {
              selected = true;
              break;
            }
          }
          if (oc.name === "top") {
            selectionDisabled = true;
          }
          allOCs.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of allOCs) {
            const name2 = row.cells[0].toLowerCase();
            const reqAttrs = row.cells[1].toLowerCase();
            const optAttrs = row.cells[2].toLowerCase();
            if (name2.includes(val) || reqAttrs.includes(val) || optAttrs.includes(val)) {
              ocRows.push(row);
            }
          }
        } else {
          ocRows = allOCs;
        }
        this.setState({
          rowsOc: ocRows,
          pagedRowsOc: ocRows.slice(0, this.state.perPageOc),
          searchOCValue: value,
          itemCountOc: ocRows.length
        });
      };
      this.handleAttrSearchChange = (event, value) => {
        let attrRows = [];
        const allAttrs = this.state.rowsAttrOrig;
        const val = value.toLowerCase();
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.attributeName.toLowerCase();
            if (name2.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsAttr: attrRows,
          pagedRowsAttr: attrRows.slice(0, this.state.perPageAttr),
          itemCountAttr: attrRows.length,
          searchAttrValue: value
        });
      };
    }
    componentDidMount() {
      const ocArray = [];
      getSingleValuedAttributes(
        this.props.editorLdapServer,
        (myAttrs) => {
          this.singleValuedAttributes = [...myAttrs];
        }
      );
      this.props.allObjectclasses.map((oc) => {
        let selectionDisabled = false;
        if (oc.name === "top") {
          selectionDisabled = true;
        }
        ocArray.push(
          {
            cells: [
              oc.name,
              oc.required.join(", "),
              oc.optional.join(", ")
            ],
            selected: false,
            disableSelection: selectionDisabled
          }
        );
        return [];
      });
      this.setState({
        itemCountOc: ocArray.length,
        rowsOc: ocArray,
        pagedRowsOc: ocArray.slice(0, this.state.perPageOc),
        loading: false
      });
    }
    getItemsToShow(page, perPage, option) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = option === "ObjectClassTable" ? this.state.rowsOc.slice(start2, end2) : option === "AttributeTable" ? this.state.rowsAttr.slice(start2, end2) : [];
      return newRows;
    }
    render() {
      const {
        loading,
        itemCountOc,
        pageOc,
        perPageOc,
        columnsOc,
        pagedRowsOc,
        itemCountAttr,
        pageAttr,
        perPageAttr,
        columnsAttr,
        pagedRowsAttr,
        commandOutput,
        namingAttr,
        namingVal,
        stepIdReached,
        ldifArray,
        resultVariant,
        editableTableData,
        validMods,
        cleanLdifArray,
        selectedAttributes,
        selectedObjectClasses
      } = this.state;
      const objectClassStep = /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, /* @__PURE__ */ import_react147.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react147.default.createElement(TextContent, null, /* @__PURE__ */ import_react147.default.createElement(Text, { component: TextVariants.h3 }, "Select ObjectClasses")), this.buildOCDropdown()), loading && /* @__PURE__ */ import_react147.default.createElement("div", null, /* @__PURE__ */ import_react147.default.createElement(Bullseye, { className: "ds-margin-top-xlg", key: "add-entry-bulleye" }, /* @__PURE__ */ import_react147.default.createElement(Title, { headingLevel: "h3", size: "lg", key: "loading-title" }, "Loading ObjectClasses ...")), /* @__PURE__ */ import_react147.default.createElement(Spinner, { className: "ds-center", size: "lg", key: "loading-spinner" })), /* @__PURE__ */ import_react147.default.createElement("div", { className: loading ? "ds-hidden" : "" }, /* @__PURE__ */ import_react147.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react147.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react147.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search Objectclasses",
          value: this.state.searchOCValue,
          onChange: this.handleOCSearchChange,
          onClear: (evt, val) => this.handleOCSearchChange(evt, "")
        }
      )), /* @__PURE__ */ import_react147.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react147.default.createElement(
        Pagination,
        {
          value: "ObjectClassTable",
          itemCount: itemCountOc,
          page: pageOc,
          perPage: perPageOc,
          onSetPage: this.handleSetPageOc,
          widgetId: "pagination-step-objectclass",
          onPerPageSelect: this.handlePerPageSelectOc,
          variant: "top",
          isCompact: true
        }
      ))), /* @__PURE__ */ import_react147.default.createElement(
        Table,
        {
          cells: columnsOc,
          rows: pagedRowsOc,
          canSelectAll: false,
          onSelect: this.handleSelectOc,
          variant: TableVariant.compact,
          "aria-label": "Pagination All ObjectClasses"
        },
        /* @__PURE__ */ import_react147.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react147.default.createElement(TableBody, null)
      )));
      const attributeStep = /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, /* @__PURE__ */ import_react147.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react147.default.createElement(TextContent, null, /* @__PURE__ */ import_react147.default.createElement(Text, { component: TextVariants.h3 }, "Select Attributes")), this.buildAttrDropdown()), /* @__PURE__ */ import_react147.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react147.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react147.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search Attributes",
          value: this.state.searchAttrValue,
          onChange: this.handleAttrSearchChange,
          onClear: (evt, val) => this.handleAttrSearchChange(evt, "")
        }
      )), /* @__PURE__ */ import_react147.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react147.default.createElement(
        Pagination,
        {
          itemCount: itemCountAttr,
          page: pageAttr,
          perPage: perPageAttr,
          onSetPage: this.handleSetPageAttr,
          widgetId: "pagination-step-attributes",
          onPerPageSelect: this.handlePerPageSelectAttr,
          isCompact: true
        }
      ))), /* @__PURE__ */ import_react147.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          cells: columnsAttr,
          rows: pagedRowsAttr,
          onSelect: this.handleSelectAttr,
          variant: TableVariant.compact,
          "aria-label": "Pagination Attributes",
          canSelectAll: false
        },
        /* @__PURE__ */ import_react147.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react147.default.createElement(TableBody, null)
      ));
      const myTitle = "DN ( Distinguished Name )";
      const entryValuesStep = /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, /* @__PURE__ */ import_react147.default.createElement(
        Alert,
        {
          variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
          isInline: true,
          title: myTitle
        },
        /* @__PURE__ */ import_react147.default.createElement("b", null, "Entry DN:\xA0\xA0\xA0"),
        namingAttr || "??????",
        "=",
        namingVal || "??????",
        ",",
        this.props.wizardEntryDn
      ), /* @__PURE__ */ import_react147.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react147.default.createElement(Text, { component: TextVariants.h3 }, "Set Attribute Values")), /* @__PURE__ */ import_react147.default.createElement(
        editableTable_default,
        {
          key: editableTableData,
          wizardEntryDn: this.props.wizardEntryDn,
          editableTableData,
          isAttributeSingleValued: this.isAttributeSingleValued,
          isAttributeRequired: this.isAttributeRequired,
          enableNextStep: this.enableNextStep,
          saveCurrentRows: this.saveCurrentRows,
          allObjectclasses: this.props.allObjectclasses,
          namingRowID: this.state.namingRowID,
          namingAttr: this.state.namingAttr,
          setNamingRowID: this.setNamingRowID
        }
      ));
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ import_react147.default.createElement(SimpleListItem, { key: index, isCurrent: line.startsWith("dn: ") }, line)
      );
      const ldifStatementsStep = /* @__PURE__ */ import_react147.default.createElement("div", null, /* @__PURE__ */ import_react147.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react147.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Statements"
        }
      )), /* @__PURE__ */ import_react147.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react147.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react147.default.createElement(SimpleList, { "aria-label": "LDIF data User" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const entryReviewStep = /* @__PURE__ */ import_react147.default.createElement("div", null, /* @__PURE__ */ import_react147.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react147.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for Entry Modification"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react147.default.createElement("div", null, /* @__PURE__ */ import_react147.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding entry ...")
      )), resultVariant === "danger" && /* @__PURE__ */ import_react147.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react147.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react147.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react147.default.createElement("h6", { key: line.id }, line.data)))));
      const addEntrySteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          hideBackButton: true
        },
        {
          id: 2,
          name: "Select ObjectClasses",
          component: objectClassStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6,
          enableNext: selectedObjectClasses.length > 0
        },
        {
          id: 3,
          name: "Select Attributes",
          component: attributeStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6,
          enableNext: selectedAttributes.length > 0
        },
        {
          id: 4,
          name: "Edit Values",
          component: entryValuesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6,
          enableNext: validMods
        },
        {
          id: 5,
          name: "LDIF Statements",
          component: ldifStatementsStep,
          nextButtonText: "Create Entry",
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: "Review Result",
          component: entryReviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached >= 6,
          hideBackButton: true,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ import_react147.default.createElement(import_react147.default.Fragment, null, "Parent DN: \xA0\xA0", /* @__PURE__ */ import_react147.default.createElement("strong", null, this.props.wizardEntryDn));
      return /* @__PURE__ */ import_react147.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          steps: addEntrySteps,
          title: "Add An LDAP Entry",
          description: title,
          onNext: this.handleNext
        }
      );
    }
  };
  var addLdapEntry_default = AddLdapEntry;

  // src/lib/ldap_editor/wizards/operations/genericUpdate.jsx
  var import_react148 = __toESM(require_react(), 1);
  var GenericUpdate = class extends import_react148.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSetPage", (_event, pageNumber) => {
        this.setState({
          page: pageNumber,
          pagedRowsAttrs: this.getAttributesToShow(pageNumber, this.state.perPage)
        });
      });
      __publicField(this, "handlePerPageSelect", (_event, perPage) => {
        this.setState({
          page: 1,
          perPage,
          pagedRowsAttrs: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return SINGLE_VALUED_ATTRS.includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        switch (this.props.entryType) {
          case ENTRY_TYPE.user:
            return PERSON_REQ_ATTRS.includes(attr);
          case ENTRY_TYPE.ou:
            return OU_REQ_ATTRS.includes(attr);
          case ENTRY_TYPE.other:
            return PERSON_REQ_ATTRS.includes(attr);
          default:
            console.log(`Unknown type of LDAP entry (${this.props.entryType})`);
        }
      });
      __publicField(this, "handleSelect", (event, isSelected, rowId) => {
        let rows;
        if (rowId === -1) {
          rows = this.state.rowsAttrs.map((oneRow) => {
            if (oneRow.disableSelection === false) {
              oneRow.selected = isSelected;
              oneRow.isAttributeSelected = isSelected;
            }
            return oneRow;
          });
          this.setState(
            {
              rowsAttrs: rows,
              allAttributesSelected: isSelected
              // TEKO - May 2021 // selectedAttributes
            },
            () => {
              this.setState({
                pagedRowsAttrs: this.getAttributesToShow(this.state.page, this.state.perPage)
              });
              this.updateValuesTableRows();
            }
          );
        } else {
          if (this.state.pagedRowsAttrs[rowId].disableSelection === true) {
            return;
          }
          rows = [...this.state.pagedRowsAttrs];
          rows[rowId].selected = isSelected;
          const attrName = this.state.pagedRowsAttrs[rowId].cells[0];
          const allItems = [...this.state.rowsAttrs];
          const index = allItems.findIndex((item) => item.cells[0] === attrName);
          allItems[index].isAttributeSelected = isSelected;
          const selectedAttributes = allItems.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
          this.setState(
            {
              rowsAttrs: allItems,
              pagedRowsAttrs: rows,
              selectedAttributes
            },
            () => this.updateValuesTableRows()
          );
        }
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = this.state.allAttributesSelected ? [
          "cn",
          "sn",
          ...PERSON_OPT_ATTRS,
          ...ORG_PERSON_ATTRS,
          ...INET_ORG_ATTRS
        ] : [...this.state.selectedAttributes];
        let editableTableData = [];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          if (this.props.entryType === ENTRY_TYPE.ou) {
            for (const attr of editableTableData) {
              if (attr.attr === "ou") {
                namingRowID = attr.id;
                namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
                break;
              }
            }
          } else {
            namingRowID = editableTableData[0].id;
            namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          }
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.props.entryType === ENTRY_TYPE.ou && namingRowID === -1) {
              for (const attr of editableTableData) {
                if (attr.attr === "ou") {
                  namingRowID = attr.id;
                  namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
                  break;
                }
              }
            }
          }
        }
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        for (const row of this.state.savedRows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal
        });
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState(
          { savedRows },
          () => {
            if (namingID !== -1) {
              this.setNamingRowID(namingID);
            }
          }
        );
      });
      __publicField(this, "generateLdifData", () => {
        switch (this.props.entryType) {
          case ENTRY_TYPE.user:
            this.generateLdifDataUser();
            break;
          case ENTRY_TYPE.ou:
            this.generateLdifDataOu();
            break;
          case ENTRY_TYPE.other:
            this.generateLdifDataOther();
            break;
          default:
            console.log(`Unknown type of LDAP entry (${this.props.entryType})`);
        }
      });
      __publicField(this, "generateLdifDataUser", () => {
        const objectClassData = ["ObjectClass: top", "ObjectClass: Person"];
        if (this.state.allAttributesSelected) {
          objectClassData.push(
            "ObjectClass: OrganizationalPerson",
            "ObjectClass: InetOrgPerson"
          );
        }
        const valueData = [];
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (objectClassData.length === 4) {
            continue;
          }
          if (!objectClassData.includes("ObjectClass: InetOrgPerson") && INET_ORG_ATTRS.includes(attrName)) {
            objectClassData.push("ObjectClass: InetOrgPerson");
          }
          if (!objectClassData.includes("ObjectClass: OrganizationalPerson") && ORG_PERSON_ATTRS.includes(attrName)) {
            objectClassData.push("ObjectClass: OrganizationalPerson");
          }
        }
        const ldifArray = [
          `dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      __publicField(this, "generateLdifDataOu", () => {
        const objectClassData = ["ObjectClass: top", "ObjectClass: organizationalUnit"];
        const valueData = [];
        let rdnValue = "";
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (attrName === "ou") {
            rdnValue = item.val;
          }
        }
        const ldifArray = [
          `dn: ou=${rdnValue},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      this.attributeValidationRules = [
        {
          name: "required",
          validator: (value) => value.trim() !== "",
          errorText: "This field is required"
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        ldifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        stepIdReached: 1,
        itemCount: 0,
        page: 1,
        perPage: 10,
        columnsAttrs: [
          { title: "Attribute Name", cellTransforms: [headerCol()] },
          { title: "From ObjectClass" }
        ],
        rowsAttrs: [],
        pagedRowsAttrs: [],
        selectedAttributes: [],
        // Values
        noEmptyValue: false,
        columnsValues: [
          "Attribute",
          "Value"
        ],
        rowsValues: [],
        // Review step
        reviewValue: "",
        reviewInvalidText: "Invalid LDIF",
        reviewIsValid: true,
        reviewValidated: "default",
        editableTableData: [],
        namingAttr: "",
        adding: true
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 3) {
          this.updateValuesTableRows();
        } else if (id === 4) {
          this.generateLdifData();
        } else if (id === 5) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? "Successfully added entry!" : "Failed to add entry, error: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 3) {
          this.updateValuesTableRows(true);
        }
      };
    }
    componentDidMount() {
      console.log("In GenericUpdate - componentDidMount()");
      const attributesArray = [];
      let namingAttr = "";
      switch (this.props.entryType) {
        case ENTRY_TYPE.user:
          this.requiredAttributes = ["cn", "sn"];
          attributesArray.push({
            cells: ["cn", "Person"],
            selected: true,
            isAttributeSelected: true,
            // disableCheckbox: true
            disableSelection: true
          });
          attributesArray.push({
            cells: ["sn", "Person"],
            selected: true,
            isAttributeSelected: true,
            // disableCheckbox: true
            disableSelection: true
          });
          PERSON_OPT_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "Person"] });
            return [];
          });
          ORG_PERSON_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "OrganizationalPerson"] });
            return [];
          });
          INET_ORG_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "InetOrgPerson"] });
            return [];
          });
          break;
        case ENTRY_TYPE.ou:
          this.requiredAttributes = ["ou"];
          attributesArray.push({
            cells: ["ou", "OrganizationalUnit"],
            selected: true,
            isAttributeSelected: true,
            // disableCheckbox: true
            disableSelection: true,
            namingAttrVal: ""
          });
          OU_OPT_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "OrganizationalUnit"] });
            return [];
          });
          namingAttr = "ou";
          break;
        case ENTRY_TYPE.other:
          break;
        default:
          console.log(`Unknown type of LDAP entry (${this.props.entryType})`);
      }
      this.setState({
        selectedAttributes: [...this.requiredAttributes],
        itemCount: attributesArray.length,
        rowsAttrs: attributesArray,
        pagedRowsAttrs: attributesArray.slice(0, this.state.perPage),
        namingAttr
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsAttrs.slice(start2, end2);
      return newRows;
    }
    render() {
      const {
        commandOutput,
        itemCount,
        page,
        perPage,
        columnsAttrs,
        pagedRowsAttrs,
        ldifArray,
        noEmptyValue,
        alertVariant,
        namingAttrVal,
        stepIdReached,
        resultVariant
      } = this.state;
      const attributesStep = /* @__PURE__ */ import_react148.default.createElement("div", null, /* @__PURE__ */ import_react148.default.createElement(TextContent, null, /* @__PURE__ */ import_react148.default.createElement(Text, { component: TextVariants.h3 }, "Select Entry Attributes")), /* @__PURE__ */ import_react148.default.createElement(
        Pagination,
        {
          itemCount,
          page,
          perPage,
          onSetPage: this.handleSetPage,
          widgetId: "pagination-options-menu-add-entry",
          onPerPageSelect: this.handlePerPageSelect,
          isCompact: true
        }
      ), /* @__PURE__ */ import_react148.default.createElement(
        Table,
        {
          cells: columnsAttrs,
          rows: pagedRowsAttrs,
          onSelect: this.handleSelect,
          variant: TableVariant.compact,
          "aria-label": "Pagination Attributes"
        },
        /* @__PURE__ */ import_react148.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react148.default.createElement(TableBody, null)
      ));
      const rdnValue = namingAttrVal.split("=")[1];
      const myTitle = namingAttrVal === "" || rdnValue === "" ? "Invalid RDN - Empty Value!" : "DN ( Distinguished Name )";
      const missingRdn = rdnValue === "" || rdnValue === void 0;
      const valuesStep = /* @__PURE__ */ import_react148.default.createElement(import_react148.default.Fragment, null, /* @__PURE__ */ import_react148.default.createElement(
        Alert,
        {
          variant: alertVariant,
          isInline: true,
          title: myTitle
        },
        !missingRdn && /* @__PURE__ */ import_react148.default.createElement(import_react148.default.Fragment, null, "The full DN of the entry will be: ", /* @__PURE__ */ import_react148.default.createElement("strong", null, namingAttrVal, ",", this.props.wizardEntryDn))
      ), /* @__PURE__ */ import_react148.default.createElement(
        editableTable_default,
        {
          editableTableData: this.state.editableTableData,
          isAttributeSingleValued: this.isAttributeSingleValued,
          isAttributeRequired: this.isAttributeRequired,
          enableNextStep: this.enableNextStep,
          setNamingRowID: this.setNamingRowID,
          namingRowID: this.state.namingRowID,
          saveCurrentRows: this.saveCurrentRows,
          namingAttr: this.state.namingAttr
        }
      ));
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ import_react148.default.createElement(SimpleListItem, { key: index, isCurrent: line.startsWith("dn: ") }, line)
      );
      const creationStep = /* @__PURE__ */ import_react148.default.createElement("div", null, /* @__PURE__ */ import_react148.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Content for Entry Creation"
        }
      ), /* @__PURE__ */ import_react148.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react148.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react148.default.createElement(SimpleList, { "aria-label": "LDIF data" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const reviewStep = /* @__PURE__ */ import_react148.default.createElement("div", null, /* @__PURE__ */ import_react148.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for Entry Creation"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react148.default.createElement("div", null, /* @__PURE__ */ import_react148.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Adding entry ...")
      ), resultVariant === "danger" && /* @__PURE__ */ import_react148.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react148.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react148.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react148.default.createElement("h6", { key: line.id }, line.data)))));
      const creationStepName = this.props.entryType === ENTRY_TYPE.user ? "Create User" : this.props.entryType === ENTRY_TYPE.ou ? "Create Organizational Unit" : "Create LDAP Entry";
      const addSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 5,
          hideBackButton: true
        },
        {
          id: 2,
          name: "Select Attributes",
          component: attributesStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 5
        },
        {
          id: 3,
          name: "Set Values",
          component: valuesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 5,
          enableNext: noEmptyValue
        },
        {
          id: 4,
          name: creationStepName,
          component: creationStep,
          nextButtonText: "Create",
          canJumpTo: stepIdReached >= 4 && stepIdReached < 5
        },
        {
          id: 5,
          name: "Review Result",
          component: reviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached >= 5 && stepIdReached < 5,
          hideBackButton: true,
          enableNext: !this.state.adding
        }
      ];
      const wizardTitle = this.props.entryType === ENTRY_TYPE.user ? "Add A New User" : this.props.entryType === ENTRY_TYPE.ou ? "Add An Organizational Unit" : "Add A New LDAP Entry";
      const desc = /* @__PURE__ */ import_react148.default.createElement(import_react148.default.Fragment, null, "Parent DN: \xA0\xA0", /* @__PURE__ */ import_react148.default.createElement("strong", null, this.props.wizardEntryDn));
      return /* @__PURE__ */ import_react148.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: wizardTitle,
          description: desc,
          steps: addSteps
        }
      );
    }
  };
  var genericUpdate_default = GenericUpdate;

  // src/lib/ldap_editor/wizards/newEntry.jsx
  var NewEntryWizard = class extends import_react149.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleOnChange", (_, event) => {
        this.setState({ getStartedStepRadio: event.currentTarget.value });
      });
      __publicField(this, "createInitialLayout", () => {
        if (this.props.createRootEntry) {
          return [
            {
              id: 1,
              name: "Get Started",
              component: /* @__PURE__ */ import_react149.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react149.default.createElement(CardTitle, null, "Requirement for a root entry creation"), /* @__PURE__ */ import_react149.default.createElement(CardBody, null, /* @__PURE__ */ import_react149.default.createElement(
                Alert,
                {
                  variant: "info",
                  isInline: true,
                  title: "The object class must contain the attribute used to name the suffix."
                }
              )), /* @__PURE__ */ import_react149.default.createElement(CardBody, null, "For example, if the entry corresponds to the suffix ", /* @__PURE__ */ import_react149.default.createElement("code", null, "ou=people,dc=example,dc=com"), ", then choose the ", /* @__PURE__ */ import_react149.default.createElement("code", null, "organizationalUnit"), " object class or another object class that allows the ", /* @__PURE__ */ import_react149.default.createElement("code", null, "ou"), " attribute."), /* @__PURE__ */ import_react149.default.createElement(CardBody, null, /* @__PURE__ */ import_react149.default.createElement(
                Alert,
                {
                  variant: "default",
                  isInline: true,
                  title: `The root entry to create is "${this.props.entryParentDn}"`
                },
                "Make sure to select an ",
                /* @__PURE__ */ import_react149.default.createElement("strong", null, "ObjectClass"),
                " that allows or requires the attribute",
                /* @__PURE__ */ import_react149.default.createElement("strong", null, " ", this.props.entryParentDn.split("=")[0])
              )))
            }
          ];
        }
        return [
          {
            id: 1,
            name: "Get Started",
            component: /* @__PURE__ */ import_react149.default.createElement("div", null, /* @__PURE__ */ import_react149.default.createElement(
              Radio,
              {
                value: "User",
                isChecked: this.state.getStartedStepRadio === "User",
                onChange: this.handleOnChange,
                label: "Create a new User",
                description: "Add a new User (inetOrgPerson objectClass)",
                name: "radio-new-step-start",
                id: "radio-new-step-start-1"
              }
            ), /* @__PURE__ */ import_react149.default.createElement(
              Radio,
              {
                className: "ds-margin-top-lg",
                value: "Group",
                isChecked: this.state.getStartedStepRadio === "Group",
                onChange: this.handleOnChange,
                label: "Create a new Group",
                description: "Add a new Group (GroupOfNames/GroupOfUniqueNames objectClass)",
                name: "group",
                id: "radio-new-step-start-2"
              }
            ), /* @__PURE__ */ import_react149.default.createElement(
              Radio,
              {
                className: "ds-margin-top-lg",
                value: "OrganizationalUnit",
                isChecked: this.state.getStartedStepRadio === "OrganizationalUnit",
                onChange: this.handleOnChange,
                label: "Create a new Organizational Unit",
                description: "Add a new Organizational Unit",
                name: "radio-new-step-start",
                id: "radio-new-step-start-3"
              }
            ), /* @__PURE__ */ import_react149.default.createElement(
              Radio,
              {
                className: "ds-margin-top-lg",
                value: "Role",
                isChecked: this.state.getStartedStepRadio === "Role",
                onChange: this.handleOnChange,
                label: "Create a new Role",
                description: "Add a new Role (Filtered / Managed / Nested)",
                name: "radio-new-step-start",
                id: "radio-new-step-start-4"
              }
            ), /* @__PURE__ */ import_react149.default.createElement(
              Radio,
              {
                className: "ds-margin-top-lg",
                value: "Other",
                isChecked: this.state.getStartedStepRadio === "Other",
                onChange: this.handleOnChange,
                label: "Create a new custom Entry",
                description: "Add a new entry by selecting ObjectClasses and Attributes",
                name: "radio-new-step-start",
                id: "radio-new-step-start-7"
              }
            ))
          }
        ];
      });
      this.state = {
        stepIdReached: 1,
        getStartedStepRadio: "User"
      };
    }
    onToggleWizard() {
      this.props.handleToggleWizard();
    }
    render() {
      const {
        getStartedStepRadio
      } = this.state;
      const initialStep = this.createInitialLayout();
      const wizardProps = {
        isWizardOpen: this.props.isWizardOpen,
        handleToggleWizard: this.props.handleToggleWizard,
        wizardEntryDn: this.props.wizardEntryDn,
        editorLdapServer: this.props.editorLdapServer,
        setWizardOperationInfo: this.props.setWizardOperationInfo,
        firstStep: initialStep,
        onReload: this.props.onReload
      };
      if (getStartedStepRadio === "User") {
        return /* @__PURE__ */ import_react149.default.createElement(
          addUser_default,
          {
            ...wizardProps
          }
        );
      } else if (getStartedStepRadio === "Group") {
        return /* @__PURE__ */ import_react149.default.createElement(
          addGroup_default,
          {
            ...wizardProps,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes
          }
        );
      } else if (getStartedStepRadio === "Role") {
        return /* @__PURE__ */ import_react149.default.createElement(
          addRole_default,
          {
            ...wizardProps,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes
          }
        );
      } else if (getStartedStepRadio === "OrganizationalUnit") {
        return /* @__PURE__ */ import_react149.default.createElement(
          genericUpdate_default,
          {
            editorLdapServer: this.props.editorLdapServer,
            entryType: ENTRY_TYPE.ou,
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            wizardEntryDn: this.props.wizardEntryDn,
            firstStep: initialStep,
            onReload: this.props.onReload
          }
        );
      } else {
        return /* @__PURE__ */ import_react149.default.createElement(
          addLdapEntry_default,
          {
            allObjectclasses: this.props.allObjectclasses,
            ...wizardProps
          }
        );
      }
    }
  };
  var newEntry_default = NewEntryWizard;

  // src/lib/ldap_editor/wizards/operations/editLdapEntry.jsx
  var import_react152 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/editGroup.jsx
  var import_react151 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/groupTable.jsx
  var import_react150 = __toESM(require_react(), 1);
  var GroupTable = class extends import_react150.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: "Member DN", transforms: [sortable] }
        ]
      };
      this.selectedCount = 0;
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      let rows = [];
      const columns = this.state.columns;
      for (const attrRow of this.props.rows) {
        let selected = false;
        if (this.props.delMemberList.includes(attrRow)) {
          selected = true;
        }
        rows.push({
          cells: [attrRow],
          selected
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Members"], disableSelection: true }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      for (const row of this.props.rows) {
        if (val !== "" && val !== "*" && row.indexOf(val) === -1) {
          continue;
        }
        rows.push({
          cells: [row]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: ["No Members"], disableSelection: true }];
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    handleSort(_event, index, direction) {
      const rows = [];
      const sortedAttrs = [...this.props.rows];
      sortedAttrs.sort();
      if (direction !== SortByDirection.asc) {
        sortedAttrs.reverse();
      }
      for (const attrRow of sortedAttrs) {
        rows.push({ cells: [attrRow] });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    actions() {
      return [
        {
          title: "View Entry",
          onClick: (event, rowId, rowData, extra) => this.props.viewEntry(rowData.cells[0])
        },
        {
          title: "Edit Entry",
          onClick: (event, rowId, rowData, extra) => this.props.editEntry(rowData.cells[0])
        },
        {
          isSeparator: true
        },
        {
          title: "Remove Entry",
          onClick: (event, rowId, rowData, extra) => this.props.removeMember(rowData.cells[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const extraPrimaryProps = {};
      const canSelectAll = false;
      let deleteBtnName = "Remove Selected Members";
      if (this.props.saving) {
        deleteBtnName = "Updating group ...";
        extraPrimaryProps.spinnerAriaValueText = "Updating";
      }
      return /* @__PURE__ */ import_react150.default.createElement("div", { className: "ds-margin-top-xlg ds-indent" }, /* @__PURE__ */ import_react150.default.createElement(
        SearchInput,
        {
          className: "ds-margin-top",
          placeholder: "Search Members",
          value: this.state.value,
          onChange: this.handleSearchChange,
          onClear: (evt) => this.handleSearchChange(evt, "")
        }
      ), /* @__PURE__ */ import_react150.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          canSelectAll,
          onSelect: (_event, isSelecting, rowIndex) => {
            if (rowIndex !== -1) {
              this.props.onSelectMember(this.state.rows[rowIndex].cells[0], isSelecting);
            }
          },
          "aria-label": "group table",
          cells: columns,
          rows,
          variant: TableVariant.compact,
          sortBy,
          onSort: this.handleSort,
          actions: rows.length > 0 ? this.actions() : null
        },
        /* @__PURE__ */ import_react150.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react150.default.createElement(TableBody, null)
      ), /* @__PURE__ */ import_react150.default.createElement(
        Pagination,
        {
          itemCount: this.props.rows.length,
          widgetId: "pagination-options-menu-bottom",
          perPage,
          page,
          variant: PaginationVariant.bottom,
          onSetPage: this.handleSetPage,
          onPerPageSelect: this.handlePerPageSelect
        }
      ), /* @__PURE__ */ import_react150.default.createElement(
        Button,
        {
          isDisabled: this.props.delMemberList.length === 0 || this.props.saving,
          variant: "primary",
          onClick: this.props.handleShowConfirmBulkDelete,
          isLoading: this.props.saving,
          spinnerAriaValueText: this.state.saving ? "Updating group ..." : void 0,
          ...extraPrimaryProps
        },
        deleteBtnName
      ), /* @__PURE__ */ import_react150.default.createElement(
        Divider,
        {
          className: "ds-margin-top-lg"
        }
      ));
    }
  };
  var groupTable_default = GroupTable;

  // src/lib/ldap_editor/wizards/operations/editGroup.jsx
  var EditGroup = class extends import_react151.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        saving: false,
        isTreeLoading: false,
        members: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        usersSearchBaseDn: "",
        usersAvailableOptions: [],
        usersChosenOptions: [],
        ldifArray: [],
        showConfirmMemberDelete: false,
        showConfirmBulkDelete: false,
        modalOpen: true,
        modalSpinning: false,
        modalChecked: false,
        delMember: "",
        bulkDeleting: false,
        delMemberList: [],
        showViewEntry: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          usersSearchBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleCloseModal = () => {
        this.setState({
          modalOpen: false
        });
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          usersAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.usersSearchBaseDn;
        const pattern = this.state.searchPattern;
        const filter = pattern === "" || pattern === "*" ? "(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))" : `(&(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))(|(cn=*${pattern}*)(uid=*${pattern}*)))`;
        const attrs = "dn";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const dnEncoded = lines[0].indexOf(":: ");
            let dnLine = lines[0];
            if (dnEncoded > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = decoded[1];
            } else {
              dnLine = dnLine.substring(4);
            }
            for (const cOption of this.state.usersChosenOptions) {
              if (cOption.props.title === dnLine) {
                return "skip";
              }
            }
            if (this.props.members.includes(dnLine)) {
              return /* @__PURE__ */ import_react151.default.createElement("span", { className: "ds-pf-green-color", key: dnLine, title: dnLine + " (ALREADY A MEMBER)" }, dnLine);
            } else {
              return /* @__PURE__ */ import_react151.default.createElement("span", { title: dnLine, key: dnLine }, dnLine);
            }
          }).filter((member_option) => member_option !== "skip");
          newOptionsArray.sort((a2, b) => a2.props.children > b.props.children ? 1 : -1);
          this.setState({
            usersAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.handleUsersOnListChange = (newAvailableOptions, newChosenOptions) => {
        const newNewAvailOptions = [...newAvailableOptions];
        const newNewChosenOptions = [];
        for (const option of newChosenOptions) {
          if ("className" in option.props && option.props.className.indexOf("ds-pf-green-color") !== -1) {
            newNewAvailOptions.push(option);
          } else {
            newNewChosenOptions.push(option);
          }
        }
        this.setState({
          usersAvailableOptions: newNewAvailOptions.sort((a2, b) => a2.props.children > b.props.children ? 1 : -1),
          usersChosenOptions: newNewChosenOptions.sort((a2, b) => a2.props.children > b.props.children ? 1 : -1)
        });
      };
      this.showConfirmMemberDelete = this.showConfirmMemberDelete.bind(this);
      this.closeConfirmMemberDelete = this.closeConfirmMemberDelete.bind(this);
      this.showConfirmBulkDelete = this.showConfirmBulkDelete.bind(this);
      this.closeConfirmBulkDelete = this.closeConfirmBulkDelete.bind(this);
      this.handleAddMembers = this.handleAddMembers.bind(this);
      this.delMember = this.delMember.bind(this);
      this.handleSelectMember = this.handleSelectMember.bind(this);
      this.delBulkMembers = this.delBulkMembers.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSwitchEditor = this.handleSwitchEditor.bind(this);
      this.editEntry = this.editEntry.bind(this);
      this.viewEntry = this.viewEntry.bind(this);
      this.handleCloseViewEntry = this.handleCloseViewEntry.bind(this);
    }
    componentDidMount() {
      this.setState({
        members: [...this.props.members],
        _members: [...this.props.members],
        usersSearchBaseDn: getBaseDNFromTree(this.props.groupdn, this.props.treeViewRootSuffixes)
      });
    }
    handleSwitchEditor() {
      this.setState({
        modalOpen: false
      }, () => {
        this.props.onReload(1);
        this.props.useGenericEditor();
      });
    }
    editEntry(memberdn) {
      this.setState({
        modalOpen: false
      });
      this.props.openEditEntry(memberdn);
    }
    viewEntry(memberdn) {
      getBaseLevelEntryAttributes(
        this.props.editorLdapServer,
        memberdn,
        (entryDetails) => {
          const ldifArray = [];
          entryDetails.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
          data.attribute !== "???: ").map((line, index) => {
            if (index === 1e3) {
              ldifArray.push({
                attribute: "... Truncated",
                value: " - Entry too large to display ..."
              });
              return [];
            } else if (index > 1e3) {
              return [];
            }
            ldifArray.push(line);
            return [];
          });
          this.setState({
            showViewEntry: true,
            ldifArray
          });
        }
      );
    }
    handleCloseViewEntry() {
      this.setState({
        showViewEntry: false,
        ldifArray: []
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmMemberDelete(name2) {
      const ldifArray = [];
      let memberAttr = "uniquemember";
      if (this.props.isGroupOfNames) {
        memberAttr = "member";
      }
      ldifArray.push(`dn: ${this.props.groupdn}`);
      ldifArray.push("changetype: modify");
      ldifArray.push(`delete:  ${memberAttr}`);
      ldifArray.push(`${memberAttr}: ${name2}`);
      this.setState({
        showConfirmMemberDelete: true,
        delMember: name2,
        modalChecked: false,
        modalSpinning: false,
        ldifArray
      });
    }
    closeConfirmMemberDelete() {
      this.setState({
        showConfirmMemberDelete: false,
        modalSpinning: false,
        modalChecked: false,
        delMember: ""
      });
    }
    handleAddMembers() {
      const params = { serverId: this.props.editorLdapServer };
      const ldifArray = [];
      let memberAttr = "uniquemember";
      let memCount = 0;
      this.setState({
        saving: true
      });
      if (this.props.isGroupOfNames) {
        memberAttr = "member";
      }
      ldifArray.push(`dn: ${this.props.groupdn}`);
      ldifArray.push("changetype: modify");
      for (const user of this.state.usersChosenOptions) {
        ldifArray.push(`add:  ${memberAttr}`);
        ldifArray.push(`${memberAttr}: ${user.props.title}`);
        ldifArray.push("-");
        memCount += 1;
      }
      modifyLdapEntry(params, ldifArray, (result) => {
        if (result.errorCode === 0) {
          this.props.addNotification(
            "success",
            "Successfully added " + memCount + " member" + (memCount > 1 ? "s" : "")
          );
        } else {
          this.props.addNotification(
            "error",
            "Failed to update group, error code: " + result.errorCode
          );
        }
        this.setState({
          saving: false,
          usersChosenOptions: []
        }, () => {
          this.props.onReload(1);
        });
      });
    }
    delMember() {
      const params = { serverId: this.props.editorLdapServer };
      modifyLdapEntry(params, this.state.ldifArray, (result) => {
        if (result.errorCode === 0) {
          this.props.addNotification(
            "success",
            "Successfully updated group"
          );
        } else {
          this.props.addNotification(
            "error",
            "Failed to update group, error code: " + result.errorCode
          );
        }
        this.setState({
          showConfirmMemberDelete: false,
          showConfirmBulkDelete: false,
          bulkDeleting: false
        }, () => {
          this.props.onReload(1);
        });
      });
    }
    handleSelectMember(memberdn, isSelected) {
      const delMemList = [...this.state.delMemberList];
      if (isSelected) {
        if (!delMemList.includes(memberdn)) {
          delMemList.push(memberdn);
        }
      } else {
        const idx = delMemList.indexOf(memberdn);
        if (idx !== -1) {
          delMemList.splice(idx, 1);
        }
      }
      this.setState({
        delMemberList: delMemList
      });
    }
    showConfirmBulkDelete() {
      this.setState({
        showConfirmBulkDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmBulkDelete() {
      this.setState({
        showConfirmBulkDelete: false
      });
    }
    delBulkMembers() {
      if (this.state.delMemberList.length === 0) {
        return;
      }
      this.setState({
        bulkDeleting: true
      });
      const ldifArray = [];
      let memberAttr = "uniquemember";
      if (this.props.isGroupOfNames) {
        memberAttr = "member";
      }
      ldifArray.push(`dn: ${this.props.groupdn}`);
      ldifArray.push("changetype: modify");
      for (const member of this.state.delMemberList) {
        ldifArray.push(`delete:  ${memberAttr}`);
        ldifArray.push(`${memberAttr}: ${member}`);
        ldifArray.push(`-`);
      }
      this.setState({
        ldifArray
      }, () => this.delMember());
    }
    render() {
      const {
        usersSearchBaseDn,
        usersAvailableOptions,
        usersChosenOptions,
        showLDAPNavModal,
        members,
        modalOpen,
        saving,
        delMemberList,
        showViewEntry,
        ldifArray
      } = this.state;
      const title = /* @__PURE__ */ import_react151.default.createElement(import_react151.default.Fragment, null, /* @__PURE__ */ import_react151.default.createElement(UsersIcon, null), "\xA0\xA0", this.props.groupdn);
      const extraPrimaryProps = {};
      let saveBtnName = "Add Members";
      if (saving) {
        saveBtnName = "Saving ...";
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      const delMemList = this.state.delMemberList.map((member) => /* @__PURE__ */ import_react151.default.createElement("div", { key: member, className: "ds-left-margin ds-left-align" }, member));
      return /* @__PURE__ */ import_react151.default.createElement("div", null, /* @__PURE__ */ import_react151.default.createElement(
        Modal,
        {
          className: "ds-modal-select-tall",
          variant: ModalVariant.large,
          title,
          isOpen: modalOpen,
          onClose: this.handleCloseModal,
          actions: [
            /* @__PURE__ */ import_react151.default.createElement(
              Button,
              {
                key: "switch",
                variant: "secondary",
                onClick: this.handleSwitchEditor,
                className: "ds-float-right"
              },
              "Switch To Generic Editor"
            )
          ]
        },
        /* @__PURE__ */ import_react151.default.createElement(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react151.default.createElement(
          Tab,
          {
            eventKey: 0,
            title: /* @__PURE__ */ import_react151.default.createElement(TabTitleText, null, "Current Members ", /* @__PURE__ */ import_react151.default.createElement("font", { size: "2" }, "(", this.props.members.length, ")"))
          },
          /* @__PURE__ */ import_react151.default.createElement(
            groupTable_default,
            {
              key: members + delMemberList,
              rows: members,
              removeMember: this.showConfirmMemberDelete,
              onSelectMember: this.handleSelectMember,
              handleShowConfirmBulkDelete: this.showConfirmBulkDelete,
              delMemberList,
              viewEntry: this.viewEntry,
              editEntry: this.props.openEditEntry,
              saving: this.state.bulkDeleting
            }
          )
        ), /* @__PURE__ */ import_react151.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react151.default.createElement(TabTitleText, null, "Find New Members") }, /* @__PURE__ */ import_react151.default.createElement(Form, { autoComplete: "off" }, /* @__PURE__ */ import_react151.default.createElement(Grid, { className: "ds-indent" }, /* @__PURE__ */ import_react151.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react151.default.createElement(TextContent, null, /* @__PURE__ */ import_react151.default.createElement(Text, null, "Search Base:", /* @__PURE__ */ import_react151.default.createElement(
          Text,
          {
            className: "ds-left-margin",
            component: TextVariants.a,
            onClick: this.handleOpenLDAPNavModal,
            href: "#"
          },
          usersSearchBaseDn
        )))), /* @__PURE__ */ import_react151.default.createElement(GridItem, { span: 12, className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react151.default.createElement(
          SearchInput,
          {
            placeholder: "Find members...",
            value: this.state.searchPattern,
            onChange: (evt, val) => this.handleSearchPattern(val),
            onSearch: this.handleSearchClick,
            onClear: () => {
              this.handleSearchPattern("");
            }
          }
        )), /* @__PURE__ */ import_react151.default.createElement(GridItem, { span: 12, className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react151.default.createElement(
          DualListSelector,
          {
            availableOptions: usersAvailableOptions,
            chosenOptions: usersChosenOptions,
            availableOptionsTitle: "Available Members",
            chosenOptionsTitle: "Chosen Members",
            onListChange: this.handleUsersOnListChange,
            id: "usersSelector"
          }
        ), /* @__PURE__ */ import_react151.default.createElement(
          Button,
          {
            className: "ds-margin-top",
            isDisabled: usersChosenOptions.length === 0 || this.state.saving,
            variant: "primary",
            onClick: this.handleAddMembers,
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
            ...extraPrimaryProps
          },
          saveBtnName
        )), /* @__PURE__ */ import_react151.default.createElement(
          Modal,
          {
            variant: ModalVariant.medium,
            title: "Choose A Branch To Search",
            isOpen: showLDAPNavModal,
            onClose: this.handleCloseLDAPNavModal,
            actions: [
              /* @__PURE__ */ import_react151.default.createElement(
                Button,
                {
                  key: "confirm",
                  variant: "primary",
                  onClick: this.handleCloseLDAPNavModal
                },
                "Done"
              )
            ]
          },
          /* @__PURE__ */ import_react151.default.createElement(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react151.default.createElement(CardBody, null, /* @__PURE__ */ import_react151.default.createElement(
            ldapNavigator_default,
            {
              treeItems: [...this.props.treeViewRootSuffixes],
              editorLdapServer: this.props.editorLdapServer,
              skipLeafEntries: true,
              handleNodeOnClick: this.onBaseDnSelection,
              showTreeLoadingState: this.showTreeLoadingState
            }
          )))
        ), /* @__PURE__ */ import_react151.default.createElement(
          Divider,
          {
            className: "ds-margin-top-lg"
          }
        ))))),
        /* @__PURE__ */ import_react151.default.createElement(
          Modal,
          {
            variant: ModalVariant.medium,
            title: "View Entry",
            isOpen: showViewEntry,
            onClose: this.handleCloseViewEntry
          },
          /* @__PURE__ */ import_react151.default.createElement(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md" }, /* @__PURE__ */ import_react151.default.createElement(CardBody, { className: "ds-textarea" }, ldifArray.map((line) => /* @__PURE__ */ import_react151.default.createElement("h6", { key: line.attribute + line.value }, line.attribute, line.value))))
        ),
        /* @__PURE__ */ import_react151.default.createElement(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmMemberDelete,
            closeHandler: this.closeConfirmMemberDelete,
            handleChange: this.onModalChange,
            actionHandler: this.delMember,
            spinning: this.state.modalSpinning,
            item: this.state.delMember,
            checked: this.state.modalChecked,
            mTitle: "Remove Member From Group",
            mMsg: "Are you sure you want to remove this member?",
            mSpinningMsg: "Deleting ...",
            mBtnName: "Delete"
          }
        ),
        /* @__PURE__ */ import_react151.default.createElement(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmBulkDelete,
            closeHandler: this.closeConfirmBulkDelete,
            handleChange: this.onModalChange,
            actionHandler: this.delBulkMembers,
            spinning: this.state.modalSpinning,
            item: delMemList,
            checked: this.state.modalChecked,
            mTitle: "Remove Members From Group",
            mMsg: "Are you sure you want to remove these members?",
            mSpinningMsg: "Deleting ...",
            mBtnName: "Delete Members"
          }
        )
      ));
    }
  };
  var editGroup_default = EditGroup;

  // src/lib/ldap_editor/wizards/operations/editLdapEntry.jsx
  var EditLdapEntry = class extends import_react152.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "useGroupGenericEditor", () => {
        this.originalEntryRows = [];
        this.setState({
          groupGenericEditor: true
        });
      });
      __publicField(this, "openEditEntry", (dn) => {
        const editProps = { ...this.state.localProps };
        editProps.wizardEntryDn = dn;
        this.setState({
          localProps: editProps,
          isGroupOfNames: false,
          isGroupOfUniqueNames: false
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr.toLowerCase());
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "enableNextStep", (yes) => {
        this.setState({
          validMods: yes
        });
      });
      __publicField(this, "saveCurrentRows", (editableTableData) => {
        let validMods = true;
        for (const row of editableTableData) {
          if (row.val === "") {
            validMods = false;
            break;
          }
        }
        this.setState({
          editableTableData,
          validMods
        });
      });
      __publicField(this, "handleSetPageOc", (_event, pageNumber) => {
        this.setState({
          pageOc: pageNumber,
          pagedRowsOc: this.getItemsToShow(pageNumber, this.state.perPageOc, "ObjectClassTable")
        });
      });
      __publicField(this, "handleSetPageAttr", (_event, pageNumber) => {
        this.setState({
          pageAttr: pageNumber,
          pagedRowsAttr: this.getItemsToShow(pageNumber, this.state.perPageAttr, "AttributeTable")
        });
      });
      __publicField(this, "handlePerPageSelectOc", (_event, perPage) => {
        this.setState({
          pageOc: 1,
          perPageOc: perPage,
          pagedRowsOc: this.getItemsToShow(1, perPage, "ObjectClassTable")
        });
      });
      __publicField(this, "handlePerPageSelectAttr", (_event, perPage) => {
        this.setState({
          pageAttr: 1,
          perPageAttr: perPage,
          pagedRowsAttr: this.getItemsToShow(1, perPage, "AttributeTable")
        });
      });
      __publicField(this, "handleSelectOc", (event, isSelected, rowId) => {
        const rows = [...this.state.pagedRowsOc];
        rows[rowId].selected = isSelected;
        const ocName = this.state.pagedRowsOc[rowId].cells[0];
        const allItems = [...this.state.rowsOc];
        const index = allItems.findIndex((item) => item.cells[0] === ocName);
        allItems[index].selected = isSelected;
        let selectedObjectClasses = [...this.state.selectedObjectClasses];
        if (isSelected) {
          selectedObjectClasses.push(allItems[index]);
        } else {
          selectedObjectClasses = selectedObjectClasses.filter((row) => row.cells[0] !== allItems[index].cells[0]);
        }
        const attrsToRemove = [];
        if (!isSelected) {
          let ocAttrs = allItems[index].cells[1].toLowerCase().replace(/\s/g, "").split(",");
          ocAttrs = ocAttrs.concat(allItems[index].cells[2].toLowerCase().replace(/\s/g, "").split(","));
          let currAttrs = [];
          for (const oc of selectedObjectClasses) {
            currAttrs = currAttrs.concat(oc.cells[1].toLowerCase().replace(/\s/g, "").split(","));
            currAttrs = currAttrs.concat(oc.cells[2].toLowerCase().replace(/\s/g, "").split(","));
          }
          for (const attr of ocAttrs) {
            if (currAttrs.indexOf(attr) === -1) {
              attrsToRemove.push(attr);
            }
          }
        }
        this.setState({
          rowsOc: allItems,
          pagedRowsOc: rows,
          selectedObjectClasses,
          attrsToRemove
        }, () => {
          this.updateAttributeTableRows();
        });
      });
      __publicField(this, "handleSelectAttr", (event, isSelected, rowId) => {
        let newEditableData = this.state.editableTableData;
        if (this.state.pagedRowsAttr[rowId].disableCheckbox === true) {
          return;
        }
        const rows = [...this.state.pagedRowsAttr];
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].attributeName;
        const allItems = [...this.state.rowsAttr];
        const allAttrs = this.getAllAttrs();
        const index = allItems.findIndex((item) => item.attributeName === attrName);
        allItems[index].isAttributeSelected = isSelected;
        let selectedAttributes = allAttrs.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]);
        if (isSelected) {
          selectedAttributes.push([allItems[index].attributeName, allItems[index].cells[1]]);
        } else {
          selectedAttributes = selectedAttributes.filter((row) => row[0] !== allItems[index].attributeName);
        }
        const rowAttr = rows[rowId].attributeName.toLowerCase();
        const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === rowAttr);
        if (isSelected) {
          if (found.length === 0 && rowAttr !== "objectclass") {
            const obj = {};
            obj.id = generateUniqueId();
            obj.attr = rows[rowId].attributeName;
            obj.val = "";
            obj.namingAttr = false;
            obj.required = false;
            newEditableData = [...newEditableData, obj];
          }
        } else if (found.length > 0) {
          newEditableData = this.state.editableTableData.filter((item) => item.attr.toLowerCase() !== rowAttr);
        }
        let validMods = true;
        for (const row of newEditableData) {
          if (row.val === "") {
            validMods = false;
          }
        }
        this.setState({
          rowsAttr: allItems,
          pagedRowsAttr: rows,
          editableTableData: newEditableData,
          selectedAttributes,
          validMods
        });
      });
      __publicField(this, "getAllAttrs", () => {
        const ocToProcess = [...this.state.selectedObjectClasses];
        const rowsAttr = [];
        const attrList = [];
        ocToProcess.map((oc) => {
          const required = oc.cells[1].split(",");
          const optional = oc.cells[2].split(",");
          for (let attr of required) {
            attr = attr.trim().toLowerCase();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              attrList.push(attr);
              rowsAttr.push({
                selected: true,
                disableCheckbox: true,
                // TODO: Hack until upgrading!
                isAttributeSelected: true,
                attributeName: attr,
                cells: [
                  {
                    title: /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, /* @__PURE__ */ import_react152.default.createElement("strong", null, attr))
                  },
                  oc.cells[0]
                ]
              });
            }
            const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === attr);
            if (found.length === 0 && attr !== "objectclass") {
              const obj = {};
              obj.id = generateUniqueId();
              obj.attr = attr;
              obj.val = "";
              obj.namingAttr = false;
              obj.required = false;
              this.setState((prevState) => ({
                editableTableData: [...prevState.editableTableData, obj],
                validMods: false
              }));
            }
          }
          for (let attr of optional) {
            attr = attr.trim();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === attr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(attr);
              rowsAttr.push({
                attributeName: attr,
                isAttributeSelected: selected,
                selected,
                cells: [attr, oc.cells[0]]
              });
            }
          }
          let personOC = false;
          for (const existingOC of this.state.selectedObjectClasses) {
            if (existingOC.cells[0].toLowerCase() === "person" || existingOC.cells[0].toLowerCase() === "nsperson") {
              personOC = true;
              break;
            }
          }
          const additionalAttrs = ["nsRoleDN", "nsAccountLock"];
          for (const addAttr of additionalAttrs) {
            if (personOC && !attrList.includes(addAttr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === addAttr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(addAttr);
              rowsAttr.push({
                attributeName: addAttr,
                isAttributeSelected: selected,
                selected,
                cells: [addAttr, ""]
              });
            }
          }
          return [];
        });
        return rowsAttr;
      });
      __publicField(this, "updateAttributeTableRows", () => {
        let rowsAttr = [];
        rowsAttr = this.getAllAttrs();
        rowsAttr.sort((a2, b) => a2.attributeName > b.attributeName ? 1 : -1);
        this.setState({
          rowsAttr,
          selectedAttributes: rowsAttr.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]),
          itemCountAttr: rowsAttr.length
        }, () => {
          this.setState({
            pagedRowsAttr: this.getItemsToShow(
              this.state.pageAttr,
              this.state.perPageAttr,
              "AttributeTable"
            )
          });
        });
      });
      __publicField(this, "generateLdifData", () => {
        const statementRows = [];
        const updateArray = [];
        const addArray = [];
        const removeArray = [];
        const ldifArray = [];
        const cleanLdifArray = [];
        let numOfChanges = 0;
        let isFilePath = false;
        for (const originalRow of this.originalEntryRows) {
          const matchingObj = this.state.editableTableData.find((elt) => elt.id === originalRow.id);
          if (!matchingObj) {
            removeArray.push(originalRow);
            continue;
          }
          const sameValue = matchingObj.val === originalRow.val;
          if (sameValue) {
            updateArray.push({ ...originalRow });
          } else {
            const myNewObject = {
              ...originalRow,
              op: LDAP_OPERATIONS.replace,
              new: matchingObj.val
            };
            if (matchingObj.encodedvalue) {
              myNewObject.encodedvalue = matchingObj.encodedvalue;
            }
            updateArray.push(myNewObject);
          }
        }
        for (const savedRow of this.state.editableTableData) {
          let found = false;
          for (const originalRow of this.originalEntryRows) {
            if (originalRow.id === savedRow.id) {
              found = true;
              break;
            }
          }
          if (!found) {
            addArray.push(savedRow);
          }
          found = false;
        }
        for (const datum of updateArray) {
          const myAttr = datum.attr;
          let myVal = datum.val;
          const isUserPwd = myAttr.toLowerCase() === "userpassword";
          isFilePath = false;
          if (myAttr === "dn") {
            ldifArray.push(`dn: ${myVal}`);
            ldifArray.push("changetype: modify");
            cleanLdifArray.push(`dn: ${myVal}`);
            cleanLdifArray.push("changetype: modify");
          }
          if (datum.op === void 0) {
            if (isUserPwd) {
              myVal = "********";
            }
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ import_react152.default.createElement(Label, null, "Keep") },
                myAttr,
                myVal
              ]
            });
          } else {
            if (ldifArray.length >= 4) {
              ldifArray.push("-");
              cleanLdifArray.push("-");
            }
            const sameAttrArray = this.originalEntryRows.filter((obj) => obj.attr === myAttr);
            if ((typeof myVal === "string" || myVal instanceof String) && myVal.toLowerCase().startsWith("file:/")) {
              isFilePath = true;
            }
            const mySeparator = BINARY_ATTRIBUTES.includes(myAttr.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
            if (sameAttrArray.length > 1) {
              ldifArray.push(`delete: ${myAttr}`);
              ldifArray.push(`${myAttr}: ${myVal}`);
              ldifArray.push("-");
              ldifArray.push(`add: ${myAttr}`);
              cleanLdifArray.push(`delete: ${myAttr}`);
              cleanLdifArray.push(`${myAttr}: ${myVal}`);
              cleanLdifArray.push("-");
              cleanLdifArray.push(`add: ${myAttr}`);
            } else {
              ldifArray.push(`replace: ${myAttr}`);
              cleanLdifArray.push(`replace: ${myAttr}`);
            }
            const valueToUse = datum.encodedvalue ? datum.encodedvalue : datum.new;
            const remainingData = foldLine(`${myAttr}${mySeparator} ${valueToUse}`);
            ldifArray.push(...remainingData);
            if (myAttr.toLowerCase().startsWith("userpassword")) {
              cleanLdifArray.push("userpassword: ********");
            } else if (myAttr.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
              const myTruncatedValue = /* @__PURE__ */ import_react152.default.createElement("div", null, "jpegphoto:: ", /* @__PURE__ */ import_react152.default.createElement(Label, { icon: /* @__PURE__ */ import_react152.default.createElement(InfoCircleIcon, null), color: "blue" }, "Value is too large to display"));
              cleanLdifArray.push(myTruncatedValue);
            } else {
              cleanLdifArray.push(...remainingData);
            }
            numOfChanges++;
            if (isUserPwd) {
              datum.new = "********";
              myVal = "********";
            }
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ import_react152.default.createElement(Label, { color: "orange" }, "Replace") },
                myAttr,
                {
                  title: /* @__PURE__ */ import_react152.default.createElement(LabelGroup, { isVertical: true }, /* @__PURE__ */ import_react152.default.createElement(Label, { variant: "outline", color: "red" }, /* @__PURE__ */ import_react152.default.createElement("em", null, "old:"), "\u2002", myVal), /* @__PURE__ */ import_react152.default.createElement(Label, { variant: "outline", color: "blue", isTruncated: true }, /* @__PURE__ */ import_react152.default.createElement("em", null, "new:"), "\u2002", datum.new))
                }
              ]
            });
          }
        }
        for (const datum of addArray) {
          const myAttr = datum.attr;
          let myVal = datum.val;
          const isUserPwd = myAttr.toLowerCase() === "userpassword";
          numOfChanges++;
          isFilePath = false;
          if ((typeof myVal === "string" || myVal instanceof String) && myVal.toLowerCase().startsWith("file:/")) {
            isFilePath = true;
          }
          const mySeparator = BINARY_ATTRIBUTES.includes(myAttr.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
          if (ldifArray.length >= 4) {
            ldifArray.push("-");
            cleanLdifArray.push("-");
          }
          ldifArray.push("add: " + myAttr);
          cleanLdifArray.push("add: " + myAttr);
          const valueToUse = datum.encodedvalue ? datum.encodedvalue : datum.val;
          const remainingData = foldLine(`${myAttr}${mySeparator} ${valueToUse}`);
          ldifArray.push(...remainingData);
          if (myAttr.toLowerCase().startsWith("userpassword")) {
            cleanLdifArray.push("userpassword: ********");
          } else if (myAttr.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
            const myTruncatedValue = /* @__PURE__ */ import_react152.default.createElement("div", null, "jpegphoto:: ", /* @__PURE__ */ import_react152.default.createElement(Label, { icon: /* @__PURE__ */ import_react152.default.createElement(InfoCircleIcon, null), color: "blue" }, "Value is too large to display"));
            cleanLdifArray.push(myTruncatedValue);
          } else {
            cleanLdifArray.push(...remainingData);
          }
          if (isUserPwd) {
            myVal = "********";
          }
          statementRows.push({
            cells: [
              { title: /* @__PURE__ */ import_react152.default.createElement(Label, { color: "orange" }, "Add") },
              myAttr,
              {
                title: /* @__PURE__ */ import_react152.default.createElement(Label, { variant: "outline", color: "blue", isTruncated: true }, myVal)
              }
            ]
          });
        }
        for (const datum of removeArray) {
          const myAttr = datum.attr;
          let myVal = datum.val;
          const isUserPwd = myAttr.toLowerCase() === "userpassword";
          isFilePath = false;
          if (ldifArray.length >= 4) {
            ldifArray.push("-");
            cleanLdifArray.push("-");
          }
          if ((typeof myVal === "string" || myVal instanceof String) && myVal.toLowerCase().startsWith("file:/")) {
            isFilePath = true;
          }
          const mySeparator = BINARY_ATTRIBUTES.includes(myAttr.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
          const valueToUse = datum.encodedvalue ? datum.encodedvalue : datum.val;
          ldifArray.push("delete: " + myAttr);
          cleanLdifArray.push("delete: " + myAttr);
          numOfChanges++;
          if (!isUserPwd) {
            const remainingData = foldLine(`${myAttr}${mySeparator} ${valueToUse}`);
            ldifArray.push(...remainingData);
            if (myAttr.toLowerCase().startsWith("userpassword")) {
              cleanLdifArray.push("userpassword: ********");
            } else if (myAttr.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
              const myTruncatedValue = /* @__PURE__ */ import_react152.default.createElement("div", null, "jpegphoto:: ", /* @__PURE__ */ import_react152.default.createElement(Label, { icon: /* @__PURE__ */ import_react152.default.createElement(InfoCircleIcon, null), color: "blue" }, "Value is too large to display"));
              cleanLdifArray.push(myTruncatedValue);
            } else {
              cleanLdifArray.push(...remainingData);
            }
          } else {
            myVal = "********";
          }
          statementRows.push({
            cells: [
              { title: /* @__PURE__ */ import_react152.default.createElement(Label, { color: "red" }, "Delete") },
              myAttr,
              {
                title: /* @__PURE__ */ import_react152.default.createElement(Label, { variant: "outline", color: "blue", isTruncated: true }, myVal)
              }
            ]
          });
        }
        const origOCs = this.state.origOC.map((oc) => {
          return oc.cells[0].toLowerCase();
        });
        const newOCs = this.state.selectedObjectClasses.map((oc) => {
          return oc.cells[0].toLowerCase();
        });
        for (const oldOC of origOCs) {
          if (newOCs.indexOf(oldOC) === -1) {
            if (ldifArray.length >= 4) {
              ldifArray.push("-");
              cleanLdifArray.push("-");
            }
            ldifArray.push("delete: objectClass");
            ldifArray.push("objectClass: " + oldOC);
            cleanLdifArray.push("delete: objectClass");
            cleanLdifArray.push("objectClass: " + oldOC);
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ import_react152.default.createElement(Label, { color: "red" }, "Delete") },
                "objectClass",
                {
                  title: /* @__PURE__ */ import_react152.default.createElement(Label, { variant: "outline", color: "blue", isTruncated: true }, oldOC)
                }
              ]
            });
            numOfChanges++;
          }
        }
        for (const newOC of newOCs) {
          if (origOCs.indexOf(newOC) === -1) {
            if (ldifArray.length >= 4) {
              ldifArray.push("-");
              cleanLdifArray.push("-");
            }
            ldifArray.push("add: objectClass");
            ldifArray.push("objectClass: " + newOC);
            cleanLdifArray.push("add: objectClass");
            cleanLdifArray.push("objectClass: " + newOC);
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ import_react152.default.createElement(Label, { color: "orange" }, "Add") },
                "objectClass",
                {
                  title: /* @__PURE__ */ import_react152.default.createElement(Label, { variant: "outline", color: "blue", isTruncated: true }, newOC)
                }
              ]
            });
            numOfChanges++;
          }
        }
        this.setState({
          statementRows,
          ldifArray,
          cleanLdifArray,
          numOfChanges
        });
      });
      __publicField(this, "handleOCDropDownToggle", (isOpen) => {
        this.setState({
          isOCDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleOCDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isOCDropDownOpen: !prevState.isOCDropDownOpen };
        });
      });
      __publicField(this, "buildOCDropdown", () => {
        const { isOCDropDownOpen, selectedObjectClasses } = this.state;
        const numSelected = selectedObjectClasses.length;
        const ocs = selectedObjectClasses.map((oc) => oc.cells[0]);
        ocs.sort();
        const items = ocs.map(
          (oc) => /* @__PURE__ */ import_react152.default.createElement(DropdownItem, { key: oc }, oc)
        );
        return /* @__PURE__ */ import_react152.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleOCDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react152.default.createElement(BadgeToggle, { id: "toggle-oc-select", onToggle: this.handleOCDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, "0 selected ")),
            isOpen: isOCDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = this.state.selectedAttributes.length;
        const attrs = selectedAttributes.map((attr) => attr[0]);
        attrs.sort();
        const items = attrs.map(
          (attr) => /* @__PURE__ */ import_react152.default.createElement(DropdownItem, { key: attr }, attr)
        );
        return /* @__PURE__ */ import_react152.default.createElement(
          Dropdown,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ import_react152.default.createElement(BadgeToggle, { id: "toggle-attr-select", onToggle: this.handleAttrDropDownToggle }, numSelected !== 0 ? /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, numSelected, " selected ") : /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, "0 selected ")),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      this.originalEntryRows = [];
      this.singleValuedAttributes = [];
      this.requiredAttributes = ["dn"];
      this.operationColumns = [
        { title: "Statement" },
        { title: "Attribute" },
        { title: "Value", cellTransforms: [breakWord] }
      ];
      this.state = {
        loading: true,
        isOCDropDownOpen: false,
        isAttrDropDownOpen: false,
        namingAttributeData: ["", ""],
        namingAttrPropsName: "",
        namingRowIndex: -1,
        namingAttribute: "",
        namingValue: "",
        editableTableData: [],
        statementRows: [],
        ldifArray: [],
        cleanLdifArray: [],
        validMods: false,
        commandOutput: "",
        resultVariant: "default",
        stepIdReached: 1,
        itemCountOc: 0,
        pageOc: 1,
        perPageOc: 6,
        itemCountAttr: 0,
        pageAttr: 1,
        perPageAttr: 10,
        columnsAttr: [
          { title: "Attribute Name", cellTransforms: [headerCol()] },
          { title: "From ObjectClass" }
        ],
        columnsOc: [
          { title: "ObjectClass Name", cellTransforms: [headerCol()] },
          { title: "Required Attributes", cellTransforms: [breakWord] },
          { title: "Optional Attributes", cellTransforms: [breakWord] }
        ],
        rowsOc: [],
        rowsAttr: [],
        pagedRowsOc: [],
        pagedRowsAttr: [],
        selectedObjectClasses: [],
        selectedAttributes: [],
        attrsToRemove: [],
        modifying: true,
        isGroupOfNames: false,
        isGroupOfUniqueNames: false,
        groupMembers: [],
        groupGenericEditor: false,
        localProps: { ...this.props },
        searchOCValue: "",
        searchValue: ""
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 2) {
          this.updateAttributeTableRows();
        } else if (id === 3) {
          this.cleanUpEntry();
        } else if (id === 4) {
          this.generateLdifData();
        } else if (id === 6) {
          const params = { serverId: this.state.localProps.editorLdapServer };
          modifyLdapEntry(params, this.state.ldifArray, (result) => {
            if (result.errorCode === 0) {
              result.output = "Successfully modified entry";
            }
            this.setState({
              commandOutput: result.errorCode === 0 ? "Successfully modified entry!" : "Failed to modify entry, error: " + result.errorCode,
              resultVariant: result.errorCode === 0 ? "success" : "danger",
              modifying: false
            }, () => {
              this.state.localProps.onReload();
            });
            const opInfo = {
              // This is what refreshes treeView
              operationType: "MODIFY",
              resultCode: result.errorCode,
              time: Date.now()
            };
            this.state.localProps.setWizardOperationInfo(opInfo);
          });
        }
      };
      this.cleanUpEntry = () => {
        const newRows = [];
        let validMods = true;
        for (const row of this.state.editableTableData) {
          const attr = row.attr.toLowerCase();
          if (this.state.attrsToRemove.indexOf(attr) === -1) {
            if (row.val === "") {
              validMods = false;
            }
            newRows.push(row);
          }
        }
        this.setState({
          editableTableData: newRows,
          validMods
        });
      };
      this.handleOCSearchChange = (event, value) => {
        let ocRows = [];
        const allOCs = [];
        const val = value.toLowerCase();
        this.state.localProps.allObjectclasses.map((oc) => {
          let selected = false;
          let selectionDisabled = false;
          for (const selectedOC of this.state.selectedObjectClasses) {
            if (selectedOC.cells[0].toLowerCase() === oc.name.toLowerCase()) {
              selected = true;
              break;
            }
          }
          if (oc.name === "top") {
            selectionDisabled = true;
          }
          allOCs.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of allOCs) {
            const name2 = row.cells[0].toLowerCase();
            const reqAttrs = row.cells[1].toLowerCase();
            const optAttrs = row.cells[2].toLowerCase();
            if (name2.includes(val) || reqAttrs.includes(val) || optAttrs.includes(val)) {
              ocRows.push(row);
            }
          }
        } else {
          ocRows = allOCs;
        }
        this.setState({
          rowsOc: ocRows,
          pagedRowsOc: ocRows.slice(0, this.state.perPageOc),
          itemCountOc: ocRows.length,
          searchOCValue: value
        });
      };
      this.handleAttrSearchChange = (event, value) => {
        let attrRows = [];
        let allAttrs = [];
        const val = value.toLowerCase();
        allAttrs = this.getAllAttrs();
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.attributeName.toLowerCase();
            const oc = row.cells[1].toLowerCase();
            if (name2.includes(val) || oc.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsAttr: attrRows,
          pagedRowsAttr: attrRows.slice(0, this.state.perPageAttr),
          itemCountAttr: attrRows.length,
          searchValue: value
        });
      };
      this.useGroupGenericEditor = this.useGroupGenericEditor.bind(this);
      this.handleLoadEntry = this.handleLoadEntry.bind(this);
    }
    handleLoadEntry(reload) {
      const ocArray = [];
      if (reload) {
        this.originalEntryRows = [];
      }
      getBaseLevelEntryAttributes(
        this.state.localProps.editorLdapServer,
        this.state.localProps.wizardEntryDn,
        (entryDetails) => {
          const objectclasses = [];
          const rdnInfo = getRdnInfo(this.state.localProps.wizardEntryDn);
          let namingAttr = "";
          let namingValue = "";
          let isGroupOfUniqueNames = false;
          let isGroupOfNames = false;
          const members = [];
          entryDetails.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
          data.attribute !== "???: ").map((line, index) => {
            let attrLowerCase;
            let namingAttribute = false;
            if (line.attribute !== void 0) {
              const obj = {};
              const attr = line.attribute;
              attrLowerCase = attr.trim().toLowerCase();
              let val = line.value.substring(1).trim();
              let encodedvalue = "";
              if (attrLowerCase === "objectclass") {
                objectclasses.push(val);
                if (val.toLowerCase() === "groupofnames") {
                  isGroupOfNames = true;
                } else if (val.toLowerCase() === "groupofuniquenames") {
                  isGroupOfUniqueNames = true;
                }
              } else {
                if (line.attribute === "dn") {
                }
                if (line.value.substring(0, 2) === "::") {
                  val = line.value.substring(3);
                  if (BINARY_ATTRIBUTES.includes(attrLowerCase)) {
                    if (attrLowerCase === "jpegphoto") {
                      const myPhoto = /* @__PURE__ */ import_react152.default.createElement(
                        "img",
                        {
                          src: `data:image/png;base64,${val}`,
                          alt: "",
                          style: { width: "48px" }
                        }
                      );
                      encodedvalue = val;
                      val = myPhoto;
                    } else if (attrLowerCase === "nssymmetrickey") {
                      val = line.value.substring(3);
                    }
                  } else {
                    val = b64DecodeUnicode(line.value.substring(3));
                  }
                } else {
                  if (attr === rdnInfo.rdnAttr && val === rdnInfo.rdnVal) {
                    namingAttribute = true;
                    namingAttr = attr;
                    namingValue = val;
                  }
                }
                obj.id = generateUniqueId();
                obj.attr = attr;
                obj.val = val;
                obj.encodedvalue = encodedvalue;
                obj.namingAttr = namingAttribute;
                obj.required = namingAttribute;
                this.originalEntryRows.push(obj);
              }
              if (attrLowerCase === "member" || attrLowerCase === "uniquemember") {
                members.push(val);
              }
            } else {
              const obj = {};
              obj.id = generateUniqueId();
              obj.attr = line.props.attr;
              obj.val = line;
              obj.encodedvalue = "";
              obj.namingAttr = false;
              obj.required = false;
              attrLowerCase = line.props.attr.trim().toLowerCase();
              this.originalEntryRows.push(obj);
            }
            return [];
          });
          this.state.localProps.allObjectclasses.map((oc) => {
            let selected = false;
            let selectionDisabled = false;
            for (const entryOC of objectclasses) {
              if (entryOC.toLowerCase() === oc.name.toLowerCase()) {
                for (const row of this.originalEntryRows) {
                  if (oc.required.includes(row.attr) || row.attr === "dn") {
                    row.required = true;
                  }
                }
                selected = true;
                break;
              }
            }
            if (oc.name === "top") {
              selectionDisabled = true;
            }
            ocArray.push(
              {
                cells: [
                  oc.name,
                  oc.required.join(", "),
                  oc.optional.join(", ")
                ],
                selected,
                disableSelection: selectionDisabled
              }
            );
            return [];
          });
          const selectedObjectClasses = ocArray.filter((item) => item.selected);
          this.setState({
            itemCountOc: ocArray.length,
            rowsOc: ocArray,
            pagedRowsOc: ocArray.slice(0, this.state.perPageOc),
            selectedObjectClasses,
            editableTableData: [...this.originalEntryRows],
            objectclasses,
            namingAttribute: namingAttr,
            namingValue,
            origAttrs: JSON.parse(JSON.stringify(this.originalEntryRows)),
            origOC: JSON.parse(JSON.stringify(selectedObjectClasses)),
            isGroupOfNames,
            isGroupOfUniqueNames,
            groupMembers: members.sort(),
            loading: false
          }, () => {
            this.updateAttributeTableRows();
          });
        }
      );
    }
    componentDidMount() {
      getSingleValuedAttributes(
        this.props.editorLdapServer,
        (myAttrs) => {
          this.singleValuedAttributes = [...myAttrs];
        }
      );
      this.setState({
        localProps: { ...this.props }
      }, () => {
        this.handleLoadEntry();
      });
    }
    getItemsToShow(page, perPage, option) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = option === "ObjectClassTable" ? this.state.rowsOc.slice(start2, end2) : option === "AttributeTable" ? this.state.rowsAttr.slice(start2, end2) : [];
      return newRows;
    }
    render() {
      const {
        loading,
        columnsOc,
        pagedRowsOc,
        itemCountAttr,
        pageAttr,
        perPageAttr,
        columnsAttr,
        pagedRowsAttr,
        commandOutput,
        stepIdReached,
        ldifArray,
        statementRows,
        resultVariant,
        editableTableData,
        numOfChanges,
        validMods,
        cleanLdifArray
      } = this.state;
      const objectClassStep = /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, /* @__PURE__ */ import_react152.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react152.default.createElement(TextContent, null, /* @__PURE__ */ import_react152.default.createElement(Text, { component: TextVariants.h3 }, "Select ObjectClasses")), this.buildOCDropdown()), loading && /* @__PURE__ */ import_react152.default.createElement("div", null, /* @__PURE__ */ import_react152.default.createElement(Bullseye, { className: "ds-margin-top-xlg", key: "add-entry-bulleye" }, /* @__PURE__ */ import_react152.default.createElement(Title, { headingLevel: "h3", size: "lg", key: "loading-title" }, "Loading ...")), /* @__PURE__ */ import_react152.default.createElement(Spinner, { className: "ds-center", size: "lg", key: "loading-spinner" })), /* @__PURE__ */ import_react152.default.createElement("div", { className: loading ? "ds-hidden" : "" }, /* @__PURE__ */ import_react152.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react152.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react152.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search Objectclasses",
          value: this.state.searchOCValue,
          onChange: this.handleOCSearchChange,
          onClear: (evt, val) => this.handleOCSearchChange(evt, "")
        }
      )), /* @__PURE__ */ import_react152.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react152.default.createElement(
        Pagination,
        {
          value: "ObjectClassTable",
          itemCount: this.state.itemCountOc,
          page: this.state.pageOc,
          perPage: this.state.perPageOc,
          onSetPage: this.handleSetPageOc,
          widgetId: "pagination-step-objectclass",
          onPerPageSelect: this.handlePerPageSelectOc,
          variant: "top",
          isCompact: true
        }
      ))), /* @__PURE__ */ import_react152.default.createElement(
        Table,
        {
          cells: columnsOc,
          rows: pagedRowsOc,
          canSelectAll: false,
          onSelect: this.handleSelectOc,
          variant: TableVariant.compact,
          "aria-label": "Pagination All ObjectClasses"
        },
        /* @__PURE__ */ import_react152.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react152.default.createElement(TableBody, null)
      )));
      const attributeStep = /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, /* @__PURE__ */ import_react152.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react152.default.createElement(TextContent, null, /* @__PURE__ */ import_react152.default.createElement(Text, { component: TextVariants.h3 }, "Select Attributes")), this.buildAttrDropdown()), /* @__PURE__ */ import_react152.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react152.default.createElement(GridItem, { span: 5 }, /* @__PURE__ */ import_react152.default.createElement(
        SearchInput,
        {
          className: "ds-font-size-md",
          placeholder: "Search Attributes",
          value: this.state.searchValue,
          onChange: this.handleAttrSearchChange,
          onClear: (evt, val) => this.handleAttrSearchChange(evt, "")
        }
      )), /* @__PURE__ */ import_react152.default.createElement(GridItem, { span: 7 }, /* @__PURE__ */ import_react152.default.createElement(
        Pagination,
        {
          itemCount: itemCountAttr,
          page: pageAttr,
          perPage: perPageAttr,
          onSetPage: this.handleSetPageAttr,
          widgetId: "pagination-step-attributes",
          onPerPageSelect: this.handlePerPageSelectAttr,
          variant: "top",
          isCompact: true
        }
      ))), /* @__PURE__ */ import_react152.default.createElement(
        Table,
        {
          className: "ds-margin-top",
          cells: columnsAttr,
          rows: pagedRowsAttr,
          onSelect: this.handleSelectAttr,
          variant: TableVariant.compact,
          "aria-label": "Pagination Attributes",
          canSelectAll: false
        },
        /* @__PURE__ */ import_react152.default.createElement(TableHeader, null),
        /* @__PURE__ */ import_react152.default.createElement(TableBody, null)
      ));
      const entryValuesStep = /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, /* @__PURE__ */ import_react152.default.createElement(TextContent, null, /* @__PURE__ */ import_react152.default.createElement(Text, { component: TextVariants.h3 }, "Edit Attribute Values")), /* @__PURE__ */ import_react152.default.createElement(
        editableTable_default,
        {
          key: editableTableData,
          wizardEntryDn: this.state.localProps.wizardEntryDn,
          editableTableData,
          quickUpdate: true,
          isAttributeSingleValued: this.isAttributeSingleValued,
          isAttributeRequired: this.isAttributeRequired,
          enableNextStep: this.enableNextStep,
          saveCurrentRows: this.saveCurrentRows,
          allObjectclasses: this.state.localProps.allObjectclasses,
          disableNamingChange: true
        }
      ));
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ import_react152.default.createElement(SimpleListItem, { key: index, isCurrent: (typeof line === "string" || line instanceof String) && line.startsWith("dn: ") }, typeof line === "string" || line instanceof String ? line.length < 1e3 ? line : /* @__PURE__ */ import_react152.default.createElement("div", null, "line.substring(0, 1000)", /* @__PURE__ */ import_react152.default.createElement(Label, { icon: /* @__PURE__ */ import_react152.default.createElement(InfoCircleIcon, null), color: "blue" }, "Value is too large to display")) : line)
      );
      const ldifStatementsStep = /* @__PURE__ */ import_react152.default.createElement("div", null, /* @__PURE__ */ import_react152.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react152.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Statements"
        }
      )), /* @__PURE__ */ import_react152.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react152.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react152.default.createElement(SimpleList, { "aria-label": "LDIF data User" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const entryReviewStep = /* @__PURE__ */ import_react152.default.createElement("div", null, /* @__PURE__ */ import_react152.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react152.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for Entry Modification"
        },
        commandOutput,
        this.state.adding && /* @__PURE__ */ import_react152.default.createElement("div", null, /* @__PURE__ */ import_react152.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Modifying entry ...")
      )), resultVariant === "danger" && /* @__PURE__ */ import_react152.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react152.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react152.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react152.default.createElement("h6", { key: line.id }, line.data)))));
      const editEntrySteps = [
        {
          id: 1,
          name: "Select ObjectClasses",
          component: objectClassStep,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          enableNext: this.state.selectedObjectClasses.length > 0,
          hideBackButton: true
        },
        {
          id: 2,
          name: "Select Attributes",
          component: attributeStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6
        },
        {
          id: 3,
          name: "Edit Values",
          component: entryValuesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6,
          enableNext: validMods
        },
        {
          id: 4,
          name: "View Changes",
          component: /* @__PURE__ */ import_react152.default.createElement(
            Table,
            {
              "aria-label": "Statement Table",
              variant: "compact",
              cells: this.operationColumns,
              rows: statementRows
            },
            /* @__PURE__ */ import_react152.default.createElement(TableHeader, null),
            /* @__PURE__ */ import_react152.default.createElement(TableBody, null)
          ),
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6,
          enableNext: numOfChanges > 0
        },
        {
          id: 5,
          name: "LDIF Statements",
          component: ldifStatementsStep,
          nextButtonText: "Modify Entry",
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: "Review Result",
          component: entryReviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached > 6,
          hideBackButton: true,
          enableNext: !this.state.modifying
        }
      ];
      const title = /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, "Entry DN: \xA0\xA0", /* @__PURE__ */ import_react152.default.createElement("strong", null, this.state.localProps.wizardEntryDn));
      let editPage = /* @__PURE__ */ import_react152.default.createElement(
        Wizard,
        {
          isOpen: this.state.localProps.isWizardOpen,
          onClose: this.state.localProps.handleToggleWizard,
          steps: editEntrySteps,
          title: "Edit An LDAP Entry",
          description: title,
          onNext: this.handleNext
        }
      );
      if (!this.state.groupGenericEditor && (this.state.isGroupOfNames || this.state.isGroupOfUniqueNames)) {
        editPage = /* @__PURE__ */ import_react152.default.createElement(
          editGroup_default,
          {
            key: this.state.groupMembers,
            groupdn: this.state.localProps.wizardEntryDn,
            members: this.state.groupMembers,
            useGenericEditor: this.useGroupGenericEditor,
            isGroupOfNames: this.state.isGroupOfNames,
            isGroupOfUniqueNames: this.state.isGroupOfUniqueNames,
            treeViewRootSuffixes: this.state.localProps.treeViewRootSuffixes,
            editorLdapServer: this.state.localProps.editorLdapServer,
            addNotification: this.state.localProps.addNotification,
            openEditEntry: this.openEditEntry,
            onReload: this.handleLoadEntry
          }
        );
      }
      return /* @__PURE__ */ import_react152.default.createElement(import_react152.default.Fragment, null, editPage);
    }
  };
  var editLdapEntry_default = EditLdapEntry;

  // src/lib/ldap_editor/wizards/operations/renameEntry.jsx
  var import_react153 = __toESM(require_react(), 1);
  var RenameEntry = class extends import_react153.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        stepIdReached: 1,
        baseDn: "",
        isTreeLoading: false,
        searching: false,
        renaming: true,
        currRdnAttr: "",
        currRdnVal: "",
        currRdnSuffix: "",
        deleteOldRdn: false,
        newRdnAttr: "",
        newRdnVal: "",
        newRdnSuffix: "",
        nextEnabled: false,
        allowedAttrs: [],
        ldifArray: [],
        resultVariant: "success",
        commandOutput: ""
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.generateLdifData();
        } else if (id === 5) {
          const params = { serverId: this.props.editorLdapServer };
          modifyLdapEntry(params, this.state.ldifArray, (result) => {
            const opInfo = {
              operationType: "MODRDN",
              resultCode: result.errorCode,
              time: Date.now()
            };
            this.props.setWizardOperationInfo(opInfo);
            this.props.onModrdnReload();
            if (result.errorCode === 0) {
              result.output = "Successfully renamed entry";
            }
            this.setState({
              commandOutput: result.errorCode === 0 ? "Successfully renamed entry!" : "Failed to rename entry, error: " + result.errorCode,
              resultVariant: result.errorCode === 0 ? "success" : "danger",
              renaming: false
            });
          });
        }
      };
      this.onBaseDnSelection = (treeViewItem) => {
        if (treeViewItem.dn.toLowerCase().includes(this.props.wizardEntryDn.toLowerCase())) {
          this.props.addNotification(
            "warning",
            "Can not select a subtree that is the current entry, or a child of the current entry."
          );
          return;
        }
        this.setState({
          newRdnSuffix: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleRdnAttrChange = (attr) => {
        this.setState({
          newRdnAttr: attr
        });
      };
      this.handleRdnValChange = (val) => {
        this.setState({
          newRdnVal: val
        });
      };
      this.handleDelRdnChange = (checked) => {
        this.setState({
          deleteOldRdn: checked
        });
      };
      this.generateLdifData = this.generateLdifData.bind(this);
    }
    componentDidMount() {
      getBaseLevelEntryAttributes(
        this.props.editorLdapServer,
        this.props.wizardEntryDn,
        (entryDetails) => {
          const objectclasses = [];
          const allowedAttrs = [];
          const rdnInfo = getRdnInfo(this.props.wizardEntryDn);
          entryDetails.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
          data.attribute !== "???: ").map((line, index) => {
            const attr = line.attribute;
            const attrLowerCase = attr.trim().toLowerCase();
            const val = line.value.substring(1).trim().toLowerCase();
            if (attrLowerCase === "objectclass") {
              objectclasses.push(val);
            }
            return [];
          });
          for (const entryOC of objectclasses) {
            for (const oc of this.props.allObjectclasses) {
              if (oc.name.toLowerCase() === entryOC) {
                for (const attr of oc.required) {
                  if (allowedAttrs.indexOf(attr) === -1) {
                    allowedAttrs.push(attr);
                  }
                }
                for (const attr of oc.optional) {
                  if (allowedAttrs.indexOf(attr) === -1) {
                    allowedAttrs.push(attr);
                  }
                }
              }
            }
          }
          const rdnSuffix = this.props.wizardEntryDn.replace(rdnInfo.rdnAttr + "=" + rdnInfo.rdnVal + ",", "").trim();
          this.setState({
            allowedAttrs,
            currRdnAttr: rdnInfo.rdnAttr,
            currRdnVal: rdnInfo.rdnVal,
            currRdnSuffix: rdnSuffix,
            newRdnAttr: rdnInfo.rdnAttr,
            newRdnVal: rdnInfo.rdnVal,
            newRdnSuffix: rdnSuffix,
            baseDn: rdnSuffix
          });
        }
      );
    }
    generateLdifData() {
      const ldifArray = [];
      ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
      ldifArray.push("changetype: modrdn");
      ldifArray.push(`newrdn: ${this.state.newRdnAttr}=${this.state.newRdnVal}`);
      if (this.state.deleteOldRdn) {
        ldifArray.push(`deleteoldrdn: 1`);
      } else {
        ldifArray.push(`deleteoldrdn: 0`);
      }
      if (this.state.newRdnSuffix !== this.state.currRdnSuffix) {
        ldifArray.push(`newsuperior: ${this.state.newRdnSuffix}`);
      }
      this.setState({
        ldifArray
      });
    }
    render() {
      const {
        allowedAttrs,
        stepIdReached,
        newRdnAttr,
        newRdnVal,
        newRdnSuffix,
        ldifArray,
        resultVariant,
        commandOutput,
        currRdnAttr,
        currRdnVal,
        currRdnSuffix
      } = this.state;
      const attrValStep = /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, /* @__PURE__ */ import_react153.default.createElement(TextContent, null, /* @__PURE__ */ import_react153.default.createElement(Text, { component: TextVariants.h2 }, "Select The Naming Attribute And Value")), /* @__PURE__ */ import_react153.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 3, className: "ds-label" }, "Naming Attribute"), /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react153.default.createElement(
        FormSelect,
        {
          id: "naming-attr",
          value: newRdnAttr,
          onChange: (str, e) => {
            this.handleRdnAttrChange(str);
          },
          "aria-label": "FormSelect Input"
        },
        allowedAttrs.map((attr, index) => /* @__PURE__ */ import_react153.default.createElement(FormSelectOption, { key: attr, value: attr, label: attr }))
      ))), /* @__PURE__ */ import_react153.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 3, className: "ds-label" }, "New Name"), /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 9 }, /* @__PURE__ */ import_react153.default.createElement(
        TextInput,
        {
          value: newRdnVal,
          type: "text",
          id: "naming-val",
          "aria-describedby": "horizontal-form-name-helper",
          name: "rdnVal",
          onChange: (str, e) => {
            this.handleRdnValChange(str);
          },
          validated: newRdnVal === "" ? ValidatedOptions.error : ValidatedOptions.default
        }
      )), /* @__PURE__ */ import_react153.default.createElement("div", { title: "Removes the old RDN attribute from the entry, otherwise this attribute remains in the entry and references the old RDN." }, /* @__PURE__ */ import_react153.default.createElement(
        Checkbox,
        {
          className: "ds-margin-top-lg",
          id: "deleteoldrdn",
          isChecked: this.state.deleteOldRdn,
          onChange: this.handleDelRdnChange,
          label: "Delete the old RDN attribute from the entry"
        }
      ))));
      const locationStep = /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, /* @__PURE__ */ import_react153.default.createElement(TextContent, null, /* @__PURE__ */ import_react153.default.createElement(Text, { component: TextVariants.h2 }, "Select The Entry Location"), /* @__PURE__ */ import_react153.default.createElement(Text, { component: TextVariants.h5, className: "ds-indent ds-margin-top-lg", title: "The superior DN where the entry will be located under." }, "Parent Subtree \xA0\xA0", /* @__PURE__ */ import_react153.default.createElement(Label, { color: "blue" }, newRdnSuffix))), /* @__PURE__ */ import_react153.default.createElement(CardBody, { className: "ds-margin-top" }, /* @__PURE__ */ import_react153.default.createElement(
        ldapNavigator_default,
        {
          treeItems: [...this.props.treeViewRootSuffixes],
          editorLdapServer: this.props.editorLdapServer,
          handleNodeOnClick: this.onBaseDnSelection,
          showTreeLoadingState: this.showTreeLoadingState
        }
      )));
      const intactRdn = newRdnAttr + "=" + newRdnVal;
      const rdnAttrLabel = newRdnAttr !== currRdnAttr || newRdnVal !== currRdnVal ? /* @__PURE__ */ import_react153.default.createElement(Label, { color: "blue" }, newRdnAttr, "=", newRdnVal) : /* @__PURE__ */ import_react153.default.createElement("div", { className: "ds-lower-field" }, intactRdn);
      const rdnSuffixLabel = newRdnSuffix !== currRdnSuffix ? /* @__PURE__ */ import_react153.default.createElement(Label, { color: "blue" }, newRdnSuffix) : /* @__PURE__ */ import_react153.default.createElement("div", { className: "ds-lower-field" }, newRdnSuffix);
      const intactCurrRdn = currRdnAttr + "=" + currRdnVal;
      const rdnCurrAttrLabel = currRdnAttr !== newRdnAttr || newRdnVal !== currRdnVal ? /* @__PURE__ */ import_react153.default.createElement(Label, { variant: "outline", color: "grey" }, currRdnAttr, "=", currRdnVal) : /* @__PURE__ */ import_react153.default.createElement("div", { className: "ds-lower-field" }, intactCurrRdn);
      const rdnCurrSuffixLabel = newRdnSuffix !== currRdnSuffix ? /* @__PURE__ */ import_react153.default.createElement(Label, { variant: "outline", color: "grey" }, currRdnSuffix) : /* @__PURE__ */ import_react153.default.createElement("div", { className: "ds-lower-field" }, currRdnSuffix);
      const reviewChangesStep = /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, /* @__PURE__ */ import_react153.default.createElement(TextContent, null, /* @__PURE__ */ import_react153.default.createElement(Text, { component: TextVariants.h2 }, "Review Changes")), /* @__PURE__ */ import_react153.default.createElement(Grid, { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Original DN"), /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react153.default.createElement(LabelGroup, null, rdnCurrAttrLabel, ",", rdnCurrSuffixLabel))), /* @__PURE__ */ import_react153.default.createElement(Grid, { className: "ds-margin-top" }, /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 2, className: "ds-label" }, "New DN"), /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react153.default.createElement(LabelGroup, null, rdnAttrLabel, ",", rdnSuffixLabel))), /* @__PURE__ */ import_react153.default.createElement("div", { className: !this.state.deleteOldRdn ? "ds-hidden" : "ds-margin-top-lg" }, /* @__PURE__ */ import_react153.default.createElement(Grid, { title: "This attribute will be removed from the entry so that there is no trace of the old RDN in the entry." }, /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Remove Old Rdn"), /* @__PURE__ */ import_react153.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react153.default.createElement(Label, { color: "orange" }, currRdnAttr, ": ", currRdnVal)))));
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ import_react153.default.createElement(SimpleListItem, { key: index, isCurrent: line.startsWith("dn: ") }, line)
      );
      const ldifStatementsStep = /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, /* @__PURE__ */ import_react153.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react153.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Statements"
        }
      )), /* @__PURE__ */ import_react153.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react153.default.createElement(CardBody, null, ldifListItems.length > 0 && /* @__PURE__ */ import_react153.default.createElement(SimpleList, { "aria-label": "LDIF data modrdn" }, ldifListItems))));
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const reviewStep = /* @__PURE__ */ import_react153.default.createElement("div", null, /* @__PURE__ */ import_react153.default.createElement("div", { className: "ds-addons-bottom-margin" }, /* @__PURE__ */ import_react153.default.createElement(
        Alert,
        {
          variant: resultVariant,
          isInline: true,
          title: "Result for Entry Modification"
        },
        commandOutput,
        this.state.renaming && /* @__PURE__ */ import_react153.default.createElement("div", null, /* @__PURE__ */ import_react153.default.createElement(Spinner, { className: "ds-left-margin", size: "md" }), "\xA0\xA0Renaming entry ...")
      )), resultVariant === "danger" && /* @__PURE__ */ import_react153.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react153.default.createElement(CardTitle, null, "LDIF Data"), /* @__PURE__ */ import_react153.default.createElement(CardBody, null, ldifLines.map((line) => /* @__PURE__ */ import_react153.default.createElement("h6", { key: line.id }, line.data)))));
      const renameSteps = [
        {
          id: 1,
          name: "Set Naming Attribute",
          component: attrValStep,
          canJumpTo: stepIdReached < 5,
          hideBackButton: true,
          enableNext: newRdnVal !== ""
        },
        {
          id: 2,
          name: "Set Entry Location",
          component: locationStep,
          canJumpTo: stepIdReached < 5 && newRdnVal !== "",
          enableNext: newRdnVal !== "" && (newRdnVal !== currRdnVal || newRdnAttr !== currRdnAttr || newRdnSuffix !== currRdnSuffix)
        },
        {
          id: 3,
          name: "Review Changes",
          component: reviewChangesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 5
        },
        {
          id: 4,
          name: "LDIF Statements",
          component: ldifStatementsStep,
          nextButtonText: "Change Entry Name",
          canJumpTo: stepIdReached > 4 && stepIdReached < 5
        },
        {
          id: 5,
          name: "Review Result",
          component: reviewStep,
          nextButtonText: "Finish",
          canJumpTo: stepIdReached > 5,
          hideBackButton: true,
          enableNext: !this.state.renaming
        }
      ];
      const desc = /* @__PURE__ */ import_react153.default.createElement(import_react153.default.Fragment, null, "Old DN: \xA0\xA0\xA0", /* @__PURE__ */ import_react153.default.createElement("b", null, currRdnAttr, "=", currRdnVal, ",", currRdnSuffix), /* @__PURE__ */ import_react153.default.createElement("br", null), /* @__PURE__ */ import_react153.default.createElement("br", null), "New DN: \xA0\xA0", /* @__PURE__ */ import_react153.default.createElement("b", null, newRdnAttr, "=", newRdnVal, ",", newRdnSuffix));
      return /* @__PURE__ */ import_react153.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          title: "Rename LDAP Entry",
          description: desc,
          steps: renameSteps
        }
      );
    }
  };
  var renameEntry_default = RenameEntry;

  // src/lib/ldap_editor/wizards/deleteOperation.jsx
  var import_react154 = __toESM(require_react(), 1);
  var DeleteOperationWizard = class extends import_react154.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        alertVariant: "danger",
        entryLdifData: "",
        numSubordinates: -1,
        ldapsearchCmd: "",
        isAckChecked: false,
        isDelChecked: false,
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        stepIdReached: 1,
        itemCountAddUser: 0,
        pageAddUser: 1,
        perPageAddUser: 10,
        columnsUser: [
          { title: "Attribute Name", cellTransforms: [headerCol()] },
          { title: "From ObjectClass" }
        ],
        rowsUser: [],
        pagedRowsUser: [],
        selectedAttributes: ["cn", "sn"],
        // Values
        noEmptyValue: false,
        columnsValue: [
          "Attribute",
          "Value"
        ],
        rowsValues: [],
        // Review step
        reviewValue: "",
        reviewInvalidText: "Invalid LDIF",
        reviewIsValid: true,
        reviewValidated: "default",
        // reviewHelperText: 'LDIF data',
        deleting: true
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          deleteLdapData(
            this.props.editorLdapServer,
            this.props.wizardEntryDn,
            this.state.numSubordinates,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? "Successfully deleted entry" : "Failed to delete entry, error: " + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                deleting: false
              }, () => {
                this.props.onReload();
              });
              const opInfo = {
                // This is what refreshes treeView
                operationType: "DELETE",
                resultCode: result.errorCode,
                time: Date.now()
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleChangeAck = (isAckChecked) => {
        this.setState({ isAckChecked });
      };
    }
    componentDidMount() {
      getBaseLevelEntryFullAttributes(
        this.props.editorLdapServer,
        this.props.wizardEntryDn,
        (result) => {
          if (result !== "") {
            const regex = /^numSubordinates:\s\d+?$/mi;
            const line = result.match(regex);
            const numSubordinates = line ? parseInt(line[0].split(":")[1].trim()) : 0;
            this.setState({
              entryLdifData: result,
              numSubordinates
            });
          }
        }
      );
      const ldapsearchCmd = `ldapsearch -LLL -o ldif-wrap=no -Y EXTERNAL -b "${this.props.wizardEntryDn}" -H ldapi://%2fvar%2frun%2fslapd-${this.props.editorLdapServer}.socket "(objectClass=*)" \\* +`;
      this.setState({
        ldapsearchCmd
      });
    }
    render() {
      const {
        commandOutput,
        entryLdifData,
        numSubordinates,
        resultVariant,
        isAckChecked,
        ldapsearchCmd
      } = this.state;
      const info2 = numSubordinates > 0 ? `It has child entries which will also be recursively deleted.` : "";
      const entryIcon = numSubordinates > 0 ? /* @__PURE__ */ import_react154.default.createElement(UsersIcon, null) : /* @__PURE__ */ import_react154.default.createElement(UserIcon, null);
      const acknowledgementStep = /* @__PURE__ */ import_react154.default.createElement("div", null, /* @__PURE__ */ import_react154.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react154.default.createElement(CardTitle, null, "Delete Acknowledgement"), /* @__PURE__ */ import_react154.default.createElement(CardBody, null, "You are about to delete this entry. ", info2), /* @__PURE__ */ import_react154.default.createElement(CardBody, null, entryIcon, "\xA0\xA0", /* @__PURE__ */ import_react154.default.createElement("b", { className: "ds-info-color" }, this.props.wizardEntryDn))));
      let nb = -1;
      const ldifLines = entryLdifData.split("\n").map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const ldifDataStep = /* @__PURE__ */ import_react154.default.createElement("div", null, /* @__PURE__ */ import_react154.default.createElement(
        Alert,
        {
          variant: "info",
          isInline: true,
          title: "LDIF Entry To Be Deleted"
        }
      ), /* @__PURE__ */ import_react154.default.createElement(Card, { isSelectable: true }, numSubordinates > 0 && /* @__PURE__ */ import_react154.default.createElement(import_react154.default.Fragment, null, /* @__PURE__ */ import_react154.default.createElement(CardBody, null, "Run this command to retrieve the LDAP entries that will be deleted"), /* @__PURE__ */ import_react154.default.createElement(CardBody, null, /* @__PURE__ */ import_react154.default.createElement(
        ClipboardCopy,
        {
          variant: ClipboardCopyVariant.expansion,
          isReadOnly: true,
          hoverTip: "Copy",
          clickTip: "Copied"
        },
        ldapsearchCmd
      ))), numSubordinates === 0 && /* @__PURE__ */ import_react154.default.createElement(CardBody, { className: "ds-textarea" }, ldifLines.map((line) => /* @__PURE__ */ import_react154.default.createElement("h6", { key: line.id }, line.data)))));
      const nbToDelete = numSubordinates > 0 ? `This entry, as well as all its child entries,` : "This entry";
      const deletionStep = /* @__PURE__ */ import_react154.default.createElement("div", null, /* @__PURE__ */ import_react154.default.createElement(
        Alert,
        {
          variant: "danger",
          isInline: true,
          title: "This is an irreversible operation!"
        }
      ), /* @__PURE__ */ import_react154.default.createElement("div", null, /* @__PURE__ */ import_react154.default.createElement(Card, { isSelectable: true }, /* @__PURE__ */ import_react154.default.createElement(CardTitle, null, "Confirm Entry Deletion"), /* @__PURE__ */ import_react154.default.createElement(CardBody, null, nbToDelete, " will be deleted."), /* @__PURE__ */ import_react154.default.createElement(CardBody, null, entryIcon, "\xA0\xA0", /* @__PURE__ */ import_react154.default.createElement("b", { className: "ds-info-color" }, this.props.wizardEntryDn)), /* @__PURE__ */ import_react154.default.createElement(CardBody, null, /* @__PURE__ */ import_react154.default.createElement(
        Switch,
        {
          isDisabled: this.props.wizardEntryDn === "",
          id: "ack-switch",
          label: "Yes, I'm sure.",
          labelOff: "No, don't delete.",
          isChecked: isAckChecked,
          onChange: this.handleChangeAck
        }
      )))));
      let reviewInfo = "";
      if (commandOutput === "") {
        reviewInfo = numSubordinates > 0 ? "The entries were" : "The entry was";
        reviewInfo += " successfully deleted.";
      } else {
        reviewInfo = "There was an error during the deletion.";
      }
      const delReviewStep = /* @__PURE__ */ import_react154.default.createElement("div", { className: "ds-margin-bottom-md" }, /* @__PURE__ */ import_react154.default.createElement(
        Alert,
        {
          variant: resultVariant,
          title: reviewInfo
        },
        commandOutput
      ), this.state.deleting && /* @__PURE__ */ import_react154.default.createElement("div", { className: "ds-center ds-margin-top-xlg" }, /* @__PURE__ */ import_react154.default.createElement(Spinner, { size: "xlg" })));
      const deleteEntrySteps = [
        {
          id: 1,
          name: "Acknowledgement",
          component: acknowledgementStep,
          hideBackButton: true,
          canJumpTo: this.state.stepIdReached >= 1 && this.state.stepIdReached < 4
        },
        {
          id: 2,
          name: "LDIF Data",
          component: ldifDataStep,
          canJumpTo: this.state.stepIdReached >= 2,
          enableNext: this.state.stepIdReached < 4
        },
        {
          id: 3,
          name: "Deletion",
          component: deletionStep,
          nextButtonText: "Delete",
          enableNext: isAckChecked,
          canJumpTo: this.state.stepIdReached === 3
        },
        {
          id: 4,
          name: "Review",
          component: delReviewStep,
          nextButtonText: "Finish",
          canJumpTo: this.state.stepIdReached >= 4,
          hideBackButton: true,
          enableNext: !this.state.deleting
        }
      ];
      return /* @__PURE__ */ import_react154.default.createElement(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          title: numSubordinates === 0 ? "Delete LDAP Entry" : "Delete LDAP Entries",
          steps: deleteEntrySteps
        }
      );
    }
  };
  var deleteOperation_default = DeleteOperationWizard;

  // src/lib/ldap_editor/wizards/genericWizard.jsx
  var GenericWizard = class extends import_react155.default.Component {
    render() {
      const wizardProps = {
        // Properties
        isWizardOpen: this.props.isWizardOpen,
        wizardEntryDn: this.props.wizardEntryDn,
        editorLdapServer: this.props.editorLdapServer,
        // Functions
        handleToggleWizard: this.props.toggleOpenWizard,
        setWizardOperationInfo: this.props.setWizardOperationInfo,
        onReload: this.props.onReload,
        onModrdnReload: this.props.onModrdnReload,
        addNotification: this.props.addNotification,
        // LDAP Data
        treeViewRootSuffixes: this.props.treeViewRootSuffixes,
        allObjectclasses: this.props.allObjectclasses
      };
      switch (this.props.wizardName) {
        case ENTRY_MENU.acis:
          return /* @__PURE__ */ import_react155.default.createElement(
            aci_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.new:
          return /* @__PURE__ */ import_react155.default.createElement(
            newEntry_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.edit:
          return /* @__PURE__ */ import_react155.default.createElement(
            editLdapEntry_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.rename:
          return /* @__PURE__ */ import_react155.default.createElement(
            renameEntry_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.cos:
          return /* @__PURE__ */ import_react155.default.createElement(
            cos_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.delete:
          return /* @__PURE__ */ import_react155.default.createElement(
            deleteOperation_default,
            {
              ...wizardProps
            }
          );
        default:
          console.log(`Unknown Wizard in GenericWizard class: ${this.props.wizardName}`);
          return null;
      }
    }
  };
  var genericWizard_default = GenericWizard;

  // src/lib/ldap_editor/search.jsx
  var SearchDatabase = class extends import_react156.default.Component {
    constructor(props) {
      super(props);
      // Process the entries that are direct children.
      __publicField(this, "processResults", (searchResults, resObj) => {
        let resultRows = [];
        let rowNumber = 0;
        if (searchResults) {
          if (this.state.checkIfLocked) {
            searchResults.map((aChild) => {
              const info2 = JSON.parse(aChild);
              resultRows = [...this.state.rows];
              let entryState = "";
              let entryStateIcon = "";
              entryStateIcon = /* @__PURE__ */ import_react156.default.createElement(LockIcon, { className: "ds-pf-blue-color" });
              const cmd = [
                "dsidm",
                "-j",
                "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
                "-b",
                info2.dn,
                info2.isRole ? "role" : "account",
                "entry-status",
                info2.dn
              ];
              log_cmd("processResults", "Checking if entry is activated", cmd);
              cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
                if (info2.isLockable) {
                  const status = JSON.parse(content);
                  entryState = status.info.state;
                  if (entryState === "inactivity limit exceeded" || entryState.startsWith("probably activated or")) {
                    entryStateIcon = /* @__PURE__ */ import_react156.default.createElement(ExclamationTriangleIcon, { className: "ds-pf-yellow-color ct-icon-exclamation-triangle" });
                  }
                }
              }).fail((err) => {
                const errMsg = JSON.parse(err);
                if (info2.isLockable && !errMsg.desc.includes("Root suffix can't be locked or unlocked")) {
                  console.error(
                    "processResults",
                    `${info2.isRole ? "role" : "account"} account entry-status operation failed`,
                    errMsg.desc
                  );
                  entryState = "error: please, check browser logs";
                  entryStateIcon = /* @__PURE__ */ import_react156.default.createElement(ExclamationCircleIcon, { className: "ds-pf-red-color ct-exclamation-circle" });
                }
              }).finally(() => {
                if (!info2.isLockable) {
                  console.info("processResults:", `${info2.dn} entry is not lockable`);
                }
                let ldapsubentryIcon = "";
                let entryStateIconFinal = "";
                if (info2.ldapsubentry) {
                  ldapsubentryIcon = /* @__PURE__ */ import_react156.default.createElement(InfoCircleIcon, { title: "This is a hidden LDAP subentry", className: "ds-pf-blue-color ds-info-icon" });
                }
                if (entryState !== "" && entryStateIcon !== "" && entryState !== "activated") {
                  entryStateIconFinal = /* @__PURE__ */ import_react156.default.createElement(
                    Tooltip,
                    {
                      position: "bottom",
                      content: /* @__PURE__ */ import_react156.default.createElement("div", { className: "ds-info-icon" }, entryState)
                    },
                    /* @__PURE__ */ import_react156.default.createElement("a", { className: "ds-font-size-md" }, entryStateIcon)
                  );
                }
                const dn = /* @__PURE__ */ import_react156.default.createElement(import_react156.default.Fragment, null, info2.dn, " ", ldapsubentryIcon, " ", entryStateIconFinal);
                resultRows.push(
                  {
                    isOpen: false,
                    cells: [
                      { title: dn },
                      info2.numSubordinates,
                      info2.modifyTimestamp
                    ],
                    rawdn: info2.dn,
                    isLockable: info2.isLockable,
                    isRole: info2.isRole,
                    entryState
                  },
                  {
                    parent: rowNumber,
                    cells: [
                      { title: this.initialResultText }
                    ]
                  }
                );
                rowNumber += 2;
                this.setState({
                  searching: false,
                  rows: resultRows,
                  // Each row is composed of a parent and its single child.
                  pagedRows: resultRows.slice(0, 2 * this.state.perPage),
                  total: resultRows.length / 2,
                  page: 1
                });
              });
              return [];
            });
          } else {
            searchResults.map((aChild) => {
              const info2 = JSON.parse(aChild);
              let dn = info2.dn;
              if (info2.ldapsubentry) {
                dn = /* @__PURE__ */ import_react156.default.createElement("div", { className: "ds-info-icon" }, info2.dn, " ", /* @__PURE__ */ import_react156.default.createElement(InfoCircleIcon, { title: "This is a hidden LDAP subentry", className: "ds-info-icon" }));
              }
              resultRows.push(
                {
                  isOpen: false,
                  cells: [
                    { title: dn },
                    info2.numSubordinates,
                    info2.modifyTimestamp
                  ],
                  rawdn: info2.dn,
                  entryState: ""
                },
                {
                  parent: rowNumber,
                  cells: [
                    { title: this.initialResultText }
                  ]
                }
              );
              rowNumber += 2;
              return [];
            });
            this.setState({
              searching: false,
              rows: resultRows,
              // Each row is composed of a parent and its single child.
              pagedRows: resultRows.slice(0, 2 * this.state.perPage),
              total: resultRows.length / 2,
              page: 1
            });
          }
        } else {
          if (resObj.status !== 0) {
            this.props.addNotification(
              "error",
              `Error searching the database: ${resObj.msg}`
            );
          }
          this.setState({
            searching: false,
            rows: resultRows,
            // Each row is composed of a parent and its single child.
            pagedRows: resultRows.slice(0, 2 * this.state.perPage),
            total: resultRows.length / 2,
            page: 1
          });
        }
      });
      __publicField(this, "actionResolver", (rowData, { rowIndex }) => {
        if (rowIndex % 2 === 1) {
          return null;
        }
        let lockingDropdown = [];
        if (rowData.entryState !== "" && !rowData.entryState.startsWith("error:")) {
          if (rowData.entryState !== "activated") {
            if (rowData.entryState.includes("probably activated") || rowData.entryState.includes("indirectly locked")) {
              lockingDropdown = [{
                title: "Lock ...",
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "lock"
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            } else {
              lockingDropdown = [{
                title: "Unlock ...",
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "unlock"
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            }
          } else {
            lockingDropdown = [{
              title: "Lock ...",
              onClick: () => {
                const entryType = rowData.isRole ? "role" : "account";
                this.setState({
                  entryDn: rowData.rawdn,
                  entryType,
                  operationType: "lock"
                }, () => {
                  this.handleConfirmModalToggle();
                });
              }
            }];
          }
        }
        const updateActions = [
          {
            title: "Search ...",
            onClick: () => {
              this.setState({
                activeTabKey: 2,
                searchBase: rowData.rawdn
              });
            }
          },
          {
            title: "Edit ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.edit,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          },
          {
            title: "New ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.new,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          },
          ...lockingDropdown,
          {
            isSeparator: true
          },
          {
            title: "ACIs ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.acis,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          },
          {
            title: "Class of Service ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.cos,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: "Delete",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.delete,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          }
        ];
        return [
          ...updateActions
        ];
      });
      this.state = {
        searching: false,
        loading: false,
        searchBase: "",
        searchFilter: "",
        searchScope: "sub",
        sizeLimit: 2e3,
        timeLimit: 30,
        isExpanded: false,
        searchSuffix: "",
        baseDN: "",
        searchType: "Search Text",
        searchText: "",
        getOperationalAttrs: false,
        total: 0,
        // Search attributes
        cn: true,
        uid: true,
        sn: true,
        givenName: true,
        mail: true,
        displayName: false,
        legalName: false,
        memberOf: false,
        member: false,
        uniqueMember: false,
        customSearchAttrs: [],
        isCustomAttrOpen: false,
        isConfirmModalOpen: false,
        checkIfLocked: false,
        // Table
        columns: [
          {
            title: "Entry DN",
            cellFormatters: [expandable]
          },
          {
            title: "Child Entries"
          },
          {
            title: "Last Modified"
          }
        ],
        rows: [],
        page: 0,
        perPage: 10,
        pagedRows: [],
        wizardName: "",
        isWizardOpen: false,
        wizardEntryDn: "",
        treeViewRootSuffixes: []
        // TODO when aci's are ready (is there a better list of suffixes?)
      };
      this.initialResultText = "Loading...";
      this.handleChangeSwitch = (checkIfLocked) => {
        this.setState({
          checkIfLocked
        });
      };
      this.handleToggle = (isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.toggleOpenWizard = () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      };
      this.setWizardOperationInfo = (opInfo) => {
        const wizardOperationInfo = { ...opInfo };
        this.setState({ wizardOperationInfo });
      };
      this.handleCustomAttrToggle = (isCustomAttrOpen) => {
        this.setState({
          isCustomAttrOpen
        });
      };
      this.handleCustomAttrClear = () => {
        this.setState({
          customSearchAttrs: [],
          isCustomAttrOpen: false
        });
      };
      this.handleCustomAttrChange = (event, selection) => {
        const { customSearchAttrs } = this.state;
        if (customSearchAttrs.includes(selection)) {
          this.setState(
            (prevState) => ({
              customSearchAttrs: prevState.customSearchAttrs.filter((item) => item !== selection),
              isCustomAttrOpen: false
            }),
            () => {
              this.buildSearchFilter(this.state.searchText);
            }
          );
        } else {
          this.setState(
            (prevState) => ({
              customSearchAttrs: [...prevState.customSearchAttrs, selection],
              isCustomAttrOpen: false
            }),
            () => {
              this.buildSearchFilter(this.state.searchText);
            }
          );
        }
      };
      this.buildSearchFilter = (value) => {
        let searchFilter2 = "";
        if (this.state.searchType === "Search Text") {
          let attrs = [];
          const chkBoxAttrs = [
            "cn",
            "uid",
            "sn",
            "givenName",
            "mail",
            "displayName",
            "legalName",
            "memberOf",
            "member",
            "uniqueMember"
          ];
          for (const attr of chkBoxAttrs) {
            if (this.state[attr]) {
              attrs.push(attr);
            }
          }
          attrs = attrs.concat(this.state.customSearchAttrs);
          if (attrs.length === 0) {
            return;
          }
          if (attrs.length > 1) {
            searchFilter2 = "(|";
            for (const attr of attrs) {
              searchFilter2 += "(" + attr + "=*" + value + "*)";
            }
            searchFilter2 += ")";
          } else {
            searchFilter2 = "(" + attrs[0] + "=*" + value + "*)";
          }
        } else {
          searchFilter2 = value;
        }
        return searchFilter2;
      };
      this.handleSearchChange = (event, value) => {
        this.setState({
          searchText: value,
          searchFilter: this.buildSearchFilter(value)
        });
      };
      this.handleSearch = () => {
        if (!this.state.searchFilter) {
          return;
        }
        this.setState({
          rows: [],
          isExpanded: false,
          searching: true
        }, () => {
          const params = {
            serverId: this.props.serverId,
            searchBase: this.state.searchBase,
            searchFilter: this.state.searchFilter,
            searchScope: this.state.searchScope,
            sizeLimit: this.state.sizeLimit,
            timeLimit: this.state.timeLimit,
            addNotification: this.props.addNotification
          };
          getSearchEntries(params, this.processResults);
        });
      };
      this.handleSearchTypeClick = (isSelected, event) => {
        const id = event.currentTarget.id;
        this.setState({
          searchType: id,
          searchText: "",
          searchFilter: ""
        });
      };
      this.handleScopeClick = (isSelected, event) => {
        const id = event.currentTarget.id;
        this.setState({ searchScope: id });
      };
      this.maxValue = 2e7;
      this.onMinus = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        });
      };
      this.onNumberChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        });
      };
      this.onPlus = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        });
      };
      this.handleClearSearchBase = () => {
        this.setState({
          searchBase: this.state.searchSuffix
        });
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSuffixChange = this.handleSuffixChange.bind(this);
      this.handleCustomAttrChange = this.handleCustomAttrChange.bind(this);
      this.getPageData = this.getPageData.bind(this);
      this.processResults = this.processResults.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.actionResolver = this.actionResolver.bind(this);
      this.handleLockUnlockEntry = this.handleLockUnlockEntry.bind(this);
    }
    componentDidMount() {
      const suffixList = this.props.suffixList;
      const searchBase = this.props.searchBase;
      let baseDN = searchBase;
      for (const suffix of suffixList) {
        if (baseDN.includes(suffix)) {
          baseDN = suffix;
          break;
        }
      }
      this.setState({
        searchBase: searchBase || (suffixList.length > 0 ? suffixList[0] : ""),
        searchSuffix: this.props.suffixList.length > 0 ? this.props.suffixList[0] : "",
        baseDN
      });
    }
    handleCollapse(event, rowKey, isOpen, data) {
      const { pagedRows } = this.state;
      pagedRows[rowKey].isOpen = isOpen;
      this.setState({
        pagedRows
      });
      const firstTime = pagedRows[rowKey + 1].cells[0].title === this.initialResultText;
      if (firstTime) {
        const baseDn = pagedRows[rowKey].rawdn;
        getBaseLevelEntryAttributes(this.props.serverId, baseDn, (entryArray) => {
          pagedRows[rowKey + 1].cells = [{
            title: /* @__PURE__ */ import_react156.default.createElement(import_react156.default.Fragment, null, entryArray.map((line) => /* @__PURE__ */ import_react156.default.createElement("div", { key: line.attribute + line.value }, /* @__PURE__ */ import_react156.default.createElement("strong", null, line.attribute), line.value.toLowerCase() === ": ldapsubentry" ? /* @__PURE__ */ import_react156.default.createElement("span", { className: "ds-info-color" }, line.value) : line.attribute.toLowerCase() === "userpassword" ? ": ********" : line.attribute.toLowerCase() === "jpegphoto" ? /* @__PURE__ */ import_react156.default.createElement("div", null, /* @__PURE__ */ import_react156.default.createElement(
              "img",
              {
                src: `data:image/png;base64,${line.value.substr(3)}`,
                alt: "",
                style: { width: "256px" }
              }
            )) : line.value)))
          }];
          this.setState({
            pagedRows
          });
        });
      }
    }
    handleCustomAttrChange(value) {
      this.setState({
        customSearchAttrs: value
      });
    }
    handleSuffixChange(e) {
      const value = e.target.value;
      this.setState({
        searchSuffix: value,
        searchBase: value,
        baseDN: value
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value.trim();
      this.setState({
        [e.target.id]: value
      }, () => {
        this.setState({
          searchFilter: this.buildSearchFilter(this.state.searchText)
        });
      });
    }
    getPageData(page, perPage) {
      if (page === 1) {
        const pagedRows = this.state.rows.slice(0, 2 * perPage);
        this.setState({ pagedRows, perPage, page, loading: false });
      } else {
        const start2 = 2 * (page - 1) * perPage;
        const end2 = 2 * page * perPage;
        const pagedRows = this.state.rows.slice(start2, end2);
        for (let i = 0; i < pagedRows.length - 1; i++) {
          if (i % 2 === 0) {
            pagedRows[i + 1].parent = i;
          }
        }
        this.setState({ pagedRows, perPage, page, loading: false });
      }
    }
    handleLockUnlockEntry() {
      const {
        entryDn,
        entryType,
        operationType
      } = this.state;
      const cmd = [
        "dsidm",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "-b",
        entryDn,
        entryType,
        operationType,
        entryDn
      ];
      log_cmd("handleLockUnlockEntry", `${operationType} entry`, cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((_) => {
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen,
          refreshEntryTime: Date.now()
        }, () => {
          this.handleSearch();
          this.handleConfirmModalToggle();
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        console.error(
          "handleLockUnlockEntry",
          `${entryType} ${operationType} operation failed -`,
          errMsg.desc
        );
        this.props.addNotification(
          `${errMsg.desc.includes(`is already ${operationType === "unlock" ? "active" : "locked"}`) ? "warning" : "error"}`,
          `${errMsg.desc}`
        );
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen,
          refreshEntryTime: Date.now()
        }, () => {
          this.handleSearch();
          this.handleConfirmModalToggle();
        });
      });
    }
    render() {
      const {
        suffixList
      } = this.props;
      const {
        baseDN,
        page,
        perPage,
        total,
        searching,
        wizardName,
        isWizardOpen,
        wizardEntryDn
      } = this.state;
      let columns = this.state.columns;
      let pagedRows = this.state.pagedRows;
      if (pagedRows.length === 0) {
        columns = [" "];
        pagedRows = [{ cells: ["No Search Results"] }];
      }
      const treeItemsProps = wizardName === "acis" ? { treeViewRootSuffixes: this.state.treeViewRootSuffixes } : {};
      return /* @__PURE__ */ import_react156.default.createElement("div", null, isWizardOpen && /* @__PURE__ */ import_react156.default.createElement(
        genericWizard_default,
        {
          wizardName,
          isWizardOpen,
          toggleOpenWizard: this.toggleOpenWizard,
          wizardEntryDn,
          editorLdapServer: this.props.serverId,
          ...treeItemsProps,
          setWizardOperationInfo: this.setWizardOperationInfo,
          onReload: this.handleSearch,
          allObjectclasses: this.props.allObjectclasses
        }
      ), /* @__PURE__ */ import_react156.default.createElement(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off" }, /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left" }, /* @__PURE__ */ import_react156.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react156.default.createElement(TextContent, null, /* @__PURE__ */ import_react156.default.createElement(Text, { component: TextVariants.h3 }, "Search Database")), /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-left-margin" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react156.default.createElement(
        FormSelect,
        {
          id: "searchSuffix",
          value: baseDN,
          onChange: (value, event) => {
            this.handleSuffixChange(event);
          },
          "aria-label": "FormSelect Input",
          className: "ds-instance-select ds-raise-field",
          isDisabled: suffixList.length === 0
        },
        suffixList.map((suffix, index) => /* @__PURE__ */ import_react156.default.createElement(FormSelectOption, { key: suffix, value: suffix, label: suffix })),
        suffixList.length === 0 && /* @__PURE__ */ import_react156.default.createElement(FormSelectOption, { isDisabled: true, key: "No database", value: "", label: "No databases" })
      )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 8 }, this.state.searchSuffix !== this.state.searchBase ? /* @__PURE__ */ import_react156.default.createElement(Label, { onClose: this.handleClearSearchBase, className: "ds-left-margin", color: "blue" }, this.state.searchBase) : "")))), /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 12 }, /* @__PURE__ */ import_react156.default.createElement("div", { className: "ds-container" }, /* @__PURE__ */ import_react156.default.createElement(ToggleGroup, { "aria-label": "Default with single selectable" }, /* @__PURE__ */ import_react156.default.createElement(
        ToggleGroupItem,
        {
          title: "Text that will be used with pre-selected attributes to find matching entries.",
          text: "Text",
          buttonId: "Search Text",
          isSelected: this.state.searchType === "Search Text",
          onChange: this.handleSearchTypeClick
        }
      ), /* @__PURE__ */ import_react156.default.createElement(
        ToggleGroupItem,
        {
          title: "Specific LDAP search filter for finding entries.",
          text: "Filter",
          buttonId: "Search Filter",
          isSelected: this.state.searchType === "Search Filter",
          onChange: this.handleSearchTypeClick
        }
      )), /* @__PURE__ */ import_react156.default.createElement(
        SearchInput,
        {
          placeholder: this.state.searchType === "Search Text" ? "Enter search text ..." : "Enter an LDAP search filter ...",
          value: this.state.searchText,
          onChange: this.handleSearchChange,
          onClear: (evt, val) => this.handleSearchChange(evt, ""),
          onSearch: this.handleSearch,
          className: "ds-search-input"
        }
      )))), /* @__PURE__ */ import_react156.default.createElement(
        ExpandableSection,
        {
          className: "ds-margin-left",
          toggleText: this.state.isExpanded ? "Hide Search Criteria" : "Show Search Criteria",
          onToggle: this.handleToggle,
          isExpanded: this.state.isExpanded,
          displaySize: this.state.isExpanded ? "large" : "default"
        },
        /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Search Base"), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 6 }, /* @__PURE__ */ import_react156.default.createElement(
          TextInput,
          {
            value: this.state.searchBase,
            type: "text",
            id: "searchBase",
            "aria-describedby": "searchBase",
            name: "searchBase",
            onChange: (str, e) => {
              this.handleChange(e);
            },
            validated: !valid_dn(this.state.searchBase) ? ValidatedOptions.error : ValidatedOptions.default
          }
        )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 2, className: "ds-left-margin ds-lower-field-md" }, /* @__PURE__ */ import_react156.default.createElement(FormHelperText, { isError: true, isHidden: valid_dn(this.state.searchBase) }, "Invalid DN syntax"))),
        /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Search Scope"), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 4 }, /* @__PURE__ */ import_react156.default.createElement(ToggleGroup, { "aria-label": "search scope" }, /* @__PURE__ */ import_react156.default.createElement(
          ToggleGroupItem,
          {
            text: "Subtree",
            buttonId: "sub",
            isSelected: this.state.searchScope === "sub",
            onChange: this.handleScopeClick,
            title: "Search for entries starting at the search base, and including all its child entries"
          }
        ), /* @__PURE__ */ import_react156.default.createElement(
          ToggleGroupItem,
          {
            text: "One Level",
            buttonId: "one",
            isSelected: this.state.searchScope === "one",
            onChange: this.handleScopeClick,
            title: "Search for entries starting at the search base, and include only the first level of child entries"
          }
        ), /* @__PURE__ */ import_react156.default.createElement(
          ToggleGroupItem,
          {
            text: "Base",
            buttonId: "base",
            isSelected: this.state.searchScope === "base",
            onChange: this.handleScopeClick,
            title: "Search for an exact entry (search base). This does not include child entries."
          }
        )))),
        /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Size Limit"), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react156.default.createElement(
          NumberInput,
          {
            value: this.state.sizeLimit,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinus("sizeLimit");
            },
            onChange: (e) => {
              this.onNumberChange(e, "sizeLimit", -1);
            },
            onPlus: () => {
              this.onPlus("sizeLimit");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))),
        /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top", title: "Search timeout in seconds" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Time Limit"), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react156.default.createElement(
          NumberInput,
          {
            value: this.state.timeLimit,
            min: -1,
            max: this.maxValue,
            onMinus: () => {
              this.onMinus("timeLimit");
            },
            onChange: (e) => {
              this.onNumberChange(e, "timeLimit", -1);
            },
            onPlus: () => {
              this.onPlus("timeLimit");
            },
            inputName: "input",
            inputAriaLabel: "number input",
            minusBtnAriaLabel: "minus",
            plusBtnAriaLabel: "plus",
            widthChars: 8
          }
        ))),
        /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top", title: "Check if the search result entries are locked, and add Lock/Unlock options to the dropdown. This setting vastly impacts the search's performance. Use only when needed." }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Show Locking"), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react156.default.createElement(Switch, { id: "no-label-switch-on", "aria-label": "Message when on", isChecked: this.state.checkIfLocked, onChange: this.handleChangeSwitch }))),
        /* @__PURE__ */ import_react156.default.createElement("div", { hidden: this.state.searchType === "Search Filter" }, /* @__PURE__ */ import_react156.default.createElement(
          Grid,
          {
            className: "ds-margin-left ds-margin-top",
            title: "Only used for Search Text based queries.  The selected attributes will use Search Text as the attribute value in the search filter"
          },
          /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 2, className: "ds-label" }, "Search Attributes")
        ), /* @__PURE__ */ import_react156.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "cn",
            id: "cn",
            isChecked: this.state.cn,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "cn"
          }
        )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "uid",
            id: "uid",
            isChecked: this.state.uid,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "uid"
          }
        )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "sn",
            id: "sn",
            isChecked: this.state.sn,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "sn"
          }
        ))), /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "givenName",
            id: "givenName",
            isChecked: this.state.givenName,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "givenName"
          }
        )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "mail",
            id: "mail",
            isChecked: this.state.mail,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "mail"
          }
        )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "displayName",
            id: "displayName",
            isChecked: this.state.displayName,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "displayName"
          }
        ))), /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "legalName",
            id: "legalName",
            isChecked: this.state.legalName,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "legalName"
          }
        )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "memberOf",
            id: "memberOf",
            isChecked: this.state.memberOf,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "memberOf"
          }
        )), /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "member",
            id: "member",
            isChecked: this.state.member,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "member"
          }
        ))), /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top" }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 3 }, /* @__PURE__ */ import_react156.default.createElement(
          Checkbox,
          {
            label: "uniqueMember",
            id: "uniqueMember",
            isChecked: this.state.uniqueMember,
            onChange: (checked, e) => {
              this.handleChange(e);
            },
            "aria-label": "uniqueMember"
          }
        ))), /* @__PURE__ */ import_react156.default.createElement(Grid, { className: "ds-margin-left ds-margin-top", title: "Enter space or comma separateed list of attributes to search." }, /* @__PURE__ */ import_react156.default.createElement(GridItem, { span: 8 }, /* @__PURE__ */ import_react156.default.createElement(
          Select,
          {
            variant: SelectVariant.typeaheadMulti,
            typeAheadAriaLabel: "Type attributes to include in filter ...",
            onToggle: this.handleCustomAttrToggle,
            onSelect: this.handleCustomAttrChange,
            onClear: this.handleCustomAttrClear,
            selections: this.state.customSearchAttrs,
            isOpen: this.state.isCustomAttrOpen,
            "aria-labelledby": "typeAhead-attr-filter",
            placeholderText: "Type attributes to include in the filter ...",
            noResultsFoundText: "There are no matching attributes"
          },
          this.props.attributes.map((attr, index) => /* @__PURE__ */ import_react156.default.createElement(
            SelectOption,
            {
              key: index,
              value: attr
            }
          ))
        )))))
      )), /* @__PURE__ */ import_react156.default.createElement("div", { className: "ds-indent" }, /* @__PURE__ */ import_react156.default.createElement("div", { className: this.state.searching ? "ds-margin-top-lg ds-center" : "ds-hidden" }, /* @__PURE__ */ import_react156.default.createElement(TextContent, null, /* @__PURE__ */ import_react156.default.createElement(Text, { component: TextVariants.h3 }, "Searching ", /* @__PURE__ */ import_react156.default.createElement("i", null, this.state.searchBase), " ...")), /* @__PURE__ */ import_react156.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" })), /* @__PURE__ */ import_react156.default.createElement("div", { className: searching ? "ds-hidden" : "" }, /* @__PURE__ */ import_react156.default.createElement("center", null, /* @__PURE__ */ import_react156.default.createElement("p", null, /* @__PURE__ */ import_react156.default.createElement("b", null, "Results:"), " ", total)), /* @__PURE__ */ import_react156.default.createElement(
        tableView_default,
        {
          key: searching,
          loading: searching,
          itemCount: total,
          page,
          perPage,
          onSetPage: (value) => this.getPageData(value, perPage),
          onPerPageSelect: (value) => this.getPageData(1, value),
          editorTableRows: pagedRows,
          onCollapse: this.handleCollapse,
          columns,
          actionResolver: pagedRows.length < 2 ? null : this.actionResolver
        }
      ))), /* @__PURE__ */ import_react156.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: `Are you sure you want to ${this.state.operationType} the ${this.state.entryType}?`,
          isOpen: this.state.isConfirmModalOpen,
          onClose: this.handleConfirmModalToggle,
          actions: [
            /* @__PURE__ */ import_react156.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleLockUnlockEntry }, "Confirm"),
            /* @__PURE__ */ import_react156.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleConfirmModalToggle }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react156.default.createElement(TextContent, { className: "ds-margin-top" }, /* @__PURE__ */ import_react156.default.createElement(Text, null, this.state.entryType === "account" ? `It will ${this.state.operationType === "lock" ? "add" : "remove"} nsAccountLock attribute
                            ${this.state.operationType === "lock" ? "to" : "from"} the entry - ${this.state.entryDn}.` : `This operation will make sure that these five entries are created at the entry's root suffix (if not, they will be created):`), this.state.entryType === "role" && /* @__PURE__ */ import_react156.default.createElement(import_react156.default.Fragment, null, /* @__PURE__ */ import_react156.default.createElement(TextList, null, /* @__PURE__ */ import_react156.default.createElement(TextListItem, null, "cn=nsManagedDisabledRole"), /* @__PURE__ */ import_react156.default.createElement(TextListItem, null, "cn=nsDisabledRole"), /* @__PURE__ */ import_react156.default.createElement(TextListItem, null, "cn=nsAccountInactivationTmp (with a child)"), /* @__PURE__ */ import_react156.default.createElement(TextListItem, null, "cn=nsAccountInactivation_cos")), /* @__PURE__ */ import_react156.default.createElement(Text, null, `The entry - ${this.state.entryDn} - will be ${this.state.operationType === "lock" ? "added to" : "removed from"} nsRoleDN attribute in cn=nsDisabledRole entry in the root suffix.`)))
      ));
    }
  };
  SearchDatabase.propTypes = {
    attributes: import_prop_types110.default.array,
    searchBase: import_prop_types110.default.string
  };
  SearchDatabase.defaultProps = {
    attributes: [],
    searchBase: ""
  };

  // src/LDAPEditor.jsx
  var LDAPEditor = class extends import_react157.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onNavItemClick", (id, active) => {
        if (id === "home" || active) {
          return;
        }
        if (id === "db-suffixes") {
          const navItems = this.state.navItems.slice(0, 2);
          this.setState({
            navItems,
            loading: true,
            baseDN: id
          });
          this.showSuffixes("Database Suffixes", null);
        } else {
          const listOfItems = this.state.navItems;
          let position;
          for (position = 2; position < listOfItems.length - 1; position++) {
            if (listOfItems[position].id === id) {
              break;
            }
          }
          const navItems = this.state.navItems.slice(0, position + 1);
          const len = navItems.length;
          navItems[len - 1].active = true;
          this.setState({
            navItems,
            baseDN: id,
            searching: true
          });
          const params = {
            serverId: this.props.serverId,
            baseDn: id,
            addNotification: this.props.addNotification
          };
          getOneLevelEntries(params, this.processDirectChildren);
        }
      });
      // Handle clicks on the numSubordinates links.
      __publicField(this, "handleClickNumSubordinates", (dn) => {
        const listOfItems = this.state.navItems;
        const itemsLength = listOfItems.length;
        let totalParentLength = 0;
        let pos = 0;
        while (pos < itemsLength) {
          listOfItems[pos].active = false;
          if (pos > 1) {
            totalParentLength += listOfItems[pos].label.length + 1;
          }
          pos++;
        }
        let newLabel = dn;
        if (itemsLength > 2) {
          const dnLength = dn.length;
          newLabel = dn.slice(0, dnLength - totalParentLength);
        }
        const newNavItems = [
          ...listOfItems,
          { id: dn, to: "#", label: newLabel, active: true }
        ];
        const tableTitle = this.state.columns[0].title;
        if (tableTitle === "Database Suffixes") {
          this.setState((prevState) => ({
            columns: [
              {
                title: "Entry DN",
                cellFormatters: [expandable]
              },
              ...prevState.columns.slice(1)
            ]
          }));
        }
        this.setState({
          navItems: newNavItems,
          baseDN: dn,
          searching: true
        });
        const params = {
          serverId: this.props.serverId,
          baseDn: dn,
          addNotification: this.props.addNotification
        };
        getOneLevelEntries(params, this.processDirectChildren);
      });
      // Process the entries that are direct children.
      __publicField(this, "processDirectChildren", (directChildren, params) => {
        this.setState({
          loading: true
        });
        const childrenRows = [];
        let rowNumber = 0;
        directChildren.map((aChild) => {
          const info2 = JSON.parse(aChild);
          const numSubCellInfo = parseInt(info2.numSubordinates) > 0 ? {
            title: /* @__PURE__ */ import_react157.default.createElement("a", { href: "#", onClick: (e) => this.handleClickNumSubordinates(info2.dn, false, e) }, info2.numSubordinates, " ", /* @__PURE__ */ import_react157.default.createElement(AngleRightIcon, null))
          } : info2.numSubordinates;
          let dn = info2.dn;
          if (info2.ldapsubentry) {
            dn = /* @__PURE__ */ import_react157.default.createElement("div", { className: "ds-info-icon" }, info2.dn, " ", /* @__PURE__ */ import_react157.default.createElement(InfoCircleIcon, { title: "This is a hidden LDAP subentry", className: "ds-info-icon" }));
          }
          childrenRows.push(
            {
              isOpen: false,
              cells: [
                { title: dn },
                numSubCellInfo,
                info2.modifyTimestamp
              ],
              rawdn: info2.dn,
              entryState: "",
              isRole: info2.isRole,
              isLockable: info2.isLockable,
              ldapsubentry: info2.ldapsubentry
            },
            {
              // customRowId: info.parentId + 1,
              parent: rowNumber,
              // info.parentId,
              cells: [
                { title: this.initialChildText }
              ]
            }
          );
          rowNumber += 2;
          return [];
        });
        this.setState({
          loading: false,
          searching: false,
          rows: childrenRows,
          // Each row is composed of a parent and its single child.
          pagedRows: childrenRows.slice(0, 2 * this.state.perPage),
          total: childrenRows.length / 2,
          page: 1
        }, () => {
          if (this.state.currentRowKey >= 0) {
            this.handleCollapse(null, this.state.currentRowKey, true, null);
          }
        });
      });
      // Update the table rows after getting details of the root suffixes.
      __publicField(this, "updateTableRootSuffixes", (entryDetails) => {
        const info2 = JSON.parse(entryDetails);
        if (info2.dn === null) {
          console.log('updateTableRootSuffixes: Got a NULL DN! Object "info" ===> ' + info2);
          return;
        }
        const isEmptySuffix = info2.errorCode === 32;
        const suffixCellInfo = !isEmptySuffix ? info2.dn : {
          title: /* @__PURE__ */ import_react157.default.createElement("div", { className: "ds-warning-icon" }, /* @__PURE__ */ import_react157.default.createElement(ExclamationTriangleIcon, null), " ", info2.dn)
        };
        let key = 0;
        const numSubCellInfo = parseInt(info2.numSubordinates) > 0 ? {
          title: /* @__PURE__ */ import_react157.default.createElement("a", { href: "#", key: "link-" + info2.dn, onClick: (e) => this.handleClickNumSubordinates(info2.dn, true, e) }, info2.numSubordinates, " ", /* @__PURE__ */ import_react157.default.createElement(AngleRightIcon, null))
        } : info2.numSubordinates;
        let node_present = false;
        for (const node of this.rootSuffixesRows) {
          if (node.rawdn === info2.dn) {
            node_present = true;
            break;
          }
        }
        if (!node_present) {
          this.rootSuffixesRows = [
            ...this.rootSuffixesRows,
            {
              isOpen: false,
              cells: [
                suffixCellInfo,
                numSubCellInfo,
                info2.modifyTimestamp
              ],
              rawdn: info2.dn,
              customRowId: info2.parentId,
              isEmptySuffix,
              entryState: ""
            },
            {
              customRowId: info2.parentId + 1,
              parent: info2.parentId,
              cells: [{
                title: !isEmptySuffix ? /* @__PURE__ */ import_react157.default.createElement(import_react157.default.Fragment, null, info2.fullEntry.map((line) => /* @__PURE__ */ import_react157.default.createElement("div", { key: key++ }, /* @__PURE__ */ import_react157.default.createElement("strong", null, " ", line.attribute), line.value))) : /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement("strong", null, "\xA0", /* @__PURE__ */ import_react157.default.createElement("em", null, "This suffix is empty!\xA0\xA0\xA0")), /* @__PURE__ */ import_react157.default.createElement("a", { key: "top-entry-" + info2.dn, href: "#", onClick: () => {
                  this.onHandleEmptySuffixToggle(info2.dn);
                } }, "Click here to create the top entry"))
              }]
            }
          ];
        }
        const numSubValue = parseInt(info2.numSubordinates);
        const randomId = generateUniqueId();
        const nodeChildren = [{
          name: "Loading...",
          id: randomId,
          icon: /* @__PURE__ */ import_react157.default.createElement(Spinner, { size: "sm" }),
          isFakeEntry: true
        }];
        const nodeDn = info2.dn === "" ? "Root DSE" : info2.dn;
        const entryTreeData = {
          name: nodeDn,
          fullEntry: info2.fullEntry,
          //
          children: numSubValue > 0 ? nodeChildren : null,
          modTime: info2.modifyTimestamp,
          // The DN value can also be retrieved from info.fullEntry
          // ( but will require to retrieve the DN line and then split it. Taking a lazy approach here ;-))
          dn: info2.dn,
          isEmptySuffix,
          loadChildren: numSubValue > 0
          // Used to insert child nodes when needed.
        };
        if (numSubValue > 0) {
          entryTreeData.customBadgeContent = numSubValue;
        }
        if (isEmptySuffix) {
          entryTreeData.icon = /* @__PURE__ */ import_react157.default.createElement(ResourcesEmptyIcon, { color: "var(--pf-global--palette--orange-300)" });
        } else {
          entryTreeData.icon = null;
        }
        node_present = false;
        for (const node of this.rootSuffixesTreeData) {
          if (node.name === entryTreeData.name) {
            node.icon = entryTreeData.icon;
            node_present = true;
            break;
          }
        }
        if (!node_present) {
          this.rootSuffixesTreeData = [...this.rootSuffixesTreeData, entryTreeData];
        }
        if (this.rootSuffixesRows.length === 2 * this.state.numberSuffixes) {
          const finalRowData = this.rootSuffixesRows.sort((e1, e22) => e1.customRowId - e22.customRowId);
          this.setState({
            loading: false,
            rows: finalRowData,
            // Each row is composed of a parent and its single child.
            pagedRows: finalRowData.slice(0, 2 * this.state.perPage),
            total: finalRowData.length / 2,
            page: 1
          });
          const myTreeRootSuffixes = [...this.rootSuffixesTreeData];
          let myLocationIdentifier = 0;
          const treeViewRootSuffixes = myTreeRootSuffixes.map((node) => {
            node.id = myLocationIdentifier.toString();
            myLocationIdentifier++;
            return node;
          });
          const timeOfCompletion = Date.now();
          this.setState({
            treeViewRootSuffixes,
            timeOfCompletion
          });
        }
      });
      // Process the root suffixes
      __publicField(this, "processRootSuffixes", (userSuffData) => {
        let loading = this.state.loading;
        let isEmpty = false;
        if (userSuffData === void 0 || userSuffData === null || userSuffData.length === 0) {
          isEmpty = true;
          loading = false;
        }
        this.rootSuffixesRows = [];
        const suffixesToProcess = isEmpty ? [] : [...userSuffData];
        this.setState({
          numberSuffixes: suffixesToProcess.length,
          suffixList: [...userSuffData],
          loading
        }, () => {
          let parentId2 = 0;
          suffixesToProcess.map((suffixDN) => {
            const params = {
              serverId: this.props.serverId,
              baseDn: suffixDN,
              parentId: parentId2,
              addNotification: this.props.addNotification
            };
            getRootSuffixEntryDetails(params, this.updateTableRootSuffixes);
            parentId2 += 2;
            return [];
          });
        });
      });
      __publicField(this, "showSuffixes", (label, event) => {
        getUserSuffixes(this.props.serverId, this.processRootSuffixes);
        if (!!label === false) {
          return;
        }
        const isRootSuff = label === "Database Suffixes";
        this.setState({
          onRootSuffixes: isRootSuff
        });
        const tableTitle = this.state.columns[0].title;
        if (isRootSuff && tableTitle !== "Database Suffixes" || !isRootSuff && tableTitle === "Database Suffixes") {
          const firstTitle = label === "Database Suffixes" ? "Database Suffixes" : "Entry DN";
          this.setState((prevState) => ({
            columns: [
              {
                title: firstTitle,
                cellFormatters: [expandable]
              },
              ...prevState.columns.slice(1)
            ]
          }), () => {
            this.setState({ searching: false });
          });
        } else {
          this.setState({
            searching: false
          });
        }
      });
      __publicField(this, "actionResolver", (rowData, { rowIndex }) => {
        if (rowIndex % 2 === 1) {
          return null;
        }
        if (rowData.isEmptySuffix) {
          return [{
            title: "Create Top Entry...",
            onClick: () => {
              this.onHandleEmptySuffixToggle(rowData.rawdn);
            }
          }];
        }
        let lockingDropdown = [];
        if (rowData.isLockable) {
          if (rowData.entryState !== "" && rowData.entryState !== "activated") {
            if (rowData.entryState.includes("probably activated") || rowData.entryState.includes("indirectly locked")) {
              lockingDropdown = [{
                title: "Lock ...",
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "lock",
                    currentRowKey: rowData.secretTableRowKeyId
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            } else {
              lockingDropdown = [{
                title: "Unlock ...",
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "unlock",
                    currentRowKey: rowData.secretTableRowKeyId
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            }
          } else if (rowData.entryState === "activated") {
            lockingDropdown = [{
              title: "Lock ...",
              onClick: () => {
                const entryType = rowData.isRole ? "role" : "account";
                this.setState({
                  entryDn: rowData.rawdn,
                  entryType,
                  operationType: "lock",
                  currentRowKey: rowData.secretTableRowKeyId
                }, () => {
                  this.handleConfirmModalToggle();
                });
              }
            }];
          }
        }
        const keyIndex = this.state.keyIndex + 1;
        const updateActions = [
          {
            title: "Search ...",
            onClick: () => {
              this.setState({
                activeTabKey: 2,
                searchBase: rowData.rawdn
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: "Edit ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.edit,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            title: "New ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.new,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            title: "Rename ...",
            isDisabled: rowData.customRowId === 0,
            // can not rename root suffix
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.rename,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          ...lockingDropdown,
          {
            title: "ACIs ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.acis,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false,
                keyIndex
              });
            }
          },
          {
            title: "Class of Service ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.cos,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false,
                keyIndex
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: "Delete ...",
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.delete,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: "Refresh ...",
            onClick: () => {
              this.handleReload(true);
            }
          }
        ];
        return [
          ...updateActions
        ];
      });
      this.rootSuffixesRows = [];
      this.rootSuffixesTreeData = [];
      this.initialChildText = "Loading...";
      this.state = {
        activeTabKey: 0,
        firstLoad: true,
        keyIndex: 0,
        suffixList: [],
        changeLayout: false,
        openNewEntry: false,
        openDeleteEntry: false,
        baseDN: "",
        emptyDN: "",
        loading: true,
        searching: false,
        perPage: 50,
        page: 0,
        total: 0,
        onRootSuffixes: true,
        numberSuffixes: 0,
        entryMenuIsOpen: false,
        wizardOperationInfo: { operationType: "", resultCode: -1, time: 0 },
        wizardName: "",
        isWizardOpen: false,
        isTreeWizardOpen: false,
        showEmptySuffixModal: false,
        wizardEntryDn: "",
        treeViewRootSuffixes: [],
        searchBase: "",
        isEntryTooLarge: false,
        refreshEntryTime: 0,
        navItems: [
          { id: "home", label: /* @__PURE__ */ import_react157.default.createElement(CatalogIcon, null), active: false },
          { id: "db-suffixes", to: "#", label: "Database Suffixes", active: true }
        ],
        columns: [
          {
            title: "Database Suffixes",
            cellFormatters: [expandable]
          },
          {
            title: "Child Entries"
          },
          {
            title: "Last Modified"
          }
        ],
        rows: [],
        pagedRows: [],
        refreshing: false,
        allObjectclasses: [],
        isConfirmModalOpen: false,
        isTreeViewAction: false,
        currentRowKey: -1
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onToggleEntryMenu = (isOpen) => {
        this.setState({
          entryMenuIsOpen: isOpen
        });
      };
      this.handleSelectEntryOptions = (event) => {
        const aTarget = event.target;
        if (aTarget.name === ENTRY_MENU.refresh) {
          this.setState({
            entryMenuIsOpen: !this.state.entryMenuIsOpen,
            refreshEntryTime: Date.now()
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.search) {
          this.setState({
            activeTabKey: 2,
            searchBase: aTarget.value
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.lockRole) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "role",
            operationType: "lock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.lockAccount) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "account",
            operationType: "lock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.unlockRole) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "role",
            operationType: "unlock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.unlockAccount) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "account",
            operationType: "unlock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        const keyIndex = this.state.keyIndex + 1;
        this.setState({
          entryMenuIsOpen: false,
          wizardName: aTarget.name,
          isTreeWizardOpen: true,
          isWizardOpen: false,
          wizardEntryDn: aTarget.value,
          keyIndex
        });
      };
      this.toggleOpenTreeWizard = () => {
        this.setState({
          isTreeWizardOpen: !this.state.isTreeWizardOpen
        });
      };
      this.handleReloadNoop = () => {
      };
      this.toggleOpenWizard = () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      };
      this.setWizardOperationInfo = (opInfo) => {
        const wizardOperationInfo = { ...opInfo };
        this.setState({
          wizardOperationInfo
        });
      };
      this.setTreeFirstClicked = (value) => {
        this.setState({ treeVisibleAndFirstClicked: value });
      };
      this.onHandleEmptySuffixToggle = (dn) => {
        const showEmptySuffixModal = this.state.showEmptySuffixModal;
        this.setState({
          showEmptySuffixModal: !showEmptySuffixModal,
          emptyDN: dn
        }, () => {
          this.handleReload(true);
        });
      };
      this.handleCollapse = this.handleCollapse.bind(this);
      this.onNavItemClick = this.onNavItemClick.bind(this);
      this.handleReload = this.handleReload.bind(this);
      this.getAttributes = this.getAttributes.bind(this);
      this.handleLockUnlockEntry = this.handleLockUnlockEntry.bind(this);
    }
    handleReload(refresh) {
      const params = {
        serverId: this.props.serverId,
        baseDn: this.state.baseDN,
        addNotification: this.props.addNotification
      };
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      this.setState({
        searching: true,
        loading: refresh
      });
      if (this.state.baseDN === "Database Suffixes" || this.state.baseDN === "db-suffixes" || this.state.baseDN === "") {
        this.rootSuffixesTreeData = [];
        this.showSuffixes("Database Suffixes", null);
      } else {
        let parentId2 = 0;
        this.state.suffixList.map((suffixDN) => {
          const params2 = {
            serverId: this.props.serverId,
            baseDn: suffixDN,
            parentId: parentId2,
            addNotification: this.props.addNotification
          };
          getRootSuffixEntryDetails(params2, this.updateTableRootSuffixes);
          parentId2 += 2;
          return [];
        });
        getOneLevelEntries(params, this.processDirectChildren);
      }
    }
    handleLockUnlockEntry() {
      const {
        entryDn,
        entryType,
        operationType,
        isTreeViewAction
      } = this.state;
      const cmd = [
        "dsidm",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "-b",
        entryDn,
        entryType,
        operationType,
        entryDn
      ];
      log_cmd("handleLockUnlockEntry", `${operationType} entry`, cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((_) => {
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen
        }, () => {
          this.handleConfirmModalToggle();
          if (isTreeViewAction) {
            this.setState({
              refreshEntryTime: Date.now(),
              isTreeViewAction: false
            });
          } else {
            this.handleReload(true);
          }
        });
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        console.error(
          "handleLockUnlockEntry",
          `${entryType} ${operationType} operation failed -`,
          errMsg.desc
        );
        this.props.addNotification(
          `${errMsg.desc.includes(`is already ${operationType === "unlock" ? "active" : "locked"}`) ? "warning" : "error"}`,
          `${errMsg.desc}`
        );
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen
        }, () => {
          this.handleConfirmModalToggle();
          if (isTreeViewAction) {
            this.setState({
              refreshEntryTime: Date.now(),
              isTreeViewAction: false
            });
          } else {
            this.handleReload(true);
          }
        });
      });
    }
    getAttributes(callbackFunc) {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        }, () => {
          callbackFunc("Database Suffixes", null);
        });
      });
    }
    componentDidMount() {
      getAllObjectClasses(this.props.serverId, (ocs) => {
        this.setState({
          allObjectclasses: ocs
        }, () => {
          this.getAttributes(this.showSuffixes);
        });
      });
    }
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(7)) {
        if (this.state.firstLoad) {
          this.handleReload(true);
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.handleReload(true);
          }
        }
      }
    }
    getPageData(page, perPage) {
      if (page === 1) {
        const pagedRows = this.state.rows.slice(0, 2 * perPage);
        this.setState({ pagedRows, perPage, page, loading: false });
      } else {
        const start2 = 2 * (page - 1) * perPage;
        const end2 = 2 * page * perPage;
        const pagedRows = this.state.rows.slice(start2, end2);
        for (let i = 0; i < pagedRows.length - 1; i++) {
          if (i % 2 === 0) {
            pagedRows[i + 1].parent = i;
          }
        }
        this.setState({ pagedRows, perPage, page, loading: false });
      }
    }
    handleCollapse(event, rowKey, isOpen, data) {
      const { pagedRows } = this.state;
      pagedRows[rowKey].isOpen = isOpen;
      this.setState({
        pagedRows
      });
      const firstTime = pagedRows[rowKey + 1].cells[0].title === this.initialChildText;
      if (firstTime) {
        const entryRows = [];
        let entryStateIcon = "";
        let isRole = false;
        const entryDn = pagedRows[rowKey].rawdn;
        getBaseLevelEntryAttributes(this.props.serverId, entryDn, (entryArray) => {
          entryArray.map((line) => {
            const attr = line.attribute;
            const attrJpegVal = line.attribute.toLowerCase() === "jpegphoto" ? /* @__PURE__ */ import_react157.default.createElement("div", null, /* @__PURE__ */ import_react157.default.createElement(
              "img",
              {
                src: `data:image/png;base64,${line.value.substr(3)}`,
                alt: "",
                style: { width: "256px" }
              }
            )) : line.value;
            const val = line.value.toLowerCase() === ": ldapsubentry" ? /* @__PURE__ */ import_react157.default.createElement("span", { className: "ds-info-color" }, line.value) : line.attribute.toLowerCase() === "userpassword" ? ": ********" : attrJpegVal;
            entryRows.push({ attr, value: val });
            const myVal = line.value.substring(1).trim().toLowerCase();
            const accountObjectclasses = [
              "nsaccount",
              "nsperson",
              "simplesecurityobject",
              "organization",
              "person",
              "account",
              "organizationalunit",
              "netscapeserver",
              "domain",
              "posixaccount",
              "shadowaccount",
              "posixgroup",
              "mailrecipient",
              "nsroledefinition"
            ];
            if (accountObjectclasses.includes(myVal)) {
              entryStateIcon = /* @__PURE__ */ import_react157.default.createElement(LockIcon, { className: "ds-pf-blue-color" });
            }
            if (myVal === "nsroledefinition") {
              isRole = true;
            }
            return [];
          });
          let entryState = "";
          const cmd = [
            "dsidm",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "-b",
            entryDn,
            isRole ? "role" : "account",
            "entry-status",
            entryDn
          ];
          log_cmd("handleCollapse", "Checking if entry is activated", cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
            if (entryDn !== "Root DSE" && entryStateIcon !== "") {
              const status = JSON.parse(content);
              entryState = status.info.state;
              if (entryState === "inactivity limit exceeded" || entryState.startsWith("probably activated or")) {
                entryStateIcon = /* @__PURE__ */ import_react157.default.createElement(ExclamationTriangleIcon, { className: "ds-pf-yellow-color ct-icon-exclamation-triangle" });
              }
            }
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            if (entryDn !== "Root DSE" && entryStateIcon !== "" && !errMsg.desc.includes("Root suffix can't be locked or unlocked")) {
              console.error(
                "handleCollapse",
                `${isRole ? "role" : "account"} account entry-status operation failed`,
                errMsg.desc
              );
              entryState = "error: please, check browser logs";
              entryStateIcon = /* @__PURE__ */ import_react157.default.createElement(ExclamationCircleIcon, { className: "ds-pf-red-color ct-exclamation-circle" });
            }
          }).finally(() => {
            let entryStateIconFinal = "";
            if (entryState !== "" && entryStateIcon !== "" && entryState !== "activated") {
              entryStateIconFinal = /* @__PURE__ */ import_react157.default.createElement(
                Tooltip,
                {
                  position: "bottom",
                  content: /* @__PURE__ */ import_react157.default.createElement("div", { className: "ds-info-icon" }, entryState)
                },
                /* @__PURE__ */ import_react157.default.createElement("a", { className: "ds-font-size-md" }, entryStateIcon)
              );
            }
            pagedRows[rowKey].entryState = entryState;
            pagedRows[rowKey + 1].cells = [{
              title: /* @__PURE__ */ import_react157.default.createElement(import_react157.default.Fragment, null, entryRows.map(
                (line) => {
                  let attrLine = "";
                  if (line.attr === "dn") {
                    attrLine = /* @__PURE__ */ import_react157.default.createElement("div", { key: line.attr + line.value }, /* @__PURE__ */ import_react157.default.createElement("strong", null, line.attr), line.value, " ", entryStateIconFinal);
                  } else {
                    attrLine = /* @__PURE__ */ import_react157.default.createElement("div", { key: line.attr + line.value }, /* @__PURE__ */ import_react157.default.createElement("strong", null, line.attr), line.value);
                  }
                  return attrLine;
                }
              ))
            }];
            this.setState({
              pagedRows,
              currentRowKey: -1
            });
          });
        });
      }
    }
    render() {
      const {
        page,
        perPage,
        total,
        columns,
        pagedRows,
        loading,
        navItems,
        entryMenuIsOpen,
        wizardOperationInfo,
        isWizardOpen,
        isTreeWizardOpen,
        wizardName,
        wizardEntryDn,
        treeViewRootSuffixes,
        refreshEntryTime
      } = this.state;
      return /* @__PURE__ */ import_react157.default.createElement(import_react157.default.Fragment, null, isWizardOpen && /* @__PURE__ */ import_react157.default.createElement(
        genericWizard_default,
        {
          wizardName,
          isWizardOpen,
          toggleOpenWizard: this.toggleOpenWizard,
          wizardEntryDn,
          editorLdapServer: this.props.serverId,
          treeViewRootSuffixes: this.state.treeViewRootSuffixes,
          setWizardOperationInfo: this.setWizardOperationInfo,
          onReload: this.handleReload,
          onModrdnReload: this.handleReload,
          allObjectclasses: this.state.allObjectclasses,
          addNotification: this.props.addNotification,
          key: this.state.keyIndex + "table"
        }
      ), isTreeWizardOpen && /* @__PURE__ */ import_react157.default.createElement(
        genericWizard_default,
        {
          wizardName,
          isWizardOpen: isTreeWizardOpen,
          toggleOpenWizard: this.toggleOpenTreeWizard,
          wizardEntryDn,
          editorLdapServer: this.props.serverId,
          treeViewRootSuffixes: this.state.treeViewRootSuffixes,
          setWizardOperationInfo: this.setWizardOperationInfo,
          onReload: this.handleReloadNoop,
          onModrdnReload: this.handleReload,
          allObjectclasses: this.state.allObjectclasses,
          addNotification: this.props.addNotification,
          key: this.state.keyIndex + "tree"
        }
      ), /* @__PURE__ */ import_react157.default.createElement(Tabs, { isBox: true, className: "ds-margin-top-lg ds-indent", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react157.default.createElement(Tab, { eventKey: 0, title: /* @__PURE__ */ import_react157.default.createElement(TabTitleText, null, "Tree View") }, /* @__PURE__ */ import_react157.default.createElement(
        treeView_default,
        {
          key: loading,
          handleToggleEntryMenu: this.onToggleEntryMenu,
          onSelectEntryOptions: this.handleSelectEntryOptions,
          entryMenuIsOpen,
          treeViewRootSuffixes,
          loading,
          timeOfCompletion: this.state.timeOfCompletion,
          setTreeFirstClicked: this.setTreeFirstClicked,
          editorLdapServer: this.props.serverId,
          wizardOperationInfo,
          refreshEntryTime,
          onReload: this.handleReload,
          refreshing: this.state.refreshing,
          allObjectclasses: this.state.allObjectclasses,
          addNotification: this.props.addNotification
        }
      )), /* @__PURE__ */ import_react157.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react157.default.createElement(TabTitleText, null, "Table View") }, /* @__PURE__ */ import_react157.default.createElement("div", { className: this.state.searching ? "ds-disabled" : "" }, /* @__PURE__ */ import_react157.default.createElement(Breadcrumb, { className: "ds-left-margin ds-margin-top-xlg" }, navItems.map(({ id, to, label, active }) => /* @__PURE__ */ import_react157.default.createElement(BreadcrumbItem, { key: id + label, to, isActive: active, onClick: () => this.onNavItemClick(id, active) }, label))), /* @__PURE__ */ import_react157.default.createElement(
        FontAwesomeIcon,
        {
          className: "ds-left-margin ds-refresh",
          icon: faSyncAlt,
          title: "Refresh",
          onClick: this.handleReload
        }
      )), /* @__PURE__ */ import_react157.default.createElement("div", { className: this.state.searching ? "ds-margin-top-xlg ds-center" : "ds-hidden" }, /* @__PURE__ */ import_react157.default.createElement(TextContent, null, /* @__PURE__ */ import_react157.default.createElement(Text, { component: TextVariants.h3 }, "Loading ", /* @__PURE__ */ import_react157.default.createElement("i", null, this.state.searchBase), " ...")), /* @__PURE__ */ import_react157.default.createElement(Spinner, { className: "ds-margin-top-lg", size: "xl" })), /* @__PURE__ */ import_react157.default.createElement("div", { className: this.state.searching ? "ds-hidden" : "" }, /* @__PURE__ */ import_react157.default.createElement(
        tableView_default,
        {
          key: loading,
          loading,
          itemCount: total,
          page,
          perPage,
          onSetPage: (value) => this.getPageData(value, perPage),
          onPerPageSelect: (value) => this.getPageData(1, value),
          editorTableRows: pagedRows,
          onCollapse: this.handleCollapse,
          columns,
          actionResolver: this.actionResolver,
          addNotification: this.props.addNotification
        }
      ))), /* @__PURE__ */ import_react157.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react157.default.createElement(TabTitleText, null, "Search") }, /* @__PURE__ */ import_react157.default.createElement(
        SearchDatabase,
        {
          key: this.state.suffixList + this.state.searchBase,
          serverId: this.props.serverId,
          suffixList: this.state.suffixList,
          attributes: this.state.attributes,
          searchBase: this.state.searchBase,
          allObjectclasses: this.state.allObjectclasses,
          addNotification: this.props.addNotification
        }
      ))), this.state.showEmptySuffixModal && /* @__PURE__ */ import_react157.default.createElement(
        rootSuffix_default,
        {
          showEmptySuffixModal: this.state.showEmptySuffixModal,
          handleEmptySuffixToggle: this.onHandleEmptySuffixToggle,
          suffixDn: this.state.emptyDN,
          editorLdapServer: this.props.serverId
        }
      ), /* @__PURE__ */ import_react157.default.createElement(
        Modal,
        {
          variant: ModalVariant.medium,
          title: `Are you sure you want to ${this.state.operationType} the ${this.state.entryType}?`,
          isOpen: this.state.isConfirmModalOpen,
          onClose: this.handleConfirmModalToggle,
          actions: [
            /* @__PURE__ */ import_react157.default.createElement(Button, { key: "confirm", variant: "primary", onClick: this.handleLockUnlockEntry }, "Confirm"),
            /* @__PURE__ */ import_react157.default.createElement(Button, { key: "cancel", variant: "link", onClick: this.handleConfirmModalToggle }, "Cancel")
          ]
        },
        /* @__PURE__ */ import_react157.default.createElement(TextContent, { className: "ds-margin-top ds-hide-vertical-scrollbar" }, /* @__PURE__ */ import_react157.default.createElement(Text, null, this.state.entryType === "account" ? `It will ${this.state.operationType === "lock" ? "add" : "remove"} nsAccountLock attribute
                            ${this.state.operationType === "lock" ? "to" : "from"} the entry - ${this.state.entryDn}.` : `This operation will make sure that these five entries are created at the entry's root suffix (if not, they will be created):`), this.state.entryType === "role" && /* @__PURE__ */ import_react157.default.createElement(import_react157.default.Fragment, null, /* @__PURE__ */ import_react157.default.createElement(TextList, null, /* @__PURE__ */ import_react157.default.createElement(TextListItem, null, "cn=nsManagedDisabledRole"), /* @__PURE__ */ import_react157.default.createElement(TextListItem, null, "cn=nsDisabledRole"), /* @__PURE__ */ import_react157.default.createElement(TextListItem, null, "cn=nsAccountInactivationTmp (with a child)"), /* @__PURE__ */ import_react157.default.createElement(TextListItem, null, "cn=nsAccountInactivation_cos")), /* @__PURE__ */ import_react157.default.createElement(Text, null, `The entry - ${this.state.entryDn} - will be ${this.state.operationType === "lock" ? "added to" : "removed from"} nsRoleDN attribute in cn=nsDisabledRole entry in the root suffix.`)))
      ));
    }
  };

  // src/ds.jsx
  var staticStates = {
    noPackage: /* @__PURE__ */ import_react158.default.createElement(TextContent, null, /* @__PURE__ */ import_react158.default.createElement(Text, { className: "ds-margin-top-xlg", component: TextVariants.h2 }, "There is no ", /* @__PURE__ */ import_react158.default.createElement("b", null, "389-ds-base"), " package installed on this system. Sorry there is nothing to manage...")),
    noInsts: /* @__PURE__ */ import_react158.default.createElement(TextContent, null, /* @__PURE__ */ import_react158.default.createElement(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2 }, "There are no Directory Server instances to manage")),
    notRunning: /* @__PURE__ */ import_react158.default.createElement(TextContent, null, /* @__PURE__ */ import_react158.default.createElement(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2 }, "This server instance is not running, either start it from the ", /* @__PURE__ */ import_react158.default.createElement("b", null, "Actions"), " dropdown menu, or choose a different instance")),
    notConnecting: /* @__PURE__ */ import_react158.default.createElement(TextContent, null, /* @__PURE__ */ import_react158.default.createElement(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2 }, "This server instance is running, but we can not connect to it. Check LDAPI is properly configured on this instance.")),
    ldapiIssue: /* @__PURE__ */ import_react158.default.createElement(TextContent, null, /* @__PURE__ */ import_react158.default.createElement(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2 }, "Problem accessing required server configuration. Check LDAPI is properly configured on this instance."))
  };
  var DSInstance = class extends import_react158.default.Component {
    componentDidMount() {
      this.loadInstanceList();
      this.updateProgress(25);
    }
    constructor(props) {
      super(props);
      this.state = {
        pageLoadingState: { state: "loading", jsx: "" },
        serverId: "",
        instList: [],
        backupRows: [],
        notifications: [],
        activeTabKey: 1,
        createKey: 0,
        wasActiveList: [],
        progressValue: 0,
        loadingOperate: false,
        dropdownIsOpen: false,
        variant: PageSectionVariants.default,
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false,
        showSchemaReloadModal: false,
        showManageBackupsModal: false,
        showCreateInstanceModal: false
      };
      this.handleToggle = (dropdownIsOpen) => {
        this.setState({
          dropdownIsOpen
        });
      };
      this.handleDropdown = (event) => {
        this.setState({
          dropdownIsOpen: !this.state.dropdownIsOpen
        });
        this.onFocus();
      };
      this.onFocus = () => {
        const element = document.getElementById("ds-dropdown");
        element.focus();
      };
      this.handleNavSelect = (event, tabIndex) => {
        const { wasActiveList } = this.state;
        if (!wasActiveList.includes(tabIndex)) {
          const newList = wasActiveList.concat(tabIndex);
          this.setState({
            wasActiveList: newList,
            activeTabKey: tabIndex
          });
        } else {
          this.setState({
            activeTabKey: tabIndex
          });
        }
      };
      this.setPageSectionVariant = (isLight) => {
        const variant = isLight ? PageSectionVariants.light : PageSectionVariants.default;
        this.setState({
          variant
        });
      };
      this.handleServerIdChange = this.handleServerIdChange.bind(this);
      this.onFieldChange = this.onFieldChange.bind(this);
      this.addNotification = this.addNotification.bind(this);
      this.removeNotification = this.removeNotification.bind(this);
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.loadInstanceList = this.loadInstanceList.bind(this);
      this.loadBackups = this.loadBackups.bind(this);
      this.setServerId = this.setServerId.bind(this);
      this.updateProgress = this.updateProgress.bind(this);
      this.openCreateInstanceModal = this.openCreateInstanceModal.bind(this);
      this.closeCreateInstanceModal = this.closeCreateInstanceModal.bind(this);
      this.operateInstance = this.operateInstance.bind(this);
      this.openManageBackupsModal = this.openManageBackupsModal.bind(this);
      this.closeManageBackupsModal = this.closeManageBackupsModal.bind(this);
      this.openSchemaReloadModal = this.openSchemaReloadModal.bind(this);
      this.closeSchemaReloadModal = this.closeSchemaReloadModal.bind(this);
      this.removeInstance = this.removeInstance.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
    }
    addNotification(variant, title) {
      const key = (/* @__PURE__ */ new Date()).getTime();
      if (variant === "error" || variant === "danger") {
        variant = "danger";
        title = /* @__PURE__ */ import_react158.default.createElement("pre", null, title);
      }
      this.setState({
        notifications: [...this.state.notifications, { title, variant, key }]
      });
    }
    removeNotification(key) {
      this.setState({
        notifications: [...this.state.notifications.filter((el) => el.key !== key)]
      });
    }
    updateProgress(value) {
      this.setState(
        (prevState) => ({
          progressValue: prevState.progressValue + value
        }),
        () => {
          if (this.state.progressValue > 100) {
            this.setState((prevState) => ({
              pageLoadingState: {
                ...prevState.pageLoadingState,
                state: "success"
              }
            }));
          }
        }
      );
    }
    setServerId(serverId, action) {
      const cmd = ["dsctl", "-j", serverId, "status"];
      log_cmd("setServerId", "Test if instance is running ", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running) {
          this.updateProgress(25);
          const cfg_cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
            "config",
            "get"
          ];
          log_cmd("setServerId", "Load server configuration", cfg_cmd);
          cockpit_default.spawn(cfg_cmd, { superuser: true, err: "message" }).done((content) => {
            const config2 = JSON.parse(content);
            const attrs = config2.attrs;
            if (Object.keys(attrs).length === 0) {
              this.setState({
                pageLoadingState: {
                  state: "ldapiIssue",
                  jsx: staticStates.ldapiIssue,
                  loading: "ldapiError"
                },
                serverId,
                wasActiveList: []
              });
              return;
            }
            const cmd2 = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
              "backend",
              "suffix",
              "list",
              "--suffix"
            ];
            log_cmd("setServerId", "Test if instance is alive ", cmd2);
            cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((_) => {
              this.updateProgress(25);
              this.setState(
                {
                  serverId,
                  wasActiveList: [this.state.activeTabKey]
                },
                () => {
                  this.loadBackups();
                }
              );
              if (action === "restart") {
                this.setState(
                  {
                    serverId: "",
                    wasActiveList: []
                  },
                  () => {
                    this.setState({
                      serverId,
                      wasActiveList: [this.state.activeTabKey]
                    });
                  }
                );
              }
            }).fail((err) => {
              const errMsg = JSON.parse(err);
              console.log("setServerId failed: ", errMsg.desc);
              this.setState(
                {
                  pageLoadingState: {
                    state: "notConnecting",
                    jsx: staticStates.notConnecting
                  }
                },
                () => {
                  this.setState(
                    {
                      serverId,
                      wasActiveList: []
                    },
                    () => {
                      this.loadBackups();
                    }
                  );
                }
              );
            });
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            console.log("setServerId failed: ", errMsg.desc);
            this.setState(
              {
                pageLoadingState: {
                  state: "notConnecting",
                  jsx: staticStates.notConnecting
                }
              },
              () => {
                this.setState(
                  {
                    serverId,
                    wasActiveList: []
                  },
                  () => {
                    this.loadBackups();
                  }
                );
              }
            );
          });
        } else {
          this.setState(
            {
              pageLoadingState: {
                state: "notRunning",
                jsx: staticStates.notRunning
              }
            },
            () => {
              this.setState(
                {
                  serverId,
                  wasActiveList: []
                }
              );
            }
          );
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        console.log("setServerId failed: ", errMsg.desc);
        this.setState(
          {
            pageLoadingState: {
              state: "notConnecting",
              jsx: staticStates.notConnecting
            }
          },
          () => {
            this.setState(
              {
                serverId,
                wasActiveList: []
              },
              () => {
                this.loadBackups();
              }
            );
          }
        );
      });
    }
    loadInstanceList(serverId, action) {
      if (serverId === void 0) {
        this.setState((prevState) => ({
          pageLoadingState: {
            ...prevState.pageLoadingState,
            state: "loading"
          }
        }));
      }
      this.setState(
        {
          wasActiveList: []
        },
        () => {
          const cmd = ["dsctl", "-l", "-j"];
          log_cmd(
            "loadInstanceList",
            "Load the instance list select",
            cmd
          );
          cockpit_default.spawn(cmd, { superuser: true }).done((data) => {
            this.updateProgress(25);
            const myObject = JSON.parse(data);
            const options4 = [];
            for (const inst of myObject.insts) {
              options4.push({ value: inst.replace("slapd-", ""), label: inst, disabled: false });
            }
            this.setState({
              instList: options4,
              loadingOperate: false
            });
            if (serverId !== void 0 && serverId !== "") {
              this.setServerId(serverId, action);
            } else {
              if (myObject.insts.length > 0) {
                this.setServerId(
                  myObject.insts[0].replace("slapd-", ""),
                  action
                );
              } else {
                this.setState({
                  serverId: "",
                  pageLoadingState: {
                    state: "noInsts",
                    jsx: staticStates.noInsts
                  }
                });
              }
            }
          }).fail((_) => {
            this.setState({
              instList: [],
              serverId: "",
              loadingOperate: false,
              pageLoadingState: {
                state: "noInsts",
                jsx: staticStates.noInsts
              }
            });
          });
        }
      );
    }
    loadBackups() {
      let cmd = ["dsctl", "-j", this.state.serverId, "backups"];
      log_cmd("loadBackups", "Load Backups", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.updateProgress(25);
        const config2 = JSON.parse(content);
        const rows = [];
        for (const row of config2.items) {
          rows.push([row[0], row[1], row[2]]);
        }
        cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.state.serverId + ".socket", "monitor", "server"];
        log_cmd("loadBackups", "Get the server version", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const monitor = JSON.parse(content2);
          this.setState({
            backupRows: rows,
            version: monitor.attrs.version[0]
          });
        }).fail((_) => {
          this.setState({
            backupRows: rows
          });
        });
      });
    }
    handleServerIdChange(e) {
      this.setState({
        pageLoadingState: { state: "loading", jsx: "" },
        progressValue: 25
      });
      this.loadInstanceList(e);
    }
    onFieldChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      if (e.target.type === "number") {
        if (e.target.value) {
          value = parseInt(e.target.value);
        } else {
          value = 1;
        }
      }
      this.setState({
        [e.target.id]: value
      });
    }
    removeInstance() {
      this.setState({
        loadingOperate: true
      });
      const cmd = ["dsctl", "-j", this.state.serverId, "remove", "--do-it"];
      log_cmd("removeInstance", `Remove the instance`, cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((_) => {
        this.loadInstanceList();
        this.addNotification("success", "Instance was successfully removed");
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.loadInstanceList();
        this.addNotification(
          "error",
          `Error during instance remove operation - ${errMsg.desc}`
        );
      });
      this.closeDeleteConfirm();
    }
    operateInstance(action) {
      this.setState({
        loadingOperate: true
      });
      const cmdStatus = ["dsctl", "-j", this.state.serverId, "status"];
      log_cmd("operateInstance", `Check instance status`, cmdStatus);
      cockpit_default.spawn(cmdStatus, { superuser: true, err: "message" }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running && action === "start") {
          this.addNotification("success", `Instance is already running`);
          this.setState({
            loadingOperate: false
          });
        } else if (!status_json.running && action === "stop") {
          this.addNotification("success", `Instance is already stopped`);
          this.setState({
            loadingOperate: false,
            pageLoadingState: {
              state: "notRunning",
              jsx: staticStates.notRunning
            }
          });
        } else {
          const cmd = ["dsctl", "-j", this.state.serverId, action];
          log_cmd("operateInstance", `Do ${action} the instance`, cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((_) => {
            this.loadInstanceList(this.state.serverId, action);
            if (action === "stop") {
              action = "stopp";
            }
            this.addNotification("success", `Instance was successfully ${action}ed`);
          }).fail((err) => {
            const errMsg = JSON.parse(err);
            this.addNotification(
              "error",
              `Error during instance ${action} operation - ${errMsg.desc}`
            );
            this.loadInstanceList(this.state.serverId, action);
          });
        }
      }).fail((err) => {
        const errMsg = JSON.parse(err);
        this.addNotification(
          "error",
          `Error during instance check status operation - ${errMsg.desc}`
        );
        this.loadInstanceList(this.state.serverId, action);
      });
    }
    openCreateInstanceModal() {
      const key = this.state.createKey + 1;
      this.setState({
        showCreateInstanceModal: true,
        createKey: key
      });
    }
    closeCreateInstanceModal() {
      this.setState({
        showCreateInstanceModal: false
      });
    }
    openManageBackupsModal() {
      this.setState({
        showManageBackupsModal: true
      });
    }
    closeManageBackupsModal() {
      this.setState({
        showManageBackupsModal: false
      });
    }
    openSchemaReloadModal() {
      this.setState({
        showSchemaReloadModal: true
      });
    }
    closeSchemaReloadModal() {
      this.setState({
        showSchemaReloadModal: false
      });
    }
    showDeleteConfirm() {
      this.setState({
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    render() {
      const {
        instList,
        serverId,
        progressValue,
        notifications,
        pageLoadingState,
        loadingOperate,
        dropdownIsOpen,
        activeTabKey
      } = this.state;
      const dropdownItems = [
        /* @__PURE__ */ import_react158.default.createElement(DropdownItem, { id: "start-ds", key: "start", component: "button", onClick: () => this.operateInstance("start") }, "Start Instance"),
        /* @__PURE__ */ import_react158.default.createElement(DropdownItem, { id: "stop-ds", key: "stop", component: "button", onClick: () => this.operateInstance("stop") }, "Stop Instance"),
        /* @__PURE__ */ import_react158.default.createElement(DropdownItem, { id: "restart-ds", key: "restart", component: "button", onClick: () => this.operateInstance("restart") }, "Restart Instance"),
        /* @__PURE__ */ import_react158.default.createElement(DropdownItem, { id: "manage-backup-ds", key: "backups", component: "button", onClick: () => this.openManageBackupsModal() }, "Manage Backups"),
        /* @__PURE__ */ import_react158.default.createElement(DropdownItem, { id: "reload-schema-ds", key: "reload", component: "button", onClick: () => this.openSchemaReloadModal() }, "Reload Schema Files"),
        /* @__PURE__ */ import_react158.default.createElement(DropdownSeparator, { key: "separator" }),
        /* @__PURE__ */ import_react158.default.createElement(DropdownItem, { id: "remove-ds", key: "remove", component: "button", onClick: () => this.showDeleteConfirm() }, "Remove This Instance"),
        /* @__PURE__ */ import_react158.default.createElement(DropdownItem, { id: "create-ds", key: "create", component: "button", onClick: () => this.openCreateInstanceModal() }, "Create New Instance")
      ];
      let mainContent = "";
      if (pageLoadingState.state === "loading") {
        mainContent = /* @__PURE__ */ import_react158.default.createElement("div", { id: "loading-instances", className: "all-pages ds-center" }, /* @__PURE__ */ import_react158.default.createElement("div", { id: "loading-page", className: "ds-center ds-loading" }, /* @__PURE__ */ import_react158.default.createElement(TextContent, null, /* @__PURE__ */ import_react158.default.createElement(Text, { id: "loading-msg", component: TextVariants.h3 }, "Loading Directory Server Configuration ...")), /* @__PURE__ */ import_react158.default.createElement("p", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react158.default.createElement("span", { className: "spinner spinner-lg spinner-inline" })), /* @__PURE__ */ import_react158.default.createElement("div", { className: "ds-margin-top-lg" }, /* @__PURE__ */ import_react158.default.createElement(Progress, { value: progressValue, label: `${progressValue}%`, measureLocation: ProgressMeasureLocation.inside }))));
      } else if (pageLoadingState.state === "noInsts") {
        mainContent = /* @__PURE__ */ import_react158.default.createElement("div", { id: "noInsts", className: "all-pages ds-center" }, pageLoadingState.jsx, /* @__PURE__ */ import_react158.default.createElement("p", { className: "ds-margin-top-xlg" }, /* @__PURE__ */ import_react158.default.createElement(
          Button,
          {
            id: "no-inst-create-btn",
            variant: "primary",
            onClick: () => this.openCreateInstanceModal()
          },
          "Create New Instance"
        )));
      } else {
        mainContent = /* @__PURE__ */ import_react158.default.createElement("div", { id: pageLoadingState.state, className: "all-pages ds-center" }, pageLoadingState.jsx);
      }
      let operateSpinner = "";
      if (loadingOperate) {
        operateSpinner = /* @__PURE__ */ import_react158.default.createElement(Spinner, { className: "ds-operate-spinner", size: "md" });
      }
      let serverDropdown = "";
      if (pageLoadingState.state !== "loading" && pageLoadingState.state !== "noInsts" && pageLoadingState.state !== "noPackage") {
        serverDropdown = /* @__PURE__ */ import_react158.default.createElement(Grid, { className: "ds-logo", hidden: pageLoadingState.state === "loading" }, /* @__PURE__ */ import_react158.default.createElement(GridItem, { span: 10 }, /* @__PURE__ */ import_react158.default.createElement(TextContent, { className: "ds-logo-style", title: this.state.version }, /* @__PURE__ */ import_react158.default.createElement(Text, { id: "main-banner", component: TextVariants.h1 }, /* @__PURE__ */ import_react158.default.createElement("div", { className: "ds-server-action" }, /* @__PURE__ */ import_react158.default.createElement(
          FormSelect,
          {
            title: "Directory Server instance list",
            value: serverId,
            id: "serverId",
            onChange: this.handleServerIdChange,
            "aria-label": "FormSelect Input",
            className: "ds-instance-select"
          },
          instList.map((option, index) => /* @__PURE__ */ import_react158.default.createElement(
            FormSelectOption,
            {
              isDisabled: option.disabled,
              key: index,
              value: option.value.replace("slapd-", ""),
              label: option.label
            }
          ))
        )), operateSpinner))), /* @__PURE__ */ import_react158.default.createElement(GridItem, { span: 2 }, /* @__PURE__ */ import_react158.default.createElement(
          Dropdown,
          {
            id: "ds-action",
            className: "ds-float-right ds-margin-top ds-margin-right",
            position: DropdownPosition.right,
            onSelect: this.handleDropdown,
            toggle: /* @__PURE__ */ import_react158.default.createElement(DropdownToggle, { onToggle: this.handleToggle, toggleIndicator: CaretDownIcon, isPrimary: true, id: "ds-dropdown" }, "Actions"),
            isOpen: dropdownIsOpen,
            dropdownItems
          }
        )));
      }
      let mainPage = /* @__PURE__ */ import_react158.default.createElement("div", null, mainContent);
      if (serverId !== "" && (pageLoadingState.state === "success" || pageLoadingState.state === "loading")) {
        mainPage = /* @__PURE__ */ import_react158.default.createElement("div", { className: "ds-margin-top" }, /* @__PURE__ */ import_react158.default.createElement("div", { hidden: pageLoadingState.state === "loading" || pageLoadingState.state === "notRunning" }, /* @__PURE__ */ import_react158.default.createElement(Tabs, { isFilled: true, activeKey: activeTabKey, onSelect: this.handleNavSelect }, /* @__PURE__ */ import_react158.default.createElement(Tab, { eventKey: 1, title: /* @__PURE__ */ import_react158.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react158.default.createElement("b", null, "Server")) }, /* @__PURE__ */ import_react158.default.createElement(
          Server,
          {
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            wasActiveList: this.state.wasActiveList,
            version: this.state.version,
            key: this.state.serverId
          }
        )), /* @__PURE__ */ import_react158.default.createElement(Tab, { eventKey: 2, title: /* @__PURE__ */ import_react158.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react158.default.createElement("b", null, "Database")) }, /* @__PURE__ */ import_react158.default.createElement(
          Database,
          {
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            wasActiveList: this.state.wasActiveList,
            key: this.state.serverId
          }
        )), /* @__PURE__ */ import_react158.default.createElement(Tab, { eventKey: 3, title: /* @__PURE__ */ import_react158.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react158.default.createElement("b", null, "Replication")) }, /* @__PURE__ */ import_react158.default.createElement(
          Replication,
          {
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            wasActiveList: this.state.wasActiveList,
            key: this.state.serverId
          }
        )), /* @__PURE__ */ import_react158.default.createElement(Tab, { eventKey: 4, title: /* @__PURE__ */ import_react158.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react158.default.createElement("b", null, "Schema")) }, /* @__PURE__ */ import_react158.default.createElement(
          Schema,
          {
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            wasActiveList: this.state.wasActiveList,
            key: this.state.serverId
          }
        )), /* @__PURE__ */ import_react158.default.createElement(Tab, { eventKey: 5, title: /* @__PURE__ */ import_react158.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react158.default.createElement("b", null, "Plugins")) }, /* @__PURE__ */ import_react158.default.createElement(
          Plugins,
          {
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            wasActiveList: this.state.wasActiveList,
            key: this.state.serverId
          }
        )), /* @__PURE__ */ import_react158.default.createElement(Tab, { eventKey: 6, title: /* @__PURE__ */ import_react158.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react158.default.createElement("b", null, "Monitoring")) }, /* @__PURE__ */ import_react158.default.createElement(
          Monitor,
          {
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            wasActiveList: this.state.wasActiveList,
            key: this.state.serverId
          }
        )), /* @__PURE__ */ import_react158.default.createElement(Tab, { eventKey: 7, title: /* @__PURE__ */ import_react158.default.createElement(TabTitleText, null, /* @__PURE__ */ import_react158.default.createElement("b", null, "LDAP Browser")) }, /* @__PURE__ */ import_react158.default.createElement(
          LDAPEditor,
          {
            key: "ldap-editor",
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            wasActiveList: this.state.wasActiveList,
            setPageSectionVariant: this.setPageSectionVariant
          }
        )))), /* @__PURE__ */ import_react158.default.createElement("div", { hidden: pageLoadingState.state !== "loading" }, mainContent));
      }
      return /* @__PURE__ */ import_react158.default.createElement("div", { className: loadingOperate ? "ds-disabled" : "" }, /* @__PURE__ */ import_react158.default.createElement(AlertGroup, { isToast: true }, notifications.map(({ key, variant, title }) => /* @__PURE__ */ import_react158.default.createElement(
        Alert,
        {
          isLiveRegion: true,
          variant: AlertVariant[variant],
          title,
          actionClose: /* @__PURE__ */ import_react158.default.createElement(
            AlertActionCloseButton,
            {
              title,
              variantLabel: `${variant} alert`,
              onClose: () => this.removeNotification(key)
            }
          ),
          timeout: true,
          key
        }
      ))), serverDropdown, mainPage, /* @__PURE__ */ import_react158.default.createElement(
        CreateInstanceModal,
        {
          key: this.state.createKey,
          showModal: this.state.showCreateInstanceModal,
          closeHandler: this.closeCreateInstanceModal,
          addNotification: this.addNotification,
          serverId: this.state.serverId,
          loadInstanceList: this.loadInstanceList
        }
      ), /* @__PURE__ */ import_react158.default.createElement(
        SchemaReloadModal,
        {
          showModal: this.state.showSchemaReloadModal,
          closeHandler: this.closeSchemaReloadModal,
          addNotification: this.addNotification,
          serverId: this.state.serverId
        }
      ), /* @__PURE__ */ import_react158.default.createElement(
        ManageBackupsModal,
        {
          addNotification: this.addNotification,
          serverId: this.state.serverId,
          showModal: this.state.showManageBackupsModal,
          closeHandler: this.closeManageBackupsModal,
          handleChange: this.onFieldChange,
          backups: this.state.backupRows,
          reload: this.loadBackups
        }
      ), /* @__PURE__ */ import_react158.default.createElement(
        DoubleConfirmModal,
        {
          showModal: this.state.showDeleteConfirm,
          closeHandler: this.closeDeleteConfirm,
          handleChange: this.onFieldChange,
          actionHandler: this.removeInstance,
          spinning: this.state.modalSpinning,
          item: this.state.serverId,
          checked: this.state.modalChecked,
          mTitle: "Remove Instance",
          mMsg: "Are you really sure you want to delete this instance?",
          mSpinningMsg: "Removing Instance...",
          mBtnName: "Remove Instance"
        }
      ));
    }
  };

  // src/index.js
  document.addEventListener("DOMContentLoaded", function() {
    import_react_dom.default.render(import_react159.default.createElement(DSInstance, {}), document.getElementById("dsinstance"));
  });
})();
//# sourceMappingURL=index.js.map
